:root{--bg:#f5f0e7;--paper:#fffdf8;--ink:#243632;--muted:#697a73;--line:#dcded5;--accent:#2c6558;--accent-soft:#e5eee8;--gold:#be9864;--shadow:0 18px 55px rgba(34,54,45,.08);--reader-size:19px;--reader-line:1.95;--reader-width:690px}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-family:ui-sans-serif,system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif}button,input,textarea,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid var(--gold);outline-offset:2px}a{color:inherit}.shell{min-height:100vh}.topbar{height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 max(24px,calc((100vw - 1180px)/2));border-bottom:1px solid var(--line);background:var(--paper);position:sticky;top:0;z-index:20}.brand{display:flex;align-items:center;gap:11px;font-family:Georgia,"Noto Serif SC",serif;font-size:19px;font-weight:700;letter-spacing:.08em}.brand-mark{display:grid;place-items:center;background:var(--ink);color:#e9d1aa;width:34px;height:34px;border-radius:11px;font-size:21px}.top-actions,.row{display:flex;align-items:center;gap:10px}.button,.icon-button,.text-button{border:0;background:transparent;color:var(--ink)}.button{border:1px solid var(--line);border-radius:11px;padding:10px 15px;background:var(--paper);font-size:14px;font-weight:600}.button:hover,.icon-button:hover{border-color:var(--accent);color:var(--accent)}.button.primary{background:var(--accent);border-color:var(--accent);color:#fff}.button.primary:hover{background:#1d5044}.button.ghost{background:transparent}.button.danger{color:#9e3b34}.icon-button{display:inline-grid;place-items:center;width:38px;height:38px;border:1px solid transparent;border-radius:10px;font-size:20px}.text-button{color:var(--accent);font-weight:650;padding:0}.container{width:min(1140px,calc(100% - 40px));margin:auto}.hero{padding:76px 0 52px;display:grid;grid-template-columns:1fr 340px;gap:70px;align-items:center}.eyebrow{color:var(--accent);font-size:12px;letter-spacing:.23em;font-weight:750;text-transform:uppercase}.hero h1{font:600 clamp(40px,5vw,68px)/1.22 Georgia,"Noto Serif SC","Songti SC",serif;letter-spacing:.02em;margin:18px 0}.hero p{font-size:16px;line-height:1.9;color:var(--muted);max-width:570px}.hero-actions{display:flex;gap:10px;margin-top:28px;flex-wrap:wrap}.hero-art{height:280px;border-radius:23px;background:radial-gradient(circle at 70% 30%,#f2dfba,transparent 35%),linear-gradient(140deg,#254b40,#1b3430);box-shadow:var(--shadow);display:grid;place-items:center;overflow:hidden;position:relative}.hero-art:after{content:"";position:absolute;border:1px solid rgba(231,210,169,.32);inset:18px;border-radius:14px}.hero-book{width:150px;height:195px;background:#eee1c8;transform:rotate(-8deg);box-shadow:12px 13px 0 rgba(0,0,0,.16);border-radius:3px 12px 12px 3px;padding:26px 16px;text-align:center;font:600 24px/1.65 "Noto Serif SC","Songti SC",serif;letter-spacing:.16em;color:#3c5548}.section-head{display:flex;justify-content:space-between;align-items:end;margin:22px 0 20px;gap:15px}.section-head h2{font:600 25px Georgia,"Noto Serif SC","Songti SC",serif;margin:0}.section-head p,.small{font-size:13px;color:var(--muted)}.library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(245px,1fr));gap:18px;padding-bottom:70px}.book-card{background:var(--paper);border:1px solid var(--line);border-radius:18px;padding:19px;box-shadow:0 7px 24px rgba(37,62,50,.035);display:flex;flex-direction:column;gap:16px;min-height:255px}.book-card:hover{border-color:#9bb6a6;transform:translateY(-2px);transition:.2s}.book-cover{height:84px;width:64px;border-radius:3px 8px 8px 3px;background:#d7e0d7;color:#365c4d;display:grid;place-items:center;font:700 27px Georgia,serif;box-shadow:5px 5px 0 #bdcfc0}.book-card h3{font:600 21px/1.45 "Noto Serif SC","Songti SC",serif;margin:0}.book-card p{font-size:13px;color:var(--muted);margin:5px 0 0}.card-bottom{margin-top:auto;display:flex;align-items:center;justify-content:space-between}.progress-track{height:4px;border-radius:4px;background:#e7e8e1;overflow:hidden;margin-top:12px}.progress-fill{height:100%;background:var(--accent);border-radius:4px}.empty{padding:25px;border:1px dashed var(--line);border-radius:14px;color:var(--muted)}
.reader-toolbar{position:sticky;top:0;z-index:20;height:64px;background:var(--paper);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 24px;gap:15px}.reader-toolbar .book-title{font-weight:700;max-width:40vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reader-body{max-width:var(--reader-width);margin:0 auto;padding:57px 24px 100px;min-height:calc(100vh - 64px)}.reader-meta{color:var(--accent);font-size:12px;letter-spacing:.2em;font-weight:700}.reader-body h1{font:600 clamp(30px,6vw,43px)/1.5 "Noto Serif SC","Songti SC",serif;margin:12px 0 14px}.reader-subtitle{color:var(--muted);font-size:13px;border-bottom:1px solid var(--line);padding-bottom:29px;margin-bottom:28px}.reading-content{font-family:"Noto Serif SC","Songti SC","SimSun",serif;font-size:var(--reader-size);line-height:var(--reader-line);letter-spacing:.018em}.reading-content p{margin:0 0 1.35em;text-indent:2em;overflow-wrap:anywhere}.reading-content h2{font-size:1.08em;line-height:1.7;font-weight:700;margin:2em 0 .8em;color:var(--accent)}.para{position:relative}.note-dot{position:absolute;right:-36px;top:2px;border:0;background:none;color:#a6afa5;font-size:16px;padding:4px}.note-dot.has-note{color:#bb8f54}.note-dot:hover{color:var(--accent)}.reader-foot{border-top:1px solid var(--line);margin-top:50px;padding-top:24px;display:flex;align-items:center;justify-content:space-between;gap:15px}.page-picker{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px}.page-picker input{width:65px;padding:7px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink)}.reader-progress{position:fixed;bottom:0;left:0;right:0;height:3px;background:var(--line);z-index:22}.reader-progress div{height:100%;background:var(--gold)}
.drawer-scrim,.modal-scrim{position:fixed;inset:0;background:rgba(22,34,30,.45);z-index:40}.drawer{position:absolute;right:0;top:0;bottom:0;width:min(420px,100%);background:var(--paper);box-shadow:-20px 0 60px rgba(0,0,0,.1);overflow-y:auto;padding:24px}.drawer-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:23px}.drawer h2,.modal h2{font:600 24px "Noto Serif SC","Songti SC",serif;margin:0}.drawer-list{display:flex;flex-direction:column;gap:3px}.chapter-item{width:100%;text-align:left;border:0;background:transparent;padding:13px 11px;border-radius:10px;color:var(--ink);display:flex;gap:14px;line-height:1.5}.chapter-item span{color:var(--muted);font-size:12px;padding-top:3px}.chapter-item.active,.chapter-item:hover{background:var(--accent-soft);color:var(--accent)}.panel-label{font-size:12px;letter-spacing:.16em;color:var(--muted);font-weight:750;margin:24px 0 12px}.setting-group{margin:22px 0}.setting-group label{display:block;font-size:14px;font-weight:650;margin-bottom:12px}.setting-group input[type=range]{width:100%;accent-color:var(--accent)}.choice-row{display:flex;gap:8px;flex-wrap:wrap}.choice{border:1px solid var(--line);background:var(--paper);padding:10px 14px;border-radius:10px;color:var(--ink)}.choice.active{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}.note-card{border:1px solid var(--line);border-radius:12px;padding:14px;margin-bottom:12px}.note-card .quote{font-family:"Noto Serif SC",serif;color:var(--muted);font-size:13px;line-height:1.7;border-left:2px solid var(--gold);padding-left:10px;margin:10px 0}.note-card p{white-space:pre-wrap;line-height:1.6;margin:10px 0}.note-card .small{margin:0}.modal-scrim{display:grid;place-items:center;padding:20px;z-index:50}.modal{background:var(--paper);border-radius:17px;width:min(500px,100%);padding:24px;max-height:90vh;overflow-y:auto;box-shadow:var(--shadow)}.modal textarea,.modal input[type=text]{width:100%;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--ink)}.modal textarea{min-height:160px;resize:vertical;line-height:1.6}.modal-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:18px}.quote-preview{border-left:3px solid var(--gold);padding-left:13px;color:var(--muted);font-size:14px;line-height:1.7;margin:18px 0}.file-input{display:none}.toolbar-label{font-size:13px;color:var(--muted)}#toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,15px);background:#243b33;color:white;border-radius:11px;padding:11px 16px;opacity:0;pointer-events:none;z-index:80;transition:.2s;white-space:nowrap;max-width:90vw;overflow:hidden;text-overflow:ellipsis}#toast.show{opacity:1;transform:translate(-50%,0)}
body[data-theme="sepia"]{--bg:#f4ead9;--paper:#fbf3e5;--ink:#493b2f;--muted:#807363;--line:#e1d4be;--accent:#82633f;--accent-soft:#f0e5d4;--gold:#a87942}body[data-theme="dark"]{--bg:#18221f;--paper:#202d28;--ink:#e0e9e1;--muted:#aabbb0;--line:#3b4e43;--accent:#a1d6b6;--accent-soft:#304b3e;--gold:#d7b780;--shadow:0 18px 55px rgba(0,0,0,.2)}body[data-theme="dark"] .hero-book{background:#dbcbaa;color:#384b3c}body[data-theme="dark"] .book-cover{background:#375b49;color:#cbe4ce;box-shadow:5px 5px 0 #284939}
@media(max-width:760px){.topbar{height:60px;padding:0 17px}.container{width:calc(100% - 36px)}.hero{grid-template-columns:1fr;padding:48px 0 25px;gap:25px}.hero-art{height:180px;order:-1}.hero-book{width:105px;height:140px;padding:20px 10px;font-size:17px}.hero h1{font-size:40px}.hero p{font-size:14px}.library-grid{grid-template-columns:1fr 1fr;gap:11px}.book-card{min-height:230px;padding:14px}.book-card h3{font-size:17px}.reader-toolbar{height:58px;padding:0 10px}.reader-toolbar .book-title{font-size:13px;max-width:35vw}.reader-body{padding:38px 23px 90px}.note-dot{position:static;float:right;margin:-4px -10px 0 8px}.reader-foot .button{padding:9px}.page-picker input{width:50px}.toolbar-label{display:none}}@media(max-width:430px){.library-grid{grid-template-columns:1fr}.book-card{min-height:205px}.hero-art{height:145px}.hero-book{transform:rotate(-7deg) scale(.85)}}
.update-banner{position:fixed;left:16px;right:16px;bottom:16px;z-index:85;max-width:650px;margin:auto;background:var(--paper);color:var(--ink);border:1px solid var(--line);box-shadow:0 14px 45px #0003;border-radius:14px;padding:14px;display:flex;align-items:center;gap:12px}.update-banner div{flex:1;min-width:0}.update-banner strong,.update-banner span{display:block}.update-banner span{font-size:12px;color:var(--muted);margin-top:4px}.update-banner .button{white-space:nowrap}@media(max-width:520px){.update-banner{flex-wrap:wrap}.update-banner div{flex-basis:100%}.update-banner .icon-button{position:absolute;top:6px;right:6px}}
@media(max-width:520px){.topbar{height:auto;min-height:60px;padding:10px 14px;gap:8px;flex-wrap:wrap}.topbar .brand{font-size:16px}.topbar .top-actions{gap:5px;flex-wrap:wrap}.topbar .top-actions .button{font-size:12px;padding:7px 9px}.reader-toolbar .row{gap:2px}.reader-toolbar .icon-button{width:31px;height:34px;font-size:18px}}

/* Stable library layout and scripture opening screen. */
.topbar{position:relative;top:auto}.hero{display:block;padding:44px 0 34px}.verse-panel{min-height:260px;max-width:850px}.hero h1{font-size:clamp(28px,4.6vw,48px);line-height:1.55;margin:18px 0 12px;overflow-wrap:anywhere}.hero p{margin:0}.verse-controls{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:22px;max-width:570px;font-size:12px;color:var(--muted)}.book-card{cursor:pointer;transition:border-color .2s,box-shadow .2s}.book-card:focus-visible{outline:3px solid var(--gold);outline-offset:3px}.book-card:hover{transform:none;box-shadow:var(--shadow)}.opening-verse{position:fixed;inset:0;z-index:1000;display:flex;flex-direction:column;justify-content:center;padding:calc(36px + env(safe-area-inset-top,0px)) 30px calc(36px + env(safe-area-inset-bottom,0px));background:#f5f0e7;color:#243632;text-align:center}.opening-verse blockquote{font:600 clamp(25px,5vw,40px)/1.9 Georgia,'Songti SC',serif;max-width:740px;margin:30px auto}.opening-verse p{font-size:15px;color:#697a73}.opening-label{font-size:16px;letter-spacing:.2em;color:#2c6558}@media(max-width:760px){.hero{padding:30px 0 25px}.verse-panel{min-height:270px}.hero h1{font-size:30px}.verse-controls{flex-wrap:wrap}.topbar{align-items:flex-start}.topbar .brand{flex-shrink:0}.top-actions{justify-content:flex-end}.hero-actions{margin-top:22px}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* A quiet, connected home layout. */
.home-shell{background:radial-gradient(ellipse at 15% 0%,#e8eee480,transparent 55%),var(--bg)}.home-shell .topbar{height:auto;min-height:76px;padding:15px max(24px,calc((100vw - 1040px)/2));background:transparent;border-bottom:0;gap:16px;align-items:center}.home-shell .brand{font-size:20px;letter-spacing:.04em}.brand-icon{width:38px;height:38px;border-radius:12px}.home-shell .top-actions .button{background:transparent;border-color:transparent;color:var(--muted);font-weight:500}.home-shell .top-actions .primary{background:var(--accent);color:var(--paper);border-radius:20px;padding:10px 17px}.home-container{width:min(1040px,calc(100% - 48px))}.home-shell .hero{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);gap:22px;padding:18px 0 30px;align-items:stretch}.home-shell .verse-panel{min-height:0;max-width:none;padding:30px 32px 24px;border-radius:26px;background:linear-gradient(125deg,var(--accent-soft),var(--paper));display:flex;flex-direction:column;position:relative;overflow:hidden}.verse-label{font-size:13px;color:var(--accent);display:flex;align-items:center;gap:9px;letter-spacing:.12em}.verse-seed{color:var(--gold);font-size:18px}.home-shell .hero h1{font:500 clamp(25px,2.7vw,35px)/1.6 Georgia,'Songti SC','Noto Serif SC',serif;letter-spacing:.02em;margin:21px 0 14px;min-height:112px}.home-shell .hero #home-verse-ref{font-size:13px;color:var(--muted)}.home-shell .verse-controls{margin-top:auto;padding-top:24px;max-width:none;font-size:12px}.home-shell .verse-controls .text-button{font-size:13px;font-weight:500}.verse-dots{display:flex;align-items:center;gap:5px}.verse-dots span{width:4px;height:4px;border-radius:10px;background:var(--muted);opacity:.25;transition:.3s}.verse-dots span.active{width:18px;background:var(--accent);opacity:1}.continue-card{padding:30px;border-radius:26px;background:var(--paper);box-shadow:0 6px 30px #293e2e04;display:flex;flex-direction:column;justify-content:center;border:1px solid var(--line)}.continue-card .eyebrow{font-size:12px;letter-spacing:.06em;font-weight:500}.continue-card h2{font:500 23px/1.5 Georgia,'Songti SC',serif;margin:17px 0 8px}.home-shell .continue-author{font-size:12px;margin:0}.continue-info{font-size:13px;color:var(--muted);margin:21px 0 17px}.continue-button{width:100%;display:flex;justify-content:space-between;align-items:center;border-radius:14px;padding:12px 16px;font-weight:500}.home-shell .section-head{margin:8px 0 19px;align-items:center}.home-shell .section-head h2{font:500 23px/1.4 Georgia,'Songti SC',serif;display:flex;align-items:center;gap:10px}.shelf-count{font:12px system-ui;display:inline-grid;place-items:center;width:24px;height:24px;background:var(--accent-soft);border-radius:50%;color:var(--accent)}.home-shell .section-head p{font-size:12px;margin:7px 0 0}.shelf-actions{display:flex;gap:20px;align-items:center;font-size:12px;color:var(--muted)}.shelf-actions a{text-decoration:none}.shelf-actions .text-button{font-size:12px;font-weight:500;color:var(--muted)}.home-shell .library-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:18px;padding-bottom:48px}.home-shell .book-card{min-height:0;display:grid;grid-template-columns:100px minmax(0,1fr);gap:23px;padding:22px;border-radius:22px;background:var(--paper);box-shadow:0 6px 26px #293e2e04;border:1px solid var(--line)}.home-shell .book-card:hover{border-color:var(--gold);box-shadow:0 10px 30px #293e2e0d}.home-shell .book-cover{width:100px;height:150px;background:linear-gradient(135deg,#3f6556,#244e43);color:#f3e5cc;border-radius:3px 10px 10px 3px;box-shadow:4px 4px 0 #c7cfc4;padding:14px 12px;display:flex;flex-direction:column;justify-content:space-between;position:relative;font-weight:400}.book-cover:before{content:'';position:absolute;inset:7px;border:1px solid #ddc79948;border-radius:2px 6px 6px 2px;pointer-events:none}.cover-category{font:8px system-ui;letter-spacing:.18em;opacity:.7}.cover-title{font:500 15px/1.55 Georgia,'Songti SC',serif;position:relative}.cover-author{font:9px system-ui;opacity:.8}.book-details{min-width:0;display:flex;flex-direction:column;justify-content:center}.home-shell .book-card h3{font-size:21px;font-weight:500;line-height:1.45}.home-shell .book-meta{font-size:12px;margin-top:7px}.home-shell .book-preview{font-size:12px;line-height:1.8;margin:14px 0 13px;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.home-shell .progress-track{margin-top:auto;height:3px}.home-shell .card-bottom{gap:10px;margin-top:11px}.card-read{font-size:12px;color:var(--accent);white-space:nowrap}.home-shell .card-bottom .small{font-size:11px}.home-shell .book-card .icon-button{width:24px;height:24px}.home-shell .book-card:only-child{grid-template-columns:100px minmax(0,1fr);max-width:none}.home-shell .book-card:only-child .book-preview{max-width:760px}.home-shell .book-card:only-child .book-details{padding:4px 0}.home-shell .book-card:only-child .progress-track{max-width:600px}.home-shell .book-card:only-child .card-bottom{max-width:600px}
@media(max-width:760px){.home-shell .topbar{padding:16px 20px 10px;min-height:64px;flex-wrap:wrap;gap:10px}.home-shell .brand{font-size:18px}.brand-icon{width:32px;height:32px;border-radius:10px}.home-shell .top-actions{gap:0}.home-shell .top-actions .button{font-size:12px;padding:7px 8px}.home-shell .top-actions .primary{padding:7px 12px}.home-container{width:calc(100% - 36px)}.home-shell .hero{grid-template-columns:1fr;gap:14px;padding:14px 0 25px}.home-shell .verse-panel{padding:24px 23px 20px;border-radius:23px}.home-shell .hero h1{font-size:27px;min-height:128px;margin:17px 0 10px;line-height:1.6}.home-shell .verse-controls{padding-top:18px;flex-wrap:nowrap}.continue-card{padding:20px 23px;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:16px;row-gap:0;border-radius:21px}.continue-card .eyebrow,.continue-card h2,.continue-card .continue-author,.continue-card .continue-info{grid-column:1}.continue-card h2{font-size:19px;margin:8px 0 4px}.continue-card .continue-info{font-size:11px;margin:8px 0 0}.continue-button{grid-column:2;grid-row:1/5;align-self:center;gap:14px;width:auto;min-height:44px;padding:10px 14px;font-size:12px}.home-shell .section-head h2{font-size:22px}.home-shell .section-head{align-items:center;margin:0 0 16px;gap:10px}.shelf-actions{gap:12px;font-size:11px;flex-wrap:wrap;justify-content:flex-end;max-width:140px}.shelf-actions .text-button{font-size:11px}.home-shell .library-grid{grid-template-columns:1fr}.home-shell .book-card,.home-shell .book-card:only-child{grid-template-columns:82px minmax(0,1fr);gap:17px;padding:18px;border-radius:20px}.home-shell .book-cover{width:82px;height:128px;padding:13px 10px}.cover-title{font-size:13px}.home-shell .book-card h3{font-size:18px}.home-shell .book-preview{font-size:11px;margin:9px 0 12px;-webkit-line-clamp:2}.home-shell .card-bottom{flex-wrap:wrap;gap:7px}.home-shell .card-bottom .small,.card-read{font-size:10px}}
@media(max-width:390px){.home-shell .topbar{gap:9px}.home-shell .top-actions{width:100%;justify-content:flex-end}.continue-card{grid-template-columns:1fr}.continue-button{grid-column:1;grid-row:auto;margin-top:15px;width:100%}.home-shell .hero h1{font-size:25px}.home-shell .book-card,.home-shell .book-card:only-child{grid-template-columns:72px minmax(0,1fr);gap:13px;padding:16px}.home-shell .book-cover{width:72px;height:122px}.cover-title{font-size:12px}.shelf-actions{max-width:125px}}

/* Reader controls stay in document flow, so they never cover chapter text. */
.reader-toolbar{position:relative;top:auto;z-index:auto}.reading-content{touch-action:pan-y pinch-zoom}
