.word-page { min-height: 100vh; display: flex; flex-direction: column; }
.word-main { flex: 1; padding-block: 54px 56px; }
.word-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 30px; }
.word-intro .section-label { margin-bottom: 18px; font: 11px/1.6 var(--mono); letter-spacing: .1em; }
.word-intro h1 { font-size: clamp(28px, 3.2vw, 43px); letter-spacing: -.04em; line-height: 1.25; }
.word-intro h1 > span { font-weight: 400; color: var(--muted); padding-inline: 4px; }
.intro-copy { color: var(--muted); font-size: 14px; margin-top: 15px; }
.local-note { color: var(--muted); font-size: 12px; white-space: nowrap; }
.local-note > span { color: var(--accent); margin-right: 6px; font-size: 9px; }
.word-main button { border: 1px solid var(--line); border-radius: 4px; padding: 9px 13px; background: var(--paper); color: var(--ink); cursor: pointer; font: inherit; font-size: 12px; }
.word-main button:hover:not(:disabled) { border-color: var(--accent); }
.word-main button:disabled { opacity: .45; cursor: default; }
.word-main .primary { background: var(--accent); color: var(--paper); border-color: var(--accent); padding: 12px 23px; font-size: 14px; }
.primary > span { font-size: 19px; padding-right: 8px; }
.export-bar { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding: 20px 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; }
.filename-label { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; min-width: 0; }
.filename-field { display: flex; align-items: center; border-bottom: 1px solid var(--line); max-width: 100%; }
.filename-field input { border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; padding: 10px 0; width: 240px; max-width: 100%; min-width: 0; }
.filename-field > span { font: 12px var(--mono); padding-left: 8px; }
.word-main :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.status { margin: 14px 0; min-height: 22px; font-size: 12px; color: var(--muted); }
.status[data-error="true"] { color: #b14835; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.editor-panel, .preview-panel { border: 1px solid var(--line); border-radius: 5px; background: var(--paper); min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 65px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 14px; white-space: nowrap; }
.panel-heading h2 > span { font: 10px var(--mono); color: var(--muted); margin-right: 10px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button { padding: 6px 9px; font-size: 11px; }
.preview-label { font-size: 11px; color: var(--muted); }
#markdown-input { resize: vertical; width: 100%; min-height: 540px; flex: 1; padding: 24px; color: var(--ink); border: 0; background: transparent; font: 13px/1.85 var(--mono); tab-size: 2; }
#markdown-input::placeholder { color: var(--muted); opacity: .7; }
#markdown-input:focus-visible { outline-offset: -3px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; display: flex; gap: 10px; justify-content: space-between; }
.preview-stage { height: 540px; overflow: auto; padding: 24px; flex: 1; background: rgba(120, 130, 116, .055); }
.document-preview { background: #fff; color: #24332a; padding: 28px 32px; min-height: 490px; box-shadow: 0 2px 12px #00000008; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.document-preview > :first-child { margin-top: 0; }
.document-preview p { margin: 0 0 14px; }
.document-preview h1, .document-preview h2, .document-preview h3, .document-preview h4, .document-preview h5, .document-preview h6 { color: #174b35; font-weight: 700; margin: 20px 0 10px; line-height: 1.45; letter-spacing: 0; }
.document-preview h1 { font-size: 24px; }.document-preview h2 { font-size: 20px; }.document-preview h3 { font-size: 17px; }.document-preview h4, .document-preview h5, .document-preview h6 { font-size: 14px; }
.document-preview ul, .document-preview ol { padding-left: 25px; margin: 12px 0; }
.document-preview li > p { margin-bottom: 3px; }
.document-preview blockquote { border-left: 3px solid #b6c6bc; margin: 16px 0; padding: 2px 0 2px 14px; color: #68756d; }
.document-preview blockquote p:last-child { margin-bottom: 0; }
.document-preview pre { padding: 13px; margin: 15px 0; white-space: pre-wrap; background: #f0f2ef; font: 11px/1.7 var(--mono); }
.document-preview code { font-family: var(--mono); font-size: .9em; background: #f0f2ef; padding: 2px 4px; }
.document-preview pre code { padding: 0; font-size: inherit; }
.document-preview a { color: #246348; text-decoration: underline; }
.document-preview hr { border: 0; border-top: 1px solid #cdd5cf; margin-block: 20px; }
.document-preview .table-scroll { overflow-x: auto; margin-block: 16px; }
.document-preview table { border-collapse: collapse; width: 100%; font-size: 11px; }
.document-preview th, .document-preview td { border: 1px solid #d2dbd5; padding: 7px 10px; }
.document-preview th { background: #eaf0eb; }
.image-note { color: #68756d; font-style: italic; }
.document-preview .empty-preview { padding-top: 135px; text-align: center; color: #68756d; font-size: 15px; }
.empty-preview span { font-size: 12px; line-height: 2.6; }
.format-note { color: var(--muted); font-size: 12px; line-height: 1.9; margin-top: 24px; }
.format-note summary { cursor: pointer; color: var(--ink); }
.format-note p { margin-top: 10px; max-width: 900px; }
.conversion-notices { margin-top: 18px; padding: 16px 18px 16px 36px; font-size: 12px; line-height: 1.9; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 900px) { .word-intro { align-items: flex-start; flex-direction: column; gap: 16px; } .editor-grid { grid-template-columns: 1fr; } #markdown-input { min-height: 330px; } .preview-stage { flex: none; height: 540px; } }
@media (max-width: 560px) {
  .word-main { padding-block: 32px; }.word-intro h1 { font-size: 29px; }.export-bar { padding: 17px; flex-wrap: wrap; }.filename-label { flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; }.filename-field { width: 100%; }.filename-field input { flex: 1; }.export-bar .primary { width: 100%; }.panel-heading { padding: 12px; gap: 8px; }.panel-heading h2 > span { display: none; }.panel-foot { padding-inline: 12px; }#markdown-input { padding: 18px; }.preview-stage { padding: 12px; }.document-preview { padding: 22px; }
}

.export-bar select { border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; padding: 10px 26px 10px 0; max-width: 190px; }
.export-bar select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.math-inline { display: inline-block; margin-inline: .12em; vertical-align: -.15em; }
.math-block { display: block; margin: 20px auto; overflow-x: auto; text-align: center; }
.math-error { color: #b14835; font-family: var(--mono); font-size: .9em; white-space: pre-wrap; }
.mermaid { margin: 20px 0; overflow-x: auto; padding: 4px; text-align: center; }
.mermaid svg { display: inline-block; height: auto; max-width: 100%; }
.mermaid-source { margin: 15px 0; }
.mermaid-source pre { margin: 0; }
.mermaid-error { border: 1px solid #d9a99e; }
.mermaid-error::before { content: "Mermaid 图表无法渲染，已保留源码"; display: block; padding: 8px 12px; color: #b14835; font-size: 11px; }
.document-preview .math-block, .document-preview .mermaid, .document-preview table, .document-preview pre, .document-preview blockquote { break-inside: avoid; page-break-inside: avoid; }
@media (max-width: 560px) { .export-bar select { max-width: 100%; width: 100%; } }
