/*
Theme Name: 頂短劇 Bao2
Theme URI: https://example.invalid/
Author: SD Network
Description: 報紙排版風短劇主題：桌面 4 欄（含側欄「本週熱門」榜單）、細黑分隔線、粗黑標題、等寬字體標示集數與時長，黑白加一點朱紅。適用於頂短劇。
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: sd-bao2
*/

/* ==========================================================================
   共用基礎層（結構 / 行為）— 顏色與造型一律走變數，各主題在下方覆寫
   需要的變數：--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; }

.bb-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; }

/* ---------- 搜尋表單 ---------- */
.bb-sf { display: flex; gap: 8px; align-items: stretch; }
.bb-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;
}
.bb-sf input[type="search"]::placeholder { color: var(--muted); opacity: .8; }
.bb-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 綁定） ---------- */
.bb-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;
}
.bb-search.is-open { opacity: 1; visibility: visible; }
.bb-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);
}
.bb-search__hint { margin: 18px 0 8px; font-size: 13px; color: var(--muted); }
.bb-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.bb-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;
}
.bb-tags a:hover { border-color: var(--accent); color: var(--accent); }

.bb-overlay { position: fixed; inset: 0; z-index: 150; background: var(--scrim, rgba(0, 0, 0, .55)); opacity: 0; transition: opacity .25s; }
.bb-overlay.is-open { opacity: 1; }
.bb-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;
}
.bb-drawer.is-open { transform: none; visibility: visible; }
.bb-drawer__close {
  position: absolute; top: 10px; right: 10px; width: 48px; height: 48px;
  display: grid; place-items: center; border: 0; background: transparent; font-size: 20px;
}
.bb-drawer__list { list-style: none; margin: 0; padding: 0; }
.bb-drawer__list a { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line); font-size: 17px; }
.bb-drawer__list [aria-current="page"], .bb-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 上下堆疊 ---------- */
.bb-dgrid { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 32px; align-items: start; }
.bb-dgrid__l, .bb-dgrid__r { min-width: 0; }
.bb-dposter img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.bb-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.bb-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.bb-pill { min-height: 44px; }
.bb-pill--accent { border-color: var(--accent); color: var(--accent); }
.bb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.bb-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;
}
.bb-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.bb-note { padding: 14px 16px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }
.bb-pn { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.bb-pn a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); }
.bb-pn a.is-next { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.bb-side-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; color: var(--accent); font-weight: 600; }
.bb-prose { max-width: 70ch; }
.bb-prose img { height: auto; }
.bb-faq details { border-bottom: 1px solid var(--line); }
.bb-faq summary { display: flex; align-items: center; min-height: 52px; cursor: pointer; font-weight: 600; }
.bb-faq details p { color: var(--muted); }
.bb-empty, .bb-notfound { padding: 48px 0; }
.bb-notfound__search { max-width: 520px; margin: 22px 0; }
.bb-notfound__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bb-results { display: grid; gap: 0; }
.bb-result { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: flex-start; min-width: 0; }
.bb-result__img { width: 72px; flex: 0 0 72px; aspect-ratio: 2 / 3; object-fit: cover; }
.bb-result__body { display: grid; gap: 4px; min-width: 0; }
.bb-result__t { font-weight: 700; overflow-wrap: anywhere; }
.bb-result__m, .bb-result__x { font-size: 13px; color: var(--muted); }
.bb-searchbar { max-width: 640px; margin: 4px 0 24px; }

/* ---------- 篩選條：行內捲動，不撐破版面 ---------- */
.bb-filter { display: grid; gap: 4px; margin: 0 0 24px; }
.bb-filter__row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bb-filter__label { flex: 0 0 auto; font-size: 13px; color: var(--muted); }
.bb-filter__list { display: flex; flex: 1 1 auto; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bb-filter__list::-webkit-scrollbar { display: none; }
.bb-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; }

@media (max-width: 900px) {
  .bb-dgrid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .bb-dgrid__l .sd-player, .bb-dgrid__l .bb-dposter { max-width: 420px; margin-inline: auto; }
}
@media (max-width: 560px) {
  :root { --gut: 16px; }
  .bb-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; }
}

/* ==========================================================================
   頂短劇 · 「報紙排版」：多欄（桌面 4 欄含側欄）/ 細黑分隔線 / 粗黑標題 / 等寬字體元資料 / 黑白 + 朱紅
   ========================================================================== */

:root {
  --bg: #f6f4ee;
  --surface: #fffefa;
  --ink: #0a0a0a;
  --muted: #55524a;
  --line: #c9c5b8;
  --accent: #d93a1d;
  --accent-2: #0a0a0a;
  --accent-soft: rgba(217, 58, 29, .12);
  --on-accent: #ffffff;
  --radius: 0px;
  --wrap: 1260px;
  --gut: 24px;
  --scrim: rgba(10, 10, 10, .6);
  --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;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
  --font: var(--sans);
}

body { font-size: 15.5px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 900; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); }

/* ---------- 報頭 ---------- */
.bb-dateline { display: flex; align-items: center; gap: 16px; min-height: 46px; border-bottom: 1px solid var(--ink); font: 400 12px var(--mono); letter-spacing: .04em; }
.bb-dateline__mid { flex: 1 1 auto; text-align: center; color: var(--muted); }
.bb-tools { display: flex; gap: 2px; margin-left: auto; }
.bb-tool { min-height: 44px; padding: 0 14px; border: 0; background: transparent; font: 700 13px var(--sans); letter-spacing: .14em; }
.bb-tool:hover { color: var(--accent); }
.bb-tool--menu { display: none; }
.bb-masthead { padding: 22px 0 14px; text-align: center; border-top: 4px solid var(--ink); }
.bb-brand { display: inline-block; font: 900 clamp(46px, 10vw, 112px)/1.05 var(--serif); letter-spacing: .08em; padding-left: .08em; }
.bb-brand:hover { color: var(--ink); }
.bb-brand__img { max-height: 84px; width: auto; margin: 0 auto; }
.bb-slogan { margin: 8px 0 0; font: 400 12.5px var(--mono); letter-spacing: .2em; color: var(--muted); }
.bb-nav { border-top: 1px solid var(--ink); border-bottom: 3px solid var(--ink); }
.bb-nav__list { display: flex; flex-wrap: wrap; justify-content: center; list-style: none; margin: 0; padding: 0; }
.bb-nav__list a { display: flex; align-items: center; min-height: 46px; padding: 0 24px; border-left: 1px solid var(--line); font: 700 14px var(--sans); letter-spacing: .12em; }
.bb-nav__list li:first-child a { border-left: 0; }
.bb-nav__list a:hover { background: var(--ink); color: var(--bg); }
.bb-nav__list [aria-current="page"], .bb-nav__list .current-menu-item > a { background: var(--ink); color: var(--bg); }

/* ---------- 通用元件 ---------- */
.bb-btn, .sd-btn { border-radius: 0; border: 2px solid var(--ink); font: 800 14px var(--sans); letter-spacing: .12em; }
.bb-btn--primary, .sd-btn { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.bb-btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.bb-pill { border-radius: 0; border: 1px solid var(--ink); font: 500 12px var(--mono); }
.bb-pill--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.bb-pill--link:hover { background: var(--ink); color: #fff; }
.bb-sf input[type="search"] { border: 2px solid var(--ink); border-radius: 0; background: var(--surface); }
.bb-sf button { border-radius: 0; background: var(--ink); color: var(--bg); font-family: var(--sans); letter-spacing: .14em; }
.bb-sf button:hover { background: var(--accent); }
.bb-search__box { border: 3px double var(--ink); border-radius: 0; }
.bb-tags a { border-radius: 0; border-color: var(--ink); font: 700 13px var(--sans); }
.bb-tags a:hover { background: var(--ink); color: #fff; }
.bb-drawer { border-left: 3px solid var(--ink); }
.bb-drawer__list a { font-family: var(--serif); font-weight: 900; border-bottom: 1px solid var(--ink); }

.bb-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 20px; padding: 6px 0; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); }
.bb-sec h2 { font-size: 22px; letter-spacing: .14em; }
.bb-sec__more { display: inline-flex; align-items: center; min-height: 44px; font: 500 12.5px var(--mono); }
.bb-sec__more:hover { color: var(--accent); text-decoration: underline; }
.bb-block { margin-top: 44px; }

/* ---------- 頭版 ---------- */
.bb-strap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin: 0; padding: 14px 0; border-bottom: 1px solid var(--ink); font-size: 14px; }
.bb-strap__brand { font: 900 22px var(--serif); letter-spacing: .12em; color: var(--accent); }
.bb-strap__tag { font: 800 15px var(--serif); letter-spacing: .08em; }
.bb-strap__no { margin-left: auto; font: 400 12px var(--mono); color: var(--muted); }

.bb-cols { display: block; }
.bb-cols--aside { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 0 32px; padding-top: 26px; }
.bb-cols__main { min-width: 0; }
.bb-lead { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 28px; padding-bottom: 26px; border-bottom: 1px solid var(--ink); align-items: start; }
.bb-lead__poster { display: block; border: 1px solid var(--ink); background: #000; }
.bb-lead__poster img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.bb-kicker { margin: 0 0 10px; font: 700 12px var(--mono); letter-spacing: .08em; color: var(--accent); text-transform: uppercase; }
.bb-lead h2 { font-size: clamp(30px, 3.6vw, 52px); line-height: 1.14; margin-bottom: 12px; overflow-wrap: anywhere; }
.bb-lead h2 a { display: inline-block; padding: 6px 0; }
.bb-lead h2 a:hover { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 6px; }
.bb-byline { margin: 0 0 14px; padding: 6px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font: 400 12.5px var(--mono); letter-spacing: .04em; }
.bb-lead__syn { font: 400 16px/1.95 var(--serif); }

/* ---------- 多欄卡片（報紙欄線） ---------- */
.bb-grid { column-count: 4; column-gap: 32px; column-rule: 1px solid var(--ink); }
.bb-cols__main .bb-grid { column-count: 3; }
.bb-grid--subs { padding-top: 26px; column-count: 2 !important; }
.bb-grid--subs .bb-card__media img { aspect-ratio: 3 / 2; }
.bb-card { display: block; break-inside: avoid; margin: 0 0 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.bb-card__media { display: block; border: 1px solid var(--ink); background: #000; }
.bb-card__media img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.bb-card__t { display: block; margin-top: 10px; font: 900 18px/1.3 var(--serif); overflow-wrap: anywhere; }
.bb-card:hover .bb-card__t { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.bb-card__w { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.bb-card__m { display: block; margin-top: 4px; font: 500 12px var(--mono); letter-spacing: .02em; }

/* ---------- 側欄：本週熱門 ---------- */
.bb-side { align-self: start; padding-left: 28px; border-left: 1px solid var(--ink); min-width: 0; }
.bb-side__h { margin-bottom: 4px; padding: 7px 12px; background: var(--ink); color: var(--bg); font-size: 18px; letter-spacing: .24em; }
.bb-hot { list-style: none; margin: 0; padding: 0; }
.bb-hot a { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; min-height: 56px; padding: 12px 0; border-bottom: 1px dotted var(--ink); }
.bb-hot__no { font: 700 22px/1.1 var(--mono); color: var(--accent); }
.bb-hot li:nth-child(n+4) .bb-hot__no { color: var(--ink); }
.bb-hot__b { display: grid; gap: 3px; min-width: 0; }
.bb-hot__t { font: 800 15.5px/1.35 var(--serif); overflow-wrap: anywhere; }
.bb-hot__m { font: 400 11.5px var(--mono); color: var(--muted); }
.bb-hot a:hover .bb-hot__t { text-decoration: underline; }

/* ---------- 分類索引 ---------- */
.bb-index { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--ink); }
.bb-index li { border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.bb-index a { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 56px; padding: 12px 14px; font: 900 17px var(--serif); }
.bb-index em { font: 400 11.5px var(--mono); font-style: normal; color: var(--muted); }
.bb-index a:hover { background: var(--ink); color: var(--bg); }
.bb-index a:hover em { color: var(--bg); }

/* ---------- 內頁抬頭 / 篩選條 ---------- */
.bb-pagehead { padding: 28px 0 18px; margin-bottom: 18px; border-top: 4px solid var(--ink); border-bottom: 1px solid var(--ink); }
.bb-pagehead h1 { font-size: clamp(34px, 5vw, 64px); }
.bb-pagehead p { margin: 8px 0 0; font: 400 13px var(--mono); color: var(--muted); }
.bb-filter { border: 1px solid var(--ink); margin-bottom: 26px; }
.bb-filter__row { gap: 0; border-bottom: 1px solid var(--ink); }
.bb-filter__row:last-child { border-bottom: 0; }
.bb-filter__label { align-self: stretch; display: flex; align-items: center; flex-basis: 72px; padding: 0 12px; background: var(--ink); color: var(--bg); font: 800 13px var(--serif); letter-spacing: .2em; }
.bb-filter__list { gap: 0; }
.bb-filter__list a { border-right: 1px solid var(--line); font: 700 13.5px var(--sans); }
.bb-filter__list a:hover { background: var(--ink); color: var(--bg); }
.bb-filter__list [aria-current="page"] { background: var(--accent); color: #fff; }

/* ---------- 詳情 / 分集 ---------- */
.bb-dhead { padding: 22px 0 20px; margin-bottom: 26px; border-top: 4px solid var(--ink); border-bottom: 1px solid var(--ink); }
.bb-dhead h1 { font-size: clamp(32px, 4.8vw, 62px); line-height: 1.14; overflow-wrap: anywhere; }
.bb-player, .bb-dposter { border: 2px solid var(--ink); background: #000; }
.bb-syn { padding-top: 12px; border-top: 3px solid var(--ink); font: 400 17px/2 var(--serif); }
.bb-actions .bb-btn { min-width: 120px; }
.bb-h2 { display: flex; align-items: baseline; gap: 12px; margin-bottom: 0; padding: 6px 0; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); font-size: 20px; letter-spacing: .14em; }
.bb-h2 small { font: 400 12px var(--mono); color: var(--muted); letter-spacing: 0; }
.bb-eps-sec { margin-top: 28px; }
.bb-eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); max-height: 440px; overflow-y: auto; border-left: 1px solid var(--ink); margin-top: 14px; border-top: 1px solid var(--ink); }
.bb-ep { display: flex; align-items: center; justify-content: center; min-height: 48px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--surface); font: 700 14px var(--mono); }
a.bb-ep:hover { background: var(--accent); color: #fff; }
.bb-ep.is-current { background: var(--ink); color: var(--bg); }
.bb-ep.is-off { color: #a7a399; background: transparent; }
.bb-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 0; border-left: 1px solid var(--ink); border-top: 1px solid var(--ink); }
.bb-fact { padding: 12px 14px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--surface); }
.bb-fact--wide { grid-column: 1 / -1; }
.bb-fact dt { font: 500 11px var(--mono); letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.bb-fact dd { margin: 4px 0 0; font: 800 17px var(--serif); overflow-wrap: anywhere; }
.bb-prose { font: 400 17px/2 var(--serif); }
.bb-faq summary { font-family: var(--serif); font-weight: 800; font-size: 17px; }
.bb-faq details { border-bottom: 1px solid var(--ink); }
.bb-pn a { border: 2px solid var(--ink); border-radius: 0; font: 700 14px var(--sans); }
.bb-pn a.is-next { background: var(--accent); border-color: var(--accent); }
.bb-side-link { color: var(--ink); font-weight: 800; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.bb-note { border: 1px dashed var(--ink); font-family: var(--mono); }

/* ---------- 搜尋 / 404 ---------- */
.bb-result { padding: 16px 0; border-bottom: 1px solid var(--ink); }
.bb-result__img { border: 1px solid var(--ink); }
.bb-result__t { font: 900 20px var(--serif); }
.bb-result__m { font-family: var(--mono); }
.bb-result:hover .bb-result__t { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
.bb-empty__title { font: 900 28px var(--serif); }
.bb-notfound { text-align: center; border-top: 4px solid var(--ink); border-bottom: 1px solid var(--ink); }
.bb-notfound__code { margin: 0; font: 900 clamp(110px, 22vw, 260px)/1 var(--serif); color: var(--accent); }
.bb-notfound h1 { font-size: clamp(30px, 4vw, 48px); }
.bb-notfound__desc { margin: 10px auto 0; max-width: 32em; color: var(--muted); }
.bb-notfound__search { margin-inline: auto; }
.bb-notfound__actions { justify-content: center; }
.bb-prose, .bb-article .bb-prose { max-width: 72ch; }

/* ---------- 分頁 ---------- */
.sd-pagination .page-numbers { border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); font: 700 14px var(--mono); }
.sd-pagination a.page-numbers:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sd-pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 頁尾（反白） ---------- */
.bb-foot { margin-top: 72px; padding: 40px 0 24px; background: var(--ink); color: #e9e6dc; border-top: 6px double var(--bg); }
.bb-foot__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.bb-foot__grid > div { padding: 0 28px; border-left: 1px solid #55524a; }
.bb-foot__grid > div:first-child { padding-left: 0; border-left: 0; }
.bb-foot__name { margin: 0 0 12px; font: 900 40px/1 var(--serif); letter-spacing: .08em; color: #fff; }
.bb-foot__note { font-size: 13px; color: #b8b4a8; }
.bb-foot h2 { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #55524a; font: 700 13px var(--mono); letter-spacing: .24em; color: #fff; }
.bb-foot ul { list-style: none; margin: 0; padding: 0; }
.bb-foot li a { display: flex; align-items: center; min-height: 44px; font-size: 14.5px; }
.bb-foot li a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.bb-foot__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 30px; padding-top: 14px; border-top: 1px solid #55524a; font: 400 12px var(--mono); color: #b8b4a8; }
.bb-foot :focus-visible { outline-color: #fff; }

/* ---------- 響應式 ---------- */
@media (max-width: 1100px) {
  .bb-cols--aside { grid-template-columns: minmax(0, 1fr); gap: 36px 0; }
  .bb-side { padding-left: 0; border-left: 0; border-top: 3px solid var(--ink); padding-top: 14px; }
  .bb-hot { column-count: 2; column-gap: 32px; column-rule: 1px solid var(--ink); }
  .bb-hot li { break-inside: avoid; }
  .bb-grid, .bb-cols__main .bb-grid { column-count: 3; }
  .bb-index { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .bb-nav { display: none; }
  .bb-tool--menu { display: inline-flex; }
  .bb-dateline__mid { display: none; }
  .bb-masthead { padding: 14px 0 10px; border-bottom: 3px solid var(--ink); }
  .bb-slogan { display: none; }
  .bb-foot__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 0; }
  .bb-foot__brand { grid-column: 1 / -1; }
  .bb-foot__grid > div:nth-child(2) { padding-left: 0; border-left: 0; }
}
@media (max-width: 700px) {
  :root { --gut: 16px; }
  .bb-lead { grid-template-columns: minmax(0, 1fr); }
  .bb-lead__poster { max-width: 360px; }
  .bb-grid, .bb-cols__main .bb-grid, .bb-grid--subs { column-count: 2 !important; column-gap: 16px; }
  .bb-card__t { font-size: 16px; }
  .bb-hot { column-count: 1; }
  .bb-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-filter__label { flex-basis: 56px; padding: 0 8px; }
  .bb-foot__grid { grid-template-columns: minmax(0, 1fr); }
  .bb-foot__grid > div { padding: 0; border-left: 0; }
  .bb-strap__no { margin-left: 0; }
}
