:root { color-scheme: dark; font-family: "PingFang SC","Microsoft YaHei",system-ui,sans-serif; background:#171816; }
* { box-sizing:border-box; }
body { margin:0; min-height:100dvh; display:grid; place-items:center; }
button,a { color:inherit; font:inherit; }
button { cursor:pointer; }
a { text-decoration:none; }
[hidden] { display:none !important; }
:focus-visible { outline:2px solid #fff2c8; outline-offset:3px; }
.app { position:relative; display:flex; flex-direction:column; width:min(calc(100% - 32px), 1080px); height:calc(100dvh - 28px); overflow:hidden; border-radius:clamp(13px,3vw,34px); isolation:isolate; container-type:inline-size; color:#fffdf3; background:#32422a url('assets/garden.jpg') center/cover; }
.app::before { position:absolute; inset:0; z-index:-1; content:""; background:#0912071a; pointer-events:none; }
.header { display:flex; align-items:center; justify-content:space-between; padding:clamp(14px,2.7cqw,25px) clamp(16px,3cqw,30px) 13px; }
.logo { font-size:clamp(15px,4.05cqw,44px); font-weight:750; letter-spacing:.18em; line-height:1; text-shadow:0 2px 8px #18211177; }
.logo { display:inline-flex; align-items:baseline; gap:clamp(7px,1.4cqw,16px); white-space:nowrap; }
.logo-cn { font-size:.52em; font-weight:650; letter-spacing:.12em; }
.glass { background:linear-gradient(124deg,#434e376b,#36413769 52%,#80918140); backdrop-filter:blur(6px) saturate(.94); border:1px solid #e8ebd651; box-shadow:inset 0 1px 1px #ffffff17; }
.pill { padding:9px 15px; border-radius:99px; white-space:nowrap; font-size:clamp(13px,2.4cqw,16px); color:#fffdf2; background-color:#19271a45; }
.pill:hover { background-color:#c5cfac42; }
main { min-height:0; flex:1; overflow:auto; scrollbar-width:none; padding:8px clamp(12px,3cqw,30px) 14px; }
main::-webkit-scrollbar,.books::-webkit-scrollbar { display:none; }
h1,p { margin:0; }
h1 { font-weight:760; font-size:clamp(25px,5.45cqw,48px); line-height:1.24; letter-spacing:-.025em; text-shadow:0 2px 10px #192616a8; }
.subtitle { margin:8px 0 20px; font-size:clamp(13px,2.35cqw,15px); font-weight:600; color:#fffdf0; text-shadow:0 1px 5px #172218; }
.shelf-intro { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:8px; }
.shelf-intro .subtitle { margin-bottom:12px; }
.shelf-search { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
.shelf-search input { flex:1; min-width:0; height:40px; padding:8px 13px; font:inherit; font-size:16px; border:1px solid #f2efdc61; border-radius:10px; background:#19281fbd; color:#fffbed; }
.shelf-search input::placeholder { color:#f4eddbb0; }
.import-trigger { margin-top:3px; }
.categories { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.categories button,.library-switch { padding:6px 10px; border:1px solid #fff5; border-radius:6px; background:#233127a6; font-size:14px; color:#fff9ed; }
.categories button[aria-pressed=true] { background:#f0ead9; color:#27352c; border-color:#f0ead9; }
.library-switch { margin:0 0 13px; }
.shelf-empty { padding:16px; border-radius:12px; }
.reading-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin:0 0 14px; }
.reading-stats div { min-width:0; padding:8px; border-radius:8px; background:#233127a8; color:#fffbed; }
.reading-stats dt { font-size:13px; line-height:1.4; }
.reading-stats dd { margin:4px 0 0; font-size:15px; font-weight:750; }
.archive-shelf { padding:12px 15px; margin-bottom:16px; border-radius:16px; }
.archive-shelf h2 { margin:0 0 9px; font-size:18px; }
.archive-strip { display:flex; gap:12px; overflow-x:auto; }
.archive-strip button { flex:0 0 106px; display:grid; gap:6px; padding:5px; min-width:0; border:1px solid #ffffff32; border-radius:8px; background:#15241c54; color:#fffbed; text-align:left; font-size:14px; }
.archive-covers { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(2,1fr); gap:2px; height:88px; }
.archive-covers img { width:100%; height:100%; min-height:0; object-fit:contain; }
.shelf-card { margin-bottom:16px; border-radius:clamp(16px,3cqw,26px); padding:12px 0 15px; isolation:isolate; }
.shelf-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-inline:16px; }
.shelf-head h2 { font-size:clamp(17px,3.15cqw,25px); margin:0; }
.shelf-tools { display:flex; align-items:center; gap:6px; font-size:14px; }
.shelf-tools span { margin-inline-end:6px; }
.slide { background:#24322553; border:1px solid #ffffff46; border-radius:50%; width:34px; height:34px; padding:0; color:#fffdf3; font-size:22px; line-height:1; }
.slide:disabled { opacity:.36; cursor:default; }
.books { --card:clamp(78px,23cqw,128px); position:relative; display:flex; overflow-x:auto; scrollbar-width:none; scroll-snap-type:x mandatory; gap:clamp(11px,2cqw,24px); padding:28px max(0px,calc((100% - var(--card)) / 2)) 23px; perspective:840px; overscroll-behavior-inline:contain; }
.book { position:relative; flex:0 0 var(--card); scroll-snap-align:center; display:grid; place-items:center; padding:0; border:0; background:none; min-width:0; color:#fffcf3; perspective:760px; transform-style:preserve-3d; transform:translate3d(0,var(--drop,0),var(--depth,0)) rotateY(var(--angle,0deg)) scale(var(--scale,.88)); transform-origin:center 69%; transition:transform .30s cubic-bezier(.19,.78,.24,1.31); }
.book-volume { position:relative; display:block; width:min(100%,calc(var(--card)*1.45*var(--book-ratio,.67))); height:calc(var(--card)*1.45); transform-style:preserve-3d; transform:rotateY(-17deg) rotateX(5deg); }
.book-volume::after { position:absolute; inset:auto 0 -2px; height:7px; content:""; background:#1920199c; border-radius:50%; filter:blur(3px); }
.book-volume > span { position:absolute; display:block; backface-visibility:hidden; pointer-events:none; }
.book-back { inset:0; background:linear-gradient(100deg,#14191566,transparent 72%),var(--cover); border-radius:2px; transform:translateZ(calc(var(--binding-depth)*-.5)) rotateY(180deg); }
.book-spine,.book-fore-edge { inset-block:1px; width:var(--binding-depth); }
.book-spine { left:calc(var(--binding-depth)*-.5); background:linear-gradient(90deg,#1c221bba,#ffffff22,#17201d77),var(--cover); transform:rotateY(-90deg); border-radius:2px; }
.book-fore-edge,.book-top-edge,.book-bottom-edge { background:repeating-linear-gradient(90deg,#82755f35 0 .55px,transparent .55px 1.7px),linear-gradient(#ebdec3,#caba9b); }
.book-fore-edge { right:calc(var(--binding-depth)*-.5); transform:rotateY(90deg); border-block:1px solid #756247; }
.book-top-edge,.book-bottom-edge { inset-inline:2px; height:var(--binding-depth); background:repeating-linear-gradient(0deg,#82755f3d 0 .65px,transparent .65px 1.75px),#e0d4b8; }
.book-top-edge { top:calc(var(--binding-depth)*-.5); transform:rotateX(90deg); }
.book-bottom-edge { bottom:calc(var(--binding-depth)*-.5); transform:rotateX(-90deg); background-color:#a89474; }
.books.dragging { cursor:grabbing; scroll-snap-type:none; user-select:none; }
.books.dragging .book { cursor:grabbing; pointer-events:none; }
.book-volume > .cover { inset:0; display:grid; place-items:center; color:var(--type); transform:translateZ(calc(var(--binding-depth)*.5)); transform-origin:left center; filter:brightness(var(--dim,1)); border-radius:2px; }
.cover:not(.has-cover) { background:linear-gradient(90deg,#171e1945,transparent 7%),var(--cover); border-radius:3px; }
.cover img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; pointer-events:none; }
.cover img.masked-cover { object-fit:fill; }
.cover.has-cover strong { visibility:hidden; }
.cover strong { font:700 clamp(14px,2.6cqw,20px)/1.45 "Songti SC","SimSun",serif; inline-size:88%; overflow-wrap:anywhere; }
.shelf-edge { height:8px; margin:-11px 5% 3px; border-radius:1px; border-top:1px solid #cda37e99; background:repeating-linear-gradient(1deg,#412a2337 0 1px,transparent 1px 3px),linear-gradient(#876350,#543c32); box-shadow:0 5px 10px #1520178c; }
.shelf-position { display:flex; align-items:center; gap:12px; margin:9px 5% 0; }
.shelf-position output { flex:none; min-width:7.5em; color:#fff3df; text-align:right; font-size:13px; font-variant-numeric:tabular-nums; }
.shelf-position input { appearance:none; flex:1; min-width:0; height:6px; border-radius:8px; margin:10px 0; background:linear-gradient(90deg,#e4bf8a var(--shelf-position,0%),#19281e9c var(--shelf-position,0%)); cursor:pointer; }
.shelf-position input::-webkit-slider-thumb { appearance:none; width:15px; height:15px; border:1px solid #fff2d8; border-radius:50%; background:#d3aa77; }
.shelf-position input::-moz-range-thumb { width:13px; height:13px; border:1px solid #fff2d8; border-radius:50%; background:#d3aa77; }
.shelf-position input:disabled { opacity:.68; cursor:default; }
#status { flex:none; display:block; min-height:4px; padding:3px 9px; text-align:center; font-size:13px; color:#fffff1; font-weight:650; text-shadow:0 1px 5px #000; }
.dock { flex:none; display:grid; grid-template-columns:1fr 1fr; margin:0 clamp(10px,3cqw,28px) 12px; border-radius:20px; min-height:69px; background-color:#273a2d42; }
.dock a { min-width:0; display:grid; justify-items:center; align-content:center; gap:5px; color:#fafbf2cc; font-size:14px; font-weight:650; }
.dock a[aria-current] { color:#fffdf4; font-weight:800; }
.dock svg { width:25px; height:25px; stroke:currentColor; stroke-width:2; fill:none; stroke-linecap:round; stroke-linejoin:round; }
.reader-tools { display:flex; justify-content:space-between; align-items:center; gap:8px; }
#finished[aria-pressed=true] { background:#495e4bcb; }
#reader h1 { text-align:center; font-size:clamp(23px,4.7cqw,44px); margin:14px 0 3px; }
.reader-source { margin-bottom:15px; text-align:center; color:#fffdf1; font-size:13px; text-shadow:0 1px 4px #18251a; }
.weread-reader { display:table; margin:0 auto 12px; text-align:center; }
.spread { --paper:#f5ecd6; --grain:url('assets/paper-grain.png'); position:relative; padding:4px; perspective:1300px; border-radius:9px; background:#88704e; border:1px solid #ba9a70; box-shadow:0 12px 30px #10180f70; }
.folio { position:relative; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-content:start; min-height:clamp(260px,45cqw,450px); padding:clamp(12px,3cqw,30px) 0 36px; color:#3f3a2d; border-radius:5px; background:linear-gradient(90deg,#874e1014,transparent 4%,transparent 45%,#594c2b26 49.7%,#594c2b48 50%,#594c2b22 51.4%,transparent 55%,transparent 98%,#874e1013),var(--grain),var(--paper); }
.paper-heading { margin:0 0 10px; padding-inline:clamp(10px,3cqw,26px); color:#73664c; font-size:clamp(14px,2.3cqw,18px); }
.passage { display:contents; }
.review { --dot-color:#af4948; }
.familiar { --dot-color:#386892; }
.dot { display:inline-block; width:9px; height:9px; border-radius:50%; background:var(--dot-color); margin-inline-end:8px; }
.status-dots { display:flex; flex-direction:column; align-items:center; padding-inline-end:3px; gap:1px; }
.status-dot { display:grid; place-items:center; width:24px; height:21px; padding:0; border:0; border-radius:50%; background:none; }
.status-dot::before { content:""; width:10px; height:10px; border-radius:50%; border:1.5px solid var(--dot-color); }
.status-dot[aria-pressed=true]::before { background:var(--dot-color); }
.status-dot:focus-visible { outline:2px solid var(--dot-color); outline-offset:-1px; }
.status-dot:hover::before { box-shadow:0 0 0 3px #6e60432c; }
.folio-empty { grid-column:1/-1; padding:24px; color:#625642; text-align:center; line-height:1.65; }
.turn { position:absolute; z-index:1; bottom:4px; width:38px; height:36px; background:none; border:0; }
.turn::after { position:absolute; content:""; bottom:2px; border:12px solid transparent; }
.next { right:0; }.previous { left:0; }
.next::after { right:.5cqw; border-bottom-color:#ded8bd; border-right-color:#ded8bd; }
.previous::after { left:.5cqw; border-bottom-color:#ded8bd; border-left-color:#ded8bd; }
.turn:disabled { opacity:.3; cursor:default; }
.page-controls { display:flex; justify-content:center; align-items:center; gap:12px; margin:14px 0 16px; font-size:14px; }
.page-controls button:disabled { opacity:.46; cursor:default; }
.review-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.review-module { display:flex; align-items:center; gap:4px; padding:13px 11px; border-radius:12px; background-color:#23332870; font-size:15px; }
.review-module:hover,.review-item:hover { background-color:#233328a6; }
.review-module .dot { flex:none; margin-inline-end:2px; }
.review-module strong { margin-inline-start:auto; color:#f3e5cd; font-size:13px; font-weight:650; white-space:nowrap; }
.review-back { display:inline-block; margin-bottom:16px; }
.review-list { display:grid; gap:10px; margin:0; padding:0; list-style:none; }
.review-item,.review-empty { display:block; border-radius:12px; padding:14px; background-color:#24322987; }
.review-item blockquote { margin:0; font:500 16px/1.65 "Songti SC","SimSun",serif; white-space:pre-wrap; overflow-wrap:anywhere; }
.review-item p { margin-top:8px; white-space:pre-wrap; overflow-wrap:anywhere; color:#f0e7d4; font-size:14px; }
.review-item small { display:block; margin-top:9px; color:#f5edddae; }
.brain-panel { position:relative; height:clamp(245px,58cqw,500px); border-radius:clamp(16px,3cqw,26px); overflow:hidden; background:radial-gradient(ellipse at center,#37465894,#151b25b5 72%); }
canvas { display:block; width:100%; height:100%; cursor:grab; touch-action:pan-y; }
canvas:active { cursor:grabbing; }
#brain-unavailable { position:absolute; inset:0; align-content:center; padding:24px; text-align:center; }
.brain-evidence { margin-top:12px; padding:clamp(13px,2.8cqw,24px); border-radius:clamp(16px,3cqw,26px); }
.brain-evidence h2 { margin:0 0 6px; font-size:clamp(17px,3cqw,22px); }
.brain-evidence p { font-size:14px; line-height:1.6; }
.brain-books { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; max-height:11rem; overflow:auto; }
.brain-books:empty { display:none; }
.brain-books button { display:inline-flex; align-items:center; gap:7px; min-width:0; max-width:100%; padding:6px 10px; border:1px solid #f2e9d45a; border-radius:14px; background:#1f2c26b5; color:inherit; text-align:left; overflow-wrap:anywhere; font:inherit; font-size:13px; }
.brain-books button[aria-pressed=true] { border-color:#f1e5c0; background:#39463bf0; }
.brain-books i { flex:none; width:7px; height:7px; border-radius:50%; box-shadow:0 0 6px currentColor; }
#brain-detail:not(:empty) { margin:8px 0; }
.brain-sources { margin-top:10px; padding-top:8px; border-top:1px solid #efeadd4a; font-size:13px; }
.brain-sources summary { width:fit-content; cursor:pointer; }
.brain-sources p,.brain-sources ul { margin-top:7px; }
.brain-sources ul { margin-bottom:0; padding-inline-start:20px; line-height:1.65; }
.brain-sources a { text-decoration:underline; }
.evolution { margin-top:18px; border-radius:22px; padding:clamp(12px,2.7cqw,24px); background:transparent; backdrop-filter:blur(6px); border:1px solid #f5f1da45; color:#fffdf0; text-shadow:0 1px 4px #172015,0 1px 8px #172015; }
.evolution-header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:7px; }
.evolution-header h2 { font-size:clamp(18px,3cqw,26px); margin:0; }
.evolution-header p { font-size:14px; font-weight:700; }
.evolution-scroll { overflow-x:auto; padding:0 4px 7px; margin-top:10px; scrollbar-color:#aaab9e transparent; scrollbar-width:thin; }
.stages { --plot-height:385px; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); align-items:start; position:relative; min-width:685px; list-style:none; padding:0 20px 0 6px; margin:0; }
.stages::before { position:absolute; top:var(--plot-height); left:3px; right:9px; height:2px; content:""; background:#fff9e1; box-shadow:0 1px 3px #283029; }
.stages::after { position:absolute; top:calc(var(--plot-height) - 4px); right:8px; border-width:5px 0 5px 9px; border-style:solid; border-color:transparent transparent transparent #fff9e1; content:""; }
.stage { min-width:0; padding:0 5px; }
.stage-label { position:relative; margin-top:1px; padding:13px 0 4px; text-align:center; min-height:83px; }
.stage-label::before { position:absolute; top:0; left:50%; width:1px; height:10px; background:#fff9e1; content:""; }
.stage[aria-current] .stage-label::before { width:3px; background:#efbe8f; }
.stage h3 { font-size:14px; margin:0 0 4px; }
.stage p { font-size:13px; line-height:1.5; }
.current-step { display:inline-block; margin-top:3px; color:#ffdeb7; font-size:12px; font-weight:750; }
.stage-visual { height:var(--plot-height); display:grid; grid-template-columns:minmax(0,1fr) minmax(23px,29%); align-items:end; gap:3px; padding:0 5px 4px; }
.stage-art { min-width:0; background-position:center bottom; background-repeat:no-repeat; background-size:contain; filter:drop-shadow(0 1px 4px #fdefbd44); }
.art-0 { height:37px; background-image:url('assets/stage-0.webp'); }
.art-1 { height:66px; background-image:url('assets/stage-1.webp'); }
.art-2 { height:102px; background-image:url('assets/stage-2.webp'); }
.art-3 { height:146px; background-image:url('assets/stage-3.webp'); }
.art-4 { height:245px; background-image:url('assets/stage-4.webp'); transform:scale(1.25); transform-origin:center bottom; }
.book-stack { display:flex; flex-direction:column-reverse; align-items:center; width:100%; justify-self:start; }
.book-stack span { flex:0 0 auto; height:var(--spine-height); width:92%; background:linear-gradient(90deg,#0001 0 12%,transparent 12% 84%,#fff4 84% 92%,transparent 92%),var(--spine-color); border-radius:1px; }
.book-stack span:nth-child(3n) { width:100%; transform:translateX(-1px); }
.book-stack span:nth-child(4n) { width:80%; transform:translateX(1px); }
.book-stack span:nth-child(5n) { width:86%; }
.book-stack span.unread-spine { opacity:.65; }
.finished-books { margin-top:9px; border-top:1px solid #807d7037; padding-top:9px; font-size:14px; }
.finished-books summary { cursor:pointer; width:fit-content; }
.finished-books ul { margin:8px 0 0; max-height:9rem; overflow:auto; padding-inline-start:20px; line-height:1.65; }
#background-dialog,#import-dialog { width:min(440px,calc(100% - 24px)); max-height:88dvh; overflow:auto; border:1px solid #efece061; border-radius:20px; padding:18px; background:#ececde; color:#27362b; box-shadow:0 14px 55px #0c170e8c; color-scheme:light; }
#background-dialog::backdrop,#import-dialog::backdrop { background:#14201765; }
.settings-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:13px; gap:8px; }
.settings-head h2 { margin:0; font-size:21px; }
.settings-close { display:grid; place-items:center; border:0; border-radius:50%; width:37px; height:37px; background:#d9dfd1; font-size:24px; }
.background-options { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.background-options button { display:grid; gap:6px; padding:5px 5px 8px; overflow:hidden; text-align:left; border:1px solid #a5ae9d; border-radius:10px; background:#f4f3e9; color:#2b392e; font-size:14px; }
.background-options button[aria-pressed=true] { outline:2px solid #435e47; outline-offset:-2px; }
.background-options img { width:100%; height:85px; border-radius:6px; object-fit:cover; }
.upload-background { width:100%; margin-top:12px; padding:11px; border:0; border-radius:9px; background:#425a47; color:#fffdf2; }
#background-feedback { min-height:20px; margin-top:7px; font-size:14px; }
.weread-help { display:inline-block; color:#345845; text-decoration:underline; text-underline-offset:3px; margin:10px 0 14px; font-size:15px; }
#import-form label { display:block; font-size:14px; font-weight:650; margin-bottom:6px; }
#import-form input { width:100%; padding:10px 12px; border:1px solid #a3ae9e; background:#fffdf5; color:#253128; border-radius:8px; font:inherit; }
.import-help,#import-feedback { margin-top:7px; font-size:14px; line-height:1.55; }
#import-feedback { min-height:21px; font-weight:650; }
#start-import:disabled { opacity:.6; cursor:wait; }
.import-advanced { margin-top:14px; font-size:14px; }
.import-advanced summary { cursor:pointer; }
.import-preview h3 { margin:0 0 7px; font-size:18px; }
.import-preview p { margin-bottom:8px; font-size:14px; line-height:1.5; }
.import-preview .reading-stats { grid-template-columns:repeat(2,minmax(0,1fr)); margin:8px 0; }
.import-preview .reading-stats div { background:#dbe1d2; color:#27362b; }
.import-preview label { display:block; font-size:14px; font-weight:650; }
.import-preview input { width:100%; padding:8px; margin-top:5px; border:1px solid #a3ae9e; border-radius:6px; background:#fffdf5; color:#253128; font:inherit; }
.import-preview ul { margin:7px 0; padding-inline-start:20px; font-size:14px; line-height:1.55; }
.preview-actions { display:flex; justify-content:end; gap:8px; margin-top:13px; }
.preview-actions button { padding:8px 12px; border:0; border-radius:7px; background:#dbe1d2; color:#263b2c; }
.preview-actions button:last-child { background:#425a47; color:#fffdf2; }
@media (max-width:600px) {
  .app { width:100%; height:100dvh; border-radius:0; }
  .header { padding-top:max(14px,env(safe-area-inset-top)); }
  .dock { margin-bottom:max(9px,env(safe-area-inset-bottom)); }
  .status-dot { width:22px; }
  .status-dots { padding-inline-end:1px; }
  .reading-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (min-width:601px) and (max-height:520px) {
  .app { height:100dvh; border-radius:0; }
  .dock { min-height:53px; margin-bottom:5px; }
}
@media (prefers-reduced-motion:reduce) { .book { transition:none; } }

.archive-shelf,.dock {
  background:linear-gradient(158deg,#ffffff39,#ffffff0c 36%,#dbe9d313);
  border:1px solid #ffffff8c;
  box-shadow:inset 0 2px 3px #ffffff62,inset 0 -5px 12px #ffffff26,0 8px 17px #111b1452;
  backdrop-filter:blur(2px) saturate(1.12);
  text-shadow:0 1px 5px #102016;
}
.dock a[aria-current] { background:#ffffff20; border-radius:19px; box-shadow:inset 0 1px 2px #ffffff60; }
#sync-state { font-size:14px; }
#reader-sync-state:empty { display:none; }
.reading-stats a { display:inline-block; text-decoration:underline; text-underline-offset:3px; }
.shelf-modes { display:grid; grid-template-columns:1fr 1fr; width:100%; gap:5px; margin:0 0 12px; padding:5px; background:#192a22c5; border:1px solid #f0f2df5c; border-radius:13px; }
.shelf-modes button { background:linear-gradient(#63726d,#32463a); min-height:45px; padding:6px 5px; font-weight:700; border:1px solid #d7e2d34f; border-radius:8px; box-shadow:inset 0 1px 1px #ffffff56,0 3px 0 #141f1b; }
.shelf-modes button[aria-pressed=true] { color:#3b3928; background:linear-gradient(#fff5bc,#edda81); border-color:#fff3af; box-shadow:inset 0 1px 0 #fffde5,0 3px 0 #a9974e; }
.books { --book-gap:clamp(11px,2cqw,24px); gap:var(--book-gap); padding-inline:0; }
.books::before,.books::after { content:""; flex:0 0 max(0px,calc((100% - var(--card)) / 2 - var(--book-gap))); }
.book-slot { flex:0 0 var(--card); display:grid; position:relative; scroll-snap-align:center; }
.book { width:100%; scroll-snap-align:none; transform:translate3d(0,var(--drop,0),var(--depth,0)) scale(var(--scale,.88)); }
.book-volume { transform:rotateY(-3deg) rotateX(4deg); }
.book-slot:has(.book.centered) { z-index:6; }
.shelf-edge { border-radius:5px; height:7px; background:linear-gradient(#fffef4a1,#fffef435); border-top-color:#ffffffc4; box-shadow:0 3px 8px #19241c6f; }
.shelf-position input { background:linear-gradient(90deg,#fffffff2 var(--shelf-position,0%),#fffef448 var(--shelf-position,0%)); }
.shelf-position input::-webkit-slider-thumb { background:#fffffff2; border-color:#fff; }
.shelf-position input::-moz-range-thumb { background:#fffffff2; border-color:#fff; }
.reader-tools,.page-controls { flex-wrap:wrap; }
#page-jump { display:flex; align-items:center; justify-content:center; gap:6px; flex-wrap:wrap; font-size:14px; }
#page-jump input { width:4.2em; padding:6px; border:1px solid #f8f1d06b; color:#fcf6dc; border-radius:6px; background:#16291db5; font:inherit; }
#page-jump button { padding-inline:8px; }
#folio { min-height:clamp(306px,52cqw,385px); padding-bottom:18px; }
.paper-side { min-width:0; padding:0 clamp(8px,2cqw,22px); }
.paper-heading { margin:0 0 13px; padding:0 0 7px; }
.paper-text { display:flex; align-items:flex-start; gap:5px; font:500 clamp(15px,2cqw,19px)/1.62 "Songti SC","SimSun",serif; }
.paper-text .status-dots { flex:none; }
.paper-text .quote-text,.curl-content p,.curl-under p { white-space:pre-wrap; overflow-wrap:anywhere; }
.thought-edit { display:block; margin-top:12px; padding:4px 7px; border:1px solid #9d8969; border-radius:9px; color:#514735; background:#dfcfaa70; font-size:13px; }
.thought-dialog { width:min(580px,calc(100% - 28px)); color:#403a2b; background:#efe5ce; border:1px solid #c9ad7c; border-radius:15px; padding:18px; color-scheme:light; }
.thought-dialog::backdrop { background:#17241999; }
.thought-dialog h2 { margin:0 0 12px; }
.thought-dialog label { display:block; }
.thought-dialog textarea { display:block; width:100%; margin:6px 0 12px; resize:vertical; padding:9px; border:1px solid #ad956c; border-radius:6px; color:#393026; background:#fffaf0; font:inherit; }
.curl-layer { position:absolute; inset:4px; pointer-events:none; z-index:8; transform-style:preserve-3d; }
.curl-strip { position:absolute; height:100%; top:0; left:50%; transform-origin:left center; transform-style:preserve-3d; }
.curl-backward .curl-strip { left:auto; right:50%; transform-origin:right center; }
.curl-face { position:absolute; inset:0; overflow:hidden; backface-visibility:hidden; background:var(--grain),var(--paper); }
.curl-face::after { position:absolute; inset:0; background:rgb(58 39 18 / var(--curl-shade,0)); content:""; }
.curl-reverse { transform:rotateY(180deg); }
.curl-content,.curl-under { position:absolute; top:0; height:100%; padding:clamp(12px,3cqw,30px) clamp(8px,2cqw,22px) 18px; background:var(--grain),var(--paper); color:#3f3a2d; font:500 clamp(15px,2cqw,19px)/1.62 "Songti SC","SimSun",serif; }
.curl-forward .curl-under { left:0; width:50%; }
.curl-backward .curl-under { right:0; width:50%; }
#brain-callouts { position:absolute; inset:0; pointer-events:none; }
#brain-callouts svg { width:100%; height:100%; display:block; }
#brain-callouts polyline { fill:none; stroke:var(--point-color); stroke-width:1.25; }
#brain-callouts p { position:absolute; right:11px; width:min(178px,44%); text-align:right; color:#fff; text-shadow:0 1px 5px #000,0 1px 10px #000; }
#brain-callouts p.at-left { left:11px; right:auto; text-align:left; }
#brain-callouts span { display:block; color:var(--point-color); font-size:13px; }
.brain-evidence { padding:6px 2px 0; border-radius:0; }
.stats-book { font-weight:700; text-decoration:underline; text-underline-offset:3px; }
#stats-list details { margin-top:7px; }
#stats-list summary { cursor:pointer; }
#stats-list p { white-space:pre-wrap; padding:7px 0; border-top:1px solid #d9e6d138; }
.print-controls { margin-bottom:12px; }
.print-controls h1 { margin-bottom:12px; }
.print-controls select { max-width:min(100%,420px); margin:0 9px 9px 0; padding:7px; color:#254135; background:#f3efdc; border:1px solid #8ba093; border-radius:6px; font:inherit; }
.print-preview { color:#252017; background:#fffcf3; max-width:850px; margin:auto; padding:clamp(20px,6cqw,56px); border-radius:8px; }
.print-preview:empty { display:none; }
.print-preview ol { padding-inline-start:1.4em; }
.print-preview li strong { color:#473e2c; font-size:.92em; }
.print-preview li p { white-space:pre-wrap; overflow-wrap:anywhere; margin:.2em 0 .8em; }
@media print {
  @page { margin:15mm; }
  :root,body,.app,main { display:block; width:auto; height:auto; min-height:0; margin:0; padding:0; overflow:visible; color:#000; background:#fff; }
  .header,.dock,#status,.print-controls,.app::before { display:none !important; }
  .print-preview { padding:0; margin:0; max-width:none; color:#000; background:#fff; font-size:11pt; line-height:1.55; }
  .print-preview h2 { margin:0; }
  .print-preview li { break-inside:avoid; }
  .print-preview li strong { break-after:avoid; }
}

.app {
  --wood:radial-gradient(ellipse at 22% -35%,#eacc9766,transparent 75%),
    repeating-linear-gradient(2deg,#69432d25 0 1px,#e8bb7e28 2px 3px,transparent 4px 8px),
    linear-gradient(#b88a5f,#8d5f3e 66%,#573b29);
}
.archive-shelf,.dock,.shelf-modes,.pill,.slide {
  border:1px solid #ffffff65;
  background:linear-gradient(165deg,#ffffff3d 0%,#ffffff07 39%,#dbf6e51d 76%,#fff9 104%),#17291b32;
  box-shadow:inset 0 1px 1px #fff9,inset 2px 0 4px #ffffff18,inset 0 -2px 4px #0a1a1466,0 3px 9px #0b19134f;
}
.pill,.slide,.archive-strip button,.shelf-modes button,.dock a {
  transition:transform .27s cubic-bezier(.2,.86,.25,1.47),background .23s,box-shadow .23s;
}
.pill:active,.slide:active,.archive-strip button:active,.shelf-modes button:active,.dock a:active { transform:translateY(1px) scale(.96); }
.shelf-modes button[aria-pressed=true] {
  color:#fff; border-color:#fff9;
  background:linear-gradient(#ffffff68,#ffffff25 48%,#dbe8dc22);
  box-shadow:inset 0 1px 2px #fff9,inset 0 -2px 4px #1725195c,0 3px 0 #16231b64;
  text-shadow:0 1px 3px #1c2d239c;
}
.shelf-edge { height:10px; background:var(--wood); border:1px solid #d8af798c; }
.book-volume { transform:rotateY(-7deg) rotateX(5deg); }
.book .book-fore-edge { background-color:#f0dfbb; }
.spine-slot { height:130px; padding:0 2px 14px; display:flex; align-items:end; position:relative; min-width:0; }
.domino-book {
  width:100%; height:var(--binding-height); border-radius:3px 4px 2px 2px; border:1px solid #f8db9b55;
  transform-origin:50% 100%; transform:perspective(380px) rotateY(-13deg) rotateZ(var(--fall,0deg));
  transition:transform .49s cubic-bezier(.26,.91,.29,1.26); box-shadow:inset 2px 0 2px #fff7, inset -4px 0 3px #25180b86,3px 2px 3px #251b14a6;
  align-content:center; padding:3px 2px; position:relative;
  background:repeating-linear-gradient(97deg,#eecfa421 0 1px,transparent 1px 4px),linear-gradient(90deg,#1c130f67,transparent 17% 74%,#1a191957),var(--binding);
}
#spread { touch-action:pan-y; }
#folio.single-note { background:url('assets/paper-grain.png'),#f5ecd6; }
#folio.single-note .paper-side { grid-column:1/-1; }
.note-filters { display:inline-flex; vertical-align:middle; margin-inline-start:7px; gap:4px; align-items:center; }
.note-filters button:first-child { padding:3px 6px; font-size:13px; }
.note-filters .status-dot { background:#e8decb; }
.stats-note { display:grid; grid-template-columns:28px minmax(0,1fr); gap:11px; margin-top:10px; border-radius:9px; padding:12px; background:#f4eddd; color:#514130; text-shadow:none; }
#stats-list .stats-note p { margin-top:3px; border:0; padding:0; font-size:16px; }
.print-cover { text-align:center; padding:17px 0 29px; }
.print-cover img { display:block; width:min(100%,284px); max-height:400px; object-fit:contain; margin:0 auto 18px; box-shadow:0 8px 17px #59402d55; }
.print-cover h2 { margin:0 0 7px; }
.print-preview li { padding-block:1.05em; }
.print-preview li + li::after {
  content:""; position:absolute; top:0; left:var(--print-number-inset); right:0;
  border-top:1px solid #d9cdb5; pointer-events:none;
}
.print-preview li section:last-child p { margin-bottom:0; }
.print-preview li strong { color:#9b660d; font-size:1.14em; font-weight:740; }
.printed-original p { color:#865808; }
.printed-thought p { color:#9b8060; }
#brain-panel { height:max(clamp(260px,57cqw,500px),var(--brain-height,280px)); background:radial-gradient(ellipse,#b8c6ba66,#5b6a60a6 90%); }
#brain-callouts polyline { opacity:.86; }
#brain-callouts polyline.behind { opacity:.37; stroke-dasharray:3 3; }
#brain-callouts polyline.selected { stroke-width:1.8; opacity:1; }
#brain-callouts circle { fill:var(--point-color); stroke:#fff9; stroke-width:.5; }
#brain-callouts circle.behind { opacity:.5; }
#brain-callouts p { width:min(165px,40%); line-height:1.22; overflow:hidden; }
#brain-callouts p strong { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#brain-callouts p span { font-size:.88em; }
#brain-callouts p.behind { opacity:.68; }
@media (prefers-reduced-motion:reduce) {
  .domino-book,.pill,.slide,.archive-strip button,.shelf-modes button,.dock a { transition:none; }
}
@media print {
  @page { size:A4; margin:15mm; background:white; }
  :root,body { color-scheme:light; background:#fff !important; margin:0 !important; padding:0 !important; width:100% !important; height:auto !important; }
  .app { display:block !important; position:static; container-type:normal; isolation:auto; width:100% !important; max-width:none !important; min-height:0; height:auto !important; overflow:visible !important; border-radius:0; }
  main,#print-page { display:block; width:100%; max-width:none; height:auto; min-height:0; overflow:visible; }
  #print-page[hidden] { display:none !important; }
  .print-preview { display:block; box-sizing:border-box; width:100% !important; max-width:none !important; margin:0 !important; padding:0 !important; writing-mode:horizontal-tb; text-align:left; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
  .print-cover { break-after:page; padding:18mm 0 5mm; }
  .print-cover img { width:auto; max-width:135mm; height:auto; max-height:180mm; box-shadow:none; }
  .print-preview li { break-inside:auto; }
  .print-preview li section { break-inside:avoid; }
  .print-preview li p { orphans:2; widows:2; }
}

.dock { grid-template-columns:repeat(3,minmax(0,1fr)); }
.shelf-modes button {
  color:#282d26; text-shadow:none;
  background:linear-gradient(#fafafcec,#ddddddc9);
  border-color:#ffffffaf;
  box-shadow:inset 0 1px 0 #fff,0 3px 0 #a8a9a4a8;
}
.shelf-modes button[aria-pressed=true] {
  color:#222823; text-shadow:none; border-color:#fff;
  background:linear-gradient(#fff,#fcfcfc 49%,#ededed);
  box-shadow:inset 0 1px 0 white,0 4px 0 #bcbeb7,0 4px 9px #121c167a;
}
.books { overflow-y:hidden; padding-block:35px 26px; overscroll-behavior-x:contain; }
.book-volume { transform:rotateY(-13deg) rotateX(6deg); }
.shelf-position input {
  height:3px;
  background:linear-gradient(90deg,#ffffffe0 var(--shelf-position,0%),#fcfff348 var(--shelf-position,0%));
}
.shelf-position input::-webkit-slider-thumb { width:9px; height:9px; background:#f7fff3b9; box-shadow:none; }
.shelf-position input::-moz-range-thumb { width:8px; height:8px; background:#f7fff3b9; box-shadow:none; }
.library-progress {
  position:absolute; top:46%; right:clamp(6px,2.1cqw,21px); transform:translateY(-35%);
  width:21px; height:92px; z-index:12; display:grid; place-items:center;
  cursor:ns-resize; touch-action:none; user-select:none;
}
.library-progress-track {
  width:3px; height:100%; border-radius:2px; pointer-events:none;
  background:linear-gradient(to bottom,#fbfff1e5 var(--read-position,0%),#edf2dc54 var(--read-position,0%));
  box-shadow:0 0 6px #1f342c7c;
}
#library-progress-text { position:absolute; bottom:-17px; white-space:nowrap; font-size:10px; color:#fffcf0; text-shadow:0 1px 4px #17291e,0 0 6px #142118; }
.display-actions { display:flex; gap:7px; flex-wrap:wrap; margin-top:10px; }
.display-actions .pill { padding:7px 10px; }
.display-row {
  position:relative; display:grid; grid-template-columns:clamp(55px,12cqw,82px) minmax(0,1fr);
  align-items:end; min-height:133px; margin-bottom:8px; padding:0 8px 13px;
  border-radius:11px; isolation:isolate;
}
.display-row::after {
  content:""; position:absolute; inset:auto 0 0; z-index:-1; height:12px;
  background:var(--wood); border-radius:0 0 10px 10px; box-shadow:inset 0 1px 2px #fdcca083,0 5px 8px #21170d7b;
}
.display-category { align-self:center; margin:0; padding:0 5px; font-size:12px; line-height:1.45; color:#eee4cc; font-weight:550; word-break:break-word; }
.display-spines { min-width:0; display:grid; grid-auto-flow:column; grid-auto-columns:minmax(27px,38px); align-items:end; touch-action:pan-y; }
.display-spines .spine-slot { height:117px; padding:0 2px; isolation:auto; touch-action:pan-y; }
.display-spines .spine-slot[data-drop]::before {
  content:""; position:absolute; top:10px; bottom:0; left:-1px; z-index:7;
  width:3px; border-radius:2px; background:#ffeed1; box-shadow:0 0 6px #f8dfa4;
}
.display-spines .spine-slot[data-drop=after]::before { left:auto; right:-1px; }
.display-spines .has-lifted-book .domino-book { opacity:.16; }
.domino-book {
  display:grid; place-items:center;
  background:linear-gradient(90deg,#29190e42,transparent 20% 74%,#1c140b60),var(--binding);
}
.carried-book {
  position:fixed; z-index:999; pointer-events:none; margin:0;
  transform:translate(-50%,calc(-100% - 6px)) rotate3d(.22,1,.06,-32deg) rotateZ(12deg) scale(1.32);
  transform-origin:center 60%; opacity:1;
  box-shadow:inset 1px 0 3px #fff6,inset -5px 0 4px #2416088c,6px 7px 0 #34251e,10px 22px 20px #16130eb0;
  animation:book-lift .32s cubic-bezier(.2,.8,.23,1.3);
}
@keyframes book-lift {
  from { transform:translate(-50%,-65%) rotateY(-12deg) scale(1); }
}
.stats-page-heading { display:flex; align-items:center; flex-wrap:wrap; gap:9px 18px; }
#notes-search-form { display:flex; align-items:center; gap:6px; flex:1 1 220px; margin:4px 0; max-width:420px; }
#notes-search {
  flex:1; width:0; height:39px; border:1px solid #f2efdc61; border-radius:9px;
  background:#19281fc9; color:#fffbed; padding:7px 10px; font:inherit;
}
#notes-search-form button { padding:8px 11px; }
.stats-card { position:relative; padding:0; min-height:87px; isolation:isolate; }
.stats-card .stats-cover {
  position:absolute; inset:0 0 auto auto; height:94px; width:min(33%,190px); object-fit:cover; object-position:right 29%;
  mask-image:linear-gradient(to right,transparent 0%,#0007 45%,#000 93%); border-radius:0 12px 9px 0; pointer-events:none;
}
.stats-card-content { position:relative; min-height:87px; padding:10px 27% 10px 13px; }
.stats-card-content .stats-category { color:#f0e6ce; font-size:12px; margin:0 0 4px; }
.stats-note-header { display:flex; align-items:center; flex-wrap:wrap; gap:3px; }
.stats-card .stats-book { background:none; border:0; padding:1px 0; text-align:left; font-weight:550; text-decoration:none; }
.stats-book[aria-expanded=true] { text-decoration:underline; text-decoration-color:#f1e7d782; }
.stats-note-count { font-size:13px; color:#cc9a51; }
.stats-notes { position:relative; padding:5px 12px 12px; background:#27342acc; border-radius:0 0 12px 12px; }
.stats-notes .stats-note { grid-template-columns:23px minmax(0,1fr); margin:0; padding:10px 0; gap:7px; border-radius:0; background:none; color:inherit; }
.stats-note + .stats-note { border-top:1px solid #fff2; }
.stats-note .stats-original,#stats-list .stats-note p { font:inherit; line-height:1.66; white-space:pre-wrap; overflow-wrap:anywhere; color:inherit; }
.stats-note a.stats-original { display:block; }
.stats-note a.stats-original:hover,.stats-note a.stats-original:focus-visible { text-decoration:underline; text-underline-offset:3px; }
.stats-note .status-dots { padding-top:1px; }
#brain-panel { background:radial-gradient(ellipse,#2d3e38f5,#11201df2 83%); }
#brain-canvas { filter:drop-shadow(0 0 3px #c7ffdc57); }
.stage-art.has-motion { background-image:none; }
.stage-art canvas { display:block; width:100%; height:100%; cursor:default; }
@media (prefers-reduced-motion:reduce) {
  .carried-book { animation:none; }
}
#library-progress-remaining { position:absolute; bottom:-29px; white-space:nowrap; font-size:9px; color:#f2f6e4; text-shadow:0 1px 4px #122517; }
.paper-text a.quote-text { color:inherit; }
.paper-text a.quote-text:hover,.paper-text a.quote-text:focus-visible { text-decoration:underline; text-underline-offset:3px; }
.print-cover .print-cover-bleed { display:none; }
.glass {
  border:1.5px solid #f5f8ed56;
  background-image:radial-gradient(ellipse 79% 18% at 25% -4%,#f3fffa66,transparent 72%),linear-gradient(124deg,#42514386,#51615845 45%,#1c2b235c);
  box-shadow:inset 0 1px 2px #fff7,inset 0 -1px 2px #d8edda51,0 4px 9px #121f1866;
}
.shelf-modes button { color:#f7f5e9;background:linear-gradient(#f0f4ed37,#e0eee515);border-color:#fff6;box-shadow:inset 0 1px 1px #fff5; }
.shelf-modes button[aria-pressed=true] { color:#263126; background:linear-gradient(150deg,#f1f1e7,#dadfd5);border-color:#fdfcf4;box-shadow:inset 0 1px 1px #fff,0 2px 5px #2030244d; }
.category-edit { appearance:none; border:0; padding:2px; background:transparent; color:inherit; font:inherit; text-align:inherit; }
.category-edit:hover { text-decoration:underline; text-underline-offset:2px; }
.display-category .category-edit { writing-mode:vertical-rl; font-size:15px; letter-spacing:.1em; line-height:1.15; }
#category-name { padding:8px; border-radius:8px; border:1px solid #cecab6; background:#fff9e8; color:#302922; font:inherit; }
#category-form label { display:block; margin-bottom:6px; }
#category-name { width:100%; }
.domino-book {
  width:min(100%,25px); margin-inline:auto; transform:perspective(400px) rotateY(-7deg) rotateZ(var(--fall,0deg));
  transition:transform .28s cubic-bezier(.31,.77,.34,1.18),opacity .13s;
  box-shadow:inset 1px 0 2px #fff7,inset -2px 0 2px #25180b86,2px 2px 3px #251b14a6;
}
.carried-book { transform:translate(-50%,calc(-100% - 6px)) rotate3d(.22,1,.06,-32deg) rotateZ(12deg) scale(1.32); }
#display-move[aria-pressed=true] { background:#f2e5ccb8; color:#28352a; }
.book-volume { transform:rotateY(var(--book-yaw,0deg)); }
.book-spine,.book-back { overflow:hidden; }
.book-spine img,.book-back img { display:block;width:100%;height:100%;object-fit:cover; }
.book-spine img { object-position:left center; filter:brightness(.80); }
.book-fore-edge { background:repeating-linear-gradient(90deg,#80765f6b 0 .55px,#f7e6c6 .8px 1.45px),#e8d4aa; }
.stats-card .stats-card-content { background:#25302924; }
.stats-notes { background:#4f5951e8; backdrop-filter:blur(6px); }
.stats-note-count { padding:2px 0; display:block; border:0; background:none; }
.stats-note-count::after { content:"▸"; margin-left:.45em; display:inline-block; }
.stats-note-count[aria-expanded=true]::after { transform:rotate(90deg); }
.note-filters .note-filter { color:#f4f2e9; padding:3px 7px; font-size:13px; background:#e9f4eb17; }
.note-filters .note-filter:not(:first-child)::before { content:""; display:inline-block; width:8px;height:8px;border-radius:50%; border:1px solid var(--dot-color); margin-right:4px; }
.note-filters .note-filter[aria-pressed=true] { background:#f5f2e443; box-shadow:inset 0 1px 2px #fff7; }
.stats-original,.paper-text .quote-text { border:0; padding:0; background:transparent; text-align:left; }
#excerpt-text { white-space:pre-wrap; margin:13px 0; padding:10px; background:#fffaf0; border-radius:8px; }
.excerpt-actions { display:flex; gap:9px; margin-top:12px; }
.excerpt-actions .pill { color:#293931; }
#brain-panel { background:radial-gradient(ellipse at 48% 35%,#567283ac,#304353cf 85%); backdrop-filter:blur(11px) saturate(.96); }
#brain-callouts polyline.behind { stroke-dasharray:3 4; opacity:.46; }
#brain-callouts polyline.behind.selected { opacity:.55; }
#brain-callouts circle.behind { visibility:hidden; }
#brain-books { position:relative; z-index:2; }
.print-preview ol { --print-number-inset:.2em; padding:0; counter-reset:printed-note; list-style:none; }
.print-preview li { counter-increment:printed-note; position:relative; padding-inline-start:2.65em; color:#37291f; }
.print-preview li::before { content:counter(printed-note) "."; position:absolute; left:var(--print-number-inset); color:#37291f; font-variant-numeric:tabular-nums; }
.print-preview li strong,.print-preview .printed-original p,.print-preview .printed-thought p { color:#37291f; }

@media screen {
  :root { background:#191919; }
  :focus-visible { outline-color:white; }
  .app {
    --glass-rim:linear-gradient(180deg,#fff9 0%,#fff4 13%,#ffffff13 39%,#ffffff0c 60%,#fff7 88%,#fffe 100%);
    --glass-clear:linear-gradient(180deg,#ffffff0c 0%,#ffffff06 45%,#ffffff21 100%);
    --glass-shadow:inset 0 1px 1px #fff5,inset 0 -2px 4px #fff4,0 3px 9px #19202625;
    color:#fff;
  }
  .app::before { background:#18201a1f; }
  .header { gap:8px; }
  .header-actions { display:flex; gap:6px; align-items:center; }
  .header-actions .pill { padding:7px clamp(8px,1.35cqw,15px); }
  .logo { letter-spacing:clamp(.065em,1cqw,.18em); }
  .glass,.pill,.slide,.archive-strip button,.shelf-modes,.shelf-modes button,.dock a[aria-current],
  .categories button,.library-switch,.reading-stats div,.brain-books button,
  .print-controls select,#notes-search,#shelf-search,#page-jump input,.note-filters .note-filter {
    border:1px solid #ffffff33;
    border-top-color:#fffa;
    border-bottom-color:#fffd;
    color:#fff;
    background:var(--glass-clear),#ffffff09;
    box-shadow:var(--glass-shadow);
    backdrop-filter:blur(4px) saturate(.44) brightness(1.08);
    -webkit-backdrop-filter:blur(4px) saturate(.44) brightness(1.08);
    text-shadow:0 1px 4px #1b261ca3;
  }
  .glass:hover:where(button,a),.slide:hover,.categories button:hover,.brain-books button:hover {
    background:var(--glass-clear),#ffffff20;
  }
  .shelf-modes button[aria-pressed=true],.categories button[aria-pressed=true],.brain-books button[aria-pressed=true],
  .note-filters .note-filter[aria-pressed=true],#display-move[aria-pressed=true],#display-push[aria-pressed=true],#finished[aria-pressed=true] {
    color:#fff;
    border-color:#ffffff8c;
    background:linear-gradient(150deg,#ffffff73,#ffffff20 74%);
    box-shadow:var(--glass-shadow);
    text-shadow:0 1px 4px #0008;
  }
  .shelf-modes { padding:3px; }
  .shelf-modes button { min-height:40px; padding:5px; background:transparent; }
  .shelf-modes button[aria-pressed=true],#display-notes,#display-print {
    color:#262626; text-shadow:none; border-color:white;
    background:linear-gradient(#fffc,#fff9 60%,#ffffffe8);
  }
  .shelf-card,.archive-shelf,.display-row,.brain-panel,.stats-card,.evolution {
    background:var(--glass-clear),#ffffff08;
    border:1px solid #ffffff33;
    border-top-color:#fff9;
    border-bottom-color:#fffd;
    box-shadow:var(--glass-shadow);
    backdrop-filter:blur(6px) saturate(.57) brightness(1.07);
    -webkit-backdrop-filter:blur(6px) saturate(.57) brightness(1.07);
  }
  #brain-panel { background:radial-gradient(ellipse at 50% 48%,#ffffff1f,#ffffff0c 92%); }
  .evolution { background:var(--glass-clear); }
  :where(.pill,.shelf-card,.archive-shelf,.display-row,.dock,.evolution,.stats-card,.print-picker,.shelf-modes) { position:relative; }
  :where(.pill:not(.note-filter),.shelf-card,.archive-shelf,.display-row,.dock,.evolution,.stats-card,.print-picker,.shelf-modes)::before {
    content:""; position:absolute; inset:0; border-radius:inherit; padding:1px; pointer-events:none;
    background:var(--glass-rim);
    mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
    mask-composite:exclude;
  }
  .dock { min-height:59px; padding:3px; }
  .dock a { position:relative; z-index:1; }
  .dock a[aria-current] { padding:2px; background:none; border:1px solid transparent; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; }
  .dock .dock-bubble { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible; }
  .dock .dock-bubble path { stroke-width:1px; stroke-linecap:round; filter:drop-shadow(0 2px 3px #0004); }
  #site-update { flex:none; align-self:center; margin:0 0 8px; padding:5px 11px; }
  #sync-state:empty,#reader-sync-state:empty { display:none; }
  #sync-state { margin:0 0 9px; color:#fff; }
  .stats-card .stats-card-content { background:#ffffff08; }
  .stats-notes { color:#442b1e; background:#f5eee4dc; backdrop-filter:blur(8px) saturate(.75); -webkit-backdrop-filter:blur(8px) saturate(.75); }
  .stats-note .stats-original { display:block; padding-inline-start:9px; border-inline-start:2px solid #fff; }
  .stats-page-heading #notes-search-form { margin-inline-start:auto; width:min(100%,550px); max-width:none; flex:0 1 550px; justify-content:flex-end; }
  #notes-search-form a { padding:8px 13px; }
  .review-item small,.stats-card-content .stats-category,.review-module strong,.subtitle,.dock a,.reader-source,
  #notes-search::placeholder,#shelf-search::placeholder,#library-progress-remaining,#library-progress-text { color:#fff; }
  .review-item p { color:#ffffffe0; }
  .review-item:hover,.review-module:hover { background-color:#ffffff1b; }
  .background-options button[aria-pressed=true] { outline-color:white; }
  .current-step,.paper-heading,.folio-empty { color:inherit; }
  .review { --dot-color:#e76363; }
  .familiar { --dot-color:#65a0df; }
  .folio .review { --dot-color:#ad3838; }
  .folio .familiar { --dot-color:#356eac; }
  .stage[aria-current] .stage-label::before { background:#fff; }
  #spread { --paper:#f8f8f8; border-color:#ffffff72; background:#ffffff52; box-shadow:0 10px 22px #0005; }
  #spread.opening-book { border-color:transparent; background:transparent; box-shadow:none; }
  .opening-book .folio { clip-path:inset(0 0 0 var(--open-left,50%)); }
  .opening-cover { padding:0; display:grid; place-items:center; background:#e7e7e7; color:#181818; text-align:center; }
  .opening-cover img { width:100%; height:100%; object-fit:contain; position:absolute; }
  #folio,.curl-face,.curl-content,.curl-under { color:#282828; }
  #folio .paper-text,.curl-content,.curl-under { color:#442b1e; }
  #folio { background:linear-gradient(90deg,#0000000c,transparent 4% 45%,#00000038 50%,transparent 55% 98%,#0000000f),var(--grain),var(--paper); }
  #folio.single-note { background:var(--grain),var(--paper); }
  .thought-edit { color:#303030; background:#fff8; border-color:#7778; }
  #reader-title { margin-top:12px; }
  #reader .reader-source { margin-top:4px; }
  #background-dialog,#import-dialog,.thought-dialog {
    color:#fff; color-scheme:dark;
    border:1px solid #fff6;
    background:linear-gradient(180deg,#ffffff24,#ffffff10 40%,#ffffff30);
    backdrop-filter:blur(22px) saturate(.7);
    -webkit-backdrop-filter:blur(22px) saturate(.7);
    box-shadow:0 10px 36px #0006;
  }
  #background-dialog::backdrop,#import-dialog::backdrop,.thought-dialog::backdrop { background:#2937314d; }
  .settings-close,.background-options button,.upload-background,.preview-actions button,.preview-actions button:last-child,
  .import-preview .reading-stats div,#import-form input,.import-preview input,#category-name,.thought-dialog textarea,#excerpt-text {
    color:#fff; border:1px solid #fff5; background:linear-gradient(150deg,#ffffff29,#ffffff12); box-shadow:inset 0 .5px #fff5;
  }
  .weread-help,.import-help,#preview-note,#preview-replace,#import-feedback,#background-feedback,.excerpt-actions .pill { color:#fff; }
  .shelf-edge { height:5px; box-shadow:0 2px 4px #0006; }
  .shelf-move { width:36px; height:36px; padding:6px; display:grid; place-items:center; cursor:grab; touch-action:none; user-select:none; }
  .shelf-move svg { width:20px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
  .shelf-move:disabled { opacity:.35; cursor:default; }
  .shelf-lifted { outline:1px solid #fff; box-shadow:0 5px 18px #17241f60; }
  .shelf-lifted .shelf-move { cursor:grabbing; }
  .books { --pitch:calc(var(--card)*.82); gap:0; padding-inline:max(0px,calc((100% - var(--pitch)) / 2)); }
  .book-slot { flex-basis:var(--pitch); }
  .book { width:var(--card); margin-inline-start:calc((var(--pitch) - var(--card))/2); transition:none; }
  .book-volume > .book-spine { background:linear-gradient(90deg,#0009,#ffffff13 44%,#0009),var(--cover); }
  .book-spine img,.book-fore-edge,.book-top-edge { filter:brightness(.57); }
  .book-spine img { object-position:center; }
  .book-spine img.cover-continuation { object-position:left center; }
  .book-spine canvas { display:block; width:100%; height:100%; filter:brightness(.65); }
  .books.range-scrubbing { scroll-snap-type:none; scroll-behavior:auto; }
  .shelf-position { margin:9px 4% 0 9%; gap:8px; }
  .shelf-position output { color:#fff; }
  .shelf-range { position:relative; flex:1; min-width:0; height:30px; display:flex; align-items:end; }
  .shelf-position input {
    --track:linear-gradient(90deg,#ffffffe8 var(--shelf-position,0%),#ffffff50 var(--shelf-position,0%));
    width:100%; height:24px; margin:0; background:transparent; touch-action:none;
  }
  .shelf-position input::-webkit-slider-runnable-track { height:6px; background:var(--track); border-radius:6px; }
  .shelf-position input::-moz-range-track { height:6px; background:var(--track); border-radius:6px; }
  .shelf-position input::-webkit-slider-thumb { width:24px; height:21px; margin-top:-8px; border:0; background:transparent; }
  .shelf-position input::-moz-range-thumb { width:24px; height:21px; border:0; background:transparent; }
  .shelf-walkway { position:absolute; inset:0 12px 14px; pointer-events:none; }
  .shelf-walkway canvas { position:absolute; width:24px; height:29px; bottom:-5px; left:var(--shelf-position,0%); transform:translateX(-50%); }
  .library-progress { right:clamp(0px,.75cqw,8px); }
  #library-progress-text,#library-progress-remaining { right:3px; }
  .library-progress-track { width:4.5px; box-shadow:0 1px 5px #0006; background:linear-gradient(#fff var(--read-position,0%),#fff5 var(--read-position,0%)); }
  .display-toolbar {
    display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:5px 6px;
    padding-inline-end:max(0px,calc(16px - clamp(12px,3cqw,30px)));
    margin-top:8px;
  }
  #display-notes { grid-column:2; justify-self:stretch; text-align:center; }
  .display-actions { grid-column:1; margin-top:0; gap:4px; }
  .display-shelf-actions { display:flex; gap:inherit; white-space:nowrap; }
  #display-print { grid-column:2; justify-self:stretch; text-align:center; }
  .display-toolbar .pill { padding:6px clamp(5px,1.2cqw,12px); font-size:clamp(12px,2cqw,15px); }
  .display-rows { --display-spine-width:20px; --display-reserve:58px; }
  .display-row { grid-template-columns:36px minmax(0,1fr); padding-bottom:8px; min-height:101px; margin-bottom:6px; }
  .display-category .category-edit { font-size:13px; }
  .display-row::after { height:7px; box-shadow:inset 0 1px #ffffff25,0 3px 5px #0006; }
  .display-category { color:#fff; }
  .display-spines { grid-auto-columns:var(--display-spine-width); }
  .display-spines .spine-slot { height:92px; padding:0; }
  .display-spines .spine-slot[data-lean="-1"] { z-index:calc(80 - var(--row-order)); }
  .display-spines .spine-slot[data-lean="1"] { z-index:var(--row-order); }
  .display-spines .spine-slot[data-drop]::before { background:#fff; box-shadow:0 0 6px #fffd; }
  .domino-book {
    width:100%; margin:0; padding:0; border:1px solid #0003; border-radius:3px 3px 2px 2px; overflow:hidden;
    transform:perspective(400px) rotateZ(var(--fall,0deg)); transition:opacity .13s;
    background:linear-gradient(90deg,#0008,transparent 23%,#fff2 52%,#0007),var(--binding);
    box-shadow:inset 1px 0 #fff4,inset -1px 0 #0006;
    -webkit-touch-callout:none; user-select:none;
  }
  .domino-book img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; pointer-events:none; }
  .domino-book canvas { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
  .domino-book img:is(.display-continuation,.cover-continuation) { object-position:left center; filter:brightness(.83); }
  .domino-book:has(.display-continuation)::after {
    content:""; position:absolute; pointer-events:none; inset:0;
    background:linear-gradient(90deg,#130e0845 0%,#fff3 17%,transparent 43%,#0d090c78 100%);
  }
  .choosing-domino .domino-book:hover { outline:1px solid #fff; outline-offset:-1px; }
  .display-book-tooltip {
    z-index:30; position:fixed; transform:translate(-50%,-100%); pointer-events:none;
    width:max-content; max-width:min(300px,calc(100vw - 18px)); padding:5px 10px;
    color:#fff; background:#312a23e8; border:1px solid #fff6; border-radius:9px;
    font-size:14px; line-height:1.35; text-align:center; overflow-wrap:anywhere;
  }
  .display-spines .press-ready { z-index:3; }
  .display-spines .press-ready .domino-book { box-shadow:inset 0 0 0 1px #fff9,0 0 6px #fff7; }
  .carried-book { transform:translate(-50%,calc(-100% - 6px)) rotate3d(.22,1,.06,-32deg) rotateZ(12deg) scale(1.32); }
  .print-toolbar { display:flex; flex-wrap:wrap; gap:7px; align-items:center; }
  .print-toolbar label { flex:none; font-size:14px; }
  .print-select { position:relative; min-width:9rem; flex:1 1 190px; }
  .print-controls select { min-height:43px; border-radius:16px; margin:0; padding:6px 12px; }
  .print-picker { display:flex; align-items:center; border-radius:16px; min-height:43px; }
  .print-picker input { min-width:0; width:100%; padding:9px 7px 9px 12px; border:0; background:none; color:#fff; font:inherit; }
  .print-picker input:focus-visible { outline:none; }
  .print-picker:focus-within { outline:1px solid #fff; outline-offset:2px; }
  .print-picker input::placeholder { color:#fffd; }
  .print-picker input::-webkit-search-cancel-button { display:none; }
  .print-picker button { flex:none; width:34px; height:38px; display:grid; place-items:center; padding:0; background:transparent; border:0; }
  .print-picker svg { width:25px; height:25px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
  #print-book-options {
    z-index:8; position:absolute; top:100%; left:0; right:0; margin:4px 0 0; padding:4px;
    list-style:none; max-height:245px; overflow:auto; border-radius:13px;
    backdrop-filter:blur(15px) brightness(.56); -webkit-backdrop-filter:blur(15px) brightness(.56);
  }
  #print-book-options li { padding:7px 8px; border-radius:7px; overflow-wrap:anywhere; }
  #print-book-options [role=option] { cursor:pointer; }
  #print-book-options [aria-selected=true],#print-book-options [role=option]:hover { background:#ffffff38; }
  #print-book-options small { display:block; color:#fffd; }
  .print-read-cover { display:block; }
  .print-controls select option { background:#242424; color:#fff; }
  .print-preview { background:#fff; }
}
@media screen and (max-width:420px) {
  .print-toolbar label { flex-basis:100%; }
  .print-select { flex-basis:100%; }
}
@media print {
  @page {
    size:A4; margin:9mm 7mm; background:white;
    @top-left { font:8pt/1 system-ui,sans-serif; }
    @top-center { content:"Z-b88k 榨读"; font:600 9pt/1 system-ui,sans-serif; }
    @top-right { content:""; }
    @bottom-left { content:""; }
    @bottom-center { content:""; }
    @bottom-right { content:counter(page) " / " counter(pages); font:8pt/1 system-ui,sans-serif; }
  }
  .print-cover { display:grid; place-content:center; padding:0; min-height:0; height:277mm; }
  .print-cover:has(img) { display:block; position:relative; isolation:isolate; overflow:hidden; }
  .print-cover:has(img) .print-read-cover { display:block; height:100%; }
  .print-cover:has(img) h2,.print-cover:has(img) p { display:none; }
  .print-cover img { display:block; width:100%; height:100%; max-width:none; max-height:none; object-position:50% 0; object-fit:contain; margin:0; }
  .print-cover .print-cover-bleed {
    display:block; position:absolute; inset:-8px; width:calc(100% + 16px); height:calc(100% + 16px);
    object-fit:cover; object-position:center; filter:blur(13mm); opacity:.50; z-index:-1;
  }
}

@media screen {
  html,body { width:100%; height:100%; min-height:0; overflow:hidden; }
  .app {
    position:fixed; inset:0; width:100%; max-width:none; height:100vh; height:100dvh; min-height:0;
    border-radius:0; padding-bottom:76px; padding-bottom:calc(76px + env(safe-area-inset-bottom,0px));
  }
  .header,main { padding-inline:clamp(14px,2.5vw,44px); }
  main { flex:1 1 0px; min-height:0; overflow-x:hidden; overflow-y:auto; overscroll-behavior-y:contain; }
  .glass.dock {
    position:fixed; z-index:20; inset:auto clamp(10px,2.5vw,44px) 9px;
    bottom:max(9px,env(safe-area-inset-bottom,0px)); margin:0; min-height:59px;
  }
  .logo { font-size:clamp(27px,3vw,48px); letter-spacing:.075em; }
  .logo-cn { font-size:.49em; }
  .shelf-card { padding-block:9px 11px; margin-bottom:13px; }
  .shelf-card .books { --card:clamp(70px,9vw,112px); padding-block:24px 17px; }
  .shelf-card .shelf-edge { margin-top:-7px; }
  .empty-shelf-label { padding:14px 17px; color:#fff; }
  .display-category .category-edit { touch-action:pan-y; user-select:none; -webkit-touch-callout:none; }
  .empty-drop-zone { padding:12px; grid-column:1/-1; background:none; color:#fff; border:1px dashed #fff5; border-radius:8px; text-align:left; }
  .empty-drop-zone[data-drop] { outline:1px solid #fff; }
  #shelf-edit-name { display:block; width:100%; margin:5px 0 10px; padding:8px; color:#fff; background:#fff2; border:1px solid #fff7; border-radius:8px; font:inherit; }
  #shelf-edit-message { margin:8px 0; }
  #shelf-edit-dialog .preview-actions { flex-wrap:wrap; }
  .stats-card .stats-cover {
    inset:7px 10px auto auto; width:66px; height:94px; object-fit:contain; object-position:center right;
    mask-image:none; -webkit-mask-image:none; border-radius:3px; opacity:1;
  }
  .stats-card .stats-card-content { min-height:109px; padding-inline-end:85px; }
  .stats-note .stats-original { color:#1a1a1a; }
  #stats-list .stats-note .stats-thought { color:#654536; }
  .stats-collapse { display:block; margin:9px auto 0; color:#37291f; border-color:#67504252; background:#ffffff87; text-shadow:none; }
  .phone-import-steps { padding-inline-start:23px; margin:8px 0; line-height:1.55; }
  #paste-weread-key { justify-self:start; margin-top:7px; padding:6px 12px; }
  #import-dialog .weread-help { margin:14px 0 2px; }
  .lite-rendering :is(.glass,.pill,.reading-stats div,.shelf-modes,.shelf-modes button,.categories button,.archive-strip button,#shelf-search) {
    backdrop-filter:none !important; -webkit-backdrop-filter:none !important;
    box-shadow:none !important;
  }
  .lite-rendering .app { container-type:normal; }
  .lite-rendering .shelf-head h2 { font-size:20px; }
  .lite-rendering :is(.shelf-card,.archive-shelf,.dock,.display-row,.stats-card,.pill,.categories button) {
    background:rgba(34,35,28,.81); border:1px solid #ffffff61;
  }
  .lite-rendering :is(.shelf-card,.archive-shelf,.dock,.display-row,.stats-card,.pill,.shelf-modes,.evolution)::before { display:none; }
  .lite-rendering .books { perspective:none; gap:7px; }
  .lite-rendering .book,.lite-rendering .book-volume,.lite-rendering .book-volume > .cover {
    transform:none; transform-style:flat; filter:none; perspective:none;
  }
  .lite-rendering .book-volume > :not(.cover),.lite-rendering .book-volume::after { display:none; }
}
@media screen and (max-width:600px) {
  .header { padding-block:14px 12px; }
  .logo { font-size:clamp(17px,5.8vw,27px); }
  .shelf-card .books { --card:clamp(62px,20vw,88px); padding-block:19px 15px; }
  .pill,.archive-strip button,.categories button,.shelf-modes button,.dock a { font-size:15px; }
  .subtitle,.reader-source,.stats-note-count,.display-category .category-edit { font-size:15px; }
  .paper-text,.curl-content,.curl-under { font-size:17px; }
  .stats-note,.stats-note .stats-original,#stats-list .stats-note p { font-size:16px; }
  #shelf-search,#notes-search,.print-picker input,#weread-key,#shelf-edit-name { font-size:16px; }
  #library-progress { right:0; }
}
