:root{--ink:#22322c;--muted:#627269;--green:#285c46;--soft:#edf3ef;--paper:#fff;--bg:#f5f7f5;--line:#dce4df;--radius:12px;font-family:"Segoe UI","Microsoft YaHei",Arial,sans-serif;color:var(--ink);background:var(--bg);font-size:17px;line-height:1.65;color-scheme:light}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer;border:1px solid var(--line);border-radius:8px;background:white;color:var(--ink);padding:10px 16px;min-height:46px;font-weight:600;line-height:1.4}button:hover{background:var(--soft);border-color:#97afa0}button:disabled{opacity:.55;cursor:wait}.primary{background:var(--green);border-color:var(--green);color:white}.primary:hover{background:#1f4836}.quiet{background:transparent;border-color:transparent}.small{font-size:14px;min-height:36px;padding:7px 10px}.danger{color:#8e3530}a{color:var(--green);text-underline-offset:3px}input,textarea,select{border:1px solid #bacbbf;border-radius:8px;background:white;color:var(--ink);padding:11px 13px;width:100%;min-width:0}textarea{resize:vertical;line-height:1.75}input:focus,textarea:focus,select:focus{border-color:var(--green);outline:3px solid #d6e6db}button:focus-visible,a:focus-visible{outline:3px solid #86ab94;outline-offset:3px}h1,h2,h3,p{margin:0}h1{font-size:clamp(28px,3vw,39px);line-height:1.35;letter-spacing:-.6px}h2{font-size:26px;line-height:1.4}h3{font-size:19px;line-height:1.4}p{margin:12px 0}.hint{color:var(--muted);font-size:15px}.eyebrow{font-size:13px;letter-spacing:.5px;text-transform:uppercase;color:var(--muted);margin-bottom:10px}.header{background:white;border-bottom:1px solid var(--line)}.header-inner{max-width:1280px;margin:auto;padding:17px 28px;display:flex;justify-content:space-between;align-items:center;gap:20px}.brand{font-size:19px;font-weight:650;line-height:1.3}.brand small{display:block;font-size:13px;color:var(--muted);font-weight:400;margin-top:3px}.header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.header select{width:128px;font-size:14px;padding:7px 9px;min-height:40px}.layout{max-width:1280px;margin:30px auto 70px;padding:0 28px;display:grid;grid-template-columns:235px minmax(0,1fr);gap:30px}.sidebar{align-self:start;position:sticky;top:22px}.project-select{margin-bottom:10px;font-size:15px}.sidebar label{display:block;font-size:13px;color:var(--muted);margin-bottom:8px}.steps{display:grid;gap:8px;margin:26px 0 20px}.step{display:flex;gap:11px;align-items:center;text-align:left;border:0;background:transparent;padding:12px 10px;font-size:15px;font-weight:500}.step b{border:1px solid #bdcdc2;border-radius:50%;width:28px;height:28px;display:grid;place-items:center;font-size:13px;flex-shrink:0}.step.active{background:var(--soft);color:var(--green);font-weight:650}.step.active b{background:var(--green);color:white;border-color:var(--green)}.sidebar-footer{border-top:1px solid var(--line);padding-top:18px;display:grid;gap:4px}.connection{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);margin:20px 0 6px}.status-dot{width:7px;height:7px;background:#95a49b;border-radius:50%}.status-dot.on{background:var(--green)}.save-state{font-size:12px;color:var(--muted);margin-top:14px}.card{background:white;border:1px solid var(--line);border-radius:var(--radius);padding:30px}.welcome{padding:32px;background:var(--soft);border:1px solid #d7e4dc;border-radius:var(--radius);margin-bottom:25px}.welcome p{max-width:720px}.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.spaced{margin-top:22px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.field{display:grid;gap:8px;margin-top:19px}.field label{font-size:16px;font-weight:600}.scene-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0 26px}.scene-option{display:block;border:1px solid var(--line);border-radius:10px;padding:16px;cursor:pointer;position:relative;background:white}.scene-option:has(input:checked){border-color:var(--green);box-shadow:inset 0 0 0 1px var(--green);background:var(--soft)}.scene-option input{width:auto;margin:0 8px 0 0;accent-color:var(--green)}.scene-option strong{font-size:17px}.scene-option small{display:block;margin:7px 0 0 24px;font-size:13px;color:var(--muted);line-height:1.6}.section-head{margin-bottom:24px}.section-head p{max-width:710px}.question-box{padding:21px 24px;border-left:3px solid var(--green);background:var(--soft);border-radius:0 9px 9px 0;margin:24px 0}.question-box small{color:var(--muted);font-size:13px}.question-box p{font-size:21px;line-height:1.65;margin-bottom:0;overflow-wrap:anywhere}.answer-text{min-height:200px}.subsection{margin-top:28px;padding-top:25px;border-top:1px solid var(--line)}.record{border:1px solid var(--line);border-radius:9px;padding:18px;margin-top:12px}.record h3{font-size:16px;margin-bottom:8px}.record p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px}.record .tools{display:flex;gap:6px;justify-content:flex-end}.material-choice{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--muted);margin-top:10px}.material-choice input{width:auto;accent-color:var(--green)}.chapter-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:24px 0;flex-wrap:wrap}.chapter-toolbar select{flex:1;max-width:420px}.chapter-text{min-height:420px}.badge{font-size:13px;padding:5px 10px;border-radius:6px;background:var(--soft);color:var(--green);display:inline-block}.review-output{white-space:pre-wrap;background:var(--soft);border-radius:8px;padding:20px;margin-top:18px;overflow-wrap:anywhere;font-size:15px}.export-option{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:24px;align-items:center;padding:23px 0;border-bottom:1px solid var(--line)}.export-option h3{margin-bottom:6px}.export-option p{margin:0}.checklist{padding-left:22px}.checklist li{padding:5px 0}.help-questions{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.help-questions button{font-size:15px;font-weight:500}.help-answer{background:var(--soft);padding:25px;border-radius:10px;min-height:120px;font-size:19px;white-space:pre-wrap}.handoff-text{font-size:14px;line-height:1.7;min-height:300px;font-family:ui-monospace,Consolas,monospace}.bottom-nav{display:flex;justify-content:space-between;margin-top:27px;gap:12px}.footnote{font-size:13px;color:var(--muted);margin-top:24px}.empty{padding:17px 0;color:var(--muted);font-size:15px}.notice{padding:13px 16px;background:var(--soft);border-radius:8px;color:var(--muted);font-size:14px;margin-top:18px}.hidden{display:none!important}[hidden]{display:none!important}dialog{border:1px solid var(--line);border-radius:14px;padding:30px;width:min(580px,calc(100vw - 28px));max-height:calc(100dvh - 50px);overflow:auto;color:var(--ink)}dialog::backdrop{background:rgb(20 35 27 / .35)}.dialog-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}.dialog-head h2{font-size:24px}dialog details{margin-top:20px}dialog summary{cursor:pointer;font-size:14px;color:var(--green)}.toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:#223c2c;color:white;border-radius:10px;padding:13px 20px;max-width:min(680px,calc(100vw - 30px));font-size:15px;box-shadow:0 5px 24px #0002;z-index:20;white-space:pre-wrap}.busy-line{font-size:14px;color:var(--green);margin-top:14px}.print-view{display:none}.print-view h1{font-size:28px}.print-view h2{font-size:23px;margin:26px 0 14px}.print-view p{white-space:pre-wrap;overflow-wrap:anywhere}.help-link{font-size:14px}.return-result{min-height:230px}@media(max-width:950px){.layout{grid-template-columns:200px minmax(0,1fr);gap:18px;padding:0 18px}.card,.welcome{padding:23px}.header-inner{padding:15px 18px}.header-actions .quiet{font-size:14px;padding:8px}.grid{grid-template-columns:1fr;gap:0}.export-option{grid-template-columns:1fr;gap:10px}.export-option button{justify-self:start}.scene-grid{gap:8px}.scene-option{padding:13px}}@media(max-width:700px){.header-inner{align-items:flex-start;padding:14px 16px;gap:12px}.header-actions{justify-content:flex-end;gap:4px}.header-actions .header-nav{display:none}.brand{font-size:16px}.brand small{font-size:12px}.header select{width:113px}.layout{display:block;margin-top:18px;padding:0 14px}.sidebar{position:static}.project-row{display:flex;align-items:center;gap:10px}.project-row select{flex:1;margin:0}.project-row button{font-size:13px;padding:8px 10px;white-space:nowrap}.sidebar label{display:none}.steps{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:18px 0}.step{display:flex;flex-direction:column;justify-content:flex-start;gap:7px;padding:9px 4px;font-size:12px;line-height:1.4;text-align:center}.step b{width:25px;height:25px}.sidebar-footer{display:flex;justify-content:space-between;align-items:center;padding-top:0;border:0;margin:8px 0 19px;gap:8px;flex-wrap:wrap}.connection{margin:0}.save-state{margin:0;flex-basis:100%}.sidebar-footer>button{font-size:13px;padding:6px 9px;min-height:35px}.card,.welcome{padding:21px 18px}h1{font-size:29px}h2{font-size:24px}.scene-grid{grid-template-columns:1fr}.scene-option small{margin-top:3px}.question-box{padding:16px}.question-box p{font-size:19px}.row button{flex-grow:1}.row .small{flex-grow:0}.help-answer{font-size:17px}.chapter-text{min-height:380px}.export-option{gap:10px}.grid{grid-template-columns:1fr}dialog{padding:23px}.section-head{margin-bottom:18px}.header-actions button{font-size:13px;padding:6px 9px;min-height:40px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}@media print{@page{size:A4;margin:20mm}:root{background:white}body{background:white;color:black;font-family:"Segoe UI","Microsoft YaHei",sans-serif;font-size:12pt;line-height:1.8}.header,.layout,dialog,.toast,.skip-link{display:none!important}.print-view{display:block!important}.print-view h1,.print-view h2{break-after:avoid;overflow-wrap:anywhere}.print-chapter{break-before:page}.print-chapter:first-of-type{break-before:auto}.print-view .hint{color:#444;font-size:10pt}}

/* The same chapter editor becomes a quiet, single-column writing surface. */
body.chapter-focus-open{overflow:hidden}
dialog.chapter-focus{inset:0;margin:0;width:100%;max-width:none;height:100dvh;max-height:none;padding:0;border:0;border-radius:0;background:#f3f1eb;overscroll-behavior:contain}
.chapter-focus::backdrop{background:var(--bg)}
.focus-header{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:20px max(28px,calc((100% - 1040px)/2));background:#f3f1eb;border-bottom:1px solid #dddcd3}
.focus-header h2{font-size:18px;font-weight:600;letter-spacing:.02em}
.focus-header h2:focus{outline:none}
.focus-header .save-state{margin:4px 0 0;font-size:13px}
.focus-tools{position:relative;display:flex;align-items:center;gap:8px;flex-shrink:0}
.focus-help{margin:0}
.focus-help>summary{min-height:44px;padding:11px 8px;font-size:13px;line-height:22px;cursor:pointer;color:var(--green);white-space:nowrap}
.focus-help>summary:focus-visible{outline:3px solid #86ab94;outline-offset:2px;border-radius:4px}
.focus-help p{position:absolute;right:0;top:calc(100% + 8px);width:min(280px,calc(100vw - 32px));margin:0;padding:12px 16px;border:1px solid var(--line);border-radius:8px;background:var(--paper);box-shadow:0 4px 16px #22322c12;font-size:14px;line-height:1.7;color:var(--muted);overflow-wrap:anywhere}
.focus-return{flex-shrink:0;background:transparent;font-size:14px;border-color:#b5bdb2}
.focus-return span[aria-hidden]{margin-right:6px}
.focus-page{width:min(920px,calc(100% - 64px));margin:24px auto 56px;padding:32px 72px 36px;background:#fffefa;border:1px solid #e1dfd5;border-radius:3px;box-shadow:0 8px 32px #353c3010;animation:focus-page-in 180ms ease-out}
.chapter-focus .badge{background:#f0f2e9;border-radius:3px}
.chapter-focus #chapterOrigin{font-size:13px}
.chapter-focus .field{margin-top:16px;gap:6px}
.chapter-focus .field label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.chapter-focus #editChapterTitle{font-family:Georgia,"Noto Serif CJK SC","Songti SC",SimSun,serif;font-size:clamp(24px,2.6vw,32px);font-weight:600;line-height:1.45;border:1px solid transparent;border-bottom-color:#dcded2;border-radius:0;background:transparent;padding:4px 0 10px;text-overflow:ellipsis}
.chapter-focus #chapterText{font-family:Georgia,"Noto Serif CJK SC","Songti SC",SimSun,serif;font-size:19px;line-height:1.95;letter-spacing:.01em;min-height:440px;border:1px solid transparent;border-radius:3px;background:transparent;padding:12px 6px;resize:none;overflow:hidden}
.chapter-focus #editChapterTitle:focus{text-overflow:clip}
.chapter-focus #editChapterTitle:focus,.chapter-focus #chapterText:focus{outline:2px solid #c9d9c8;outline-offset:5px}
.chapter-focus #chapterEditor>.row.spaced,.chapter-focus #reviewPanel{display:none!important}
.focus-end{border-top:1px solid #e6e5dc;padding-top:24px;margin:32px 0 0;font-size:14px;color:var(--muted);line-height:1.7}
@keyframes focus-page-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:700px){
  .focus-header{padding:12px 16px;gap:10px;align-items:center}
  .focus-header>div:first-child{min-width:0;flex:1}
  .focus-header h2{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .focus-header .save-state{margin:0;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
  .focus-tools{gap:6px}
  .focus-return{max-width:116px;flex-shrink:0;font-size:13px;padding:10px 12px;min-height:44px}
  .focus-page{width:100%;margin:0;padding:18px 24px 36px;border:0;box-shadow:none;border-radius:0;min-height:calc(100dvh - 100px)}
  .chapter-focus #chapterText{font-size:18px;line-height:1.9;min-height:50dvh;padding:10px 2px}
  .focus-end{font-size:13px}
}
@media(prefers-reduced-motion:reduce){.focus-page{animation:none}}

/* Saved sources stay compact; disclosure and search never change AI selection. */
.source-search-label{display:block;font-size:21px;font-weight:600;line-height:1.4;margin-bottom:16px}
.source-search-row{display:flex;gap:10px;align-items:center}
.source-search-row input{flex:1;min-width:0}
.source-search-row button{flex-shrink:0;font-size:14px}
.source-search-row button:disabled{cursor:default}
.source-search-status{font-size:14px;color:var(--green);margin:12px 0 24px;font-variant-numeric:tabular-nums}
.source-group-title{font-size:17px;margin-bottom:4px}
.source-record{border-bottom:1px solid var(--line)}
.source-record>summary{position:relative;display:block;list-style:none;padding:20px 30px 20px 0;cursor:pointer;overflow-wrap:anywhere}
.source-record>summary::-webkit-details-marker{display:none}
.source-record>summary:hover .source-title{color:var(--green)}
.source-record>summary:focus-visible{outline:3px solid #86ab94;outline-offset:3px;border-radius:3px}
.source-meta{display:flex;gap:14px;align-items:baseline;flex-wrap:wrap;font-size:12px;line-height:1.5;margin-bottom:8px;color:var(--muted)}
.source-id{font-family:ui-monospace,Consolas,monospace;font-size:13px;color:var(--green);letter-spacing:.04em}
.source-title{display:block;font-size:17px;font-weight:600;line-height:1.6}
.source-excerpt{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin-top:6px;font-size:15px;font-weight:400;color:var(--muted);line-height:1.7}
.source-arrow{position:absolute;right:6px;top:24px;font-size:25px;line-height:1;transform-origin:center;transition:transform 140ms ease-out;color:var(--green)}
.source-record[open]>summary .source-arrow{transform:rotate(90deg)}
.source-record[open]>summary .source-excerpt{display:none}
.source-body{padding:0 0 18px}
.source-record[open]>.source-body{animation:source-reveal 140ms ease-out}
.source-content{white-space:pre-wrap;overflow-wrap:anywhere;font-size:16px;line-height:1.85;margin:0 0 16px}
.source-body .material-choice{min-height:44px;margin:0}
.source-body .tools{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
.source-body .tools button{min-height:44px}
@keyframes source-reveal{from{opacity:.4}to{opacity:1}}
@media(max-width:700px){.source-search-row{align-items:stretch;flex-wrap:wrap}.source-search-row input{flex-basis:100%}.source-search-row button{margin-left:auto;min-height:44px}.source-search-label{font-size:20px}.source-record>summary{padding-top:18px;padding-bottom:18px}.source-title{font-size:16px}}
@media(prefers-reduced-motion:reduce){.source-arrow{transition:none}.source-record[open]>.source-body{animation:none}}

/* A manuscript contents page, not a gate in front of backup or export. */
.manuscript-overview{border-block:1px solid var(--line);padding:25px 0;margin-bottom:12px}
.manuscript-eyebrow{font-size:13px;font-weight:500;letter-spacing:.06em;color:var(--muted)}
.manuscript-title{font-family:Georgia,"Noto Serif CJK SC","Songti SC",SimSun,serif;font-size:clamp(25px,2.8vw,34px);font-weight:600;line-height:1.45;overflow-wrap:anywhere;margin:12px 0 16px}
.manuscript-counts{font-size:15px;font-variant-numeric:tabular-nums;line-height:1.8;color:var(--ink)}
.manuscript-note{font-size:14px;line-height:1.8;color:var(--muted);transition:color 160ms ease-out}
.manuscript-overview[data-state="reviewed"] .manuscript-note{color:var(--green)}
.manuscript-check{font-size:14px;margin:4px 0 10px;border-color:#9bad9f;background:var(--soft);color:var(--green)}
.manuscript-directory{margin-top:14px;border-top:1px solid var(--line)}
.manuscript-directory>summary{display:flex;justify-content:space-between;align-items:center;gap:16px;list-style:none;cursor:pointer;padding:16px 0;font-size:15px;font-weight:600;line-height:1.5}
.manuscript-directory>summary::-webkit-details-marker{display:none}
.manuscript-chevron{font-size:25px;color:var(--green);transition:transform 140ms ease-out}
.manuscript-directory[open]>summary .manuscript-chevron{transform:rotate(90deg)}
.manuscript-chapters{list-style:none;margin:0;padding:0 8px 0 0;max-height:24rem;overflow:auto;overscroll-behavior:contain}
.manuscript-chapter{display:flex;align-items:center;gap:16px;padding:16px 0;border-top:1px solid var(--line)}
.manuscript-number{font-family:Georgia,serif;font-size:19px;color:var(--muted);align-self:flex-start;font-variant-numeric:tabular-nums;flex-shrink:0}
.manuscript-chapter-text{min-width:0;flex:1}
.manuscript-chapter-title{display:block;font-size:16px;font-weight:600;overflow-wrap:anywhere;line-height:1.6}
.manuscript-chapter-state{display:block;font-size:12px;color:var(--muted);margin-top:4px;line-height:1.6}
.manuscript-chapter[data-reviewed="true"] .manuscript-chapter-state{color:var(--green)}
.manuscript-chapter button{flex-shrink:0;max-width:35%;min-height:44px;color:var(--green);text-decoration:underline;text-underline-offset:4px}
.manuscript-scope{font-size:13px;color:var(--muted);line-height:1.75;margin:20px 0 0}
.manuscript-return{margin-bottom:16px;color:var(--green);min-height:44px}
.manuscript-directory>summary:focus-visible,.manuscript-chapters:focus-visible,#exportOverview:focus-visible,#chapterEditor:focus-visible{outline:3px solid #86ab94;outline-offset:4px}
@media(max-width:700px){.manuscript-overview{padding:22px 0}.manuscript-chapter{gap:10px}.manuscript-chapter button{font-size:12px;padding:8px}.manuscript-number{font-size:17px}.manuscript-chapter-title{font-size:15px}.manuscript-counts{font-size:14px}.manuscript-chapters{padding-right:4px}}
@media(prefers-reduced-motion:reduce){.manuscript-note,.manuscript-chevron{transition:none}}
.draft-question{margin:20px 0;padding:16px 20px;border-left:3px solid var(--green);background:var(--soft);font-size:17px;line-height:1.8;overflow-wrap:anywhere}
.save-recovery{padding:16px;margin-bottom:20px;border:1px solid #b98239;border-radius:12px;background:#fff7e8;overflow-wrap:anywhere}.save-recovery p{margin:0 0 12px}.save-recovery .row{flex-wrap:wrap}.save-recovery button{max-width:100%;white-space:normal}
