/*
Theme Name: sd-b2 苔綠書店
Theme URI: https://example.invalid/
Author: SD Network
Description: 苔綠書店風短劇主題：米黃紙張質感、三欄書脊式卡片、書籤標籤分類，單一苔綠強調色。
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: sd-b2
*/

/* ==========================================================================
   共用基礎層（結構 / 行為）— 顏色與造型一律走變數，各主題在下方覆寫
   需要的變數：--bg --surface --ink --muted --line --accent --accent-2 --accent-soft
              --on-accent --radius --wrap --gut --font --scrim
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.7 var(--font); overflow-x: clip;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.sd-no-scroll { overflow: hidden; }
img, video, iframe, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.b2-wrap { width: 100%; max-width: var(--wrap, 1240px); margin: 0 auto; padding: 0 var(--gut, 20px); }
.sr-only, .screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -80px; z-index: 999; padding: 12px 18px; background: var(--ink); color: var(--bg); }
.skip:focus { top: 12px; }

/* ---------- 搜尋表單 ---------- */
.b2-sf { display: flex; gap: 8px; align-items: stretch; }
.b2-sf input[type="search"] {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius);
  -webkit-appearance: none; appearance: none;
}
.b2-sf input[type="search"]::placeholder { color: var(--muted); opacity: .8; }
.b2-sf button {
  flex: 0 0 auto; min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent); font-weight: 700;
}

/* ---------- 搜尋面板 / 遮罩 / 手機抽屜（app.js 以 id 綁定） ---------- */
.b2-search {
  position: fixed; inset: 0; z-index: 200; display: grid; align-items: start; justify-items: center;
  padding: 12vh 16px 16px; background: var(--scrim, rgba(0, 0, 0, .55));
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.b2-search.is-open { opacity: 1; visibility: visible; }
.b2-search__box {
  width: min(640px, 100%); max-height: 80vh; overflow: auto; padding: 20px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
}
.b2-search__hint { margin: 18px 0 8px; font-size: 13px; color: var(--muted); }
.b2-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.b2-tags a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px;
}
.b2-tags a:hover { border-color: var(--accent); color: var(--accent); }

.b2-overlay { position: fixed; inset: 0; z-index: 150; background: var(--scrim, rgba(0, 0, 0, .55)); opacity: 0; transition: opacity .25s; }
.b2-overlay.is-open { opacity: 1; }
.b2-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 160; width: min(320px, 86vw);
  padding: 68px 22px 28px; overflow: auto; background: var(--surface); color: var(--ink);
  border-left: 1px solid var(--line);
  transform: translateX(100%); visibility: hidden; transition: transform .25s, visibility .25s;
}
.b2-drawer.is-open { transform: none; visibility: visible; }
.b2-drawer__close {
  position: absolute; top: 10px; right: 10px; width: 48px; height: 48px;
  display: grid; place-items: center; border: 0; background: transparent; font-size: 20px;
}
.b2-drawer__list { list-style: none; margin: 0; padding: 0; }
.b2-drawer__list a { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line); font-size: 17px; }
.b2-drawer__list [aria-current="page"], .b2-drawer__list .current-menu-item > a { color: var(--accent); font-weight: 700; }

/* ---------- 麵包屑 ---------- */
.sd-crumbs { padding: 14px 0 4px; font-size: 13px; color: var(--muted); }
.sd-crumbs__list { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0; padding: 0; }
.sd-crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.sd-crumbs li + li::before { content: "/"; margin: 0 8px; opacity: .5; }
.sd-crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.sd-crumbs a:hover { color: var(--accent); }
.sd-crumbs [aria-current="page"] { color: var(--ink); max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 分頁 ---------- */
.sd-pagination { margin: 36px 0 8px; }
.sd-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sd-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600;
}
.sd-pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.sd-pagination .current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sd-pagination .dots { background: none; border-color: transparent; }

/* ---------- 播放器 / 提示框 ---------- */
.sd-player { background: #000; overflow: hidden; }
.sd-player video { display: block; width: 100%; aspect-ratio: 9 / 16; max-height: 78vh; object-fit: contain; background: #000; }
.sd-embed { aspect-ratio: 9 / 16; max-height: 78vh; background: #000; }
.sd-embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.sd-player__fallback { padding: 18px; color: #e5e7eb; font-size: 14px; }
.sd-player__fallback a { text-decoration: underline; }
.sd-callout { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 20px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.sd-callout__body { flex: 1 1 200px; }
.sd-callout__title { font-weight: 800; margin-bottom: 4px; }
.sd-callout__desc { color: var(--muted); font-size: 14px; }
.sd-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  border: 0; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); font-weight: 700;
}

/* ---------- 版面骨架（詳情 / 分集）：左播放器、右選集；≤900px 上下堆疊 ---------- */
.b2-dgrid { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 32px; align-items: start; }
.b2-dgrid__l, .b2-dgrid__r { min-width: 0; }
.b2-dposter img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.b2-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.b2-pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; font-size: 13px; border: 1px solid var(--line); border-radius: 999px; }
a.b2-pill { min-height: 44px; }
.b2-pill--accent { border-color: var(--accent); color: var(--accent); }
.b2-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.b2-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius); font-weight: 600;
}
.b2-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.b2-note { padding: 14px 16px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }
.b2-pn { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.b2-pn a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); }
.b2-pn a.is-next { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.b2-side-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; color: var(--accent); font-weight: 600; }
.b2-prose { max-width: 70ch; }
.b2-prose img { height: auto; }
.b2-faq details { border-bottom: 1px solid var(--line); }
.b2-faq summary { display: flex; align-items: center; min-height: 52px; cursor: pointer; font-weight: 600; }
.b2-faq details p { color: var(--muted); }
.b2-empty, .b2-notfound { padding: 48px 0; }
.b2-notfound__search { max-width: 520px; margin: 22px 0; }
.b2-notfound__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.b2-results { display: grid; gap: 0; }
.b2-result { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: flex-start; min-width: 0; }
.b2-result__img { width: 72px; flex: 0 0 72px; aspect-ratio: 2 / 3; object-fit: cover; }
.b2-result__body { display: grid; gap: 4px; min-width: 0; }
.b2-result__t { font-weight: 700; overflow-wrap: anywhere; }
.b2-result__m, .b2-result__x { font-size: 13px; color: var(--muted); }
.b2-searchbar { max-width: 640px; margin: 4px 0 24px; }

/* ---------- 篩選條：行內捲動，不撐破版面 ---------- */
.b2-filter { display: grid; gap: 4px; margin: 0 0 24px; }
.b2-filter__row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.b2-filter__label { flex: 0 0 auto; font-size: 13px; color: var(--muted); }
.b2-filter__list { display: flex; flex: 1 1 auto; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.b2-filter__list::-webkit-scrollbar { display: none; }
.b2-filter__list a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; white-space: nowrap; }

/* ---------- 選集容器（app.js 會把目前集捲到可視範圍） ---------- */
[data-eps] { position: relative; }

/* ---------- 共用預設（各主題在 theme.css 覆寫） ---------- */
.b2-block { margin-top: clamp(40px, 6vw, 72px); }
.b2-pagehead { padding: 26px 0 20px; }
.b2-pagehead h1 { font-size: clamp(28px, 4vw, 44px); overflow-wrap: anywhere; }
.b2-pagehead p { margin: 10px 0 0; color: var(--muted); }
.b2-dhead { padding: 8px 0 22px; }
.b2-dhead h1 { font-size: clamp(26px, 3.6vw, 40px); overflow-wrap: anywhere; }
.b2-syn { font-size: 16px; line-height: 1.9; }
.b2-h2 { font-size: 20px; margin: 0 0 14px; }
.b2-h2 small { margin-left: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.b2-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); column-gap: 28px; margin: 0; }
.b2-fact { padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.b2-fact dt { font-size: 12.5px; color: var(--muted); }
.b2-fact dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.b2-fact--wide { grid-column: 1 / -1; }
.b2-article { max-width: 860px; }
.b2-notfound__code { margin: 0; font-size: clamp(72px, 16vw, 150px); font-weight: 900; line-height: 1; color: var(--accent); }
.b2-notfound h1 { font-size: clamp(26px, 4vw, 40px); margin: 6px 0 10px; }
.b2-notfound__desc { max-width: 34em; color: var(--muted); }
.b2-empty__title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.b2-result:hover .b2-result__t { color: var(--accent); }
.b2-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.b2-sec__more { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; white-space: nowrap; }

@media (max-width: 900px) {
  .b2-dgrid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .b2-dgrid__l .sd-player, .b2-dgrid__l .b2-dposter { max-width: 420px; margin-inline: auto; }
}
@media (max-width: 560px) {
  :root { --gut: 16px; }
  .b2-filter__row { gap: 8px; }
  .sd-crumbs [aria-current="page"] { max-width: 48vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   sd-b2 苔綠書店：米黃橫線紙 / 苔綠招牌與條紋遮陽篷 / 書脊式卡片 / 書籤標籤 / 目錄頁分集
   ========================================================================== */

:root {
  --bg: #efe6c8;
  --surface: #f9f3df;
  --ink: #2b2a1c;
  --muted: #6c6a50;
  --line: #cdbf97;
  --accent: #4b6b3a;
  --accent-2: #6d8f55;
  --accent-soft: rgba(75, 107, 58, .14);
  --on-accent: #f7f1dc;
  --moss-dk: #34502a;
  --radius: 3px;
  --wrap: 1200px;
  --gut: 24px;
  --scrim: rgba(35, 42, 24, .55);
  --serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", "MingLiU", "Times New Roman", serif;
  --sans: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font: var(--sans);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --s0: var(--accent); --s1: #6b4f2d; --s2: #2f4f5a; --s3: #9a7b2f;
}

body {
  background-color: var(--bg);
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(75, 107, 58, .08) 31px 32px);
}
h1, h2, h3 { font-family: var(--serif); font-weight: 900; }
a:hover { color: var(--accent); }

/* ---------- 頁首：營業條 / 遮陽篷 / 招牌 / 書籤導覽 ---------- */
.b2-strip { background: var(--moss-dk); color: var(--on-accent); font-size: 12.5px; letter-spacing: .1em; }
.b2-strip__in { display: flex; align-items: center; gap: 16px; min-height: 48px; }
.b2-strip__open i { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #f2c14e; box-shadow: 0 0 0 3px rgba(242, 193, 78, .25); }
.b2-strip__date { flex: 1 1 auto; opacity: .75; }
.b2-tools { display: flex; gap: 2px; margin-left: auto; }
.b2-tool { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: inherit; letter-spacing: .12em; }
.b2-tool:hover { color: #f2c14e; }
.b2-tool--menu { display: none; }
.b2-awning { height: 18px; background: repeating-linear-gradient(90deg, var(--accent) 0 32px, #f4ecd0 32px 64px); box-shadow: 0 4px 0 -1px rgba(52, 80, 42, .25); }
.b2-sign { display: flex; flex-direction: column; align-items: center; padding: 26px 0 14px; text-align: center; }
.b2-brand { display: inline-block; padding: 6px 34px 10px; border: 3px double var(--accent); font: 900 clamp(34px, 5.6vw, 64px)/1.15 var(--serif); letter-spacing: .1em; color: var(--accent); background: var(--surface); box-shadow: 6px 6px 0 var(--accent-soft); }
.b2-brand:hover { color: var(--moss-dk); }
.b2-brand__img { max-height: 64px; width: auto; }
.b2-motto { margin: 12px 0 0; font: italic 400 15px/1.7 var(--serif); color: var(--muted); }
.b2-nav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(249, 243, 223, .6); }
.b2-nav .b2-wrap { display: flex; justify-content: center; }
.b2-nav__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 6px; list-style: none; margin: 0; padding: 0; }
.b2-nav__list a { display: flex; align-items: center; min-height: 48px; padding: 0 18px; font: 700 15px var(--serif); letter-spacing: .1em; }
.b2-nav__list a:hover { color: var(--accent); }
.b2-nav__list [aria-current="page"], .b2-nav__list .current-menu-item > a { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }

/* ---------- 區塊標題 / 按鈕 ---------- */
.b2-sec { margin: 0 0 24px; gap: 14px; align-items: center; }
.b2-sec h2 { font-size: clamp(22px, 2.6vw, 30px); white-space: nowrap; color: var(--accent); }
.b2-sec__rule { flex: 1 1 auto; height: 6px; border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent); opacity: .55; min-width: 20px; }
.b2-sec__more { font: 700 14px var(--serif); }
.b2-btn { background: var(--surface); border-color: var(--accent); color: var(--accent); font-family: var(--serif); letter-spacing: .08em; }
.b2-btn:hover { background: var(--accent-soft); }
.b2-btn--primary { background: var(--accent); color: var(--on-accent); }
.b2-btn--primary:hover { background: var(--moss-dk); color: var(--on-accent); }
.b2-pill { background: var(--surface); border-color: var(--line); }
a.b2-pill:hover { border-color: var(--accent); color: var(--accent); }
.b2-pill--accent { border-color: var(--accent); }

/* ---------- 首頁：歡迎招牌 + 店長便條 ---------- */
.b2-welcome { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: center; margin-top: 30px; padding: 40px; background: var(--accent); color: var(--on-accent); border-radius: var(--radius); box-shadow: inset 0 0 0 6px var(--accent), inset 0 0 0 7px rgba(247, 241, 220, .55), 0 14px 30px -18px rgba(35, 42, 24, .7); }
.b2-welcome a:hover { color: #f2c14e; }
.b2-kicker { margin: 0 0 10px; font: 700 12px var(--sans); letter-spacing: .3em; color: #f2c14e; }
.b2-welcome h1 { display: grid; gap: 10px; }
.b2-h1__brand { font-size: clamp(34px, 4.8vw, 60px); line-height: 1.12; letter-spacing: .06em; }
.b2-h1__tag { font: 500 clamp(17px, 2vw, 22px)/1.5 var(--serif); opacity: .9; }
.b2-welcome__p { max-width: 32em; margin: 18px 0 20px; font: 400 16px/1.95 var(--serif); opacity: .92; }
.b2-welcome .b2-btn--primary { background: #f2c14e; border-color: #f2c14e; color: #2b2a1c; }
.b2-welcome .b2-btn--primary:hover { background: #f7d77b; color: #2b2a1c; }
.b2-lead { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 0; align-items: stretch; transform: rotate(1.4deg); background: var(--surface); color: var(--ink); box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .55); }
.b2-lead__cover { display: block; padding: 10px; }
.b2-lead__cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.b2-lead__note { padding: 18px 18px 16px 6px; min-width: 0; background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(75, 107, 58, .14) 27px 28px); }
.b2-lead__note .b2-kicker { color: var(--accent); }
.b2-lead__note h2 { font-size: clamp(20px, 2vw, 26px); margin-bottom: 6px; }
.b2-lead__note h2 a { display: inline-flex; align-items: center; min-height: 44px; }
.b2-lead__note h2 a:hover { color: var(--accent); }
.b2-lead__meta { margin: 0 0 8px; font: 12.5px var(--mono); color: var(--muted); }
.b2-lead__syn { font-size: 14px; line-height: 1.8; color: var(--muted); }
.b2-lead .b2-btn { background: var(--surface); color: var(--accent); }

/* ---------- 書脊式卡片 ---------- */
.b2-shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 28px; }
.b2-book { display: grid; grid-template-columns: minmax(130px, 46%) minmax(0, 1fr); gap: 16px; align-items: start; min-width: 0; padding-bottom: 14px; border-bottom: 6px solid #b79d6c; box-shadow: 0 7px 0 -3px rgba(98, 74, 36, .3); }
.b2-book__body { display: flex; box-shadow: 4px 6px 0 rgba(43, 42, 28, .16); }
.b2-book__spine { flex: 0 0 30px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #f6f0dc; background: var(--s0); box-shadow: inset 3px 0 0 rgba(255, 255, 255, .2), inset -2px 0 0 rgba(0, 0, 0, .25), inset 0 8px 0 -4px #f2c14e, inset 0 -8px 0 -4px #f2c14e; }
.b2-book__spine--s1 { background: var(--s1); }
.b2-book__spine--s2 { background: var(--s2); }
.b2-book__spine--s3 { background: var(--s3); }
.b2-book__stitle { writing-mode: vertical-rl; max-height: 100%; padding: 14px 0; font: 700 13px/1 var(--serif); letter-spacing: .18em; white-space: nowrap; overflow: hidden; }
.b2-book__cover { position: relative; flex: 1 1 auto; min-width: 0; display: block; }
.b2-book__cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.b2-book__badge { position: absolute; right: 0; top: 10px; padding: 3px 8px 3px 10px; font: 700 11.5px var(--sans); background: #f2c14e; color: #2b2a1c; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 8px 50%); }
.b2-book__cap { display: grid; gap: 6px; align-content: start; min-width: 0; padding-top: 4px; }
.b2-book__t { font: 900 17px/1.4 var(--serif); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.b2-book:hover .b2-book__t { color: var(--accent); }
.b2-book__m { font: 12.5px/1.6 var(--mono); color: var(--muted); }
.b2-book:hover .b2-book__body { transform: translateY(-4px); }
.b2-book__body { transition: transform .2s; }

/* ---------- 書籤：篩選條 / 分類 ---------- */
.b2-filter { gap: 6px; padding: 8px 0 14px; margin-bottom: 30px; border-bottom: 1px dashed var(--line); }
.b2-filter__label { min-width: 2.8em; font: 700 14px var(--serif); color: var(--accent); }
.b2-filter__list { gap: 8px; padding: 4px 0 6px; }
.b2-filter__list a, .b2-marks a { min-height: 52px; padding: 0 16px 8px; background: var(--surface); border: 0; font: 600 14px var(--serif); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 8px), 0 100%); box-shadow: inset 0 3px 0 var(--accent); }
.b2-filter__list a:hover { background: var(--accent-soft); }
.b2-filter__list a[aria-current="page"] { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 3px 0 #f2c14e; }
.b2-marks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.b2-marks a { display: inline-flex; align-items: center; gap: 8px; }
.b2-marks li:nth-child(4n+2) a { box-shadow: inset 0 3px 0 var(--s1); }
.b2-marks li:nth-child(4n+3) a { box-shadow: inset 0 3px 0 var(--s2); }
.b2-marks li:nth-child(4n+4) a { box-shadow: inset 0 3px 0 var(--s3); }
.b2-marks a:hover { background: var(--accent-soft); color: var(--accent); }
.b2-marks em { font: normal 12px var(--mono); color: var(--muted); }

/* ---------- 暢銷榜（收據） ---------- */
.b2-duo { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; }
.b2-rank { list-style: none; margin: 0; padding: 18px 20px; background: var(--surface); border: 1px dashed var(--accent); box-shadow: 6px 6px 0 var(--accent-soft); }
.b2-rank a { display: flex; align-items: baseline; gap: 8px; min-height: 48px; align-items: center; }
.b2-rank a:hover { color: var(--accent); }
.b2-rank__no { flex: 0 0 1.6em; font: 700 15px var(--mono); color: var(--accent); }
.b2-rank__t { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.b2-rank__dots { flex: 1 1 12px; min-width: 12px; border-bottom: 2px dotted var(--line); transform: translateY(4px); }
.b2-rank__m { flex: 0 0 auto; font: 12px var(--mono); color: var(--muted); white-space: nowrap; }

/* ---------- 列表頁 / 詳情 ---------- */
.b2-pagehead { padding: 30px 0 14px; }
.b2-pagehead h1 { color: var(--accent); }
.b2-pagehead h1::before { content: "§ "; opacity: .5; }
.b2-dhead h1 { color: var(--accent); }
.b2-dgrid { gap: 40px; }
.b2-player, .b2-dposter { border: 8px solid var(--surface); box-shadow: 0 0 0 1px var(--line), 8px 10px 0 rgba(43, 42, 28, .18); background: #000; }
.b2-dposter { background: var(--surface); }
.b2-dgrid__r { padding: 24px 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: 6px 6px 0 var(--accent-soft); }
.b2-syn { font: 400 17px/2 var(--serif); }
.b2-syn::first-letter { float: left; margin: 4px 8px 0 0; font: 900 46px/1 var(--serif); color: var(--accent); }
.b2-note { background: var(--bg); border-color: var(--accent); }
.b2-eps-sec { margin-top: 22px; }
.b2-eps-sec .b2-h2 { font-family: var(--serif); color: var(--accent); padding-bottom: 8px; border-bottom: 2px double var(--accent); }
.b2-toc { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
.b2-toc a, .b2-toc .is-off { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 8px; }
.b2-toc a:hover { background: var(--accent-soft); }
.b2-toc__t { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-weight: 600; }
.b2-toc__dots { flex: 1 1 14px; min-width: 14px; border-bottom: 2px dotted var(--line); transform: translateY(4px); }
.b2-toc__d { flex: 0 0 auto; font: 12.5px var(--mono); color: var(--muted); }
.b2-toc .is-current { background: var(--accent); color: var(--on-accent); }
.b2-toc .is-current .b2-toc__d { color: var(--on-accent); }
.b2-toc .is-current .b2-toc__dots { border-color: rgba(247, 241, 220, .6); }
.b2-toc .is-off { opacity: .5; }
.b2-facts-sec { padding: 24px 28px; background: var(--surface); border: 1px dashed var(--accent); }
.b2-facts-sec .b2-sec h2 { color: var(--accent); }
.b2-fact { border-bottom: 1px dotted var(--line); }
.b2-fact dt { font-family: var(--serif); }
.b2-pn a { background: var(--surface); border-color: var(--accent); color: var(--accent); font-family: var(--serif); }
.b2-pn a.is-next { background: var(--accent); color: var(--on-accent); }
.b2-faq details { border-bottom: 1px dotted var(--accent); }
.b2-faq summary { font-family: var(--serif); }
.sd-pagination .page-numbers { background: var(--surface); border-color: var(--line); font-family: var(--serif); }
.b2-result { border-bottom: 1px dotted var(--line); }
.b2-result__img { box-shadow: 3px 3px 0 var(--accent-soft); }
.b2-sf input[type="search"] { background: var(--surface); border-color: var(--accent); }
.b2-search__box, .b2-drawer { background: var(--surface); }

/* ---------- 頁尾：書架橫板 ---------- */
.b2-foot { margin-top: 90px; background: var(--moss-dk); color: var(--on-accent); }
.b2-plank { height: 16px; background: linear-gradient(180deg, #8c6a3c, #6b4f2d); box-shadow: 0 -6px 0 -2px #b79d6c, inset 0 -3px 0 rgba(0, 0, 0, .25); }
.b2-foot__grid { display: grid; grid-template-columns: 1.4fr 1.2fr 1fr; gap: 40px; padding: 44px 0 10px; }
.b2-foot h2 { margin-bottom: 12px; font-size: 16px; letter-spacing: .2em; color: #f2c14e; }
.b2-foot ul { list-style: none; margin: 0; padding: 0; }
.b2-foot li a { display: inline-flex; align-items: center; min-height: 44px; opacity: .88; }
.b2-foot li a:hover { color: #f2c14e; opacity: 1; }
.b2-foot__tags { display: flex; flex-wrap: wrap; gap: 0 18px; }
.b2-foot__name { font: 900 24px var(--serif); letter-spacing: .1em; margin-bottom: 8px; }
.b2-foot__grid p { font-size: 14px; opacity: .85; max-width: 32em; }
.b2-foot__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin: 24px 0 0; padding: 16px 0 24px; border-top: 1px solid rgba(247, 241, 220, .25); font-size: 12.5px; opacity: .8; }

/* ---------- 響應式 ---------- */
@media (max-width: 1000px) {
  .b2-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b2-welcome { grid-template-columns: minmax(0, 1fr); padding: 30px 24px; }
  .b2-lead { max-width: 520px; transform: none; }
  .b2-duo { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .b2-foot__grid { grid-template-columns: 1fr 1fr; }
  .b2-foot__grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .b2-tool--menu { display: inline-flex; }
  .b2-nav { display: none; }
}
@media (max-width: 900px) {
  .b2-dgrid__r { padding: 18px; }
}
@media (max-width: 560px) {
  .b2-strip__date { display: none; }
  .b2-shelf { gap: 28px 14px; }
  .b2-book { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .b2-book__t { font-size: 15px; }
  .b2-welcome { padding: 24px 18px; box-shadow: inset 0 0 0 4px var(--accent), inset 0 0 0 5px rgba(247, 241, 220, .55); }
  .b2-lead { grid-template-columns: 34% minmax(0, 1fr); }
  .b2-brand { padding: 4px 18px 8px; letter-spacing: .06em; }
  .b2-foot__grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .b2-facts-sec { padding: 18px; }
  .b2-sec h2 { white-space: normal; }
}
