:root{
  --paper:#faf9f6;--page:#fff;--ink:#233b30;--text:#353b36;--muted:#7d877f;
  --line:#e8eae3;--green:#347c54;--green-dark:#1e5c41;--soft-green:#eef5eb;
  --warm:#fff7e9;--amber:#e8aa54;--shadow:0 12px 35px rgba(51,64,49,.055);
  color-scheme:light;font-family:Inter,-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  font-size:14px;color:var(--text);background:var(--paper);font-synthesis:none;
}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-height:100vh;background:
  radial-gradient(ellipse 550px 260px at 94% 13%,rgba(228,237,210,.35),transparent 84%),
  linear-gradient(180deg,#fffdf9 0,var(--paper) 460px)}
button,input{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}
a{color:inherit;text-decoration:none}p,h1,h2,h3{margin-top:0}
button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible{
  outline:3px solid #85ba97;outline-offset:2px
}
img{max-width:100%}
.svg-symbols{position:absolute;width:0;height:0;overflow:hidden}
svg{width:20px;height:20px;flex-shrink:0}
.wrap{width:min(100% - 64px,1460px);margin-inline:auto}
.visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;clip-path:inset(50%)}
[hidden]{display:none!important}
.site-header{min-height:84px;display:flex;align-items:center;gap:26px;padding-block:12px}
.brand{display:flex;align-items:center;gap:13px;color:#222b25;min-width:0}
.brand img{width:48px;height:48px}
.brand strong{display:block;white-space:nowrap;font-size:23px;letter-spacing:-.035em}
.brand small{display:block;color:#8a928b;font-size:12px;font-weight:450;letter-spacing:.04em;margin-top:2px}
.surface{background:rgba(255,255,255,.93);border:1px solid #f0efe9;border-radius:24px;box-shadow:var(--shadow);min-width:0}
.discover-card{min-width:0;padding:16px 18px;border:1px solid #e5eddf;border-radius:19px;background:linear-gradient(130deg,#f3f8f0,#fbfaf4);box-shadow:var(--shadow)}
.discover-content{width:100%;min-width:0}
.discover-heading{display:flex;align-items:center;gap:7px;color:#5c906d}
.discover-heading svg{width:16px;height:16px}
.discover-card h2{font-size:14px;line-height:1.4;color:#315b40;margin:0;font-weight:750}
.maker-card{background:linear-gradient(130deg,#fff8eb,#fdfbf6);border-color:#eee4d2}
.maker-card .discover-heading{gap:9px}
.maker-card .discover-heading img{width:32px;height:32px;object-fit:contain}
.maker-card p{font-size:13px;line-height:1.8;margin:12px 0 14px}
.maker-download{width:100%;font-size:13px;padding:10px 12px}
.discover-card p{font-size:11px;color:#758577;line-height:1.7;margin:9px 0 11px}
.discover-contact{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:3px 7px}
.discover-contact span{grid-column:1/-1;font-size:10px;color:#8a998a}
.discover-contact strong{font-size:12px;min-width:0;color:#366c48;user-select:all;overflow-wrap:anywhere}
.discover-contact button{border:0;background:#397e55;color:#fff;border-radius:8px;padding:6px 10px;font-size:11px;font-weight:720;white-space:nowrap}
.discover-contact button:hover{background:#286b44}
.primary-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid #38794f;border-radius:11px;padding:12px 20px;background:linear-gradient(160deg,#438858,#286c43);color:#fff;font-weight:720;white-space:nowrap}
.primary-button:hover{background:linear-gradient(160deg,#387e50,#215b3a)}
.primary-button svg{width:16px;height:16px}
.primary-button.full{width:100%}
.dashboard{display:grid;grid-template-columns:minmax(0,3fr) minmax(250px,1fr);gap:16px;grid-template-areas:"reading aside" "shelf aside";align-items:start}
.bookshelf{grid-area:shelf;padding:24px 25px 26px;min-height:290px}
.bookshelf .section-header{flex-wrap:wrap}
.shelf-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:7px;margin-left:auto}
.shelf-clear{border-color:transparent;background:transparent;color:#89958e;font-weight:600}
.shelf-clear:hover:enabled{background:#f4f3ef;color:#6e776f}
.shelf-clear:disabled{opacity:.38}
.section-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.section-title{display:flex;align-items:center;gap:11px;min-width:0}
.section-title h2{color:#27372d;font-size:19px;letter-spacing:-.02em;margin:0;white-space:nowrap}
.section-mark{width:30px;height:30px;display:grid;place-items:center;border-radius:9px}
.section-mark svg{width:18px;height:18px}
.section-mark.green{background:#e9f4e7;color:#5e986a}
.section-mark.amber{background:#fff0d9;color:#d89d51}
.count{font-size:11px;color:#9ba39a;background:#f3f6f1;border-radius:20px;padding:5px 9px;white-space:nowrap}
.subtle-button{display:inline-flex;align-items:center;gap:6px;background:#fff;border:1px solid #e7e9e3;border-radius:10px;color:#63766a;padding:8px 12px;font-size:12px;font-weight:650}
.shelf-import{cursor:pointer;white-space:nowrap}
.subtle-button svg{width:15px;height:15px}
.subtle-button:hover{background:#f4f9f3;color:#377a53}
.shelf-filters{display:flex;align-items:center;gap:11px;margin:0 0 18px;flex-wrap:wrap}
.shelf-filters button{border:0;padding:7px 12px;background:transparent;border-radius:20px;font-size:12px;color:#929990}
.shelf-filters button.active{background:#edf5e8;color:#3d7952;font-weight:720}
.shelf-search{display:flex;align-items:center;gap:9px;width:min(100%,390px);min-height:41px;border:1px solid #e5eae2;background:#fbfcf9;border-radius:11px;padding:9px 12px;color:#8f9f92;margin-bottom:15px}
.shelf-search:focus-within{border-color:#9ec8a6;box-shadow:0 0 0 2px #80bb9030}
.shelf-search svg{width:16px;height:16px}
.shelf-search input{width:100%;min-width:0;border:0;background:transparent;outline:none;color:#3f5445;font-size:12px}
.book-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(139px,1fr));gap:15px}
.book-card{border:1px solid #edf0eb;border-radius:13px;padding:0 0 10px;background:#fff;overflow:hidden;min-width:0;position:relative;transition:transform .15s,box-shadow .15s;box-shadow:0 3px 13px #303a3010}
.book-card:hover{transform:translateY(-2px);box-shadow:0 8px 20px #303a301a}
.cover-button{display:block;position:relative;width:100%;border:0;background:#f2f0e8;overflow:hidden;padding:0;aspect-ratio:1 / 1.05}
.cover-button img{width:100%;height:100%;object-fit:cover;display:block}
.book-card__title{border:0;background:transparent;padding:9px 11px 0;width:100%;font-size:13px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#303e34;font-weight:700}
.book-card__author{font-size:11px;color:#999f97;padding:4px 11px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.book-card__foot{display:flex;align-items:center;justify-content:space-between;gap:3px;padding:9px 10px 0}
.book-label{font-size:10px;background:#eaf5eb;color:#558665;border-radius:20px;padding:4px 7px;white-space:nowrap}
.book-label.secondary{background:#f5f4f1;color:#8a938b}
.favorite-toggle{width:26px;height:26px;display:grid;place-items:center;border:0;background:transparent;color:#9da7a0;border-radius:8px}
.favorite-toggle svg{width:15px;height:15px}
.favorite-toggle[aria-pressed="true"]{color:#d9746f}
.favorite-toggle[aria-pressed="true"] svg{fill:#f2c3c3}
.empty-books{grid-column:1/-1;min-height:170px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;border:1px dashed #e5ebdf;border-radius:15px;padding:24px;color:#7c8b7b;background:#fcfdf9}
.empty-book-art{display:grid;place-items:center;width:51px;height:51px;margin-bottom:9px;border-radius:16px;color:#619673;background:#eaf5e8}
.empty-book-art svg{width:30px;height:30px}
.empty-books strong{font-size:14px;color:#4a624e}
.empty-books p{font-size:12px;line-height:1.7;margin:8px 0 13px}
.secondary-button{border:1px solid #d6e5d4;background:#f3f9ef;border-radius:10px;color:#397c52;padding:9px 15px;font-size:12px;font-weight:720}
.secondary-button:hover{background:#eaf3e4}
.aside-column{grid-area:aside;display:grid;gap:15px;align-content:start}
.recent-panel{padding:22px 18px}
.recent-panel .section-title h2{font-size:17px}
.recent-list{display:grid;gap:10px}
.recent-item{display:grid;grid-template-columns:45px 1fr;align-items:center;gap:10px;border:0;background:transparent;text-align:left;padding:4px 0;width:100%;color:#36493b}
.recent-item img{width:45px;height:62px;border-radius:7px;object-fit:cover;background:#e5ecdf}
.recent-item strong{font-size:12px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px}
.recent-item small{color:#8d998e;font-size:10px;display:block;margin:5px 0}
.progress{height:4px;background:#e9ece6;border-radius:10px;overflow:hidden;margin-top:6px}
.progress span{display:block;height:100%;background:#7aae83;border-radius:10px}
.subtle-text{font-size:12px;color:#98a399;line-height:1.8}
.backup-note{display:flex;align-items:flex-start;gap:9px;padding:11px 13px;border-radius:12px;background:#f6f7f4;color:#829087;font-size:11px;line-height:1.7}
.backup-note svg{width:15px;height:15px;color:#9daaa0;margin-top:2px}
.backup-note p{margin:0;min-width:0}
.backup-note strong{font-weight:700;color:#4d6d58;white-space:nowrap}
.device-panel{padding:21px 20px}
.device-panel strong{font-size:13px;color:#4e6955}
.device-panel p{font-size:11px;color:#9ba59c;margin:8px 0}
.device-illustration{font-size:24px;letter-spacing:12px;color:#9daf9d;margin-top:14px}
.reading{grid-area:reading;padding:22px 25px}
.reading .section-header{margin-bottom:15px}
.reader-mode-label{font-size:11px;color:#9a9e94}
.reading-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:22px;align-items:stretch}
/* Keep the illustrated file-opening card, not a fake cover/book summary.
   This higher-specificity empty state also wins over the mobile grid rules. */
.reading--empty .reading-summary{display:none}
.reading--empty .reading-layout{grid-template-columns:minmax(0,1fr)}
.reading-summary{display:flex;flex-direction:column;align-items:flex-start;gap:14px}
.summary-cover{width:110px;max-width:100%;height:138px;border-radius:13px;display:grid;place-items:center;background:linear-gradient(145deg,#eaf3e3,#fdf6e8);color:#9cb29b;overflow:hidden;box-shadow:0 4px 12px #313f3113}
.summary-cover img{height:100%;width:100%;object-fit:cover}
.summary-cover>svg{width:53px;height:53px}
.summary-meta strong{font-size:17px;line-height:1.5;color:#2b4232;display:block}
.summary-meta small{display:block;margin:6px 0;color:#89968b;font-size:12px;line-height:1.6}
.tag-group{display:flex;flex-wrap:wrap;gap:5px}
.tag{display:inline-flex;align-items:center;border-radius:30px;background:#edf5ec;color:#5a8c62;padding:5px 9px;font-size:10px;font-weight:650}
.tag:nth-child(even){color:#96865c;background:#f8f3e6}
.rights-note{font-size:11px;color:#a57c50;line-height:1.6;margin:9px 0 0}
.summary-action{display:inline-flex;align-items:center;gap:7px;margin-top:auto;padding:10px 12px;border:1px solid #dbebe0;background:#f0f7f1;border-radius:11px;font-size:12px;font-weight:700;color:#3c7752}
.summary-action svg{width:17px;height:17px}
.reader-preview{position:relative;background:linear-gradient(130deg,#e9e8dd,#fff6e8 50%,#ded9c9);border:1px solid #ebe9dd;border-radius:17px;min-height:315px;padding:12px;display:flex;flex-direction:column;justify-content:center;align-items:center;overflow:hidden}
.reader-empty{text-align:center;padding:16px 22px;max-width:390px}
.reader-empty img{display:block;object-fit:contain;width:185px;height:120px;margin:0 auto 7px}
.reader-empty strong{display:block;color:#507456;font-size:18px}
.page-stage{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;align-items:center;justify-content:center;width:100%;min-height:120px;max-height:550px;overflow:auto}
.page-stage[data-spread="double"]{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
.page-face{position:relative;overflow:hidden;width:min(100%,370px);max-width:100%;margin-inline:auto;box-shadow:0 3px 12px rgba(42,42,30,.12);background:white}
.page-stage[data-spread="double"] .page-face{width:100%;max-width:none}
.page-face img{display:block;width:100%;height:auto}
.hotspots{position:absolute;inset:0;pointer-events:none}
.hotspot{position:absolute;cursor:pointer;pointer-events:auto;background:transparent;border:1px solid transparent;padding:0;border-radius:3px;touch-action:manipulation}
.hotspot:hover,.hotspot:focus-visible{background:rgba(81,181,126,.22);border-color:#479f69}
.hotspot.active{background:rgba(248,202,62,.34);border:2px solid #e4ae40}
.reader-controls{display:flex;align-items:center;justify-content:space-between;gap:9px;width:100%;margin-top:11px;flex-wrap:wrap}
.focus-hide-controls{display:none}
.view-mode-field{display:inline-flex;align-items:center;gap:6px;margin-left:auto;border:1px solid #e7e9e3;border-radius:10px;padding:4px 7px;background:#fff;color:#63766a;white-space:nowrap;font-size:11px;font-weight:650}
.view-mode-field select{border:0;background:transparent;min-height:29px;max-width:172px;color:#3f7653;font-size:12px;font-weight:700;cursor:pointer}
.view-mode-field select:focus-visible{outline:2px solid #85ba97;border-radius:5px}
.page-navigation,.playback-actions{display:flex;align-items:center;gap:7px}
.page-navigation{border-radius:10px;background:#fffcf4ea;border:1px solid #ede7db;padding:3px 4px}
.page-navigation span{font-size:12px;white-space:nowrap;color:#677366;min-width:52px;text-align:center}
.page-navigation button{display:grid;place-items:center;width:30px;height:30px;border:0;background:transparent;border-radius:7px;color:#5f6d5d}
.page-navigation button:hover{background:#eaf2e8}
.page-navigation svg{width:15px;height:15px}
.page-navigation svg.flip{transform:rotate(180deg)}
.playback-actions button{display:flex;align-items:center;gap:5px;border:1px solid #e6e6dc;border-radius:9px;padding:8px 10px;background:#fffefa;color:#34533b;font-size:11px;font-weight:720;white-space:nowrap}
.playback-actions button:nth-child(2){background:#ecf5ea;border-color:#d7e8d5;color:#306a46}
.playback-actions button svg{width:15px;height:15px}
.acceptance{padding:18px 25px;margin-top:16px;background:#fffaf0}
.acceptance h2{font-size:15px;color:#826b39;margin:0 0 7px}
.acceptance p{font-size:12px;color:#9a8b6e;line-height:1.7}
.acceptance-items{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.acceptance-items button,.acceptance-items a{font-size:12px;padding:9px 11px;border-radius:9px;border:1px solid #e6d6af;color:#866b40;background:#fff}
.acceptance-items button{font-weight:720}
.site-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;font-size:11px;color:#a6afa4;padding:25px 5px 35px}
.site-footer b{font-weight:450;margin:0 3px}
.site-footer button{border:0;background:transparent;color:#62936d;text-decoration:underline;cursor:pointer;font-size:11px}
.toast{position:fixed;z-index:100;bottom:24px;left:50%;transform:translateX(-50%);max-width:min(500px,calc(100% - 30px));background:#244d36;color:#fff;border-radius:12px;box-shadow:0 12px 35px #122d202b;padding:13px 20px;text-align:center;font-size:13px;line-height:1.6}
.toast.error{background:#934d47}
.help-dialog{border:1px solid #e4e7df;border-radius:20px;max-width:510px;width:calc(100% - 32px);box-shadow:0 20px 90px #223a272f;padding:22px;background:#fff;color:#405445}
.help-dialog::backdrop{background:#15271c66}
.help-top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:15px}
.help-top h2{font-size:18px;margin:0;color:#254630}
.help-top button{border:0;background:transparent;color:#849388;font-size:20px}
.help-body{max-height:60vh;overflow:auto}
.help-body h3{font-size:13px;color:#356f46;margin:16px 0 5px}
.help-body p{font-size:12px;line-height:1.9;color:#718074}
.help-body code{color:#326b46;background:#eaf2e8;padding:2px 4px;border-radius:4px}
.help-dialog .full{margin-top:18px}
.drop-target::after{content:"松开文件，加入点读书书架";position:fixed;inset:12px;z-index:101;display:grid;place-items:center;background:#edf7ebe8;border:3px dashed #66aa79;border-radius:20px;color:#2c7249;font-size:25px;font-weight:700;pointer-events:none}
@media(max-width:1190px){
  .wrap{width:min(100% - 36px,1460px)}
  .book-grid{gap:9px;grid-template-columns:repeat(auto-fill,minmax(117px,1fr))}
  .dashboard{grid-template-columns:minmax(0,1fr) 260px}.reading-layout{grid-template-columns:165px minmax(0,1fr);gap:12px}
  .bookshelf,.reading{padding:20px}.reading-summary{gap:9px}
}
@media(max-width:850px){
  .wrap{width:min(100% - 26px,720px)}.site-header{min-height:70px}
  .brand strong{font-size:20px}.brand small{font-size:10px}
  .dashboard{grid-template-columns:minmax(0,1fr);grid-template-areas:"reading" "shelf" "aside";gap:13px}
  .aside-column{grid-template-columns:minmax(0,1fr)}
  .aside-column .discover-card{width:min(100%,355px)}
  .device-panel{display:none}
  .reading-layout{grid-template-columns:140px minmax(0,1fr)}
}
@media(max-width:530px){
  .wrap{width:calc(100% - 22px)}
  .site-header{min-height:68px}.brand{gap:7px}.brand img{width:39px;height:39px}
  .brand strong{font-size:19px}.brand small{font-size:10px}
  .discover-card{padding:14px 16px;border-radius:18px}
  .bookshelf,.reading{padding:16px 13px;border-radius:19px}
  .section-header{margin-bottom:13px}
  .section-title{gap:7px}.section-title h2{font-size:17px}
  .section-mark{width:27px;height:27px}
  .shelf-filters{gap:2px;margin-bottom:12px}
  .shelf-search{width:100%;margin-bottom:12px}
  .shelf-filters button{font-size:11px;padding:7px 10px}
  .book-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  .book-card__title{font-size:11px;padding:6px 7px 0}
  .book-card__author{font-size:10px;padding:3px 7px 0}
  .book-card__foot{padding:5px 6px 0}
  .reader-mode-label{display:none}
  .reading-layout{display:flex;flex-direction:column;gap:10px}
  .reading-summary{display:grid;grid-template-columns:51px minmax(0,1fr) auto;align-items:center;gap:9px}
  .summary-cover{width:51px;height:63px;border-radius:8px}
  .summary-cover>svg{width:30px;height:30px}
  .summary-meta strong{font-size:13px}.summary-meta small{font-size:10px;margin:4px 0}
  .summary-meta .tag-group{display:none}
  .rights-note{margin:3px 0}
  .summary-action{padding:7px 8px;font-size:0;gap:0}
  .summary-action svg{width:18px;height:18px}
  .reader-preview{min-height:250px;padding:10px;border-radius:13px}
  .page-stage{max-height:none;overflow:visible}
  .page-stage[data-spread="double"]{grid-template-columns:1fr}
  .page-stage .page-face{width:100%;max-width:390px}
  .page-stage .page-face:last-child:not(:first-child){display:none}
  .reader-controls{gap:7px;align-items:center}
  .playback-actions{flex-wrap:wrap;justify-content:flex-end;gap:4px}
  .reader-controls .view-mode-field{display:none}
  .playback-actions button{font-size:10px;padding:7px}
  .playback-actions button svg{width:13px;height:13px}
  .page-navigation{gap:2px}.page-navigation span{font-size:11px;min-width:40px}
  .page-navigation button{width:26px;height:26px}
  .reader-empty img{width:130px;height:98px}
  .reader-empty strong{font-size:15px}
  .aside-column{grid-template-columns:1fr}
  .device-panel{display:none}
  .recent-panel{padding:15px}
  .site-footer{font-size:10px;padding:20px 4px 28px}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.book-card{transition:none}}

/* Immersive reading is an independent reader-only feature. On desktop we
   additionally request native fullscreen when supported; iPhone Safari can
   still use this CSS focus surface without the Fullscreen API. */
.focus-enter{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  border:1px solid #d5e6d6;background:#ecf6eb;color:#316d46;
  padding:9px 13px;border-radius:12px;font-size:12px;font-weight:750;
  white-space:nowrap;min-height:37px;
}
.focus-enter svg{width:16px;height:16px}
.focus-enter:hover:enabled{background:#e0f0df;border-color:#b7d7c0}
.reader-controls .focus-enter{margin-left:auto}
.focus-topbar{display:none}

body.reader-immersive{overflow:hidden;overscroll-behavior:none}
body.reader-immersive .reading{
  position:fixed;inset:0;z-index:80;width:100vw;max-width:none;
  height:100vh;height:100dvh;margin:0;padding:0;border:0;border-radius:0;
  display:flex;flex-direction:column;overflow:hidden;box-shadow:none;
  background:radial-gradient(ellipse 70% 55% at 50% 50%,#fffdf8,#f0eee5);
  overscroll-behavior:contain;
}
body.reader-immersive .reading .section-header,
body.reader-immersive .reading-summary{display:none}
body.reader-immersive .reading-layout{
  flex:1 1 auto;min-height:0;min-width:0;display:flex;gap:0;
  align-items:stretch;width:100%;height:100%;margin:0;padding:0;
}
body.reader-immersive .reader-preview{
  display:flex;flex:1;min-height:0;min-width:0;width:100%;height:100%;
  margin:0;padding:0;border:0;border-radius:0;overflow:hidden;
  background:transparent;align-items:center;justify-content:center;
}
body.reader-immersive .page-stage,
body.reader-immersive .page-stage[data-spread="double"]{
  display:flex;align-items:center;justify-content:center;
  flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%;
  max-height:none;gap:5px;overflow:hidden;
  padding:calc(36px + env(safe-area-inset-top,0px)) 14px
    calc(22px + env(safe-area-inset-bottom,0px));
  touch-action:pan-y;overscroll-behavior:contain;
}
body.reader-immersive .page-stage .page-face,
body.reader-immersive .page-stage[data-spread="double"] .page-face{
  flex:0 0 auto;max-width:none;max-height:100%;margin:0;
  width:auto;border-radius:3px;
  box-shadow:0 12px 34px rgba(52,54,41,.15),0 0 0 1px rgba(107,111,88,.08);
}
body.reader-immersive .page-stage .page-face img{width:100%;height:auto}
body.reader-immersive .hotspot{touch-action:pan-y pinch-zoom}
body.reader-immersive .focus-topbar{
  position:absolute;z-index:5;top:0;left:0;right:0;
  display:flex;align-items:center;justify-content:space-between;
  min-height:calc(62px + env(safe-area-inset-top,0px));
  padding:calc(11px + env(safe-area-inset-top,0px))
    calc(13px + env(safe-area-inset-right,0px))
    10px calc(13px + env(safe-area-inset-left,0px));
  gap:10px;color:#3c5442;pointer-events:none;
  background:linear-gradient(180deg,rgba(255,253,247,.94),rgba(255,253,247,0));
  transition:background .22s ease;
}
body.reader-immersive .focus-topbar>*{pointer-events:auto}
.focus-topbar button{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:42px;gap:7px;padding:9px 13px;border:1px solid #e1e7d9;
  background:rgba(255,255,255,.88);color:#42614d;border-radius:28px;
  white-space:nowrap;font-size:12px;font-weight:700;
  box-shadow:0 4px 16px #56644c13;backdrop-filter:blur(8px);
}
.focus-topbar button svg{width:18px;height:18px}
.focus-topbar__title{
  min-width:0;flex:1;text-align:center;max-width:50ch;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:13px;font-weight:750;color:#597062;
}
.focus-topbar__hint{font-size:11px;color:#85988a;white-space:nowrap}
.focus-status{
  position:absolute;z-index:9;left:50%;bottom:calc(92px + env(safe-area-inset-bottom,0px));
  transform:translateX(-50%);max-width:calc(100vw - 36px);width:max-content;
  padding:10px 15px;border-radius:13px;
  background:rgba(127,54,42,.94);color:#fff;font-size:12px;
  line-height:1.6;text-align:center;box-shadow:0 8px 25px #2a251a29;
}
body.reader-immersive .reader-controls{
  position:absolute;z-index:6;bottom:calc(12px + env(safe-area-inset-bottom,0px));
  left:50%;transform:translateX(-50%);max-width:calc(100vw - 28px);width:auto;
  margin:0;padding:10px 13px;border:1px solid rgba(222,228,215,.95);
  border-radius:20px;background:rgba(255,255,251,.94);
  box-shadow:0 10px 38px #30372f2a;backdrop-filter:blur(17px);
  display:flex;align-items:center;justify-content:center;gap:9px;
  opacity:1;transition:opacity .25s ease,transform .25s ease;
}
body.reader-immersive .reader-controls .view-mode-field{display:inline-flex;margin-left:0;background:#f7f9f3}
body.reader-immersive .reader-controls .focus-enter{display:none}
body.reader-immersive .page-navigation{background:#f4f6ee;border-color:#edf1e9}
body.reader-immersive .page-navigation button{min-width:40px;min-height:40px}
body.reader-immersive .page-navigation span{font-size:12px;min-width:67px}
body.reader-immersive .playback-actions{flex-wrap:nowrap;gap:5px;justify-content:center}
body.reader-immersive .playback-actions button{
  min-height:42px;padding:10px 12px;font-size:12px;border-radius:12px;
}
body.reader-immersive .focus-hide-controls{
  position:absolute;top:-40px;right:9px;display:inline-flex;
  justify-content:center;align-items:center;gap:4px;min-width:74px;
  min-height:38px;padding:7px 11px 8px;
  border:1px solid rgba(222,228,215,.95);border-radius:13px 13px 0 0;
  border-bottom:0;background:rgba(255,255,251,.94);color:#54725c;
  font-size:12px;font-weight:700;white-space:nowrap;cursor:pointer;
  box-shadow:0 -3px 12px rgba(48,55,47,.07);
}
body.reader-immersive .focus-hide-controls svg{
  width:14px;height:14px;transform:rotate(90deg);
}
body.reader-immersive .focus-hide-controls:hover,
body.reader-immersive .focus-hide-controls:focus-visible{
  color:#2f7650;background:#eef8ec;
}
body.reader-immersive.controls-hidden .reader-controls{
  opacity:0;pointer-events:none;transform:translate(-50%,12px);
}
body.reader-immersive.controls-hidden .focus-topbar{background:transparent}
body.reader-immersive.controls-hidden .focus-topbar__title,
body.reader-immersive.controls-hidden .focus-topbar__hint{
  opacity:0;pointer-events:none;
}
/* The back affordance stays discreetly visible even if a comic page covers
   the whole screen with hotspots. Children cannot be trapped in this mode. */
body.reader-immersive.controls-hidden #focus-exit{opacity:.5}
body.reader-immersive #focus-exit:hover,
body.reader-immersive #focus-exit:focus-visible{opacity:1}
body.reader-immersive .toast{z-index:100}
@media(max-width:660px){
  .focus-enter{font-size:11px;gap:5px;padding:8px 10px;min-height:35px}
  .focus-topbar button{min-width:43px;min-height:43px;padding:8px 11px}
  .focus-topbar__hint{display:none}
  body.reader-immersive .focus-topbar__title{font-size:12px;text-align:right}
  body.reader-immersive .reader-controls{
    max-width:calc(100vw - 16px);width:max-content;padding:8px 9px;gap:5px;
    border-radius:17px;flex-wrap:wrap;
  }
  body.reader-immersive .page-navigation button{min-width:36px;min-height:36px}
  body.reader-immersive .page-navigation span{min-width:50px;font-size:11px}
  body.reader-immersive .playback-actions{gap:4px}
  body.reader-immersive .playback-actions button{
    min-height:39px;font-size:11px;padding:8px 9px;
  }
  body.reader-immersive .playback-actions button svg{width:14px;height:14px}
  body.reader-immersive .page-stage{
    padding:calc(27px + env(safe-area-inset-top,0px)) 9px
      calc(20px + env(safe-area-inset-bottom,0px));
  }
}
@media(max-width:530px){
  .reader-controls{
    display:grid;grid-template-columns:minmax(0,1fr) auto;
    align-items:center;gap:7px;
  }
  .reader-controls .page-navigation{grid-column:1;grid-row:1;justify-self:start}
  .reader-controls .playback-actions{
    grid-column:1/-1;grid-row:2;justify-self:center;
    flex-wrap:nowrap;justify-content:center;
  }
  .reader-controls .focus-enter{
    grid-column:2;grid-row:1;justify-self:end;margin:0;white-space:nowrap;
  }
}
@media(max-width:649px){
  .reader-controls .view-mode-field,
  body.reader-immersive .reader-controls .view-mode-field{display:none}
}
@media(max-width:370px){
  body.reader-immersive .reader-controls{max-width:calc(100vw - 10px)}
  body.reader-immersive .playback-actions button{padding:7px}
  body.reader-immersive .focus-topbar button span{font-size:11px}
}
@media(prefers-reduced-motion:reduce){
  body.reader-immersive .reader-controls,
  body.reader-immersive .focus-topbar{transition:none}
}
