body{ overflow-x:hidden; background:#fff }
.fb{ --ink:#2B3A35; --muted:#5E6E68; --teal:#2F4F47; --gold:#F7C948; --coral:#E8836B; --line:#DCE4E0; --sand:#EDF3EF;
  --display:"Playfair Display", Georgia, serif; --ui:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; --ease:cubic-bezier(.23,1,.32,1);
  display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:24px; max-width:1360px; margin:0 auto; padding:20px 16px 40px; align-items:start }
.fb *{ box-sizing:border-box }
.stage{ position:sticky; top:72px; display:flex; flex-direction:column; gap:12px; align-items:stretch; min-width:0 }
.stage .ctrl{ align-self:center }
.viewport{ width:100%; max-width:100%; min-width:0; overflow:auto; display:flex; justify-content:safe center; scrollbar-width:thin }
.book{ position:relative; display:flex; justify-content:center; width:100%; height:calc(100vh - 170px); min-height:420px }
.book .pg{ height:100%; aspect-ratio:2/3; max-width:50%; background:#fff; box-shadow:0 2px 16px rgba(43,58,53,.16); overflow:hidden; transition:opacity .2s var(--ease) }
.book .pg img{ width:100%; height:100%; object-fit:contain; display:block; background:#fff }
.book .pg.blank{ background:transparent; box-shadow:none }
.book .pg.l{ border-radius:6px 0 0 6px } .book .pg.r{ border-radius:0 6px 6px 0 } .book .pg.solo{ border-radius:6px }
.book.turn .pg{ opacity:.35 }
.viewport.zoomed{ cursor:grab } .viewport.drag{ cursor:grabbing; user-select:none }
body.zoom .stage{ position:static } body.zoom .viewport{ max-height:none !important }
.book.zoomed{ width:max-content; height:auto !important; margin:0 auto }
.book.zoomed .pg{ max-width:none; height:auto; width:var(--pw) }
.ctrl{ display:flex; flex-wrap:wrap; justify-content:center; gap:10px; align-items:center; font-family:var(--ui); font-size:15px; color:var(--muted) }
.ctrl button{ font:inherit; font-weight:700; color:var(--teal); background:#fff; border:2px solid var(--teal); border-radius:999px; padding:8px 18px; cursor:pointer; transition:transform 160ms var(--ease) }
.ctrl button:active{ transform:scale(.97) }
.ctrl button:disabled{ opacity:.35; cursor:default; transform:none }
.ctrl select{ font:inherit; padding:7px 10px; border-radius:10px; border:1.5px solid var(--line); color:var(--ink); background:#fff; max-width:200px }
.ctrl .sep{ width:1px; height:24px; background:var(--line) }
.ctrl .zl{ min-width:44px; text-align:center; font-variant-numeric:tabular-nums }
body.full .dvtop, body.full .side{ display:none }
body.full .fb{ grid-template-columns:1fr; max-width:none; padding:8px 8px 4px }
body.full .stage{ position:static } body.full .book{ height:calc(100vh - 70px) } body.full .viewport{ max-height:calc(100vh - 66px) }
.side{ display:flex; flex-direction:column; gap:14px; font-family:var(--ui); color:var(--ink) }
.box{ background:#fff; border:2px solid var(--ink); border-radius:16px; padding:18px 18px; display:flex; flex-direction:column; gap:10px }
.box[hidden]{ display:none }
.box h2{ margin:0; font-family:var(--display); font-size:20px; line-height:1.2; color:var(--teal) }
.box p{ margin:0; font-family:"Source Serif 4",Georgia,serif; font-size:16px; line-height:1.5 }
.online{ box-shadow:4px 4px 0 var(--gold) }
.online .chap{ font-size:13px; font-weight:700; color:var(--muted) }
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; font-family:var(--ui); font-size:15px; font-weight:700; text-decoration:none; border-radius:999px; padding:11px 18px; border:2px solid var(--ink); cursor:pointer; transition:transform 160ms var(--ease) }
.btn:active{ transform:scale(.97) }
.btn.gold{ background:var(--gold); color:var(--ink) }
.btn.coral{ background:var(--coral); color:var(--ink) }
.online .none{ font-size:14px; color:var(--muted); font-family:var(--ui) }
.toc{ padding:14px 8px 10px }
.toc h2{ padding:0 10px }
.toc ol{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; max-height:calc(100vh - 430px); min-height:160px; overflow:auto }
.toc a{ display:flex; justify-content:space-between; gap:12px; padding:8px 10px; border-radius:10px; color:var(--ink); text-decoration:none; font-size:14.5px; line-height:1.3 }
.toc a b{ font-weight:400; color:var(--muted); font-variant-numeric:tabular-nums }
.toc a.sub{ padding-left:22px; font-size:13.5px; color:var(--muted) }
.toc a[aria-current="true"]{ background:var(--sand); color:var(--teal); font-weight:700 }
@media (hover:hover) and (pointer:fine){ .toc a:hover{ background:var(--sand) } .ctrl button:not(:disabled):hover{ background:var(--sand) } }
.sheetbar{ display:none }
button:focus-visible, a:focus-visible, select:focus-visible{ outline:3px solid var(--ink); outline-offset:2px }
@media (max-width:900px){
  .fb{ grid-template-columns:1fr; padding:12px 12px 90px }
  .stage{ position:static }
  .book{ height:auto; min-height:0 }
  .book .pg{ height:auto; width:100%; max-width:520px; border-radius:6px }
  .book .pg.second, .book .pg.blank{ display:none }
  .side{ position:fixed; left:0; right:0; bottom:0; z-index:20; background:#fff; border-top:2px solid var(--ink); border-radius:18px 18px 0 0; padding:0 14px 14px; max-height:75vh; overflow:auto; transform:translateY(calc(100% - 58px)); transition:transform .3s var(--ease) }
  .side.open{ transform:none }
  .sheetbar{ display:flex; position:sticky; top:0; z-index:1; background:#fff; justify-content:space-between; align-items:center; gap:10px; padding:14px 2px; font:700 15px var(--ui); color:var(--teal); border:0; width:100%; cursor:pointer }
  .sheetbar .chev{ transition:transform .3s var(--ease) } .side.open .sheetbar .chev{ transform:rotate(180deg) }
  .toc ol{ max-height:none }
  body.full .book{ height:auto }
  body.full .book .pg{ max-width:none; width:min(100%, calc((100vh - 80px) * 2 / 3)); height:auto }
  .ctrl{ gap:6px } .ctrl button{ padding:7px 12px } .ctrl .zl, .ctrl .sep{ display:none }
}
@media (prefers-reduced-motion: reduce){ .side, .book .pg, .btn, .ctrl button{ transition:none } }