:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif;color:#203047;background:#edf0f4;font-synthesis:none;--navy:#17263b;--lime:#d7f487;--muted:#738094}*{box-sizing:border-box}body{margin:0;display:flex;min-height:100dvh}button,input,textarea,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{opacity:.4;cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #789c35;outline-offset:3px}[hidden]{display:none!important}.sidebar{width:288px;background:var(--navy);color:#f9fbff;position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;padding:32px 25px;z-index:20}.brand{display:flex;gap:12px;align-items:center;text-decoration:none;color:inherit;font-size:23px;font-weight:600;letter-spacing:2px}.brand img{width:42px;height:42px}.brand small{display:block;font-size:10px;letter-spacing:1.7px;margin-top:7px;color:#c3cedc}.sidebar-body{margin-top:48px;overflow:auto}.eyebrow{font-size:11px;letter-spacing:1.7px;font-weight:600;color:var(--muted);margin:0 0 16px}.sidebar .eyebrow{color:#9facc1}.source-tabs{display:flex;padding:4px;background:#23344d;border-radius:9px;margin-bottom:18px}.source-tabs button{border:0;background:none;flex:1;color:#c3cedc;padding:10px 0;font-size:14px;border-radius:6px}.source-tabs .selected{background:#f6f9fd;color:#17263b;font-weight:600}.upload-btn{width:100%;border:1px dashed #728197;color:white;border-radius:8px;background:#1c2e46;min-height:68px;display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px}.upload-btn:hover{border-color:var(--lime);background:#253950}.icon{font-size:25px;font-weight:300}.hint{font-size:12px;line-height:1.8;color:#9eacc1;margin:12px 0 0}.divider{height:1px;background:#334157;margin:28px 0}.sidebar label{display:block;font-size:14px;margin-bottom:12px;color:#dde4ef}.badge{float:right;font-size:10px;color:var(--lime);border:1px solid #647351;padding:3px 5px;border-radius:4px}.sidebar select{width:100%;background:#23344b;color:#eff4fc;border:1px solid #46566d;border-radius:7px;font-size:14px;min-height:44px;padding:8px;white-space:normal}.rate-title{display:flex;justify-content:space-between;margin-top:28px}.rate-title output{color:var(--lime);font-weight:600}input[type=range]{accent-color:var(--lime);width:100%;cursor:pointer}.range-labels{display:flex;justify-content:space-between;font-size:12px;color:#9eacc1;margin:10px 0 22px}.sidebar .check{display:flex;align-items:center;gap:8px;margin-top:23px;font-size:13px}.check input{accent-color:var(--lime);width:16px;height:16px}.sidebar-footer{display:flex;gap:10px;margin-top:auto;padding-top:25px;color:#b7c5d8;font-size:12px;line-height:1.7}.sidebar-footer p{margin:0}.sidebar-footer small{display:block;color:#8c9cb3;font-size:10px}.privacy-icon{font-size:24px}.subtle-btn{border:0;color:var(--lime);padding:12px 0 0;background:none;font-size:12px}#pdfSettings{margin-top:20px}main{margin-left:288px;width:calc(100% - 288px);height:100dvh;display:flex;flex-direction:column;min-width:0}.topbar{padding:30px 40px 25px;display:flex;align-items:center;justify-content:space-between;background:#f8fafc;flex-shrink:0;border-bottom:1px solid #dce2eb}.topbar .eyebrow{font-size:10px;color:#768397;display:block;margin:0 0 8px}.topbar h1{font-size:25px;letter-spacing:1px;font-weight:550;margin:0}.edition{font-size:12px;color:#778294;letter-spacing:3px}.workspace{min-height:0;display:flex;flex-direction:column;flex:1}.document-toolbar{padding:20px 40px;display:flex;gap:15px;align-items:center;justify-content:space-between;border-bottom:1px solid #dce2eb}.file-info{display:flex;gap:12px;align-items:center;min-width:0}.file-info>div{min-width:0}.document-icon{width:38px;height:43px;border:1px solid #d2d9e3;border-radius:6px;background:white;font-family:Georgia,serif;display:grid;place-items:center;color:#64748b;flex-shrink:0}.file-info h2{margin:0 0 5px;font-size:14px;line-height:1.4;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:600px}.file-info span:not(.document-icon){font-size:12px;color:#748196}.reading-instruction{padding:14px 40px;display:flex;align-items:center;gap:8px;font-size:12px;color:#7b8798}.marker{width:9px;height:9px;background:var(--lime);border:1px solid #bdcd90;border-radius:2px}#wordCount{margin-left:auto;font-size:11px}.reader-scroll{overflow:auto;flex:1;min-height:0;padding:10px 40px 50px;scroll-behavior:smooth}.paper{background:white;box-shadow:0 3px 18px #21314b0a;max-width:850px;margin:0 auto;min-height:750px}.text-paper{padding:56px 64px 70px;font-family:Georgia,"Times New Roman",serif;font-size:19px;line-height:1.95;color:#303d4d;white-space:pre-wrap}.text-paper p{margin:0 0 1.4em}.text-paper p:first-child{font-size:30px;line-height:1.4;color:#17263b;margin-bottom:24px}.word{cursor:pointer;border-radius:3px}.text-paper .word:hover{background:#eaf3d5}.word.active{background:var(--lime)!important;color:#182631!important;box-shadow:0 2px 0 #9cbc4c}.player{background:#f9fbfd;border-top:1px solid #d8e0e9;padding:18px 40px 13px;flex-shrink:0;z-index:10}.player-main{display:flex;align-items:center;gap:14px}.round-btn{border:1px solid #d7dfe8;background:white;color:#36465c;width:38px;height:38px;border-radius:50%;font-size:22px;flex-shrink:0}.round-btn:hover{background:#eef2f7}.play-btn{border:0;background:var(--navy);color:white;height:44px;min-width:128px;border-radius:7px;display:flex;align-items:center;justify-content:center;gap:10px;font-size:14px}.play-btn:hover{background:#2a405d}#playIcon{font-size:13px}.now-reading{display:flex;flex-direction:column;gap:5px;min-width:0}.now-reading strong{font-size:13px;font-weight:600}.now-reading span{font-size:12px;color:#7c8999;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:380px}.progress-meta{margin-left:auto;text-align:right;display:flex;flex-direction:column;gap:5px;white-space:nowrap}.progress-meta strong{font-size:14px}.progress-meta span{font-size:11px;color:#7c8999}.progress{height:3px;display:block;margin:17px 0 4px;accent-color:#263c55!important}.page-tools{display:flex;align-items:center;gap:6px;white-space:nowrap}.page-tools button{border:1px solid #d4dce6;background:white;font-size:22px;border-radius:5px;width:28px;height:32px}.page-tools label{font-size:12px;color:#6c7a90}.page-tools input{width:38px;border:0;background:transparent;text-align:center;color:#243449;font-size:13px;-moz-appearance:textfield}.page-tools input::-webkit-inner-spin-button{display:none}.pdf-page{position:relative;background:white;margin:0 auto 24px;box-shadow:0 3px 18px #21314b14;max-width:100%;overflow:hidden}.pdf-page canvas{display:block;width:100%;height:100%}.textLayer{opacity:1}.textLayer .pdf-word{position:static!important;display:inline!important;white-space:pre!important;transform:none!important;font-size:inherit!important;font-family:inherit!important;cursor:pointer!important;color:transparent!important;border-radius:1px}.textLayer .pdf-word.active{background:#c8e97799!important;color:transparent!important;box-shadow:none}.textLayer .pdf-word:hover{background:#d2ed9999}.pdf-page-number{display:block;text-align:center;font-size:11px;color:#7a8698;margin:-12px 0 24px}.notice{margin:12px 40px 0;background:#fff7e6;border:1px solid #e4ce93;color:#7c5b1f;border-radius:7px;padding:12px 16px;font-size:13px;line-height:1.7}.notice.error{background:#fff0ed;color:#9c3427;border-color:#f0c8bf}.empty-state{text-align:center;padding:90px 24px;color:#718198;background:white;border:1px dashed #c5cfda;border-radius:8px;max-width:850px;margin:auto}.empty-state h3{color:#283c53;font-size:22px}.empty-state p{font-size:14px;line-height:1.9}.empty-state button{margin-top:12px}.primary{border:0;background:var(--navy);color:white;padding:12px 22px;border-radius:6px;cursor:pointer;font-size:14px}dialog{border:1px solid #d8e0eb;border-radius:14px;padding:30px;width:min(740px,calc(100% - 32px));box-shadow:0 20px 100px #0003;color:#203047}dialog::backdrop{background:#12223780;backdrop-filter:blur(3px)}.modal-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.modal-heading h2{font-size:23px;margin:0}.modal-heading .eyebrow{font-size:10px;margin-bottom:8px}dialog label{font-size:14px;display:block;margin-bottom:10px}textarea{width:100%;height:330px;resize:vertical;border:1px solid #ccd6e3;border-radius:7px;padding:16px;font-family:Georgia,serif;font-size:17px;line-height:1.7}.modal-footer{display:flex;align-items:center;justify-content:space-between;margin-top:20px;gap:10px}.modal-footer span{font-size:12px;color:#748196}.drag-active .reader-scroll{outline:3px dashed #8aac42;outline-offset:-12px;background:#eaf4d5}@media(min-width:1500px){.reader-scroll{padding-top:20px}.paper{max-width:900px}.text-paper{padding:65px 80px}}@media(max-width:1100px){.sidebar{width:245px;padding:28px 20px}main{margin-left:245px;width:calc(100% - 245px)}.topbar,.document-toolbar{padding-left:25px;padding-right:25px}.reader-scroll{padding-left:25px;padding-right:25px}.text-paper{padding:35px}.reading-instruction,.player{padding-left:25px;padding-right:25px}.now-reading span{max-width:170px}.edition{display:none}.file-info h2{max-width:370px}}@media(max-width:760px){body{display:block}.sidebar{position:relative;width:100%;padding:18px 20px;display:block}.brand{font-size:21px}.brand small{font-size:9px}.brand img{width:34px;height:34px}.sidebar-body{margin-top:22px;display:grid;grid-template-columns:1fr 1fr;gap:12px 18px;overflow:visible}.sidebar-body>.eyebrow,.sidebar-footer,.divider,.hint,.range-labels,.sidebar .check{display:none}.source-tabs{grid-column:1/-1;margin:0}.upload-btn{min-height:45px}#textPanel,#pdfPanel{grid-column:1/-1}.sidebar-body>label{grid-column:1;grid-row:3;margin:3px 0;font-size:12px}#voiceSelect{grid-column:1;grid-row:4;min-width:0;font-size:12px;min-height:38px}.rate-title{grid-column:2;grid-row:3;margin:0}.rate-title label{font-size:12px;margin:3px 0}.rate-title output{font-size:13px}#rate{grid-column:2;grid-row:4;margin:auto 0}#pdfSettings{grid-column:1/-1;margin:0;display:flex;gap:10px;align-items:center}#pdfSettings label{white-space:nowrap;margin:0;font-size:12px}#pdfSettings select{min-height:34px;font-size:12px}.badge{display:none}main{margin:0;width:100%;height:auto;min-height:70dvh}.topbar{padding:22px 20px 18px}.topbar h1{font-size:22px}.document-toolbar{padding:15px 18px}.file-info h2{max-width:calc(100vw - 120px);font-size:13px}.page-tools{gap:3px}.page-tools input{width:28px}.page-tools:not([hidden])~*{display:none}body.pdf-mode .file-info h2{max-width:calc(100vw - 235px)}.document-icon{width:30px;height:35px;font-size:14px}.reading-instruction{padding:13px 18px;font-size:11px}.reader-scroll{padding:0 12px 155px;overflow:visible}.text-paper{padding:30px 24px;font-size:18px;min-height:400px}.text-paper p:first-child{font-size:25px}.player{position:fixed;bottom:0;left:0;right:0;padding:13px 18px calc(13px + env(safe-area-inset-bottom))}.player-main{gap:10px}.play-btn{min-width:105px;font-size:13px}.round-btn{width:33px;height:33px}.now-reading{flex:1}.now-reading span{max-width:130px;font-size:10px}.now-reading strong{font-size:12px}.progress-meta span{display:none}.progress-meta strong{font-size:12px}.notice{margin:12px 18px 0}.modal-heading h2{font-size:19px}dialog{padding:22px}textarea{height:290px}.pdf-page{margin-bottom:20px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

@media(max-width:760px){.topbar{display:none}.text-paper p:first-child{font-size:24px}.sidebar{border-radius:0}.file-info h2{max-width:calc(100vw - 110px)}}
@media(max-width:760px){#voiceHint{display:block;grid-column:1/-1;margin:0;font-size:11px}.sidebar-body{gap:9px 18px}}

/* Local AI controls share the reading room's existing design. */
.sidebar-body{margin-top:28px}.voice-label{margin-top:17px}.model-panel{margin-top:14px;padding:13px;background:#22354c;border:1px solid #3c5067;border-radius:9px}.model-button{width:100%;border:0;padding:11px 8px;border-radius:6px;background:var(--lime);color:#203047;font-weight:600;font-size:13px}.model-panel p{font-size:12px;line-height:1.7;color:#c4d1e1;margin:10px 0 0}.model-panel progress{width:100%;height:7px;accent-color:var(--lime);margin-top:12px}.model-panel .subtle-btn{font-size:12px;padding-top:10px}.sidebar-footer{padding-top:15px}.divider{margin:22px 0}.original-link{font-size:13px;color:#50617a;text-decoration:none;white-space:nowrap}.original-link:hover{text-decoration:underline}.word.spoken-range{background:#eaf4d4;border-radius:2px}.textLayer .pdf-word.spoken-range{background:#d5eaae88!important}.player .busy{animation:breathing 1s infinite alternate}@keyframes breathing{to{opacity:.4}}@media(prefers-reduced-motion:reduce){.player .busy{animation:none}}@media(max-width:760px){.voice-engine-block{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:9px 14px}.voice-engine-block label{margin:0;font-size:12px}.voice-engine-block #engineSelect{grid-column:1;grid-row:2;font-size:12px}.voice-engine-block .voice-label{grid-column:2;grid-row:1}.voice-engine-block #voiceSelect{grid-column:2;grid-row:2}.voice-engine-block #voiceHint{grid-column:1/-1;grid-row:3;display:block}.model-panel{grid-column:1/-1;grid-row:4;margin:0;padding:10px 12px}.model-panel p{font-size:11px}.model-button{font-size:12px;padding:9px}.sidebar-body .rate-title{grid-column:1;grid-row:auto;margin:0}.sidebar-body #rate{grid-column:2;grid-row:auto}.sidebar-body{gap:12px}.sidebar-body>label{grid-row:auto}.source-tabs{grid-row:1}.sidebar-footer{display:none}.topbar{display:flex;padding:12px 18px}.topbar h1,.topbar .eyebrow{display:none}.original-link{margin-left:auto;font-size:12px}}

.model-panel.ready #loadModel{display:none}.model-panel.ready p{margin:0}.model-panel.ready{padding:10px 12px}

/* Edition 03: compact controls and independent document viewport. */
.performance{margin:18px 0;border-top:1px solid #3c5067;padding-top:14px;font-size:12px}.performance summary{cursor:pointer;color:#e4edd6;display:flex;justify-content:space-between}.performance summary span{font-size:10px;color:var(--lime)}.performance label{font-size:12px;margin:14px 0 6px}.performance p{font-size:11px;color:#b7c5d8;line-height:1.6}.performance input{width:100%;background:#23344b;border:1px solid #46566d;border-radius:5px;color:white;padding:7px}.model-panel .subtle-btn+.subtle-btn{margin-left:10px}.version-links{display:flex;gap:14px}.view-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:10px 24px;background:#f8fafc;border-bottom:1px solid #dce2eb}.pdf-zoom,.view-actions,.prepare-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.view-actions{margin-left:auto}.view-tools button,.prepare-tools button,.prepare-tools select{background:white;border:1px solid #ced7e2;border-radius:6px;color:#34465d;padding:7px 10px;font-size:12px}.view-tools button[aria-pressed=true]{background:#deefb6;border-color:#9fb963}.zoom-value{font-size:12px;white-space:nowrap}.zoom-value input{width:48px;border:0;background:transparent;color:#243449;font:inherit;text-align:right;appearance:textfield}.zoom-value input::-webkit-inner-spin-button{display:none}.prepare-tools{padding:8px 24px;background:#f0f4e9;font-size:12px}.prepare-tools span{color:#60713f}.buffer-strip{display:flex;justify-content:space-between;gap:10px;font-size:11px;color:#718198;margin-bottom:10px}.topbar{padding-top:20px;padding-bottom:18px}.document-toolbar{padding-top:13px;padding-bottom:13px}.reading-instruction{padding-top:9px;padding-bottom:9px}.sidebar-body>.eyebrow{display:none}.sidebar-body{margin-top:23px}.sidebar-body .hint{font-size:11px}.voice-label{margin-top:12px}.divider{margin:17px 0}.rate-title{margin-top:18px}.range-labels{margin-bottom:12px}.sidebar .check{margin-top:15px}.model-panel{margin-top:10px}.sidebar-footer{font-size:11px}
body.focus-mode .sidebar{display:none}body.focus-mode main{margin-left:0;width:100%}body.focus-mode .topbar{display:none}#readingArea:fullscreen{margin:0;width:100%;height:100dvh;background:#edf0f4}#readingArea:fullscreen .topbar{display:none}.pdf-mode .reader-scroll{overflow:auto;overscroll-behavior:contain;scroll-behavior:auto;padding:16px 24px 50px}.pdf-mode #pdfReader{width:max-content;min-width:100%;position:relative}.pdf-mode .pdf-page{max-width:none;flex-shrink:0}.pdf-mode .pdf-page-number{position:relative}.pdf-mode .reader-scroll.pan-mode{cursor:grab;user-select:none}.pdf-mode .pan-mode .textLayer,.pdf-mode .pan-mode .word{pointer-events:none}.pdf-mode .pan-mode.dragging{cursor:grabbing}.pdf-page{contain:layout paint}.pdf-page.loading::before{content:'正在准备页面…';position:absolute;top:24px;left:24px;font:13px sans-serif;color:#7b8798}
@media(max-width:760px){body.pdf-mode{height:100dvh;overflow:hidden;display:flex;flex-direction:column}body.pdf-mode .sidebar{max-height:36dvh;overflow:auto;flex-shrink:0}body.pdf-mode main{height:auto;min-height:0;flex:1;overflow:hidden}body.pdf-mode .player{position:relative;padding:10px 12px}body.pdf-mode .reader-scroll{padding:12px 12px 35px;overflow:auto}.performance{grid-column:1/-1;margin:0}.performance .hint{display:block}.view-tools{padding:8px 12px}.view-tools button{padding:7px;font-size:11px}.prepare-tools{padding:6px 12px}.buffer-strip{font-size:10px}.player{padding-bottom:12px}.performance[open]{padding-bottom:12px}.focus-mode main{height:100dvh!important;min-height:0!important}.focus-mode .player{position:relative}.focus-mode .reader-scroll{overflow:auto}.focus-mode .workspace{min-height:0}.version-links{margin-left:auto}.topbar{padding:9px 12px}.reading-instruction{padding:8px 12px}.document-toolbar{padding:10px 12px}.sidebar .voice-engine-block{grid-template-columns:1fr 1fr}}

/* 3.5: the PDF reading rule remains reachable in narrow windows. */
#pdfSettings .check{font-size:14px;white-space:normal}#skipStatus{font-size:12px;line-height:1.6;margin-bottom:16px}
@media(max-width:760px){#pdfSettings{display:grid;grid-template-columns:auto 1fr;gap:10px}#pdfSettings .check{display:flex;grid-column:1/-1;margin:0}#skipStatus{display:block;grid-column:1/-1;margin:0}#pdfSettings .check input{flex-shrink:0}}

.reading-rule{display:flex!important;align-items:center;gap:8px}.reading-rule input{flex-shrink:0}#orderStatus{margin-bottom:12px}
/* Fourth edition: controls stay reachable on touch screens. */
.boot-status{position:fixed;z-index:9999;inset:12px 12px auto;background:#102742;color:white;border-radius:8px;padding:14px;font:14px/1.5 system-ui}.boot-status[hidden]{display:none}.diagnostics{margin-top:16px;padding:10px 0;border-top:1px solid #ccd4de}.diagnostics summary{cursor:pointer;font-size:14px}.diagnostics button{display:block;text-align:left}.version-links{flex-wrap:wrap;justify-content:flex-end}.sidebar .hint{font-size:12px}.performance label,.performance select{font-size:14px}.reader-scroll{touch-action:pan-x pan-y}.player{padding-bottom:max(12px,env(safe-area-inset-bottom))}
@media(max-width:900px){.topbar h1{font-size:22px}.version-links{gap:8px}.view-tools button,.prepare-tools button{min-height:38px;font-size:13px}.buffer-strip{flex-wrap:wrap;font-size:12px}.sidebar .voice-engine-block{display:block}.diagnostics{grid-column:1/-1}.sidebar{padding-bottom:12px}.now-reading{min-width:0}.sidebar input,.sidebar select{font-size:16px}}
@media(max-width:500px){.topbar{display:none}.document-toolbar{padding:8px}.file-info h2{font-size:14px}.view-tools{padding:6px}.pdf-zoom{gap:4px}.reading-instruction{font-size:12px}.progress-meta{display:none}.view-actions{margin-left:0}.player-main{gap:8px}.play-btn{padding:10px 14px}body.pdf-mode .sidebar{max-height:31dvh}}

.audio-recover{border:1px solid #b6c4b4;border-radius:8px;background:#f4f7ef;color:#355440;padding:5px 9px;cursor:pointer;font:inherit;font-size:12px;white-space:nowrap}.audio-blocked{font-size:12px;line-height:1.5;color:#7e481e;background:#fff4df;padding:7px 10px;border-radius:6px;margin:4px 0}.buffer-strip{flex-wrap:wrap;gap:6px}.diagnostics select{width:100%}
.compact-player .buffer-strip{display:flex;justify-content:flex-end;margin:0}.compact-player .buffer-strip>span{display:none}#readerPlayer .audio-blocked{flex-shrink:0}

/* PDF ink is painted on the canvas below this transparent interaction layer. */
.textLayer .pdf-word.active,.textLayer .pdf-word.spoken-range,.textLayer .pdf-word:hover{background:transparent!important;color:transparent!important;opacity:1!important}
.textLayer .pdf-word.spoken-range{box-shadow:0 2px 0 #66822a!important}
.textLayer .pdf-word.active{outline:1px solid #54721b;outline-offset:2px;box-shadow:0 2px 0 #54721b!important}
.textLayer .pdf-word:hover{outline:1px dashed #54721b;outline-offset:2px}
.effective-settings{padding:10px 12px;background:#eef2e7;border-radius:8px;line-height:1.65;font-size:12px;color:#334324;overflow-wrap:anywhere}

#textReader .word.active,#textReader .word.spoken-range{background:transparent;color:inherit;box-shadow:0 2px 0 #54721b;opacity:1}
