@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');
:root{--green:#1c302c;--green-2:#304b42;--mint:#b8c9bb;--cream:#f5f4ef;--paper:#fffdfa;--ink:#202d2a;--muted:#82908b;--line:#e6e7e0;--card:#fff;--gold:#ac9260;--shadow:0 12px 34px rgba(21,42,33,.07)}*{box-sizing:border-box}html,body{height:100%;margin:0}body{font-family:'DM Sans',-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;background:var(--cream);color:var(--ink)}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.38;cursor:not-allowed}.hidden{display:none!important}.app{min-height:100vh;display:flex}.sidebar{width:262px;flex:none;background:var(--green);color:#e4ede5;display:flex;flex-direction:column;padding:28px 18px 18px;position:sticky;top:0;height:100vh;z-index:10}.brand{display:flex;align-items:center;gap:13px;font:400 27px Georgia,serif;letter-spacing:-1px;padding:4px 11px 51px;color:#e9ebde}.brand-icon{font:40px serif;color:#c7ab73}.brand-strong{font-weight:700}.brand small{display:block;font:8px 'DM Sans',sans-serif;letter-spacing:2.1px;color:#93ab9c;margin-top:8px}.main-nav{display:grid;gap:5px}.nav-item{background:transparent;color:#b3c4ba;border:0;text-align:left;padding:14px 17px;border-radius:9px;display:flex;align-items:center;gap:13px;font-size:14px}.nav-item:hover,.nav-item.active{color:white;background:#314a40}.nav-icon{font-size:21px;font-family:Georgia,serif;width:20px;text-align:center}.nav-arrow{margin-left:auto}.sidebar-spacer{flex:1}.side-note{padding:19px;border:1px solid #456055;border-radius:12px;line-height:1.5;background:rgba(255,255,255,.035)}.side-note-dot{display:inline-block;width:7px;height:7px;background:#b9c8a3;border-radius:50%;margin-right:6px}.side-note b{font:italic 14px Georgia,serif}.side-note p{color:#a4b5ab;font-size:12px;margin:10px 0 0;line-height:1.8}.sidebar-footer{display:flex;justify-content:space-between;font-size:9px;letter-spacing:1px;color:#91a69a;margin-top:27px}.offline-dot{letter-spacing:0}.main{min-width:0;flex:1;min-height:100vh}.topbar{height:79px;border-bottom:1px solid var(--line);padding:0 44px;display:flex;align-items:center;justify-content:space-between;background:#fbfaf6}.topbar #breadcrumb{letter-spacing:2.2px;font-size:10px;color:#6c8075;font-weight:700}.topbar #breadcrumb span{color:#a6aba5;letter-spacing:0;font-weight:400;margin-left:12px}.top-actions{display:flex;align-items:center;gap:19px}.device-label{font-size:10px;color:#a4aaa4;letter-spacing:.5px}.icon-btn{border:0;background:transparent;color:#40584a;font-size:23px;padding:7px}.top-add,.primary-btn{background:var(--green);border:1px solid var(--green);border-radius:7px;color:white;font-weight:700;padding:12px 18px;font-size:12px}.top-add:hover,.primary-btn:hover{background:#36574c}.mobile-menu{display:none}.page{padding:44px max(34px,5.2vw) 70px;max-width:1700px;margin:auto}.hero{display:flex;justify-content:space-between;gap:25px;align-items:flex-end;margin-bottom:37px}.eyebrow{font-size:10px;color:#a38c5e;letter-spacing:3.5px;font-weight:700}.hero h1,.page-title{font:400 clamp(28px,3.2vw,41px) Georgia,'Noto Serif SC',serif;margin:13px 0 12px;letter-spacing:-.8px}.hero p{font-size:13px;color:#818b85;margin:0;line-height:1.8}.hero-ornament{font:92px Georgia,serif;color:#c6d0c5;line-height:1;margin:0 30px 2px 0}.stats{display:flex;gap:13px;margin-bottom:37px}.stat{padding:21px 26px;border-radius:11px;background:white;border:1px solid #ecede8;min-width:150px;flex:1;box-shadow:0 4px 15px rgba(20,43,32,.025)}.stat b{display:block;font:26px Georgia,serif;color:#2a4439;margin-bottom:7px}.stat small{font-size:10px;color:#909a93;letter-spacing:1px}.library-tools{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;gap:20px}.library-tools h2{font-size:17px;margin:0;letter-spacing:.2px}.tools-right{display:flex;gap:10px;align-items:center}.search{width:min(320px,35vw);padding:12px 13px;border:1px solid #e4e7e0;background:white;border-radius:8px;font-size:12px;outline-color:#94ab9b}.sort{padding:12px;background:white;border:1px solid #e4e7e0;border-radius:8px;font-size:12px;color:#556b5d}.book-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(158px,1fr));gap:29px 21px}.book-tile{min-width:0;cursor:pointer}.book-cover{height:227px;background:#dde6dc;border-radius:6px 10px 10px 6px;position:relative;overflow:hidden;box-shadow:6px 10px 19px rgba(21,39,32,.13);display:flex;flex-direction:column;justify-content:space-between;padding:17px 15px;color:#fff;transition:transform .2s}.book-tile:hover .book-cover{transform:translateY(-4px)}.book-cover:after{content:'';position:absolute;left:4px;top:0;bottom:0;width:2px;background:rgba(255,255,255,.22);box-shadow:3px 0 4px rgba(0,0,0,.12)}.cover-mark{font-size:13px;letter-spacing:2px;opacity:.65}.cover-title{font:19px/1.3 Georgia,'Songti SC',serif;overflow-wrap:anywhere;max-height:100px;overflow:hidden}.cover-type{font-size:9px;letter-spacing:2px;opacity:.75}.book-data{margin-top:13px;padding-right:10px}.book-data b{font-size:13px;line-height:1.45;display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.book-data span{font-size:11px;color:#929b93;display:block;margin-top:5px}.progress-track{height:3px;background:#dfe6dd;border-radius:9px;margin-top:12px;overflow:hidden}.progress-fill{height:100%;background:#638875}.add-tile{height:227px;border:1.5px dashed #c3d0c7;border-radius:9px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;color:#597666;background:#eef2ed;transition:.2s}.add-tile:hover{background:#e1e9e0}.add-tile strong{font-size:13px}.add-circle{width:52px;height:52px;border:1px solid #c3d2c7;border-radius:50%;display:grid;place-items:center;font-size:27px}.empty-state{grid-column:1/-1;text-align:center;padding:75px 20px;color:#7f9284;border:1px dashed #cdd9cf;border-radius:10px}.empty-state b{display:block;color:#334d3c;font-size:18px;margin-bottom:9px}.mini-actions{display:flex;gap:8px;margin-top:8px}.mini-actions button,.outline-btn{background:white;border:1px solid #d9e0d7;padding:10px 13px;border-radius:7px;font-size:12px;color:#4d6c56}.mini-actions button:hover,.outline-btn:hover{background:#e7eee8}.settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(310px,1fr));gap:20px}.setting-panel,.note-item{padding:24px;background:white;border:1px solid #e9ebe5;border-radius:12px}.setting-panel h3{font-size:16px;margin:0 0 9px}.setting-panel p{font-size:12px;line-height:1.7;color:#78857c}.setting-panel label{display:block;font-size:12px;margin:16px 0 5px;color:#526757}.setting-panel input:not([type=checkbox]),.setting-panel select{width:100%;border:1px solid #dee5dd;border-radius:6px;padding:11px;outline-color:#8da599;background:#fbfcfa;font-size:13px}.setting-panel button{margin-top:15px}.note-item{margin:12px 0}.note-item b{font-size:13px}.note-item p{font-family:Georgia,serif;line-height:1.75;color:#506157;font-size:14px}.note-item small{color:#9aaba1}.danger-txt{color:#aa5c4c!important}.reader{position:fixed;inset:0;z-index:50;background:#f3f0e9;display:flex;flex-direction:column}.reader-top{height:64px;flex:none;display:flex;align-items:center;border-bottom:1px solid #e8e6df;background:#fffefa;padding:0 21px;gap:16px}.r-icon{background:transparent;border:0;color:#3a5044;font-size:24px;padding:8px}.reader-title{min-width:0;margin-right:auto;display:flex;flex-direction:column;gap:3px}.reader-title b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:30vw}.reader-title small{font-size:10px;color:#9b9f98;max-width:30vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reader-top-actions{display:flex;align-items:center;gap:10px}.r-text{border:0;background:transparent;padding:9px 8px;font-size:13px;color:#51635b}.r-text.active{background:#dbe7d9;border-radius:7px;color:#285441}.reader-body{min-height:0;flex:1;display:flex;position:relative}.paper-area{flex:1;min-width:0;overflow-y:auto;overscroll-behavior:contain;position:relative;padding:20px 25px 70px;scroll-behavior:smooth}.reading-header{max-width:880px;margin:11px auto 25px;display:flex;justify-content:space-between;font-size:10px;color:#b0aa9e;letter-spacing:2px}.reading-surface{max-width:880px;margin:auto;min-height:65vh;background:#fffdfa;border:1px solid #ece9e0;box-shadow:0 16px 55px rgba(50,49,34,.055);border-radius:3px;position:relative}.book-content{padding:62px clamp(25px,7vw,86px) 85px;font:19px/1.9 Georgia,'Songti SC',serif;color:#312d27;overflow-wrap:anywhere;user-select:text;-webkit-user-select:text}.book-content h1,.book-content h2,.book-content h3{font-family:Georgia,'Songti SC',serif;line-height:1.38;margin:1.5em 0 .6em}.book-content h1{font-size:1.58em}.book-content h2{font-size:1.3em}.book-content p{margin:0 0 1.05em;text-align:justify}.book-content p::selection,.book-content ::selection{background:#c0dbca}.book-content blockquote{border-left:3px solid #b3c9ba;padding-left:18px;color:#687366}.book-content img{display:block;max-width:100%;height:auto;margin:20px auto}.book-content .translation-line{display:block;font:normal .87em/1.8 'DM Sans','PingFang SC',sans-serif;color:#637a70;margin:6px 0 18px;padding:9px 14px;border-left:2px solid #abc5b5;background:#f1f5ef;border-radius:2px}.page-bottom{max-width:880px;margin:22px auto;display:flex;justify-content:space-between;align-items:center;color:#a6a59d;font-size:11px}.page-bottom button{border:0;background:transparent;color:#5e7766;padding:12px}.reader-toc{width:260px;flex:none;background:#fffefa;border-right:1px solid #e5e6df;padding:20px;overflow:auto;z-index:6}.panel-head{display:flex;justify-content:space-between;align-items:center;font-weight:700;font-size:14px;color:#243b32;margin:0 0 20px}.plain-close{font-size:21px;border:0;background:transparent;color:#8c9890}.toc-link{display:block;border:0;background:transparent;padding:12px 9px;width:100%;text-align:left;color:#78847a;font:13px/1.5 Georgia,serif;border-bottom:1px solid #f0f0eb}.toc-link.active{color:#2e6047;background:#edf3ed;border-radius:5px;font-weight:700}.assistant-panel{width:344px;flex:none;background:#fffefa;border-left:1px solid #e5e7e2;overflow-y:auto;padding:26px 20px;z-index:5}.assistant-spark{font:23px Georgia,serif;color:#a68c54;margin-right:8px}.assist-caption{font-size:9px;letter-spacing:2.3px;color:#afb8ae;margin-top:-10px;margin-bottom:26px}.assist-card{padding:17px;border:1px solid #e8ebe5;background:#fff;border-radius:9px;margin-bottom:14px}.section-mini{display:flex;justify-content:space-between;color:#344a3b;font-size:12px;font-weight:700;letter-spacing:.3px;margin-bottom:13px}.section-mini span{color:#a3aca5;font-weight:400;font-size:11px}.selection-view{max-height:125px;overflow:auto;background:#f7f8f4;padding:12px;border-radius:5px;color:#777f76;font:12px/1.7 Georgia,'Songti SC',serif;min-height:57px;white-space:pre-wrap}.action-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-top:11px}.action-grid button{background:#f4f6f2;color:#617765;border:1px solid #e5ebe3;border-radius:5px;padding:8px 1px;font-size:11px}.action-grid button.active{background:#dcebe0;border-color:#9fbbaa;color:#335a43}.assist-primary{display:flex;gap:8px;margin-top:12px}.assist-primary button{flex:1;padding:10px 6px;font-size:11px}.secondary-btn{background:#f1f5ef;color:#3f5b48;border:1px solid #dce5dc;border-radius:6px;padding:9px 12px;font-size:12px}.fulltext-card p,.tip{font-size:11px;color:#8e978f;line-height:1.75;margin:0}.switch-line{margin-top:13px;display:flex;gap:9px;font-size:11px;color:#516b58;align-items:center}.result-view{min-height:150px;white-space:pre-wrap;line-height:1.8;font-size:13px;color:#64776a;overflow-wrap:anywhere}.text-action,.linklike{background:transparent;border:0;color:#668d75;font-size:11px}.linklike{margin-top:8px;text-decoration:underline}.ink-tools-row{display:flex;gap:7px;align-items:center;margin:10px 0}.ink-tools-row label{font-size:11px;color:#59645b;display:flex;align-items:center;gap:6px}.ink-tools-row input[type=color]{width:35px;height:33px;border:0;background:none}.ink-tools-row input[type=range]{width:75px}.ink-canvas{position:absolute;z-index:4;top:0;left:0;width:100%;height:100%;touch-action:none;cursor:crosshair}.selection-bar{position:fixed;z-index:90;top:100px;left:35%;display:flex;background:#1f3e32;padding:5px;border-radius:9px;box-shadow:0 8px 18px #1b352d55}.selection-bar button{border:0;background:transparent;color:white;padding:8px 12px;font-size:12px}.reader-prefs{position:fixed;z-index:100;right:355px;top:68px;background:white;box-shadow:0 17px 35px #243a2a30;border:1px solid #e2e8dc;border-radius:9px;padding:20px;width:245px}.reader-prefs label{font-size:12px;color:#607264;display:flex;align-items:center;justify-content:space-between;gap:7px;margin:18px 0}.reader-prefs input[type=range]{width:110px}.reader-prefs select{padding:7px;border:1px solid #e3e8df}.pdf-canvas-wrap{position:relative;margin:auto;display:table}.pdf-canvas-wrap canvas{max-width:100%;height:auto;display:block}.textLayer{position:absolute;inset:0;overflow:hidden;opacity:1;line-height:1;text-align:initial;text-size-adjust:none;forced-color-adjust:none}.textLayer span,.textLayer br{color:transparent;position:absolute;white-space:pre;cursor:text;transform-origin:0 0}.textLayer ::selection{background:#84ba9b88}.pdf-fallback{height:80vh;max-width:880px;margin:0 auto}.pdf-fallback iframe{width:100%;height:100%;border:0}.toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);padding:14px 20px;background:#254638;color:white;border-radius:9px;z-index:200;box-shadow:0 12px 30px #19332c45;font-size:13px;max-width:90%;opacity:0;pointer-events:none;transition:opacity .2s}.toast.show{opacity:1}.mobile-only{display:none}.drag-overlay{position:fixed;inset:0;background:#183d2bbd;color:white;font-size:23px;display:grid;place-items:center;z-index:300;border:6px dashed #c1debd}.upload-hint{font-size:11px;color:#8d998f;margin-top:16px}.theme-night{--cream:#1a231f;--ink:#e3e9df;--line:#34453a}.theme-night .topbar,.theme-night .stat,.theme-night .setting-panel,.theme-night .note-item{background:#23372c;color:#e5e9dc;border-color:#385444}.theme-night .page .hero p,.theme-night .book-data span{color:#aab9ac}.theme-night .library-tools .search,.theme-night .library-tools .sort{background:#2a4235;color:white;border-color:#4d6152}.theme-night .book-data b,.theme-night .library-tools h2{color:#e4f1de}
@media(max-width:1100px){.sidebar{width:211px}.page{padding:32px}.assistant-panel{width:306px}.reader-prefs{right:317px}.book-grid{grid-template-columns:repeat(auto-fill,minmax(145px,1fr))}}
@media(max-width:760px){.sidebar{position:fixed;transform:translateX(-110%);transition:.25s;box-shadow:10px 0 30px #12251944;width:260px}.sidebar.open{transform:translateX(0)}.mobile-menu{display:block}.topbar{height:64px;padding:0 14px}.top-actions{gap:7px}.device-label{display:none}.top-add{padding:10px 12px}.top-add span{display:none}.page{padding:29px 19px 60px}.hero{margin-bottom:25px}.hero-ornament{font-size:55px;margin:0}.stats{gap:8px;margin-bottom:27px}.stat{padding:15px 13px;min-width:0}.stat b{font-size:21px}.stat small{font-size:9px}.library-tools{align-items:stretch;flex-direction:column;gap:13px}.tools-right{width:100%}.search{flex:1;width:100%;min-width:0}.book-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:23px 15px}.book-cover,.add-tile{height:208px}.reader-top{height:59px;padding:0 8px;gap:5px}.reader-top-actions{gap:0}.reader-title b{max-width:33vw;font-size:12px}.reader-title small{max-width:34vw}.r-text{padding:9px 6px}.r-text span{display:none}.reader-body{display:block}.paper-area{height:calc(100% - 0px);padding:8px 6px 70px}.reading-header{padding:0 15px;font-size:8px}.reading-surface{border:0;min-height:70vh}.book-content{padding:32px 23px 65px}.reader-toc{position:absolute;left:0;top:0;bottom:0;z-index:24;width:min(85%,300px);box-shadow:10px 0 30px #233b3024}.mobile-only{display:block}.reader-prefs{right:10px;top:59px}.selection-bar{left:12px;right:12px;top:auto;bottom:15px;justify-content:center}.page-bottom{padding:0 15px}.ink-canvas{z-index:10}.pdf-fallback{height:75vh}.note-item{padding:17px}}

.book-data{position:relative}.book-more{position:absolute;right:0;top:-4px;padding:2px 7px;border:0;background:transparent;color:#89988e;font-size:20px;line-height:1}.book-more:hover{color:#203e33}.book-cover.has-image{padding:0}.book-cover.has-image:after{pointer-events:none}.real-cover{width:100%;height:100%;object-fit:cover;display:block}.manage-dialog{border:1px solid #dce5da;border-radius:13px;width:min(440px,90vw);padding:25px;box-shadow:0 22px 55px #112b2044;background:#fffefa;color:#213c30}.manage-dialog::backdrop{background:#193b2b8c}.manage-dialog label{display:block;font-size:12px;color:#5f7766;margin:15px 0}.manage-dialog input{display:block;width:100%;border:1px solid #d9e5d9;border-radius:7px;padding:11px;margin-top:7px}.manage-actions{display:flex;justify-content:space-between;gap:10px;margin-top:23px}.manage-actions button{font-size:12px}


/* InkAtlas 2.0 — The Open Atlas visual identity */
:root{--green:#384248;--green-2:#485359;--mint:#A59E95;--cream:#EFEAE2;--paper:#F4F0E9;--ink:#384248;--muted:#6C6862;--line:#DCD6CD;--card:#F4F0E9;--gold:#CEBCA2;--shadow:0 12px 34px rgba(34,43,48,.08)}
body{background:var(--cream)}
.sidebar{background:#384248;color:#EFEAE2}
.brand{font-family:Georgia,serif;letter-spacing:-.6px;gap:10px;color:#EFEAE2;padding-left:6px}
.brand-logo{width:51px;height:51px;object-fit:contain;border-radius:12px;flex-shrink:0}
.brand small{color:#CEC7BC;letter-spacing:1.45px}
.nav-item{color:#D1CEC8}.nav-item:hover,.nav-item.active{background:#526066;color:#fff}
.side-note{border-color:#758080}.side-note-dot{background:#CEBCA2}.side-note p{color:#C9C6C0}
.topbar{background:#F4F0E9}.top-add,.primary-btn{background:#384248;border-color:#384248;color:#EFEAE2}.top-add:hover,.primary-btn:hover{background:#4B565B}
.hero{align-items:center;background:linear-gradient(115deg,#F4F0E9,#EFEAE2);border:1px solid #DED6CB;border-radius:13px;padding:30px 34px;margin-bottom:26px;min-height:190px}
.hero h1.daily-quote{font:400 clamp(21px,2.7vw,35px)/1.5 Georgia,'Songti SC','Noto Serif SC',serif;letter-spacing:0;max-width:700px;margin:16px 0 13px}
.hero .eyebrow{color:#8C7661;letter-spacing:2.8px}.hero .quote-credit{color:#79766F;font-size:11px;letter-spacing:1px}
.hero-ornament{margin:0}.hero-ornament img{width:115px;filter:drop-shadow(0 5px 14px #38424820);border-radius:20px}
.stat,.setting-panel,.note-item{background:#F9F6F0;border-color:#DED6CB}.stat b{color:#384248}
.book-data b,.library-tools h2{color:#384248}.add-tile{background:#E5DED4;color:#384248;border-color:#BDB5A8}.add-tile:hover{background:#D8D0C5}.add-circle{border-color:#B8AEA1}
.progress-fill{background:#8D8578}.book-cover{box-shadow:5px 10px 18px #38424825}
.reader{background:#EAE4DB}.reader-top{background:#F4F0E9;border-color:#DCD6CD}.reader-toc,.assistant-panel{background:#F4F0E9;border-color:#DCD6CD}
.paper-area{background:#EAE4DB}.reading-surface{background:#F4F0E9;border-color:#DDD6CC;box-shadow:0 18px 50px #38424813}
.book-content{font-family:Georgia,'Noto Serif CJK SC','Songti SC',serif;color:#343C3F;font-size:19px;line-height:1.95;letter-spacing:.008em}
.book-content h1,.book-content h2,.book-content h3{font-family:Georgia,'Noto Serif CJK SC','Songti SC',serif;color:#384248;letter-spacing:.01em}
.book-content h1:first-child,.book-content h2:first-child{font-size:2.05em;margin-top:.35em;margin-bottom:1.15em;padding-bottom:.35em;border-bottom:1px solid #DCD6CD}
.book-content p{margin-bottom:1.2em;line-height:inherit;hyphens:auto;overflow-wrap:break-word}
.book-content p::selection,.book-content ::selection{background:#D6C79C99}
.book-content blockquote{border-left-color:#A59E95;color:#68625A;padding:10px 18px;background:#ECE6DC;font-style:italic}
/* An inline full-width translation avoids WebKit anonymous-block highlight loss. */
.book-content .translation-line{display:inline-block;width:100%;color:#575F63;background:#E9E6DD;border-left-color:#A59E95}
.book-content :has(> .translation-line){text-align:start}
.reader-toc .panel-head{font:500 17px Georgia,serif;letter-spacing:1px;padding-bottom:17px;border-bottom:1px solid #DCD6CD}
.toc-link{display:flex;align-items:center;gap:13px;min-height:56px;padding:13px 8px;color:#5F6363;font:13px/1.5 Georgia,'Songti SC',serif;border-bottom:1px solid #E0DAD1;text-align:left}
.toc-number{font:12px Georgia,serif;color:#A59E95;letter-spacing:1px;width:24px;flex-shrink:0}.toc-chapter-title{flex:1}.toc-arrow{color:#A59E95;font-size:18px}
.toc-link.active{background:#E6E0D6;color:#384248;font-weight:600}.toc-link.active .toc-number{color:#384248}
.selection-bar{background:#384248}.reader-prefs{background:#F4F0E9}
.assist-card{background:#FBF8F2;border-color:#DED6CB}.action-grid button{background:#ECE7DF;border-color:#DAD2C7;color:#384248}.action-grid button.active{background:#D5CEC2;border-color:#A59E95}
.theme-night{--cream:#222B30;--ink:#EFEAE2;--line:#485359;--card:#354147}
.theme-night .topbar,.theme-night .stat,.theme-night .setting-panel,.theme-night .note-item{background:#354147;color:#EFEAE2;border-color:#556168}
.theme-night .hero{background:linear-gradient(120deg,#303B40,#263137);border-color:#58646A}.theme-night .hero h1,.theme-night .hero .quote-credit{color:#EFEAE2}
.theme-night .library-tools .search,.theme-night .library-tools .sort{background:#354147;color:#EFEAE2;border-color:#58646A}.theme-night .book-data b,.theme-night .library-tools h2{color:#EFEAE2}
.theme-night .add-tile{background:#354147;color:#EFEAE2;border-color:#617077}
@media(max-width:760px){.hero{padding:23px 21px;min-height:155px;gap:10px}.hero h1.daily-quote{font-size:23px}.hero-ornament img{width:58px}.brand-logo{width:44px;height:44px}.book-content{padding:35px 23px 65px}.reader-toc{width:min(89%,335px)}}

/* InkAtlas 2.1 · editorial night mode and reading systems */
:root{--green:#384248;--green-2:#526066;--ink:#384248;--muted:#6C6862;--gold:#C8B38F;--cream:#EFEAE2;--line:#DCD6CD;--card:#F4F0E9}
body{background:var(--cream)}.sidebar{background:#384248}.topbar{background:#F4F0E9}.hero{box-shadow:none}.brand small{color:#cec8bb}
.book-content{font-family:Georgia,'Iowan Old Style','Noto Serif CJK SC','Songti SC',serif;font-kerning:normal;text-rendering:optimizeLegibility;line-height:1.95;overflow-wrap:break-word;max-width:100%;letter-spacing:.008em}
.book-content p{margin:0 0 1.2em;orphans:2;widows:2;hyphens:auto}.book-content h1,.book-content h2{font-weight:400;line-height:1.25;break-after:avoid;margin:1.7em 0 .8em}.book-content h1:first-child{font-size:2.25em;margin-top:.3em;padding-bottom:.75em;letter-spacing:.025em}.book-content h3{font-weight:500}.book-content blockquote{font-style:normal;border-left:2px solid #a59e95}.book-content img{max-width:100%;object-fit:contain}.reader-toc .toc-link{width:100%;font-size:14px;transition:background .15s}.reader-toc .toc-link:hover{background:#ebe6dc}.reader-toc{width:min(340px,80vw)}.reader-toc .toc-number{font-family:Georgia,serif;font-size:12px;color:#817a70}
.discover-cta{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:24px;margin:28px 0;background:#E6E0D7;border:1px solid #D5CCC0;border-radius:14px}.discover-cta span{display:block;font-size:10px;letter-spacing:2px;color:#797268;margin-bottom:9px}.discover-cta b{font:400 17px Georgia,'Songti SC',serif}.catalog-subtitle{color:var(--muted);font-size:14px;line-height:1.9;margin:0 0 38px}.catalog-section-label{margin:36px 0 18px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:12px;font:13px Georgia,serif;letter-spacing:2px}.catalog-section-label span{font:11px sans-serif;letter-spacing:0;color:var(--muted)}.catalog-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:18px}.catalog-card{background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden}.catalog-cover{height:175px;background:var(--catalog-color);color:#EFEAE2;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;padding:20px}.catalog-cover b{font:26px/1.15 Georgia,serif;max-width:230px}.catalog-cover small,.catalog-cover i{font:9px sans-serif;letter-spacing:2px;opacity:.8}.catalog-card-body{padding:18px}.catalog-card-body span{font-size:11px;color:var(--muted)}.catalog-card-body h3{font:19px Georgia,serif;margin:9px 0}.catalog-card-body p{font-size:12px;line-height:1.8;min-height:55px;color:var(--muted)}.catalog-card-body button,.catalog-card-body a{display:inline-flex;text-decoration:none}.catalog-notice{font-size:11px;color:var(--muted);line-height:1.7;margin:26px 0}.account-pill{border:1px solid var(--line);border-radius:100px;background:transparent;padding:8px 13px;max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink);font-size:12px}
.account-dialog{padding:0;border:0;max-height:94vh;max-width:min(880px,96vw);width:880px;border-radius:16px;box-shadow:0 25px 100px #0c1e2380;background:#EFEAE2;color:#384248}.account-dialog::backdrop{background:#101c22b0;backdrop-filter:blur(6px)}.auth-layout{display:grid;grid-template-columns:1fr 1fr;min-height:530px}.auth-brand{position:relative;overflow:hidden;background:#384248;color:#EFEAE2;padding:48px 38px}.auth-brand>img{width:74px}.auth-brand>span{display:block;font:10px sans-serif;letter-spacing:2px;margin:21px 0 60px}.auth-brand h2{font:400 32px/1.4 Georgia,'Songti SC',serif}.auth-brand p{font:italic 16px/1.7 Georgia,serif;color:#d3cec3}.auth-landscape{position:absolute;bottom:-50px;left:-40px;right:-40px;height:190px}.auth-landscape span{position:absolute;bottom:0;width:120%;left:-8%;height:80%;border-radius:48% 52% 0 0/60% 40% 0 0;background:#a59e95;transform:rotate(-9deg)}.auth-landscape span:nth-child(2){bottom:-42px;background:#b6aa98;left:12%;transform:rotate(8deg)}.auth-landscape span:nth-child(3){bottom:-95px;background:#222b30;left:-20%;transform:rotate(-5deg)}.auth-form{position:relative;padding:46px 38px;overflow:auto}.auth-close{position:absolute;right:24px;top:21px}.auth-form h2{font:400 30px Georgia,'Songti SC',serif;margin:14px 0}.auth-form p{font-size:12px;line-height:1.8;color:#6C6862}.auth-form label{display:block;font-size:12px;color:#555;margin-top:17px}.auth-form input{width:100%;padding:12px 13px;border:1px solid #d2cbc1;background:#fcfaf5;border-radius:7px;margin-top:6px;color:#384248}.auth-cta{width:100%;margin-top:14px}.auth-guest{margin:18px auto;display:block;border:0;background:transparent;color:#384248}.auth-config{border-top:1px solid #d9d0c5;margin-top:20px;padding-top:16px}.auth-config summary{font-size:12px;cursor:pointer}.auth-config .secondary-btn{margin-top:12px}
/* Full dark theme, not the old green-on-green recolor. */
body.theme-night{--cream:#1C2429;--card:#303B41;--ink:#E8E3D9;--muted:#B9B2A7;--line:#465158;--green:#273137;background:#1C2429;color:#E8E3D9}
.theme-night .sidebar{background:#151D21;color:#E8E3D9}.theme-night .brand,.theme-night .brand small{color:#E8E3D9}.theme-night .nav-item{color:#BFBEB8}.theme-night .nav-item.active,.theme-night .nav-item:hover{background:#35434A;color:white}.theme-night .side-note{background:#222d33;border-color:#445159}.theme-night .side-note p,.theme-night .sidebar-footer{color:#b4b3ad}
.theme-night .topbar{background:#252F34;color:#E8E3D9;border-color:#445159}.theme-night .topbar #breadcrumb,.theme-night .topbar #breadcrumb span{color:#c3bcb1}.theme-night .top-actions button{color:#E8E3D9}.theme-night .top-add,.theme-night .primary-btn{background:#D6C79C;border-color:#D6C79C;color:#222B30}.theme-night .account-pill{border-color:#6A777B}
.theme-night .hero{background:linear-gradient(130deg,#303a40,#28343a);border-color:#485158}.theme-night .hero h1,.theme-night .page-title,.theme-night .hero .eyebrow,.theme-night .library-tools h2,.theme-night .eyebrow{color:#E8E3D9}.theme-night .hero .quote-credit,.theme-night .hero p,.theme-night .catalog-subtitle{color:#c2b7aa}.theme-night .hero-ornament img{opacity:.78}
.theme-night .stat,.theme-night .setting-panel,.theme-night .note-item,.theme-night .catalog-card{background:#303b41;border-color:#48545b;color:#E8E3D9;box-shadow:none}.theme-night .stat b,.theme-night .setting-panel h3,.theme-night .note-item b,.theme-night .catalog-card h3{color:#E8E3D9}.theme-night .stat small,.theme-night .note-item p,.theme-night .catalog-card p,.theme-night .setting-panel p,.theme-night .setting-panel label{color:#c8c2b8}.theme-night .search,.theme-night .sort,.theme-night .setting-panel input,.theme-night .setting-panel select{background:#263137;color:#E8E3D9;border-color:#5b6569}.theme-night .book-data b{color:#E8E3D9}.theme-night .book-data span,.theme-night .upload-hint{color:#B8B4AE}.theme-night .add-tile{background:#2d393f;border-color:#59656a;color:#e8e3d9}.theme-night .progress-track{background:#576167}.theme-night .progress-fill{background:#d6c79c}.theme-night .discover-cta{background:#354047;border-color:#566166}.theme-night .discover-cta b{color:#eee8dc}.theme-night .secondary-btn,.theme-night .outline-btn,.theme-night .mini-actions button{background:#344147;color:#f0e9de;border:1px solid #626e72}.theme-night .catalog-section-label{color:#E8E3D9}.theme-night .panel-head{color:#e8e3d9}.theme-night .section-mini,.theme-night .tip{color:#ded7ca}.theme-night .auth-form{background:#252e33;color:#eee8dc}.theme-night .auth-form p,.theme-night .auth-form label{color:#c6bfb4}.theme-night .auth-form input{background:#364349;border-color:#647078;color:white}
/* Optional true page-wise column pagination. Scroll/ink mode stays available. */
.page-turn-mode .paper-area{overflow-y:hidden}.page-turn-mode .reading-surface{max-width:min(880px,100%);height:calc(100% - 92px);min-height:380px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;-webkit-overflow-scrolling:touch}.page-turn-mode .reading-surface::-webkit-scrollbar{display:none}.page-turn-mode .book-content{height:100%!important;width:100%;max-width:none;columns:1 auto;column-width:calc(min(880px,100vw - 70px) - 120px);column-gap:clamp(32px,8vw,115px);column-fill:auto;padding:35px clamp(28px,7vw,65px);overflow:visible}.page-turn-mode .book-content>*{break-inside:avoid-column}.page-turn-mode .reading-header{margin:0 auto 10px}.page-turn-mode .page-bottom{margin:8px auto}.page-turn-mode #inkCanvas{display:none!important}
@media(max-width:650px){.auth-layout{grid-template-columns:1fr}.auth-brand{min-height:190px;padding:24px}.auth-brand>img{width:48px}.auth-brand>span{margin:8px 0}.auth-brand h2{margin:5px 0;font-size:25px}.auth-brand p{font-size:12px}.auth-landscape{opacity:.4}.auth-form{padding:28px}.catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.catalog-cover{height:144px;padding:12px}.catalog-cover b{font-size:18px}.catalog-card-body{padding:12px}.catalog-card-body h3{font-size:15px}.catalog-card-body p{font-size:11px}.discover-cta{flex-direction:column;align-items:flex-start}.account-pill{max-width:67px;font-size:10px;padding:7px}.catalog-section-label{font-size:10px}.catalog-section-label span{font-size:9px}.page-turn-mode .book-content{column-width:calc(100vw - 112px);column-gap:48px;padding:28px 30px}}


/* InkAtlas 2.2 — real reflow-page geometry, per-spread navigation */
.page-turn-mode .paper-area{overflow:hidden}
.page-turn-mode .reading-surface{overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:none;scroll-snap-type:x mandatory;scroll-behavior:smooth}
.page-turn-mode .reading-surface::-webkit-scrollbar{display:none}
.page-turn-mode .book-content{box-sizing:border-box;max-width:none!important;min-width:0;max-height:none!important;overflow:visible!important;column-width:var(--page-column-width,520px);column-gap:var(--page-column-gap,92px);column-fill:auto;padding:18px var(--page-inset,46px) 18px;break-inside:avoid-column}
.page-turn-mode .book-content p,.page-turn-mode .book-content li,.page-turn-mode .book-content blockquote{orphans:2;widows:2;break-inside:avoid-column}
.page-turn-mode .book-content h1,.page-turn-mode .book-content h2,.page-turn-mode .book-content h3{break-after:avoid-column}
.page-turn-mode .page-bottom button{min-width:105px;color:var(--ink)}
.page-turn-mode .reader-body{overflow:hidden}
.cloud-panel{grid-column:span 1}
.cloud-panel button:disabled{opacity:.5;cursor:wait}
.theme-night .cloud-panel{background:#303B41;border-color:#4A585F;color:#E8E3D9}
.theme-night .cloud-panel small{color:#C8C1B7}
@media(max-width:760px){.page-turn-mode .book-content{padding-top:18px;padding-bottom:18px}.cloud-panel .mini-actions{flex-wrap:wrap}}
.page-turn-mode .book-content{column-count:auto}

.catalog-search-section{margin-top:40px;border-top:1px solid var(--line);padding-top:18px}
.public-search-form{display:flex;gap:12px;align-items:center;margin:18px 0 25px}
.public-search-form input{flex:1;min-width:0;padding:14px 16px;background:var(--card);border:1px solid var(--line);border-radius:8px;color:var(--ink)}
.public-search-form button{padding:14px 17px;border-radius:8px;white-space:nowrap}
.public-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(275px,1fr));gap:15px}
.public-book{display:flex;gap:16px;padding:16px;background:var(--card);border:1px solid var(--line);border-radius:11px;min-width:0}
.public-cover{flex:0 0 75px;height:108px;background:var(--green);border-radius:3px;color:var(--paper);display:grid;place-items:center;text-align:center;font:10px Georgia,serif;overflow:hidden}
.public-cover img{width:100%;height:100%;object-fit:cover}
.public-details{min-width:0;flex:1}.public-details h3{font:normal 17px/1.3 Georgia,'Songti SC',serif;margin:0 0 7px;color:var(--ink)}
.public-details p{font-size:12px;color:var(--muted);margin:0 0 7px}.public-details small{display:block;font-size:10px;color:var(--muted)}
.public-actions{margin-top:13px;display:flex;flex-wrap:wrap;align-items:center;gap:11px}
.public-actions a{font-size:12px;color:var(--green);text-decoration:underline;text-underline-offset:3px}
.public-actions button{font-size:11px}
.theme-night .public-book,.theme-night .public-search-form input{background:#303B41;border-color:#485359;color:#E8E3D9}
.theme-night .public-details h3,.theme-night .public-actions a{color:#E8E3D9}
@media(max-width:760px){.public-search-form{flex-direction:column;align-items:stretch}.public-results{grid-template-columns:1fr}}
.page-turn-mode .reading-surface{touch-action:pan-y}
/* InkAtlas 2.2 — complete night theme pass; charcoal rather than green */
.theme-night{--cream:#171E22;--ink:#EAE5DC;--paper:#242D32;--card:#283339;--line:#465159;--muted:#C2BCB2;--gold:#D6C79C;--shadow:0 12px 40px #0E161B70;background:#171E22;color:#EAE5DC}
.theme-night .sidebar{background:#141B20;border-right:1px solid #3B464E}
.theme-night .nav-item{color:#BABBB9}
.theme-night .nav-item.active,.theme-night .nav-item:hover{background:#374349;color:#F0EBE2}
.theme-night .side-note{background:#212B30;border:1px solid #48535A}
.theme-night .topbar{background:#1F282E;border-color:#435059}
.theme-night .topbar #breadcrumb,.theme-night .top-actions button,.theme-night .page-title,.theme-night .library-tools h2{color:#EAE5DC}
.theme-night .top-actions .top-add,.theme-night .primary-btn{background:#D6C79C;color:#222B30;border-color:#D6C79C}
.theme-night .page{background:#171E22}
.theme-night .hero{background:linear-gradient(125deg,#303B41,#202B31);border-color:#4B575E}
.theme-night .hero h1,.theme-night .hero .eyebrow{color:#EFEAE2}
.theme-night .hero .quote-credit{color:#C8C1B7}
.theme-night .stats .stat,.theme-night .stat,.theme-night .setting-panel,.theme-night .note-item{background:#283339;border-color:#465159;color:#EAE5DC}
.theme-night .stat b,.theme-night .book-data b{color:#EAE5DC}
.theme-night .stat small,.theme-night .book-data span,.theme-night .catalog-subtitle{color:#C2BCB2}
.theme-night input,.theme-night select{background:#29363C;color:#ECE8DF;border-color:#4D585F}
.theme-night .add-tile{background:#303C42;color:#EAE5DC;border-color:#536069}
.theme-night .book-more{color:#D3C9B9}
.theme-night .discover-cta{background:#29343A;border-color:#4F585D;color:#EAE5DC}
.theme-night .discover-cta b{color:#EAE5DC}
.theme-night .catalog-card,.theme-night .catalog-card-body{background:#29343A;border-color:#465159;color:#EAE5DC}
.theme-night .catalog-card h3,.theme-night .catalog-card p{color:#EAE5DC}
.theme-night .secondary-btn{background:#35434A;color:#E8E3D9;border-color:#627078}.theme-night .section-mini{color:#ECE5DB}.theme-night .action-grid button{background:#35444B;color:#EAE5DC;border-color:#56656D}
.theme-night .auth-brand{background:#27343B;color:#F2EDE5}
.theme-night .auth-form{background:#222D33;color:#EAE5DC}
.theme-night .auth-form input{background:#303F46;color:#EAE5DC;border-color:#58666E}
.theme-night .auth-guest{color:#E0D3B5}
.theme-night .public-actions a{color:#D6C79C}

/* The whole reader, including floating controls, has one paper-owned palette.
   Never derive these tokens from the home page's day/night theme. */
html[data-reader-paper] {
  --reader-paper-bg: #F4F0E9;
  --reader-paper-ink: #343C3F;
  --reader-paper-muted: #635D55;
  --reader-paper-line: #CFC7BB;
  --reader-paper-inset: #EBE5DC;
  --reader-paper-card: #FBF8F2;
  --reader-control-accent: #435F52;
  --reader-control-on-accent: #FFFFFF;
  --reader-control-hover: #344C40;
  --reader-control-danger: #A84639;
  --reader-color-scheme: light;
}
html[data-reader-paper="dark"] {
  --reader-paper-bg: #222B30;
  --reader-paper-ink: #EFEAE2;
  --reader-paper-muted: #C8C1B7;
  --reader-paper-line: #4C595F;
  --reader-paper-inset: #303D44;
  --reader-paper-card: #29363C;
  --reader-control-accent: #D4C69B;
  --reader-control-on-accent: #222B30;
  --reader-control-hover: #E3D4AA;
  --reader-control-danger: #F0AFA3;
  --reader-color-scheme: dark;
}
html[data-reader-paper] #reader {
  background: var(--reader-paper-bg);
  color: var(--reader-paper-ink);
  color-scheme: var(--reader-color-scheme);
  accent-color: var(--reader-control-accent);
}
html[data-reader-paper] #reader :is(.paper-area, .reading-surface, .book-content,
    .reader-top, .reader-toc, .assistant-panel, .reader-prefs) {
  background-color: var(--reader-paper-bg);
  border-color: var(--reader-paper-line);
}
html[data-reader-paper] #reader :is(.reader-top, .reader-toc, .assistant-panel, .reader-prefs) {
  color: var(--reader-paper-ink);
}
/* Limit text rules to prose and reader chrome: PDF selection layers stay transparent. */
html[data-reader-paper] #reader :is(.book-content, .book-content h1, .book-content h2,
    .book-content h3, .reader-top button, .reader-title b, .page-bottom button,
    .panel-head, .section-mini, .result-view, .switch-line, .ink-tools-row label,
    .reader-prefs label, #pdfRangeForm label, #pdfTranslationRange summary) {
  color: var(--reader-paper-ink);
}
html[data-reader-paper] #reader :is(.reading-header, .reader-title small, .page-bottom,
    .page-bottom span, .assist-caption, .section-mini span, .selection-view,
    .fulltext-card p, .tip, #translationUsage, #aiProviderNotice) {
  color: var(--reader-paper-muted);
}
html[data-reader-paper] #reader :is(.book-content blockquote, .book-content .translation-line) {
  background-color: var(--reader-paper-inset);
  color: var(--reader-paper-muted);
  border-color: var(--reader-paper-line);
}
html[data-reader-paper] #reader .book-content ::selection { background: #D6C79C; color: #222B30; }
html[data-reader-paper] #reader .assist-card {
  background: var(--reader-paper-card);
  color: var(--reader-paper-ink);
  border-color: var(--reader-paper-line);
}
html[data-reader-paper] #reader .selection-view { background: var(--reader-paper-inset); }
html[data-reader-paper] #reader .assistant-spark { color: var(--reader-control-accent); }
html[data-reader-paper] #reader :is(.text-action, .linklike, .result-view a, .assistant-panel a) {
  color: var(--reader-control-accent);
}
html[data-reader-paper] #reader .result-view a { text-decoration: underline; text-underline-offset: .15em; }

/* Shared button states also cover dynamically added wallet/provider actions. */
html[data-reader-paper] #reader :is(.secondary-btn, .outline-btn, .action-grid button) {
  background: var(--reader-paper-inset);
  color: var(--reader-paper-ink);
  border-color: var(--reader-paper-line);
}
html[data-reader-paper] #reader :is(.secondary-btn, .outline-btn, .action-grid button):hover:not(:disabled) {
  background: var(--reader-paper-bg);
  border-color: var(--reader-control-accent);
}
html[data-reader-paper] #reader :is(.primary-btn, .top-add, .action-grid button.active) {
  background: var(--reader-control-accent);
  color: var(--reader-control-on-accent);
  border-color: var(--reader-control-accent);
}
html[data-reader-paper] #reader :is(.primary-btn, .top-add, .action-grid button.active):hover:not(:disabled) {
  background: var(--reader-control-hover);
  color: var(--reader-control-on-accent);
  border-color: var(--reader-control-hover);
}
html[data-reader-paper] #reader :is(.reader-top button.active, .reader-top button:hover:not(:disabled)) {
  background-color: var(--reader-paper-inset);
}
html[data-reader-paper] #reader .danger-txt { color: var(--reader-control-danger) !important; }
html[data-reader-paper] #reader #pdfRangeError { color: var(--reader-control-danger); }
html[data-reader-paper] #reader .plain-close { background: transparent; color: var(--reader-paper-muted); }
html[data-reader-paper] #reader .plain-close:hover { background: var(--reader-paper-inset); }

html[data-reader-paper] #reader .reader-toc .panel-head { border-color: var(--reader-paper-line); }
html[data-reader-paper] #reader .toc-link {
  background: transparent;
  color: var(--reader-paper-ink);
  border-color: var(--reader-paper-line);
}
html[data-reader-paper] #reader :is(.toc-number, .toc-arrow) { color: var(--reader-paper-muted); }
html[data-reader-paper] #reader .toc-link:hover { background: var(--reader-paper-inset); }
html[data-reader-paper] #reader .toc-link.active {
  background: var(--reader-paper-inset);
  color: var(--reader-control-accent);
  box-shadow: inset 3px 0 var(--reader-control-accent);
}
html[data-reader-paper] #reader .toc-link.active :is(.toc-number, .toc-arrow) { color: var(--reader-control-accent); }

/* Native controls need their own palette as well as their container's colors. */
html[data-reader-paper] #reader :is(select, option, input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color])) {
  background: var(--reader-paper-inset);
  color: var(--reader-paper-ink);
  border: 1px solid var(--reader-paper-line);
  color-scheme: var(--reader-color-scheme);
}
html[data-reader-paper] #reader :is(input[type=checkbox], input[type=radio], input[type=range], input[type=color]) {
  background: transparent;
  color: var(--reader-paper-ink);
  border: 0;
  accent-color: var(--reader-control-accent);
  color-scheme: var(--reader-color-scheme);
}
html[data-reader-paper] #reader :is(button, input, select, a, summary):focus-visible {
  outline: 2px solid var(--reader-control-accent);
  outline-offset: 3px;
}
html[data-reader-paper] #readerPrefs { box-shadow: 0 17px 35px #17232830; }
html[data-reader-paper] #selectionBar {
  background: var(--reader-control-accent);
  color: var(--reader-control-on-accent);
}
html[data-reader-paper] #selectionBar button { background: transparent; color: var(--reader-control-on-accent); }
html[data-reader-paper] #selectionBar button:hover { background: var(--reader-control-hover); }
html[data-reader-paper] #selectionBar button:focus-visible { outline-color: var(--reader-control-on-accent); }


#pdfPageTranslation, .pdf-scroll-translation {
  max-width: 850px;
  margin: 16px auto;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--reader-paper-line);
  border-radius: 10px;
  background: var(--reader-paper-inset);
  color: var(--reader-paper-ink);
  overflow-wrap: anywhere;
}
#pdfPageTranslation h3, .pdf-scroll-translation h3 { margin: 0 0 .7em; font-size: 1rem; }
#pdfPageTranslation p, .pdf-scroll-translation p { margin: .75em 0 0; line-height: 1.8; white-space: pre-wrap; }

#pdfTranslationRange { margin-top: 8px; }
#pdfTranslationRange summary { cursor: pointer; padding: 12px 0; font-size: .9rem; }
#pdfRangeForm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#pdfRangeForm label { display: grid; gap: 4px; font-size: .8rem; }
#pdfRangeForm input { width: 100%; min-height: 44px; }
#translatePdfRangeBtn { grid-column: 1 / -1; min-height: 44px; }
#pdfRangeError:not(:empty) { display: block; margin-top: 8px; }


.reader.pdf-continuous .paper-area {
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  scroll-behavior: auto;
  scroll-snap-type: none;
  touch-action: pan-y pinch-zoom;
}
.reader.pdf-continuous .reading-surface {
  max-width: 850px;
  min-height: 0;
  height: auto;
  border: 0;
  box-shadow: none;
  overflow: visible;
}
#pdfScrollPages { width: 100%; }
.pdf-scroll-page { display: flow-root; width: 100%; margin: 0 0 clamp(8px, 1.4vw, 16px); }
.pdf-scroll-page:last-child { margin-bottom: 0; }
.pdf-scroll-sheet {
  position: relative;
  width: 100%;
  aspect-ratio: var(--pdf-scroll-default-ratio, .7071);
  background: white;
  box-shadow: 0 0 0 1px var(--reader-paper-line, #d9d6cc), 0 2px 8px #151b2110;
}
.pdf-scroll-canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.pdf-scroll-retry {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  min-height: 44px;
  max-width: 90%;
  border: 1px solid var(--reader-paper-line);
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--reader-paper-bg);
  color: var(--reader-paper-ink);
}

/* Read-aloud marks leave EPUB/HTML/PDF text and native selections untouched. */
#readAloudFollowLayer{position:fixed;inset:0;pointer-events:none;z-index:60;overflow:hidden}
#readAloudFollowLayer i{position:absolute;height:2px;background:linear-gradient(90deg,#435f52,#2e4a3c);border-radius:2px;pointer-events:none}
html[data-reader-paper="dark"] #readAloudFollowLayer i{background:#d4c69b;box-shadow:0 0 5px #d4c69b33}
.selection-bar{max-width:calc(100vw - 24px);flex-wrap:wrap}
.selection-bar button{min-height:44px}

/* Daily reflection: a folded sheet and a tactile, accessible quote switch. */
.hero.daily-reflection, .builtin-library-heading {
  --quote-paper: #F8F5EF;
  --quote-face-start: #FCFAF5;
  --quote-face-end: #F4F0E8;
  --quote-outline: #DDD5C8;
  --quote-back-shade: #CBC4B8;
  --quote-back-mid: #E8E4DB;
  --quote-back-light: #FFFEFA;
  --quote-back-edge: #F9F7F1;
  --quote-shadow: #453C2E;
  --quote-shadow-opacity: .13;
}
.hero.daily-reflection {
  position: relative;
  isolation: isolate;
  overflow: visible;
  gap: clamp(24px,4vw,64px);
  min-height: 242px;
  padding: 32px clamp(28px,3vw,48px) 42px;
  margin-bottom: 36px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.hero.daily-reflection::before,.hero.daily-reflection::after { content: none; }
.daily-reflection .quote-paper-art {
  position: absolute;
  inset: 0; width: 100%; height: 100%; z-index: 0;
  overflow: visible;
  pointer-events: none;
}
.daily-reflection .paper-face-start { stop-color: var(--quote-face-start); }
.daily-reflection .paper-face-end { stop-color: var(--quote-face-end); }
.daily-reflection .paper-back-shade { stop-color: var(--quote-back-shade); }
.daily-reflection .paper-back-mid { stop-color: var(--quote-back-mid); }
.daily-reflection .paper-back-light { stop-color: var(--quote-back-light); }
.daily-reflection .paper-back-edge { stop-color: var(--quote-back-edge); }
.daily-reflection .paper-shadow { flood-color: var(--quote-shadow); flood-opacity: var(--quote-shadow-opacity); }
.daily-reflection .quote-paper-sheet { stroke: var(--quote-outline); stroke-width: .65; }
.daily-reflection .quote-paper-curl-shadow { fill: var(--quote-shadow); opacity: .16; }
.daily-reflection .quote-paper-lip { fill: none; stroke: var(--quote-back-light); stroke-width: .65; opacity: .6; }
.daily-reflection .quote-copy { position: relative; z-index: 1; min-width: 0; flex: 1; }
.hero.daily-reflection h1.daily-quote {
  max-width: 940px;
  min-height: 3.1em;
  margin: 17px 0 14px;
  font-size: clamp(24px,2.5vw,34px);
  line-height: 1.55;
  text-wrap: pretty;
}
.hero.daily-reflection .quote-credit {
  display: flex; flex-wrap: wrap; align-items: baseline;
  column-gap: 12px; row-gap: 3px;
  padding-left: 24px;
  font-size: 13px; line-height: 1.6; letter-spacing: .3px;
  color: #70695F;
}
.daily-reflection .quote-source { font-style: normal; }
.daily-reflection .quote-date { white-space: nowrap; }
.hero.daily-reflection .quote-refresh {
  position: relative;
  z-index: 1;
  display: block; flex: 0 0 auto;
  width: 115px; height: 115px;
  margin: 0 8px 0 0; padding: 0;
  border: 0; border-radius: 26px;
  background: transparent;
  color: #F8F5EF;
  line-height: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 18px 25px -13px #1D2B3366,0 5px 8px -3px #1D2B3338;
  transition: box-shadow .18s ease;
}
.hero.daily-reflection .quote-refresh img {
  display: block;
  width: 100%; height: 100%; border-radius: inherit;
  filter: none; opacity: 1;
  transition: transform .18s ease;
}
.daily-reflection .quote-refresh:focus-visible {
  outline: 2px solid #7B6951;
  outline-offset: 6px;
}
.daily-reflection .quote-refresh:active { transform: scale(.97); }
.daily-reflection .quote-refresh.is-bouncing { animation: ia-quote-bounce .56s cubic-bezier(.2,.75,.3,1); }
@keyframes ia-quote-bounce {
  0% { transform: scale(.96); }
  36% { transform: scale(1.13); }
  62% { transform: scale(.985); }
  82% { transform: scale(1.035); }
  100% { transform: scale(1); }
}
.daily-reflection .quote-tooltip {
  position: absolute;
  z-index: 3;
  bottom: calc(100% + 12px); right: 0;
  width: max-content; max-width: calc(100vw - 56px);
  padding: 8px 11px;
  border: 1px solid #52615C;
  border-radius: 8px;
  background: #35463E;
  color: #FFFEFA;
  box-shadow: 0 6px 14px #17251D22;
  font: 500 12px/1.45 'DM Sans','PingFang SC','Microsoft YaHei',sans-serif;
  letter-spacing: 0;
  white-space: nowrap;
  visibility: hidden; opacity: 0;
  transform: translateY(4px);
  transition: opacity .16s ease,transform .16s ease,visibility 0s linear .16s;
  pointer-events: none;
}
.daily-reflection .quote-tooltip::after {
  content: '';
  position: absolute; right: 19px; top: 100%;
  border: 5px solid transparent;
  border-top-color: #35463E;
}
.daily-reflection .quote-refresh:focus-visible .quote-tooltip {
  visibility: visible; opacity: 1; transform: translateY(0); transition-delay: 0s;
}
@media (hover:hover) {
  .daily-reflection .quote-refresh:hover { box-shadow: 0 22px 31px -13px #1D2B3370,0 6px 10px -3px #1D2B3338; }
  .daily-reflection .quote-refresh:hover img { transform: translateY(-2px); }
  .daily-reflection .quote-refresh:hover .quote-tooltip {
    visibility: visible; opacity: 1; transform: translateY(0); transition-delay: 0s;
  }
}
.theme-night .hero.daily-reflection, .theme-night .builtin-library-heading {
  --quote-paper: #303B40;
  --quote-face-start: #354249;
  --quote-face-end: #2A353A;
  --quote-outline: #4C585E;
  --quote-back-shade: #202B30;
  --quote-back-mid: #455359;
  --quote-back-light: #66757C;
  --quote-back-edge: #4E5E65;
  --quote-shadow: #050A0D;
  --quote-shadow-opacity: .35;
}
.theme-night .hero.daily-reflection {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.theme-night .hero.daily-reflection .quote-credit { color: #D0C7B9; }
.theme-night .daily-reflection .quote-refresh:focus-visible { outline-color: #D4C69B; }
.theme-night .daily-reflection .quote-tooltip { background: #E6DDC8; color: #26342E; border-color: #E6DDC8; }
.theme-night .daily-reflection .quote-tooltip::after { border-top-color: #E6DDC8; }
@media (max-width:760px) {
  .hero.daily-reflection { display: block; min-height: 286px; padding: 25px 22px 38px; }
  .hero.daily-reflection .eyebrow { max-width: calc(100% - 76px); min-height: 48px; line-height: 1.8; font-size: 10px; letter-spacing: 1.6px; }
  .hero.daily-reflection h1.daily-quote { margin-top: 16px; min-height: 4.65em; font-size: 24px; line-height: 1.55; }
  .hero.daily-reflection .quote-credit { padding-left: 18px; padding-right: 0; font-size: 12px; column-gap: 8px; }
  .hero.daily-reflection .quote-refresh { position: absolute; top: 23px; right: 22px; width: 58px; height: 58px; margin: 0; border-radius: 15px; }
}
@media (prefers-reduced-motion:reduce) {
  .daily-reflection .quote-refresh,.daily-reflection .quote-refresh img,.daily-reflection .quote-tooltip { transition: none; }
  .daily-reflection .quote-refresh.is-bouncing { animation: none; }
  .daily-reflection .quote-refresh:active { transform: none; }
  .daily-reflection .quote-refresh:hover img { transform: none; }
}
