/* ══════════════════════════════════════════════════════════════
   請看下回（to-be-continued）— 書架、書的首頁、目錄、章頁共用樣式
   外觀依 marku/docs/products/novel-app/design/README.md（色彩代號、字級、版面斷點、閱讀工具）。
   頁面由 npm_scripts/FireFrame/zh-TW/apps/to-be-continued/gen-novel-pages.mjs 產生；class 一律 tbc- 前綴。
   主題：data-theme（reader.js 記在本機，light、sepia、green、dark）優先；沒設定過時跟系統的淺深色。
   章頁原樣複製、不經建置：不用 inset、:has()、color-mix() 這類 Chrome 74、Safari 12 不認得的寫法。
   ══════════════════════════════════════════════════════════════ */

:root {
  --tbc-paper: #fcfcfb;
  --tbc-surface: #f3f3f1;
  --tbc-raised: #ffffff;
  --tbc-ink: #1c1d21;
  --tbc-ink-2: #585b63;
  --tbc-ink-3: #6b6e76;
  --tbc-line: #e2e2de;
  --tbc-accent: #b3261e;
  --tbc-accent-ink: #ffffff;
  --tbc-accent-soft: #fbeceb;
  --tbc-gold: #8a6212;
  --tbc-gold-bg: #fbf3df;
  --tbc-gold-line: #dcb65c;
  --tbc-cover-bg: #17191e;
  --tbc-cover-ink: #f4f1ea;
  --tbc-shadow: 0 1px 2px rgb(20 20 25 / .06), 0 8px 24px -12px rgb(20 20 25 / .18);
  --tbc-float-shadow: 0 2px 6px rgba(20, 20, 25, .08), 0 14px 36px -12px rgba(20, 20, 25, .28);
  --tbc-count-fill: rgba(255, 255, 255, .24); /* 讀完自動接下一回：倒數時下一回卡（朱紅底）上由左往右填的那一層 */

  /* 系統字，不載入網路字型：設計的 Noto Serif TC、Noto Sans TC 走 Google Fonts 時 Lighthouse 行動版效能只有 55 分
     （規格「已定的事」：未達 85 分改用系統字）。本機裝了 Noto 的照樣用它，其餘退回各平台的明體與黑體。 */
  --tbc-font-serif: "Noto Serif TC", "Noto Serif CJK TC", "Songti TC", "PMingLiU", serif;
  --tbc-font-ui: "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --tbc-font-read: var(--tbc-font-serif); /* 內文字體：讀者可改黑體（data-font="sans"）*/

  --tbc-s1: 4px; --tbc-s2: 8px; --tbc-s3: 12px; --tbc-s4: 16px; --tbc-s5: 24px; --tbc-s6: 32px; --tbc-s7: 48px; --tbc-s8: 64px;
  --tbc-radius: 10px;

  --tbc-fs-body: 18px;
  --tbc-lh-body: 1.85;
  --tbc-fs-ui: 15px;
  --tbc-fs-small: 13px;
  --tbc-fs-title: 24px;
  --tbc-measure: 40.8em; /* 約 40 個中文字（含 0.02em 字距），跟著字級放大 */
  color-scheme: light;
}

/* 夜間代號：寫兩次，一次給「讀者自己選了夜間」、一次給「沒選過、照系統」 */
:root[data-theme="dark"] {
  --tbc-paper: #121316; --tbc-surface: #1b1c20; --tbc-raised: #202126;
  --tbc-ink: #e4e2dd; --tbc-ink-2: #a4a6ad; --tbc-ink-3: #8a8c93; --tbc-line: #2d2e34;
  --tbc-accent: #f0766b; --tbc-accent-ink: #1a0b09; --tbc-accent-soft: #2e1a19;
  --tbc-gold: #e3b55a; --tbc-gold-bg: #231e13; --tbc-gold-line: #6b5423;
  --tbc-cover-bg: #0b0c0f; --tbc-cover-ink: #efece5;
  --tbc-shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 28px -14px rgb(0 0 0 / .7);
  --tbc-float-shadow: 0 2px 8px rgba(0, 0, 0, .45), 0 16px 40px -12px rgba(0, 0, 0, .8);
  --tbc-count-fill: rgba(26, 11, 9, .2);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --tbc-paper: #121316; --tbc-surface: #1b1c20; --tbc-raised: #202126;
    --tbc-ink: #e4e2dd; --tbc-ink-2: #a4a6ad; --tbc-ink-3: #8a8c93; --tbc-line: #2d2e34;
    --tbc-accent: #f0766b; --tbc-accent-ink: #1a0b09; --tbc-accent-soft: #2e1a19;
    --tbc-gold: #e3b55a; --tbc-gold-bg: #231e13; --tbc-gold-line: #6b5423;
    --tbc-cover-bg: #0b0c0f; --tbc-cover-ink: #efece5;
    --tbc-shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 28px -14px rgb(0 0 0 / .7);
    --tbc-float-shadow: 0 2px 8px rgba(0, 0, 0, .45), 0 16px 40px -12px rgba(0, 0, 0, .8);
    --tbc-count-fill: rgba(26, 11, 9, .2);
    color-scheme: dark;
  }
}
/* 護眼黃、護眼綠：讀者在閱讀設定選了才換，整頁一起換（頁首、卡片、抽屜都跟著）；沒列的代號跟淺色相同 */
:root[data-theme="sepia"] {
  --tbc-paper: #f4ecdb; --tbc-surface: #eae0c8; --tbc-raised: #faf5ea;
  --tbc-ink: #2e261c; --tbc-ink-2: #5a4d3b; --tbc-ink-3: #685a46; --tbc-line: #dccfb2;
  --tbc-accent: #a3281c; --tbc-accent-soft: #f0dccd;
  --tbc-gold: #765410; --tbc-gold-bg: #ede0bd; --tbc-gold-line: #c49d45;
}
:root[data-theme="green"] {
  --tbc-paper: #d9e9d2; --tbc-surface: #cbdec2; --tbc-raised: #e8f1e3;
  --tbc-ink: #1b2619; --tbc-ink-2: #3f503d; --tbc-ink-3: #4b5c49; --tbc-line: #b8cfae;
  --tbc-accent: #9c251b; --tbc-accent-soft: #e6d5c9;
  --tbc-gold: #664c0e; --tbc-gold-bg: #e0dcb8; --tbc-gold-line: #b89a44;
}

/* 字級四級：手機 17、18、20、22；桌機每級大一級。行距三級（緊湊、標準、寬鬆）：手機 1.7、1.85、2.05，桌機 1.75、1.9、2.1 */
:root[data-size="0"] { --tbc-fs-body: 17px; }
:root[data-size="2"] { --tbc-fs-body: 20px; }
:root[data-size="3"] { --tbc-fs-body: 22px; }
:root[data-lh="0"] { --tbc-lh-body: 1.7; }
:root[data-lh="2"] { --tbc-lh-body: 2.05; }
:root[data-font="sans"] { --tbc-font-read: var(--tbc-font-ui); }
@media (min-width: 1024px) {
  :root { --tbc-fs-title: 30px; --tbc-lh-body: 1.9; --tbc-fs-body: 20px; }
  :root[data-size="0"] { --tbc-fs-body: 18px; }
  :root[data-size="2"] { --tbc-fs-body: 22px; }
  :root[data-size="3"] { --tbc-fs-body: 24px; }
  :root[data-lh="0"] { --tbc-lh-body: 1.75; }
  :root[data-lh="2"] { --tbc-lh-body: 2.1; }
}

/* ── 基本 ── */
.tbc-page, .tbc-page *, .tbc-page *::before, .tbc-page *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--tbc-paper); }
.tbc-page {
  margin: 0; background: var(--tbc-paper); color: var(--tbc-ink);
  font: 400 var(--tbc-fs-ui)/1.6 var(--tbc-font-ui);
  overflow-x: hidden;
}
.tbc-page [hidden] { display: none !important; }
/* 連結、按鈕、輸入框與焦點外框只套在小說自己的區塊：右下工具列、Cookie 同意條等火框共用件也掛在 body 底下，
   寫成 .tbc-page 會蓋掉它們的字色、字型與焦點外框。在這些區塊以外加連結或按鈕時，把那一塊補進來。
   不改用 :where() 降權重：小說自己的按鈕現在的樣子靠這個權重，瀏覽器地板（Chrome 74、Safari 12）也不支援。 */
.tbc-appbar a, .tbc-main a, .tbc-reader a, .tbc-sheet a, .tbc-drawer a { color: inherit; }
.tbc-appbar button, .tbc-main button, .tbc-reader button, .tbc-sheet button, .tbc-drawer button,
.tbc-dock button, .tbc-rail button, .tbc-modebar button, .tbc-toast button, button.tbc-follow,
.tbc-appbar input, .tbc-main input, .tbc-reader input, .tbc-sheet input, .tbc-drawer input { font: inherit; color: inherit; }
.tbc-appbar :focus-visible, .tbc-main :focus-visible, .tbc-reader :focus-visible, .tbc-sheet :focus-visible, .tbc-drawer :focus-visible,
.tbc-dock :focus-visible, .tbc-rail :focus-visible, .tbc-toast :focus-visible, .tbc-follow:focus-visible { outline: 2px solid var(--tbc-accent); outline-offset: 2px; border-radius: 6px; }
.tbc-modebar :focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.tbc-sheet:focus, .tbc-drawer:focus { outline: none; } /* 對話框打開時焦點在對話框本身，不畫外框 */
.tbc-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tbc-wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--tbc-s4); }
@media (min-width: 720px) { .tbc-wrap { padding: 0 var(--tbc-s6); } }
.tbc-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tbc-note { color: var(--tbc-ink-2); font-size: 14px; margin-top: var(--tbc-s4); }

/* ── 按鈕 ── */
.tbc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--tbc-s2);
  min-height: 44px; padding: 0 var(--tbc-s5); border-radius: 999px;
  border: 1px solid var(--tbc-line); background: var(--tbc-raised);
  font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.tbc-btn:hover { border-color: var(--tbc-ink-3); }
.tbc-btn--primary { background: var(--tbc-accent); border-color: var(--tbc-accent); color: var(--tbc-accent-ink) !important; font-weight: 700; }
.tbc-btn--primary:hover { filter: brightness(1.06); border-color: var(--tbc-accent); }
.tbc-icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; background: none; border-radius: 999px; cursor: pointer; color: var(--tbc-ink-2); text-decoration: none;
}
.tbc-icon-btn:hover { background: var(--tbc-surface); color: var(--tbc-ink); }
.tbc-icon-btn[aria-pressed="true"] { color: var(--tbc-accent); background: var(--tbc-accent-soft); }
.tbc-when-dark { display: none; }
:root[data-theme="dark"] .tbc-when-dark { display: contents; }
:root[data-theme="dark"] .tbc-when-light { display: none; }

/* ── 頁首（不透明，內文不從底下透出）、頁尾 ── */
.tbc-appbar { position: sticky; top: 0; z-index: 20; background: var(--tbc-paper); border-bottom: 1px solid var(--tbc-line); }
.tbc-appbar__row { display: flex; align-items: center; gap: var(--tbc-s2); height: 56px; }
.tbc-brand { display: inline-flex; align-items: center; gap: var(--tbc-s2); min-height: 44px; text-decoration: none; font-weight: 700; letter-spacing: .08em; font-size: 17px; }
.tbc-brand__mark { width: 10px; height: 10px; background: var(--tbc-accent); border-radius: 2px; align-self: center; }
.tbc-spacer { flex: 1; }
.tbc-back { display: inline-flex; align-items: center; gap: var(--tbc-s1); text-decoration: none; font-weight: 500; min-height: 44px; padding-right: var(--tbc-s2); margin-left: -10px; min-width: 0; }
.tbc-back .tbc-icon { color: var(--tbc-ink-2); }
.tbc-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--tbc-accent); }
.tbc-foot { border-top: 1px solid var(--tbc-line); margin-top: var(--tbc-s8); padding: var(--tbc-s6) 0 var(--tbc-s7); font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); }
.tbc-foot__row { display: flex; flex-wrap: wrap; gap: var(--tbc-s2) var(--tbc-s5); justify-content: space-between; }
.has-reader-tools .tbc-foot { padding-bottom: 120px; } /* 留出底部工具列與控制列的高度，頁尾不被蓋住 */

/* ── 封面：有書封圖時圖當底（圖裡沒有字）、書名與印章用 HTML 疊在左上的暗部；沒有就是純文字書名版 ── */
.tbc-cover {
  position: relative; aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden;
  background: var(--tbc-cover-bg); color: var(--tbc-cover-ink); box-shadow: var(--tbc-shadow);
  display: grid; place-items: center;
}
.tbc-cover::before { content: ""; position: absolute; top: 7%; right: 7%; bottom: 7%; left: 7%; border: 1px solid rgb(244 241 234 / .22); z-index: 2; }
.tbc-cover__title { writing-mode: vertical-rl; white-space: nowrap; font-family: var(--tbc-font-serif); font-weight: 700; letter-spacing: .18em; font-size: var(--tbc-cover-size, 44px); line-height: 1; }
.tbc-cover__kicker { position: absolute; top: 11%; right: 13%; writing-mode: vertical-rl; font-size: calc(var(--tbc-cover-size, 44px) * .26); letter-spacing: .3em; opacity: .7; }
.tbc-cover__seal {
  position: absolute; left: 12%; bottom: 10%; width: calc(var(--tbc-cover-size, 44px) * .62); height: calc(var(--tbc-cover-size, 44px) * .62);
  background: #b3261e; color: #fff; display: grid; place-items: center; border-radius: 3px;
  font-family: var(--tbc-font-serif); font-weight: 700; font-size: calc(var(--tbc-cover-size, 44px) * .2); line-height: 1.05; writing-mode: vertical-rl; letter-spacing: .05em;
}
.tbc-cover--art { display: block; aspect-ratio: auto; } /* 高度由圖的寬高比決定（img 的 width、height 先佔好位置，版面不跳） */
.tbc-cover__img { display: block; width: 100%; height: auto; }
.tbc-cover__shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background:
  linear-gradient(100deg, rgba(12, 13, 16, .62) 0%, rgba(12, 13, 16, .32) 34%, rgba(12, 13, 16, 0) 58%),
  linear-gradient(180deg, rgba(12, 13, 16, .35) 0%, rgba(12, 13, 16, 0) 40%); }
.tbc-cover--art .tbc-cover__title { position: absolute; z-index: 3; left: 15%; top: 10%; font-size: calc(var(--tbc-cover-size, 44px) * .76); text-shadow: 0 2px 14px rgba(0, 0, 0, .55); }
.tbc-cover--art .tbc-cover__kicker { z-index: 3; top: 10.5%; left: calc(15% + var(--tbc-cover-size, 44px) * .92); right: auto; opacity: .86; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.tbc-cover--art .tbc-cover__seal {
  z-index: 3; left: calc(15% + var(--tbc-cover-size, 44px) * .13); bottom: 10%;
  width: calc(var(--tbc-cover-size, 44px) * .5); height: calc(var(--tbc-cover-size, 44px) * .5);
  font-size: calc(var(--tbc-cover-size, 44px) * .17); box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.tbc-cover--art.tbc-cover--small .tbc-cover__kicker, .tbc-cover--art.tbc-cover--small .tbc-cover__seal { display: none; } /* 書架多本時的小縮圖只留書名 */

/* ── 書架、書的首頁 ── */
.tbc-main { padding-top: var(--tbc-s5); }
.tbc-shelf-head { padding: var(--tbc-s5) 0; }
.tbc-shelf-head h1 { margin: 0; font-size: 28px; letter-spacing: .06em; }
.tbc-shelf-head p { margin: var(--tbc-s2) 0 0; color: var(--tbc-ink-2); }
.tbc-feature { display: grid; gap: var(--tbc-s5); align-items: center; grid-template-columns: 132px 1fr; }
.tbc-feature .tbc-cover { --tbc-cover-size: 34px; }
.tbc-feature__title { margin: 0; font-family: var(--tbc-font-serif); font-size: 28px; letter-spacing: .06em; line-height: 1.3; }
.tbc-feature__sub { margin: var(--tbc-s1) 0 0; color: var(--tbc-accent); font-weight: 500; }
.tbc-feature__blurb { grid-column: 1 / -1; margin: 0; font-size: 16px; line-height: 1.8; }
.tbc-feature .tbc-meta, .tbc-feature__actions { grid-column: 1 / -1; }
.tbc-meta { font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); display: flex; flex-wrap: wrap; gap: 0 var(--tbc-s3); }
.tbc-feature__actions { display: flex; flex-wrap: wrap; gap: var(--tbc-s3); }
.tbc-feature__actions .tbc-btn { flex: 1 1 auto; }
.tbc-feature--book { margin-top: var(--tbc-s4); }
@media (min-width: 720px) {
  .tbc-feature { grid-template-columns: 260px 1fr; gap: var(--tbc-s5) var(--tbc-s7); padding: var(--tbc-s5) 0; }
  .tbc-feature .tbc-cover { --tbc-cover-size: 64px; grid-row: span 4; }
  .tbc-feature__title { font-size: 44px; }
  .tbc-feature__sub { font-size: 17px; }
  .tbc-feature__blurb { grid-column: 2; font-size: 18px; max-width: 30em; }
  .tbc-feature .tbc-meta, .tbc-feature__actions { grid-column: 2; }
  .tbc-feature__actions .tbc-btn { flex: 0 0 auto; }
}
.tbc-latest, .tbc-resume {
  display: flex; align-items: center; gap: var(--tbc-s3); margin-top: var(--tbc-s6);
  padding: var(--tbc-s4); border-radius: var(--tbc-radius); text-decoration: none;
}
.tbc-latest { border: 1px solid var(--tbc-line); background: var(--tbc-raised); }
.tbc-latest__t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbc-latest > .tbc-icon, .tbc-resume > .tbc-icon:last-child { color: var(--tbc-ink-3); }
.tbc-resume { margin-top: var(--tbc-s5); gap: var(--tbc-s4); background: var(--tbc-surface); }
.tbc-resume > div { flex: 1; min-width: 0; }
.tbc-resume__k { font-size: 12px; font-weight: 700; color: var(--tbc-ink-2); letter-spacing: .1em; }
.tbc-resume__t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbc-resume__pct { display: flex; align-items: center; margin-top: 6px; font-size: 12px; color: var(--tbc-ink-2); font-variant-numeric: tabular-nums; }
.tbc-resume__bar { flex: 1; max-width: 160px; height: 3px; margin-right: var(--tbc-s2); border-radius: 3px; background: var(--tbc-line); overflow: hidden; }
.tbc-resume__bar > span { display: block; width: 0; height: 100%; background: var(--tbc-accent); }
.tbc-tag { flex: none; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; line-height: 1.6; }
.tbc-tag--new { color: var(--tbc-accent); background: var(--tbc-accent-soft); }
.tbc-tag--here { color: var(--tbc-ink); background: var(--tbc-surface); }
.tbc-tag--now { color: var(--tbc-accent-ink); background: var(--tbc-accent); }
.tbc-grid { display: grid; gap: var(--tbc-s5); grid-template-columns: 1fr; }
@media (min-width: 720px) { .tbc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tbc-grid { grid-template-columns: repeat(3, 1fr); } }
.tbc-card { display: grid; grid-template-columns: 104px 1fr; gap: var(--tbc-s4); text-decoration: none; padding: var(--tbc-s4); border-radius: var(--tbc-radius); border: 1px solid var(--tbc-line); background: var(--tbc-raised); }
.tbc-card:hover { border-color: var(--tbc-ink-3); }
.tbc-card .tbc-cover { --tbc-cover-size: 26px; box-shadow: none; }
.tbc-card__title { margin: 0; font-family: var(--tbc-font-serif); font-size: 21px; letter-spacing: .04em; }
.tbc-card__blurb { margin: var(--tbc-s1) 0 var(--tbc-s2); font-size: 14px; line-height: 1.7; color: var(--tbc-ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.tbc-crumbs { font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); display: flex; flex-wrap: wrap; gap: 0 var(--tbc-s2); }
.tbc-crumbs a { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; text-decoration: none; } /* 觸控目標 44px，負邊距不撐高這一列 */
.tbc-crumbs a:hover { text-decoration: underline; }
.tbc-section-title { display: flex; align-items: baseline; justify-content: space-between; margin: var(--tbc-s7) 0 var(--tbc-s3); }
.tbc-section-title h2 { margin: 0; font-size: 20px; }
.tbc-section-title a { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; font-size: 14px; color: var(--tbc-ink-2); }
.tbc-vol-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--tbc-line); }
.tbc-vol-list a { display: flex; gap: var(--tbc-s3); align-items: center; min-height: 56px; padding: var(--tbc-s3) 0; border-bottom: 1px solid var(--tbc-line); text-decoration: none; }
.tbc-vol-list__n { flex: none; width: 4.5em; color: var(--tbc-ink-2); font-size: 14px; }
.tbc-vol-list__t { flex: 1; min-width: 0; }
.tbc-vol-list__c { flex: none; color: var(--tbc-ink-3); font-size: 13px; }

/* ── 目錄（目錄頁與章頁的目錄抽屜共用）── */
.tbc-toc-head { padding: var(--tbc-s5) 0 var(--tbc-s3); display: grid; gap: var(--tbc-s4); }
.tbc-toc-head h1 { margin: 0; font-size: 26px; }
.tbc-jump { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tbc-s2); margin: 0; }
.tbc-jump label { font-weight: 500; }
.tbc-jump__field { display: inline-flex; align-items: center; gap: var(--tbc-s2); height: 44px; padding: 0 var(--tbc-s3); border: 1px solid var(--tbc-ink-3); border-radius: 8px; background: var(--tbc-raised); }
.tbc-jump input { width: 4.5em; border: 0; background: none; font-size: 17px; text-align: center; }
.tbc-jump input:focus { outline: none; }
.tbc-jump__field:focus-within { border-color: var(--tbc-accent); box-shadow: 0 0 0 1px var(--tbc-accent); }
.tbc-jump__err { flex-basis: 100%; color: var(--tbc-accent); font-size: 14px; margin: 0; }
.tbc-jump.is-error .tbc-jump__field { border-color: var(--tbc-accent); }
.tbc-toc-tools { display: flex; gap: var(--tbc-s4); font-size: 14px; }
.tbc-linkish { background: none; border: 0; padding: 0; color: var(--tbc-ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.tbc-vol { border-top: 1px solid var(--tbc-line); }
.tbc-vol:last-of-type { border-bottom: 1px solid var(--tbc-line); }
.tbc-vol > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto 24px; gap: var(--tbc-s3); align-items: center; padding: var(--tbc-s4) 0; min-height: 64px; }
.tbc-vol > summary::-webkit-details-marker { display: none; }
.tbc-vol__n { display: block; font-size: 13px; font-weight: 700; color: var(--tbc-accent); letter-spacing: .1em; }
.tbc-vol__t { display: block; font-family: var(--tbc-font-serif); font-weight: 600; font-size: 18px; line-height: 1.45; }
.tbc-vol__c { color: var(--tbc-ink-3); font-size: 13px; }
.tbc-vol > summary .tbc-icon { transition: transform .2s ease; color: var(--tbc-ink-2); }
.tbc-vol[open] > summary .tbc-icon { transform: rotate(180deg); }
.tbc-ch-list { list-style: none; margin: 0 0 var(--tbc-s4); padding: 0; display: grid; grid-template-columns: 1fr; column-gap: var(--tbc-s6); }
@media (min-width: 1024px) { .tbc-main .tbc-ch-list { grid-template-columns: 1fr 1fr; } }
.tbc-ch-list a { display: flex; gap: var(--tbc-s3); align-items: baseline; padding: 10px 0; min-height: 44px; text-decoration: none; border-bottom: 1px dashed var(--tbc-line); }
.tbc-ch-list a:hover .tbc-ch-list__t { text-decoration: underline; text-underline-offset: 3px; }
.tbc-ch-list__n { flex: none; width: 4.2em; color: var(--tbc-ink-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.tbc-ch-list__t { flex: 1; min-width: 0; line-height: 1.55; }
.tbc-ch-list a.is-hit { background: var(--tbc-accent-soft); border-radius: 6px; }
.tbc-ch-list a.is-current { margin: 0 calc(var(--tbc-s2) * -1); padding-left: var(--tbc-s2); padding-right: var(--tbc-s2); background: var(--tbc-accent-soft); border-radius: 6px; }

/* ── 章頁 ── */
.tbc-reader { max-width: calc(var(--tbc-measure) + 2 * var(--tbc-s4)); margin: 0 auto; padding: 0 var(--tbc-s4); font-size: var(--tbc-fs-body); }
@media (min-width: 720px) { .tbc-reader { padding: 0 var(--tbc-s6); max-width: calc(var(--tbc-measure) + 2 * var(--tbc-s6)); } }
.tbc-ch-head { padding: var(--tbc-s6) 0 var(--tbc-s4); font-size: var(--tbc-fs-ui); }
.tbc-ch-head__vol { margin: 0; color: var(--tbc-ink-2); font-size: var(--tbc-fs-small); }
.tbc-ch-head__num { margin: var(--tbc-s4) 0 var(--tbc-s1); color: var(--tbc-accent); font-weight: 700; letter-spacing: .12em; }
.tbc-ch-head__title { margin: 0; font-family: var(--tbc-font-serif); font-weight: 700; font-size: var(--tbc-fs-title); line-height: 1.4; letter-spacing: .02em; text-wrap: balance; }
.tbc-pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--tbc-s2); align-items: center; font-size: var(--tbc-fs-ui); padding-bottom: var(--tbc-s5); border-bottom: 1px solid var(--tbc-line); }
.tbc-pager__prev { justify-self: start; }
.tbc-pager__next { justify-self: end; }
.tbc-pager .tbc-btn { padding: 0 var(--tbc-s4); }
.tbc-pager .tbc-btn[aria-disabled="true"] { color: var(--tbc-ink-3); border-style: dashed; background: none; pointer-events: none; }
.tbc-kbd-hint { display: none; font-size: var(--tbc-fs-small); color: var(--tbc-ink-3); text-align: center; margin-top: var(--tbc-s3); }
@media (min-width: 1024px) and (hover: hover) { .tbc-kbd-hint { display: block; } }
.tbc-kbd-hint kbd { font-family: var(--tbc-font-ui); font-size: 12px; border: 1px solid var(--tbc-line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }

.tbc-prose { padding-top: var(--tbc-s6); font-family: var(--tbc-font-read); line-height: var(--tbc-lh-body); letter-spacing: .02em; text-align: justify; overflow-wrap: anywhere; }
.tbc-prose > * { border-radius: 4px; transition: background-color .25s, box-shadow .25s; }
.tbc-prose p { margin: 0 0 1.05em; }
.tbc-prose h2, .tbc-prose h3 { font-size: 1.05em; margin: 1.8em 0 .8em; line-height: 1.5; }
.tbc-prose ul, .tbc-prose ol { margin: 0 0 1.05em; padding-left: 1.5em; }
.tbc-prose li { margin-bottom: .4em; }
.tbc-prose blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1em; border-left: 2px solid var(--tbc-line); color: var(--tbc-ink-2); }
.tbc-prose blockquote p { margin: 0 0 .6em; }
.tbc-prose blockquote p:last-child { margin: 0; }
.tbc-prose hr.tbc-scene-break { border: 0; text-align: center; margin: 2em 0; }
.tbc-prose hr.tbc-scene-break::after { content: "◆　◆　◆"; font-size: 10px; letter-spacing: .4em; color: var(--tbc-ink-3); }
/* 毒舌旁白：黑體、金色淺底、左邊一道金線，上方小標「旁白」（::before，不進內文，聽書也不會唸）。
   旁白與內心話也算內文：字級是內文的 0.95 倍、至少 17px（規格「手機字級至少 17px」，最小一級的內文就是 17px） */
.tbc-prose .tbc-narrator {
  position: relative; margin: 1.6em 0; padding: 1.9em 1.1em .9em 1.1em;
  font-family: var(--tbc-font-ui); font-size: max(17px, .95em); line-height: 1.8; letter-spacing: .01em; text-align: left;
  color: var(--tbc-ink); background: var(--tbc-gold-bg); border-left: 3px solid var(--tbc-gold-line); border-radius: 0 8px 8px 0;
}
.tbc-prose .tbc-narrator::before { content: "旁白"; position: absolute; top: .7em; left: 1.2em; font-size: 12px; font-weight: 700; letter-spacing: .3em; color: var(--tbc-gold); }
/* 莫凡內心話：括號裡是「」的那種 */
.tbc-prose .tbc-inner-voice { margin: 1.4em 0; padding-left: 1em; border-left: 2px dotted var(--tbc-accent); color: var(--tbc-ink-2); font-family: var(--tbc-font-ui); font-size: max(17px, .95em); text-align: left; }
/* 聽書正在唸的段落：淡朱紅底往外擴一點，不推動版面 */
.tbc-prose .is-speaking { background: var(--tbc-accent-soft); box-shadow: 0 0 0 .35em var(--tbc-accent-soft); }
.tbc-prose .tbc-narrator.is-speaking { background: var(--tbc-gold-bg); box-shadow: 0 0 0 2px var(--tbc-accent); }
.tbc-prose .tbc-inner-voice.is-speaking { box-shadow: 0 0 0 2px var(--tbc-accent); }
.tbc-ch-end { text-align: center; color: var(--tbc-ink-3); font-size: var(--tbc-fs-small); letter-spacing: .12em; margin: var(--tbc-s6) 0 var(--tbc-s5); }

.tbc-end-tools { display: grid; grid-gap: var(--tbc-s2); }
.tbc-next-nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--tbc-s3); font-size: var(--tbc-fs-ui); }
@media (min-width: 600px) { .tbc-next-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tbc-nav-card { display: flex; align-items: center; gap: var(--tbc-s3); min-height: 76px; padding: var(--tbc-s3) var(--tbc-s4); border: 1px solid var(--tbc-line); border-radius: var(--tbc-radius); background: var(--tbc-raised); text-decoration: none; }
.tbc-nav-card:hover { border-color: var(--tbc-ink-3); }
.tbc-nav-card > div { flex: 1; min-width: 0; }
.tbc-nav-card__k { display: block; font-size: 12px; font-weight: 700; color: var(--tbc-ink-2); letter-spacing: .1em; }
.tbc-nav-card__t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tbc-nav-card--next { position: relative; overflow: hidden; text-align: right; background: var(--tbc-accent); border-color: var(--tbc-accent); color: var(--tbc-accent-ink) !important; }
.tbc-nav-card--next .tbc-nav-card__k { color: inherit; opacity: .85; }
/* 讀完自動接下一回：倒數時下一回卡由左往右填滿（每秒一格、1 秒線性補間），填滿就換頁 */
.tbc-nav-card--next::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: var(--tbc-count-fill); transform-origin: left center; transform: scaleX(var(--tbc-count, 0)); pointer-events: none; }
.tbc-nav-card--next.is-counting::before { transition: transform 1s linear; }
.tbc-nav-card--next > * { position: relative; }
.tbc-count-cancel { justify-self: end; }
.tbc-nav-card--empty { visibility: hidden; }
.tbc-wip { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 76px; padding: var(--tbc-s3) var(--tbc-s4); border: 1px dashed var(--tbc-ink-3); border-radius: var(--tbc-radius); text-align: right; }
.tbc-wip__k { font-size: 12px; font-weight: 700; color: var(--tbc-ink-2); letter-spacing: .1em; }
.tbc-wip__t { font-weight: 700; }
@media (max-width: 599px) {
  .tbc-nav-card--next, .tbc-wip { order: -1; }
  .tbc-wip { text-align: left; }
  .tbc-nav-card--empty { display: none; }
  .tbc-count-cancel { justify-self: start; }
}
.tbc-toc-link { text-align: center; margin: var(--tbc-s3) 0 0; font-size: var(--tbc-fs-ui); }
.tbc-toc-link a { display: inline-flex; align-items: center; gap: var(--tbc-s2); min-height: 44px; color: var(--tbc-ink-2); }

/* 支持條（章尾，一直顯示、不浮出） */
.tbc-support { margin-top: var(--tbc-s7); padding: var(--tbc-s5); border-radius: 14px; background: var(--tbc-surface); font-size: var(--tbc-fs-ui); display: grid; gap: var(--tbc-s4); align-items: center; }
.tbc-support h2 { margin: 0 0 var(--tbc-s1); font-size: 18px; }
.tbc-support p { margin: 0; line-height: 1.7; }
.tbc-support .tbc-btn { justify-self: start; }
@media (min-width: 720px) { .tbc-support { grid-template-columns: 1fr auto; gap: var(--tbc-s6); padding: var(--tbc-s5) var(--tbc-s6); } }

/* ── 閱讀工具：手機與平板是左下的浮動工具列（右邊讓出火框右下浮動鈕的 86px），桌機是內文右側的直列 ──
   底部浮著的東西都疊上 --ff-admob-banner-height（原生 App 的廣告條）與 --tbc-lift（首訪 Cookie 同意條在時往上讓）。 */
.tbc-dock {
  position: fixed; z-index: 30; left: 12px; right: 86px; max-width: 420px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--ff-admob-banner-height, 0px) + var(--tbc-lift, 0px));
  padding: 2px 6px 6px; overflow: hidden;
  background: var(--tbc-raised); color: var(--tbc-ink); border: 1px solid var(--tbc-line); border-radius: 16px; box-shadow: var(--tbc-float-shadow);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .22s, visibility 0s;
}
.tbc-dock.is-hidden {
  transform: translateY(calc(100% + 24px)); opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .22s, visibility 0s .22s;
}
.tbc-dock__line { position: absolute; left: 0; top: 0; height: 3px; width: 0; background: var(--tbc-accent); }
.tbc-dock__progress { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; min-height: 44px; }
.tbc-dock__progress .tbc-icon-btn { color: var(--tbc-ink-2); }
.tbc-dock__txt { text-align: center; font-size: 13px; color: var(--tbc-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbc-dock__txt b { color: var(--tbc-ink); font-weight: 700; }
.tbc-dock__tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-gap: 4px; }
.tbc-tool {
  display: grid; justify-items: center; align-content: center; grid-gap: 2px; min-height: 52px; padding: 4px 2px;
  border: 0; border-radius: 10px; background: var(--tbc-surface); color: var(--tbc-ink); cursor: pointer; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.tbc-tool:hover { color: var(--tbc-accent); }
.tbc-tool[aria-pressed="true"] { background: var(--tbc-accent-soft); color: var(--tbc-accent); }
.tbc-rail { display: none; }
@media (min-width: 1024px) {
  .tbc-dock { display: none; }
  .tbc-rail {
    display: grid; grid-gap: 2px; justify-items: center; position: fixed; z-index: 30; top: 50%; right: 16px; transform: translateY(-50%);
    padding: 6px; border: 1px solid var(--tbc-line); border-radius: 14px; background: var(--tbc-raised); box-shadow: var(--tbc-shadow);
    transition: opacity .22s, visibility 0s;
  }
  /* 內文欄右側 20px；畫面不夠寬時貼齊右邊 16px（不認得 min() 的瀏覽器就一直貼右邊） */
  @supports (left: min(1px, 2px)) {
    .tbc-rail { right: auto; left: min(calc(50% + (var(--tbc-fs-body) * 40.8 + 64px) / 2 + 20px), calc(100% - 74px)); }
  }
  .tbc-rail hr { width: 24px; border: 0; border-top: 1px solid var(--tbc-line); margin: 6px 0; }
  .tbc-rail__pct { font-size: 12px; font-weight: 700; color: var(--tbc-ink-2); font-variant-numeric: tabular-nums; padding: 2px 0; }
  .tbc-rail .tbc-icon-btn { position: relative; }
  .tbc-rail .tbc-icon-btn[data-tip]:hover::after, .tbc-rail .tbc-icon-btn[data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    white-space: nowrap; font-size: 13px; line-height: 1.5; padding: 4px 10px; border-radius: 6px; background: var(--tbc-ink); color: var(--tbc-paper); pointer-events: none;
  }
}

/* 自動捲動與聽書的控制列：同一個位置、同一種長相（深底），一次只會出現一個；在夜間會變成淺底深字，跟內文有反差 */
.tbc-modebar {
  position: fixed; z-index: 31; left: 12px; right: 86px; max-width: 420px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--ff-admob-banner-height, 0px) + var(--tbc-lift, 0px));
  display: grid; grid-gap: 2px; padding: 8px 6px 6px;
  background: var(--tbc-ink); color: var(--tbc-paper); border-radius: 16px; box-shadow: var(--tbc-float-shadow); font-size: 12px;
}
@media (min-width: 1024px) { .tbc-modebar { left: 50%; right: auto; width: 440px; max-width: none; transform: translateX(-50%); } }
.tbc-modebar__label { display: flex; justify-content: space-between; padding: 0 6px 2px; line-height: 1.5; }
.tbc-modebar__k { font-weight: 700; }
.tbc-modebar__v { margin-left: 8px; opacity: .78; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbc-modebar__row { display: flex; align-items: center; }
.tbc-modebar__row > * + * { margin-left: 4px; }
.tbc-mb-gap { flex: 1; }
.tbc-mb-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: none; color: inherit; cursor: pointer; flex: none; }
.tbc-mb-btn:hover { background: rgba(127, 127, 127, .22); }
.tbc-mb-main { border-radius: 999px; background: var(--tbc-accent); color: var(--tbc-accent-ink); }
.tbc-mb-main:hover { background: var(--tbc-accent); filter: brightness(1.08); }
.tbc-mb-main .tbc-icon { fill: currentColor; }
.tbc-mb-main .tbc-ic-play, .tbc-mb-main.is-paused .tbc-ic-pause { display: none; }
.tbc-mb-main.is-paused .tbc-ic-play { display: block; }
.tbc-mb-speed-k { opacity: .78; }
.tbc-mb-speed { display: inline-flex; align-items: center; flex: none; border-radius: 10px; background: rgba(127, 127, 127, .2); }
.tbc-mb-speed output { min-width: 18px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.tbc-mb-rate { flex: none; min-width: 56px; height: 44px; padding: 0 8px; border: 1px solid rgba(127, 127, 127, .45); border-radius: 999px; background: none; color: inherit; font-size: 13px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.tbc-follow {
  position: fixed; z-index: 31; left: 12px;
  bottom: calc(104px + env(safe-area-inset-bottom, 0px) + var(--ff-admob-banner-height, 0px) + var(--tbc-lift, 0px));
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px 0 10px; border-radius: 999px;
  border: 1px solid var(--tbc-line); background: var(--tbc-raised); color: var(--tbc-ink); box-shadow: var(--tbc-shadow); cursor: pointer; font-size: 14px; font-weight: 500;
}
.tbc-follow .tbc-icon { margin-right: 6px; }
@media (min-width: 1024px) { .tbc-follow { left: 50%; transform: translateX(-50%); } }

/* 提示（回到上次讀到的地方、已複製連結、沒有中文語音、全螢幕閱讀）：在頁首下方置中，不跟底部的工具列與火框浮動鈕搶位置 */
.tbc-toast {
  position: fixed; z-index: 45; left: 50%; top: calc(68px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -8px); opacity: 0;
  display: flex; align-items: center; width: max-content; max-width: calc(100% - 24px);
  padding: 8px 14px; border-radius: 12px; background: var(--tbc-ink); color: var(--tbc-paper); box-shadow: var(--tbc-float-shadow); font-size: 14px; line-height: 1.5;
  transition: opacity .2s, transform .2s;
}
.tbc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.tbc-toast > * + * { margin-left: 10px; }
.tbc-toast .tbc-icon { opacity: .8; }
.tbc-toast button { flex: none; min-width: 44px; min-height: 44px; margin-right: -6px; padding: 0 12px; border: 0; border-radius: 8px; background: rgba(127, 127, 127, .28); color: inherit; font-weight: 700; cursor: pointer; }

/* 全螢幕閱讀：點一下內文收起頁首與工具列（直列），頂端留一條細進度線；再點一下叫回來 */
.tbc-page--chapter .tbc-appbar { transition: transform .22s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.is-immersive .tbc-page--chapter .tbc-appbar { transform: translateY(-100%); visibility: hidden; transition: transform .22s cubic-bezier(.2, .8, .2, 1), visibility 0s .22s; }
.is-immersive .tbc-rail { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .22s, visibility 0s .22s; }
.tbc-topline { position: fixed; z-index: 21; left: 0; top: env(safe-area-inset-top, 0px); height: 2px; width: 0; background: var(--tbc-accent); pointer-events: none; }
.is-instant .tbc-page *, .is-instant .tbc-page *::before, .is-instant .tbc-page *::after { transition: none !important; }

/* ── 閱讀設定與目錄抽屜：共用一層遮罩 ── */
.tbc-sheet-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 40; background: rgb(0 0 0 / .32); opacity: 0; transition: opacity .2s; }
.is-sheet-open .tbc-sheet-backdrop, .is-drawer-open .tbc-sheet-backdrop { opacity: 1; }
/* 閱讀設定：手機底部滑出、桌機 Aa 鈕下方小面板 */
.tbc-sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto;
  padding: var(--tbc-s4) var(--tbc-s4) calc(var(--tbc-s5) + env(safe-area-inset-bottom, 0px));
  background: var(--tbc-raised); color: var(--tbc-ink); border-radius: 16px 16px 0 0; box-shadow: var(--tbc-shadow);
  transform: translateY(105%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); font-size: var(--tbc-fs-ui);
}
.is-sheet-open .tbc-sheet { transform: none; }
@media (min-width: 720px) {
  .tbc-sheet { left: auto; right: max(16px, calc((100vw - 1080px) / 2 + 16px)); top: 64px; bottom: auto; width: 360px; max-height: calc(100vh - 80px); border-radius: 12px; border: 1px solid var(--tbc-line); transform: translateY(-8px); opacity: 0; transition: transform .18s, opacity .18s; }
  .is-sheet-open .tbc-sheet { opacity: 1; transform: none; }
  .is-sheet-open .tbc-sheet-backdrop { background: transparent; }
}
.tbc-sheet h2 { margin: 0 0 var(--tbc-s2); font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.tbc-sheet__row { display: flex; align-items: center; justify-content: space-between; gap: var(--tbc-s3); padding: 10px 0; border-top: 1px solid var(--tbc-line); }
.tbc-sheet__row > span:first-child { flex: 0 1 auto; min-width: 0; }
.tbc-sheet__row > :not(:first-child) { flex: none; }
.tbc-sheet__hint { display: block; font-size: 12px; color: var(--tbc-ink-2); }
.tbc-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--tbc-surface); border-radius: 10px; padding: 3px; }
.tbc-seg button { min-width: 48px; height: 44px; padding: 0 6px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-family: var(--tbc-font-serif); color: var(--tbc-ink-2); white-space: nowrap; }
.tbc-seg button[data-set="size"][data-v="0"] { font-size: 14px; }
.tbc-seg button[data-set="size"][data-v="1"] { font-size: 16px; }
.tbc-seg button[data-set="size"][data-v="2"] { font-size: 18px; }
.tbc-seg button[data-set="size"][data-v="3"] { font-size: 20px; }
.tbc-seg--ui button, .tbc-seg button.tbc-seg__sans { font-family: var(--tbc-font-ui); font-size: 14px; }
.tbc-seg button.tbc-seg__serif { font-family: var(--tbc-font-serif); font-size: 16px; }
.tbc-seg button.tbc-seg__sans { font-size: 15px; }
.tbc-seg button[aria-pressed="true"] { background: var(--tbc-raised); color: var(--tbc-ink); box-shadow: 0 1px 3px rgb(0 0 0 / .15); font-weight: 700; }
.tbc-lh { display: inline-grid; width: 18px; margin-right: 4px; vertical-align: middle; }
.tbc-lh i { display: block; height: 2px; border-radius: 2px; background: currentColor; }
.tbc-lh--0 { grid-gap: 2px; }
.tbc-lh--1 { grid-gap: 4px; }
.tbc-lh--2 { grid-gap: 6px; }
.tbc-swatches { display: grid; grid-template-columns: repeat(4, 1fr); grid-gap: 4px; width: 232px; }
.tbc-swatches button { display: grid; justify-items: center; grid-gap: 4px; min-height: 64px; padding: 4px 0; border: 0; border-radius: 8px; background: none; cursor: pointer; font-size: 12px; color: var(--tbc-ink-2); }
.tbc-swatches button[aria-checked="true"] { color: var(--tbc-ink); font-weight: 700; }
.tbc-sw { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(127, 127, 127, .35); font-family: var(--tbc-font-serif); font-size: 13px; }
.tbc-swatches button[aria-checked="true"] .tbc-sw { box-shadow: 0 0 0 2px var(--tbc-raised), 0 0 0 4px var(--tbc-accent); }
.tbc-sw--light { background: #fcfcfb; color: #1c1d21; }
.tbc-sw--sepia { background: #f4ecdb; color: #2e261c; }
.tbc-sw--green { background: #d9e9d2; color: #1b2619; }
.tbc-sw--dark { background: #121316; color: #e4e2dd; }
/* 開關：按鈕本身 56×44（觸控目標），軌道與圓鈕畫在 ::before、::after */
.tbc-switch { position: relative; width: 56px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; flex: none; }
.tbc-switch::before { content: ""; position: absolute; left: 2px; top: 6px; width: 52px; height: 32px; border-radius: 999px; background: var(--tbc-line); transition: background-color .18s; }
.tbc-switch::after { content: ""; position: absolute; left: 5px; top: 9px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .18s; }
.tbc-switch[aria-checked="true"]::before { background: var(--tbc-accent); }
.tbc-switch[aria-checked="true"]::after { transform: translateX(20px); }
.tbc-sheet__preview { margin: var(--tbc-s2) 0 0; padding: var(--tbc-s3); border-radius: 8px; background: var(--tbc-paper); font-family: var(--tbc-font-read); font-size: var(--tbc-fs-body); line-height: var(--tbc-lh-body); color: var(--tbc-ink); }

/* 章頁的目錄抽屜：手機從底部滑出、88% 高、圓角在上；桌機從右邊滑出、420px 寬、整個高度 */
.tbc-drawer {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; height: 88vh; display: flex; flex-direction: column;
  background: var(--tbc-raised); color: var(--tbc-ink); border-radius: 16px 16px 0 0; box-shadow: var(--tbc-shadow); font-size: var(--tbc-fs-ui);
  transform: translateY(105%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.is-drawer-open .tbc-drawer { transform: none; }
@media (min-width: 1024px) {
  .tbc-drawer { left: auto; top: 0; height: auto; width: 420px; border-radius: 0; border-left: 1px solid var(--tbc-line); transform: translateX(105%); }
}
.tbc-drawer__head { display: flex; align-items: center; gap: var(--tbc-s3); padding: var(--tbc-s4) var(--tbc-s3) var(--tbc-s3) var(--tbc-s4); border-bottom: 1px solid var(--tbc-line); }
.tbc-drawer__head > div { flex: 1; min-width: 0; }
.tbc-drawer__head h2 { margin: 0; font-size: 18px; }
.tbc-drawer__head p { margin: 2px 0 0; font-size: var(--tbc-fs-small); color: var(--tbc-ink-2); }
.tbc-drawer .tbc-jump { padding: var(--tbc-s3) var(--tbc-s4); border-bottom: 1px solid var(--tbc-line); }
.tbc-drawer__body { flex: 1; overflow-y: auto; padding: 0 var(--tbc-s4); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.tbc-drawer__body .tbc-vol:first-child { border-top: 0; }
.tbc-drawer__foot { padding: var(--tbc-s3) var(--tbc-s4) calc(var(--tbc-s3) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--tbc-line); text-align: center; }
.tbc-drawer__foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--tbc-ink-2); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .tbc-page *, .tbc-page *::before, .tbc-page *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
