/* Shared design-size paper rules used by the editor, preview and public reader. */
.issue-paper, .issue-paper * { box-sizing: border-box; }
.issue-paper { position: relative; flex: none; background: #fffdf7; box-shadow: 0 8px 30px #2433211a; }
.issue-paper--cover-image { overflow: hidden; }
.issue-cover-image { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.issue-paper--cover-image > .issue-page-flow { position: relative; z-index: 1; }
.editor-cover-settings { padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid #dce2d5; }
.editor-inspector .editor-cover-pending { padding: 10px; background: #f5ead0; color: #75552b; border-radius: 6px; }
.editor-inspector .editor-cover-notice { color: #a23c2c; }
.issue-cover.issue-cover--custom { aspect-ratio: 5 / 7; }
.issue-cover-preview { position: relative; aspect-ratio: 5 / 7; width: 100%; overflow: hidden; }
.issue-cover-preview > .issue-page-frame { position: absolute; inset: 0 auto auto 0; pointer-events: none; }
.issue-cover-preview .issue-paper { box-shadow: none; }
.intake-cover-column > .issue-cover-preview { width: 6.5rem; border: 1px solid #d1cbb9; border-radius: .35rem; }
.search-cover-preview { display: block; flex: 0 0 3rem; width: 3rem; }
.issue-page-flow { display: grid; align-content: start; align-items: start; height: 100%; min-height: 0; }
.issue-block { position: relative; min-width: 0; justify-self: start; overflow-wrap: anywhere; }
.issue-paragraph { white-space: pre-wrap; min-height: 1em; overflow-wrap: anywhere; }
.issue-mark-word { background: #f7e7a6; color: inherit; border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.issue-mark-sentence { text-decoration: underline wavy #60844f; text-underline-offset: .22em; text-decoration-thickness: 1px; }
.issue-paragraph ruby { ruby-align: center; ruby-position: over; }
.issue-paragraph rt { font-family: system-ui, sans-serif; font-size: .5em; font-weight: 400; font-style: normal; color: #41643a; text-indent: 0; user-select: none; }
.issue-work-title { margin: 0 0 18px; line-height: 1.4; }
.issue-author { margin: 12px 0 0; text-align: right; text-indent: 0; line-height: 1.7; }
.issue-divider { border: 0; border-top: 1px solid #b2baaa; margin: 12px 0; }
.issue-page-number { position: absolute; bottom: 16px; left: 0; width: 100%; text-align: center; font: 12px/1.5 system-ui; color: #6c7967; }
.issue-toc-title { grid-column: 1 / -1; margin: 0; font-size: 26px; }
.issue-toc { list-style: none; padding: 0; margin: 0; }
.issue-toc a { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dotted #bdc6b6; color: inherit; }
.issue-toc-groups { grid-column: 1 / -1; list-style: none; padding: 0; margin: 0; }
.issue-toc-group + .issue-toc-group { margin-top: 14px; }
.issue-toc-group-name { display: block; padding: 8px 0 4px; border-bottom: 1px solid #a9b49d; font-weight: 700; letter-spacing: .08em; }
/* 栏目开头：简洁标题为名称加细线，淡色标题条用浅色底条；导语都在标题下方。 */
.issue-section-heading { grid-column: 1 / -1; }
.issue-section-name { margin: 0; font-size: 26px; line-height: 1.4; letter-spacing: .12em; }
.issue-section-rule { border: 0; border-top: 1px solid #b2baaa; margin: 8px 0 0; }
.issue-section-band { padding: 10px 14px; border-left: 3px solid #7f9b6c; border-radius: 4px; background: #eef3e7; }
.issue-section-band .issue-section-name { font-size: 22px; letter-spacing: .1em; }
.issue-section-intro { margin: 8px 0 0; color: #6d7865; }
.issue-paper[data-kind="cover"] .issue-page-flow, .issue-paper[data-kind="back"] .issue-page-flow { align-content: center; }
.issue-page-frame { position: relative; flex: none; width: calc(600px * var(--page-scale)); height: calc(840px * var(--page-scale)); }
.issue-page-frame > .issue-paper { transform: scale(var(--page-scale)); transform-origin: top left; }
.issue-measure { position: fixed; left: -100000px; top: 0; visibility: hidden; pointer-events: none; }
.admin-shell.is-editing { grid-template-columns: 11rem minmax(0,1fr); }
.admin-shell.is-editing .admin-content { max-width: none; padding: 12px; }
.admin-shell.is-editing.is-focused { grid-template-columns: minmax(0,1fr); }
.admin-shell.is-focused .admin-sidebar { display: none; }
.publication-editor { container-type: inline-size; border: 1px solid #dce2d5; border-radius: 12px; overflow: hidden; background: #f6f7f1; }
.publication-editor button:focus-visible, .publication-editor input:focus-visible, .publication-editor select:focus-visible { outline: 2px solid #55794b; outline-offset: 2px; }
.editor-topbar, .editor-formatbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; background: #fffef9; border-bottom: 1px solid #e0e5da; }
.editor-topbar h2 { font-size: 16px; margin-right: auto; }
.editor-topbar button, .editor-formatbar button, .editor-navigation button, .editor-work-panel button, .editor-inspector button { border: 1px solid #d9e0d1; border-radius: 6px; padding: 6px 9px; font-size: 12px; background: #fffef9; }
.publication-editor button:disabled { opacity: .4; cursor: default; }
.publication-editor button[aria-pressed="true"] { background: #e3ecd9; border-color: #69875c; }
.editor-topbar .editor-primary { background: #436a3d; color: white; }
.editor-status { width: 100%; font-size: 12px; color: #496444; }
.editor-status.is-error { color: #a23c2c; }
.editor-formatbar label { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; }
.publication-editor input, .publication-editor select { min-width: 0; border: 1px solid #d9e0d1; border-radius: 5px; background: white; padding: 5px; font: inherit; }
.editor-formatbar input[type="number"] { width: 58px; }
.editor-formatbar input[type="color"] { width: 34px; height: 28px; padding: 2px; }
.editor-layout { display: grid; grid-template-columns: 160px minmax(0,1fr) 290px; height: clamp(440px, calc(100dvh - 310px), 850px); }
.editor-layout.has-library { grid-template-columns: 160px 250px minmax(0,1fr) 290px; }
.editor-navigation, .editor-work-panel, .editor-inspector { min-width: 0; min-height: 0; padding: 12px; background: #fcfcf7; overflow: auto; overscroll-behavior: contain; }
.editor-navigation, .editor-work-panel { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.editor-navigation-tools, .editor-library-tools { flex: none; padding: 12px; border-bottom: 1px solid #e0e5da; }
.editor-navigation-tools { display: grid; gap: 8px; }
.editor-page-list, .editor-library { flex: 1; min-height: 0; padding: 12px; overflow: auto; overscroll-behavior: contain; overflow-anchor: none; }
.editor-work-panel { border-right: 1px solid #e0e5da; }
.editor-library-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.editor-library-heading h3 { margin: 0; font-size: 14px; }
.editor-library-target { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: #436a3d; }
.editor-library-tools input, .editor-library-tools select { display: block; width: 100%; margin: 0 0 8px; font-size: 12px; }
.editor-library-tools .editor-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.editor-navigation { border-right: 1px solid #e0e5da; }
.editor-inspector { border-left: 1px solid #e0e5da; }
.editor-navigation h3, .editor-inspector h3 { font-size: 14px; margin: 8px 0 14px; }
.editor-navigation input, .editor-navigation select { width: 100%; margin-bottom: 8px; font-size: 12px; }
.editor-tabs { display: flex; gap: 5px; margin-bottom: 12px; }
.editor-page-thumb { display: block; width: 100%; margin: 0 0 10px; text-align: left; }
.editor-page-thumb .issue-page-frame { --page-scale: .17 !important; margin: 5px auto; pointer-events: none; }
.editor-page-thumb > span { display: block; font-size: 12px; margin-top: 5px; }
.editor-library-group { margin-bottom: 6px; }
.editor-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 6px; border: 1px solid #dce2d5; border-radius: 6px; background: #f4f6ee; font-size: 12px; }
.editor-group-head strong { font-weight: 700; }
.editor-group-head span { color: #778070; }
.editor-group-head[aria-expanded="false"] { opacity: .78; }
.editor-work-section { display: block; margin-top: 3px; color: #5d7a4d; }
.editor-tidy { margin-bottom: 8px; }
.editor-tidy-preview { margin: 0 0 16px; padding: 12px; border: 1px solid #c9d6bb; border-radius: 8px; background: #f7f9f2; }
.editor-tidy-preview h3 { margin-bottom: 8px; font-size: 13px; }
.editor-tidy-preview p { font-size: 12px; line-height: 1.7; color: #6d7865; }
.editor-tidy-preview ol { margin: 8px 0; padding-left: 18px; font-size: 12px; }
.editor-tidy-preview li { margin-bottom: 4px; }
.editor-tidy-preview li span { display: block; color: #778070; overflow-wrap: anywhere; }
.editor-work-item { border-bottom: 1px solid #e1e6da; padding: 12px 0; font-size: 12px; }
.editor-work-item p { margin: 5px 0; overflow-wrap: anywhere; color: #778070; }
.editor-work-item button { margin-top: 5px; }
.editor-canvas { min-width: 0; min-height: 0; overflow: auto; background: #e8ecdf; padding: 24px; overscroll-behavior: contain; overflow-anchor: none; }
.editor-canvas-pages { display: flex; align-items: start; justify-content: center; gap: 20px; min-width: max-content; }
.editor-canvas .issue-block:hover { outline: 1px dashed #869f77; }
.editor-canvas .issue-block.is-selected { outline: 2px solid #71965d; outline-offset: 5px; }
.editor-canvas .issue-paper.is-selected { box-shadow: 0 0 0 2px #779767; }
.editor-canvas .issue-paragraph[contenteditable] { outline: 1px dashed #83a471; cursor: text; }
.editor-canvas .issue-paper.is-overflowing { box-shadow: 0 0 0 3px #b24531; }
.issue-block-handle { position: absolute; left: -26px; top: 0; width: 23px; height: 27px; border: 1px solid #b5c4a8; border-radius: 4px; background: #fffef9; cursor: grab; font: 18px/1 system-ui; color: #547046; opacity: 0; }
.issue-block:hover > .issue-block-handle, .issue-block.is-selected > .issue-block-handle, .issue-block-handle:focus { opacity: 1; }
.editor-inspector label { display: grid; gap: 5px; margin: 10px 0; font-size: 12px; }
.editor-inspector .editor-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.editor-inspector p, .editor-inspector summary { font-size: 12px; line-height: 1.7; color: #6d7865; }
.editor-inspector details p { white-space: pre-wrap; }
.publication-editor [hidden] { display: none !important; }
.editor-inspector .editor-formatbar { display: block; padding: 0; border: 0; background: transparent; }
.editor-inspector .editor-formatbar label { display: grid; font-size: 12px; }
.editor-inspector .editor-formatbar input[type="number"] { width: 100%; }
.editor-inspector details { margin: 16px 0; }
.publication-editor summary { cursor: pointer; }
.editor-tool-tabs button { flex: 1; padding: 9px 5px; }
.editor-preset { margin: 16px 0; font-size: 12px; }
.editor-preset .editor-actions { margin-top: 7px; }
.editor-preset small { display: block; margin-top: 5px; color: #6d7865; }
.editor-selection { padding: 12px; border-radius: 6px; background: #edf1e7; color: #3f5436; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 140px; overflow: auto; font-size: 14px; }
.editor-pinyin { margin-top: 18px; padding-top: 12px; border-top: 1px solid #dce2d5; }
.editor-pinyin-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; max-height: 280px; overflow: auto; }
.editor-pinyin-grid label { margin: 0; text-align: center; font-size: 17px; }
.editor-pinyin-grid input { width: 100%; text-align: center; font: 14px system-ui; }
.editor-more { position: relative; }
.editor-more > summary { border: 1px solid #d9e0d1; border-radius: 6px; padding: 6px 9px; font-size: 12px; }
.editor-more[open] > div { position: absolute; z-index: 10; top: 100%; left: 0; width: 210px; display: grid; gap: 8px; padding: 12px; border: 1px solid #d9e0d1; background: #fffef9; box-shadow: 0 6px 20px #24332120; }
.editor-more label { font-size: 12px; }
.editor-hint { font-size: 12px; color: #68765e; margin: 0 0 16px; }
.editor-warning { color: #a13d2d; }
.document-reader #reader-content { width: 100%; min-width: 0; }
.document-reader .reader-workspace { display: block; overflow: auto; padding: 24px; }
.document-reader-pages { display: flex; justify-content: center; gap: 20px; min-width: max-content; }
.document-reader .reader-edge { display: none; }
.document-reader .reader-dots { overflow: auto; max-width: 50vw; }
@container (max-width: 1239px) {
  .editor-layout.has-library { grid-template-columns: 150px 240px minmax(0,1fr); }
  .editor-layout.has-library .editor-inspector { display: none; }
}
@container (max-width: 800px) {
  .editor-layout { grid-template-columns: 150px minmax(0,1fr); }
  .editor-layout:not(.has-library) { height: auto; grid-template-rows: 560px auto; }
  .editor-inspector { grid-column: 1 / -1; border-top: 1px solid #e0e5da; max-height: 500px; }
  .editor-inspector label { max-width: 100%; }
  .editor-pinyin-grid { grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)); }
}
@media (max-width: 1100px) {
  .admin-shell.is-editing { grid-template-columns: 9rem minmax(0,1fr); }
}
@container (max-width: 600px) {
  .editor-layout, .editor-layout.has-library { grid-template-columns: 110px minmax(0,1fr); height: auto; }
  .editor-layout.has-library { grid-template-rows: 440px 500px; }
  .editor-layout.has-library .editor-canvas { grid-column: 1 / -1; }
  .editor-navigation-tools, .editor-page-list { padding: 6px; }
  .editor-page-thumb .issue-page-frame { --page-scale: .12 !important; }
  .editor-canvas { padding: 12px; }
}
@media (max-width: 767px) {
  .admin-shell.is-editing { display: block; }
  .editor-topbar h2 { width: 100%; }
  .document-reader .reader-workspace { padding: 12px; }
  .document-reader .reader-title { min-width: 0; }
}
