/* These rules keep the native WebKit window and browsers on the same layout. */
.layout-ready .layout-inbox-hidden {display:none!important}
body.layout-ready {display:flex;flex-direction:column;height:100vh;height:100dvh;min-height:0;overflow:hidden}
.layout-ready .topbar {flex:none;height:48px;min-height:48px;padding:0 14px;gap:10px}
.layout-ready .layout-toolbar {display:flex;align-items:center;gap:5px;flex:none;min-height:34px;padding:3px 12px;background:#fffdf9;border-bottom:1px solid #dedbd4;flex-wrap:wrap}
.layout-toolbar-label {font-size:11px;color:#879095;margin-right:3px;white-space:nowrap}
.layout-region-button,.layout-reset {border:1px solid transparent;border-radius:5px;background:transparent;color:#8a9398;font-size:12px;padding:4px 9px;min-height:27px;white-space:nowrap}
.layout-region-button.active {background:#efe9df;color:#415264;border-color:#e4dccc}
.layout-region-button:hover,.layout-reset:hover {background:#f2eee7;color:#9d564c}
.layout-region-button:focus-visible,.layout-reset:focus-visible,.layout-collapse:focus-visible,.layout-expand:focus-visible {outline:2px solid #b76556;outline-offset:2px}
.layout-reset {margin-left:6px;border-left:1px solid #e6e0d7;border-radius:0;font-size:11px}
.layout-toolbar-tip {margin-left:auto;color:#a0a6a7;font-size:11px;white-space:nowrap}
.layout-presets {display:flex;align-items:center;gap:4px;padding-left:9px;margin-left:5px;border-left:1px solid var(--skin-border,#e6e0d7)}
.layout-preset {border:1px solid var(--skin-border,#dedbd4);border-radius:5px;background:var(--skin-surface,#fffdf9);color:var(--skin-muted,#687780);font-size:11px;padding:4px 8px;min-height:27px;white-space:nowrap}
.layout-preset[aria-pressed=true] {background:var(--skin-soft,#efe9df);color:var(--skin-accent,#a65348);border-color:currentColor}
.layout-preset:focus-visible {outline:2px solid var(--skin-focus,#b76556);outline-offset:2px}
.layout-ready .app-shell {display:grid;flex:1;height:auto;min-height:0;min-width:0;overflow-x:auto;overflow-y:hidden;align-items:stretch}
.layout-ready .workspace {height:100%;min-height:0;min-width:0;overflow:auto}
.layout-ready .review-workspace {height:100%;min-height:360px}
.layout-ready .projects-pane,.layout-ready .chapters-pane {display:flex;flex-direction:column;height:100%;min-height:0;min-width:0;border-right:0;overflow:hidden}
.layout-ready .layout-pane {position:relative;min-width:0;min-height:0}
.layout-pane-bar {display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;min-height:24px;padding:0 7px 0 10px;background:#f3f0e9;border-bottom:1px solid #e6e1d7;color:#899095;font-size:11px}
.layout-collapse {display:grid;place-items:center;width:25px;height:23px;padding:0;border:0;border-radius:4px;background:transparent;color:#707e89;font-size:24px;line-height:1}
.layout-collapse:hover {background:#e6dfd2;color:#a65d51}
.layout-pane-rail {display:none;height:100%;width:100%;background:#eeebe4;border-right:1px solid #dfd9cf}
.layout-expand {display:flex;align-items:center;flex-direction:column;gap:11px;width:100%;min-height:158px;padding:6px 0 14px;border:0;background:transparent;color:#768089}
.layout-expand:hover {background:#e3dacf;color:#a65d51}
.layout-rail-arrow {font-size:24px;line-height:24px}
.layout-rail-label {writing-mode:vertical-rl;white-space:nowrap;letter-spacing:3px;font-size:12px;font-weight:650}
.layout-ready .layout-pane.layout-collapsed > :not(.layout-pane-rail) {display:none!important}
.layout-ready .layout-pane.layout-collapsed > .layout-pane-rail {display:block}
.layout-separator {height:100%;position:relative;align-self:stretch;background:#e8e3da;cursor:col-resize;touch-action:none;outline:none;z-index:1}
.layout-separator::after {content:"";position:absolute;inset:0 2px;background:transparent;transition:background .15s}
.layout-separator:hover::after,.layout-separator.dragging::after,.layout-separator:focus-visible::after {background:#ba796b}
.layout-separator:focus-visible {box-shadow:inset 0 0 0 1px #9e5d50}
.layout-separator.disabled {cursor:default;background:#ebe6df}
.layout-separator.disabled::after {display:none}
.layout-dragging,.layout-dragging * {cursor:col-resize!important;user-select:none!important;-webkit-user-select:none!important}
.layout-ready .document-grid {display:grid;flex:1;min-height:0;gap:0;overflow-x:auto;overflow-y:hidden}
.layout-ready .document-grid > .document-pane,.layout-ready .document-grid > .comments-pane {display:flex;flex-direction:column;height:100%;min-height:0;max-height:none;grid-column:auto;border:0}
.layout-ready .document-grid[data-view] > .document-pane:not(.layout-collapsed),.layout-ready .document-grid[data-view] > .comments-pane:not(.layout-collapsed) {display:flex}
.layout-all-hidden {display:none;align-items:center;justify-content:center;min-width:180px;height:100%;padding:28px;text-align:center;font-size:13px;line-height:1.8;color:#8b9295;background:#fbfaf7}
.layout-document-hidden > .layout-all-hidden {display:flex}
.layout-ready .mobile-view-toggle {display:none}
.layout-ready .document-toolbar,.layout-ready .comments-head {flex:none;min-height:50px;padding:6px 12px;flex-wrap:wrap;gap:3px 8px}
.layout-ready .document-toolbar {display:grid;grid-template-columns:minmax(58px,1fr) auto;align-content:center}
.layout-ready .document-toolbar>div {display:contents}
.layout-ready .document-toolbar .document-label {grid-column:1;grid-row:1}
.layout-ready .document-toolbar small {grid-column:1 / -1;grid-row:2;margin-top:0}
.layout-ready .document-toolbar select,.layout-ready .document-toolbar .word-count {grid-column:2;grid-row:1}
.layout-ready .document-toolbar select {padding:3px 5px;max-width:160px;min-width:0;flex-shrink:1}
.layout-ready .comments-head small {margin-top:2px}
.layout-ready .paper-text,.layout-ready .editing-pane textarea {padding:14px 22px 45px;font-size:16px;line-height:2;min-height:0}
.layout-ready .paper-text {user-select:text;-webkit-user-select:text}
.layout-ready .comments-head small {max-width:240px}
.layout-ready .comment-compose {display:block;flex:none;padding:13px}
.layout-ready .comment-compose textarea {height:90px}
.layout-ready .comment-compose button {width:100%;margin-top:8px}
.layout-ready .comment-list {display:block;overflow:auto;padding:13px 13px 40px;min-height:0}
.layout-ready .comment-card {min-width:0;max-width:none;margin:0 0 10px}
.layout-ready .projects-pane .pane-heading,.layout-ready .chapters-pane .pane-heading {display:flex;position:static;min-height:70px;padding:17px 14px 12px;justify-content:space-between;flex:none}
.layout-ready .projects-pane .pane-heading>div,.layout-ready .chapters-pane .pane-heading>div {display:block;min-width:0}
.layout-ready .projects-pane .pane-heading .icon-button {width:28px;height:28px;font-size:19px}
.layout-ready .desk-nav {display:grid;flex:none;padding:12px 10px 0;overflow-x:visible;gap:3px}
.layout-ready .desk-nav button {padding:9px 10px;font-size:12px;white-space:normal}
.layout-ready .project-list,.layout-ready .chapter-list {display:block;overflow:auto;padding:5px 8px;flex:1;min-height:0;margin:0}
.layout-ready .project-card,.layout-ready .chapter-card {width:100%;max-width:none;min-width:0;margin:0 0 4px;padding:11px 10px;align-items:flex-start}
.layout-ready .project-card .card-meta,.layout-ready .chapter-card .card-meta {display:block}
.layout-ready .project-initial {width:30px;height:30px;font-size:16px}
.layout-ready .sidebar-note {display:block;flex:none;margin:12px 14px 16px;font-size:11px}
.layout-ready .chapters-pane .text-button {display:block;flex:none;margin:8px 14px 18px}
.layout-ready .chapter-header {flex:none;min-height:50px;padding:7px 14px;flex-direction:row;align-items:center;flex-wrap:wrap;gap:6px 12px}
.layout-ready .chapter-identity {display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;flex:1;min-width:0}
.layout-ready .chapter-identity .eyebrow {display:inline;margin:0;flex:none;letter-spacing:.06em}
.layout-ready .chapter-identity h1 {margin:0;overflow-wrap:anywhere}
.layout-ready .chapter-header .button {min-height:32px;padding:5px 10px;font-size:12px}
.layout-ready .chapter-identity h1 {font-size:20px}
.layout-ready .header-actions {width:auto;margin-left:auto;justify-content:flex-end;flex-wrap:wrap;gap:7px}
.layout-ready .save-state {font-size:11px;margin-right:2px}
.layout-ready .review-info {padding:6px 14px;min-height:30px;flex:none;line-height:1.5}
.layout-ready #authorRecoveryNotice .text-button {margin:0;padding:3px 0}
.layout-ready .writing-actions {padding:5px 14px;flex:none;gap:5px 7px;position:relative}
.layout-ready .writing-actions .button {font-size:12px;min-height:30px;padding:4px 9px}
.layout-ready .new-version-notice {flex:none;padding:6px 14px}
.layout-ready .revision-summary {padding:5px 12px;gap:5px}
.layout-ready .revision-summary button {padding:3px 6px}

/* Supporting guidance opens over the manuscript, leaving its height available. */
.chapter-help {position:relative;flex:none;margin-left:auto;font-size:11px;color:var(--skin-muted,#6f797c)}
.chapter-help>summary {cursor:pointer;list-style:none;display:flex;align-items:center;gap:5px;min-height:30px;padding:4px 8px;border:1px solid var(--skin-border,#dedbd4);border-radius:5px;background:var(--skin-surface,#fff);white-space:nowrap}
.chapter-help>summary::-webkit-details-marker {display:none}
.chapter-help>summary::after {content:"▾";font-size:10px}
.chapter-help[open]>summary::after {content:"▴"}
.chapter-help>summary:focus-visible {outline:2px solid var(--skin-focus,#b76556);outline-offset:2px}
.chapter-help-content {position:absolute;right:0;top:calc(100% + 6px);z-index:5;width:520px;max-width:calc(100vw - 40px);max-height:320px;max-height:min(320px,45dvh);overflow:auto;border:1px solid var(--skin-border,#dedbd4);border-radius:8px;background:var(--skin-surface,#fffdf9);color:var(--skin-ink,#26384b);box-shadow:0 8px 28px #172b3b30;padding:10px 12px}
.layout-ready .chapter-help-content #reviewInfo,.layout-ready .chapter-help-content .manual-learning-guide {min-height:0;padding:0;margin:0;font-size:12px;line-height:1.65;border:0;background:transparent;color:inherit}
.layout-ready .chapter-help-content .manual-learning-guide {margin-top:9px;padding-top:9px;border-top:1px solid var(--skin-border,#e3ded5)}
#submissionOriginalPane {margin-bottom:24px}
#submissionOriginalPane .snapshot-text {margin:10px 0 0;user-select:text;-webkit-user-select:text}
#submissionSourceSelect {margin:0;font-size:12px}
#submissionOriginalPane .snapshot-text:empty::before {content:"本次提交未保存 原稿。";color:#969c9d}
#feedbackSelectionPreview {margin:16px 0 8px;max-height:100px;overflow:auto}
@media(max-width:1100px) {
  .layout-ready .topbar-right .local-badge {display:none}
  .layout-toolbar-tip {display:none}
  .layout-ready .topbar .brand {font-size:15px;gap:8px}
  .layout-ready .topbar-right {gap:7px}
  .layout-ready .topbar .button {font-size:12px;padding:5px 9px;min-height:32px}
}
.layout-ready .topbar-right #accountButton {max-width:min(24vw,240px);overflow:hidden;text-overflow:ellipsis}
@media(max-width:760px) {
  .layout-ready .topbar {height:auto;min-height:48px;padding:6px 10px;flex-wrap:wrap;gap:6px}
  .layout-ready .topbar-right {margin-left:auto;flex-wrap:wrap;max-width:100%}
}
@media(max-width:600px) {
  .layout-ready .layout-toolbar {padding:3px 8px;gap:3px}
  .layout-toolbar-label {width:100%}
  .layout-region-button {padding:4px 7px;font-size:11px}
  .layout-reset {padding:4px 6px;font-size:11px}
  .layout-ready .topbar-right #accountButton {max-width:150px}
}

.source-annotation-highlight {background:#f6df9d;color:inherit;border-radius:2px;scroll-margin:30px}
.source-multi-selected {background:#dce8ff;color:inherit;box-shadow:inset 0 -1px #658ac6;border-radius:2px}
body[data-theme="night"] .source-multi-selected {background:#344e73;color:inherit;box-shadow:inset 0 -1px #9bbdf0}
.comment-compose .clear-source-selection,#feedbackCompose .clear-source-selection {display:block;width:auto;min-height:24px;padding:2px 0;margin:0 0 6px;font-size:11px}
.selection-preview {overflow:auto}

/* The compact view uses the same live DOM and editor, without copying text or
   changing stored desktop dimensions. Only one navigation/document pane shows. */
body.layout-ready.layout-compact .layout-compact-hidden {display:none!important}
.layout-compact .layout-separator,.layout-compact .layout-pane-rail,
.layout-compact .layout-presets,.layout-compact .layout-reset,
.layout-compact .layout-toolbar-label,.layout-compact .layout-toolbar-tip {display:none!important}
.layout-ready.layout-compact .layout-toolbar {flex-wrap:nowrap;gap:4px;padding:3px 8px;min-height:40px;overflow:hidden}
.layout-compact .layout-region-button {flex:1;min-width:0;min-height:32px;padding:4px;font-size:12px}
.layout-compact .layout-region-button:disabled {opacity:.45}
.layout-ready.layout-compact .app-shell {grid-template-columns:minmax(0,1fr);overflow:hidden}
.layout-ready.layout-compact .workspace {width:100%;overflow-x:hidden;overflow-y:auto}
.layout-ready.layout-compact .review-workspace {min-height:360px;height:100%}
.layout-ready.layout-compact .document-grid {display:grid;grid-template-columns:minmax(0,1fr);min-width:0;min-height:220px;overflow:hidden}
.layout-ready.layout-compact .document-grid>.layout-pane:not(.layout-compact-hidden) {display:flex!important;grid-column:1}
.layout-compact .document-grid .layout-pane-bar {display:none}
.layout-ready.layout-compact .document-toolbar,.layout-ready.layout-compact .comments-head {min-height:44px;padding:5px 12px}
.layout-ready.layout-compact .paper-text,.layout-ready.layout-compact .editing-pane textarea {padding:12px 20px 40px}
.layout-ready.layout-compact .chapter-header {min-height:0;padding:6px 12px;gap:5px 8px}
.layout-ready.layout-compact .chapter-identity h1 {font-size:20px;overflow-wrap:anywhere}
.layout-ready.layout-compact .chapter-identity .eyebrow {margin:0}
.layout-ready.layout-compact .header-actions {width:auto;gap:6px}
.layout-ready.layout-compact .header-actions .save-state {margin-right:auto;white-space:normal}
.layout-ready.layout-compact .review-info {padding:5px 12px;min-height:0;overflow-wrap:anywhere}
.layout-ready.layout-compact .writing-actions {padding:4px 12px;gap:5px}
.layout-ready.layout-compact .writing-actions .button {min-height:30px;font-size:11px;padding:4px 7px}
.layout-ready.layout-compact .projects-pane,.layout-ready.layout-compact .chapters-pane {width:100%}
.layout-ready.layout-compact .projects-pane .pane-heading,.layout-ready.layout-compact .chapters-pane .pane-heading {min-height:54px;padding:12px 14px}
.layout-compact .overview-head,.layout-compact .overview-card-head {flex-wrap:wrap}
.layout-compact .overview-panel {min-width:0;max-width:100%;overflow-wrap:anywhere}

@media(max-width:600px) {
  .layout-ready.layout-compact .header-actions {width:100%}
  .layout-ready .chapter-help-content {position:fixed;right:12px;left:12px;top:auto;width:auto;max-width:none;margin-top:6px;max-height:40vh;max-height:40dvh}
}
@media(max-height:540px) {
  .layout-ready .workspace {overflow-y:auto}
  .layout-ready .review-workspace {min-height:360px}
  .chapter-help-content {max-height:40vh;max-height:40dvh}
}
