/* ═══════════════════════════════════════════════════════════════
   Fan Guide — 前台樣式
   首頁主視覺顏色（--bg-deep / --bg-mid / --bg-glow / --cream / --gold）
   由後台「主題色」設定，執行時寫到 <html> 上；其餘為閱讀頁的明暗主題。
   ═══════════════════════════════════════════════════════════════ */
:root {
  --font-tw: "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", system-ui, sans-serif;
  --font-jp: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  /* 主視覺（後台可改） */
  --bg-deep: #230805;
  --bg-mid: #7a2712;
  --bg-glow: #c8462a;
  --cream: #f6efd9;
  --gold: #e9d9a3;

  /* 應援動作色 */
  --chant: #f5942c;
  --clap: #4fa8e0;
  --wave: #5ecdc4;
  --jump: #b98cff;
  --spin: #ff86c8;

  /* 閱讀頁（淺色） */
  --ui-bg: #f5f5f7;
  --ui-surface: #ffffff;
  --ui-raised: #eaeaed;
  --ui-text: #1d1d1f;
  --ui-muted: #64646b;
  --ui-line: #e8e8eb;
  --ui-accent: #755724;
  --ui-chant: #b24d00;
  --dock: rgba(255, 255, 255, 0.72);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --control-h: 40px;
  --touch-h: 44px;
  --radius: 8px;
  --pill: 999px;
  --float: 0 8px 24px rgba(0, 0, 0, 0.15);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --beat: 0.6s;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ui-bg: #151619; --ui-surface: #202125; --ui-raised: #2b2c30; --ui-text: #f5f5f7; --ui-muted: #a9a9af;
    --ui-line: rgba(255, 255, 255, 0.1); --ui-accent: #e9d9a3; --ui-chant: #f5942c; --dock: rgba(55, 56, 62, 0.72);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ui-bg: #151619; --ui-surface: #202125; --ui-raised: #2b2c30; --ui-text: #f5f5f7; --ui-muted: #a9a9af;
  --ui-line: rgba(255, 255, 255, 0.1); --ui-accent: #e9d9a3; --ui-chant: #f5942c; --dock: rgba(55, 56, 62, 0.72);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: var(--font-tw);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.55;
}
body.is-home { background: var(--bg-deep); color: var(--cream); }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ui-text); outline-offset: 2px; }
.is-home :focus-visible { outline-color: var(--cream); }
.ic { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─────────────── 載入／錯誤 ─────────────── */
.boot { min-height: 100svh; display: grid; place-items: center; color: var(--ui-muted); font-size: 14px; }
.boot .spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ui-line); border-top-color: var(--ui-muted); animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-page { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 24px; }
.empty-page h1 { font-size: 22px; margin: 0 0 8px; }
.empty-page p { color: var(--ui-muted); margin: 0 0 20px; }

/* ─────────────── 圓形工具鈕 ─────────────── */
.round-btn {
  width: var(--control-h); height: var(--control-h); border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--ui-raised); color: var(--ui-text); cursor: pointer; transition: background 0.2s;
}
.round-btn:hover { background: color-mix(in srgb, var(--ui-raised) 80%, var(--ui-text)); }
.round-btn .ic { width: 18px; height: 18px; }
.is-home .round-btn { background: rgba(255, 255, 255, 0.14); color: #fff; }
.is-home .round-btn:hover { background: rgba(255, 255, 255, 0.22); }

/* ═══════════════ 首頁 ═══════════════ */
.hero {
  position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center;
  padding: calc(44px + var(--safe-top)) 20px 36px; text-align: center; isolation: isolate;
  background: var(--bg-deep) var(--poster, none) center 42% / cover no-repeat;
}
.hero.no-poster { background: radial-gradient(120% 70% at 50% 0%, var(--bg-glow) 0%, var(--bg-mid) 38%, var(--bg-deep) 78%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 0; background: color-mix(in srgb, var(--bg-deep) 74%, transparent); }
.hero.no-poster::after { background: none; }
@media (min-width: 720px) { .hero { padding-top: 72px; } }
.hero-theme { position: absolute; top: calc(12px + var(--safe-top)); right: 14px; z-index: 2; }
.hero-inner { position: relative; z-index: 1; width: 100%; max-width: 560px; margin-block: auto; display: flex; flex-direction: column; align-items: center; }
.eyebrow { font-size: clamp(13px, 3.6vw, 16px); letter-spacing: 0.14em; text-transform: uppercase; color: color-mix(in srgb, var(--gold) 85%, #000); }
.tour-title { margin: 16px 0 0; font-size: clamp(40px, 10vw, 58px); font-weight: 700; letter-spacing: -0.045em; line-height: 1.08; color: var(--gold); overflow-wrap: anywhere; }
.tour-title .artist { display: block; font-size: 0.44em; font-weight: 500; letter-spacing: 0.12em; color: #fff; margin-bottom: 8px; }

.countdown { margin-top: 26px; }
.cd-pill {
  display: inline-flex; align-items: center; gap: clamp(12px, 3.4vw, 18px);
  padding: clamp(11px, 3vw, 15px) clamp(20px, 5.6vw, 30px); border-radius: var(--radius);
  background: color-mix(in srgb, #000 55%, var(--bg-deep)); font-family: var(--font-mono);
}
.cd-dday, .cd-clock { font-size: clamp(26px, 7.6vw, 36px); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cd-dday { color: #fff; }
.cd-clock { color: #e7e3d8; }
.cd-sep { width: 1px; align-self: stretch; background: color-mix(in srgb, var(--cream) 30%, transparent); }
.cd-pill.is-live .cd-dday { color: var(--chant); }
.cd-pill.is-end .cd-dday { color: #b9b3a6; letter-spacing: 0.16em; }
.cd-pill.is-end .cd-sep, .cd-pill.is-end .cd-clock { display: none; }

.show-meta { margin-top: 30px; width: 100%; max-width: 420px; text-align: left; }
.show-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 13px 2px; border-top: 1px solid color-mix(in srgb, var(--cream) 16%, transparent); }
.show-row.past { opacity: 0.45; }
.show-row.live .show-day, .show-row.live .show-time { color: var(--chant); }
.show-day { font-size: clamp(18px, 5vw, 22px); color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.show-day .dow { margin-left: 6px; }
.show-time { font-size: clamp(16px, 4.4vw, 20px); color: #b9b3a6; font-variant-numeric: tabular-nums; }
.show-venue { padding-top: 13px; border-top: 1px solid color-mix(in srgb, var(--cream) 16%, transparent); font-size: clamp(12px, 3.2vw, 13px); letter-spacing: 0.08em; color: color-mix(in srgb, var(--gold) 85%, #000); }

.today-card { margin-top: 18px; width: 100%; max-width: 420px; text-align: left; padding: 14px 16px; border-radius: var(--radius); background: color-mix(in srgb, #000 45%, var(--bg-deep)); }
.today-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gold); letter-spacing: 0.06em; }
.today-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chant); }
.today-list { list-style: none; margin: 10px 0 0; padding: 0; }
.today-list li { display: flex; gap: 14px; padding: 6px 0; font-size: 14px; color: #ddd6c4; }
.today-list li.done { opacity: 0.45; }
.today-list li.now { color: #fff; font-weight: 600; }
.today-list time { font-variant-numeric: tabular-nums; color: var(--gold); min-width: 44px; }

.main-menu { width: 100%; max-width: 560px; margin-top: 30px; display: grid; gap: 10px; }
.menu-btn {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; border-radius: var(--radius);
  padding: 20px 24px; background: var(--gold); color: #1d1408; cursor: pointer; text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: 0.04em;
  transition: background 0.2s;
}
.menu-btn:hover { background: color-mix(in srgb, var(--gold) 88%, #000); }
.menu-btn.secondary { background: color-mix(in srgb, #000 40%, var(--bg-deep)); color: var(--cream); border: 1px solid color-mix(in srgb, var(--gold) 24%, transparent); }
.menu-btn.secondary:hover { background: color-mix(in srgb, #000 25%, var(--bg-deep)); }
.menu-btn small { font-size: 11px; font-weight: 500; color: var(--chant); letter-spacing: 0.08em; }

.menu-card { width: 100%; max-width: 560px; margin: 14px auto 0; border: 1px solid color-mix(in srgb, var(--gold) 18%, transparent); border-radius: var(--radius); overflow: hidden; background: color-mix(in srgb, #000 30%, var(--bg-deep)); text-align: left; }
.info-card + .info-card { border-top: 1px solid color-mix(in srgb, var(--gold) 14%, transparent); }
.menu-row {
  width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: none; border: 0;
  color: var(--cream); text-align: left; cursor: pointer; transition: background 0.2s;
}
.menu-row:hover { background: rgba(255, 255, 255, 0.04); }
.menu-row .ic { width: 16px; height: 16px; color: var(--gold); }
.menu-row-label { flex: 1; min-width: 0; font-size: 13.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-row .chev { color: color-mix(in srgb, var(--cream) 60%, transparent); transition: transform 0.25s; }
.info-card.open .chev { transform: rotate(180deg); }
.info-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease; }
.info-card.open .info-panel { grid-template-rows: 1fr; }
.info-panel > div { overflow: hidden; }
.info-panel-inner { padding: 6px 18px 22px; font-size: 14px; line-height: 1.75; color: #e9e2cf; }

.home-aside { width: 100%; max-width: 560px; margin-top: 14px; padding: 16px 18px; border-radius: var(--radius); text-align: left; background: color-mix(in srgb, #000 30%, var(--bg-deep)); border: 1px solid color-mix(in srgb, var(--gold) 14%, transparent); }
.home-aside h3 { margin: 0 0 6px; font-size: 14px; color: var(--gold); display: flex; gap: 8px; align-items: center; }
.home-aside p { margin: 0; font-size: 13px; line-height: 1.75; color: #d9d1bc; white-space: pre-line; }
.home-foot { margin-top: 18px; display: flex; justify-content: center; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: var(--pill); border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 13px; cursor: pointer; }
.pill-btn .ic { width: 15px; height: 15px; }
.pill-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* ─────────────── 資訊卡內容（Markdown） ─────────────── */
.md-title { text-align: center; color: var(--gold); font-size: 13px; letter-spacing: 0.1em; margin: 14px 0 12px; }
.md-title .bar { opacity: 0.45; }
.md-h { margin: 20px 0 8px; font-size: 14.5px; color: #fff; display: flex; align-items: baseline; gap: 8px; }
.md-h span { font-size: 11px; font-weight: 500; color: var(--chant); letter-spacing: 0.06em; }
.md-hr { border: 0; border-top: 1px solid color-mix(in srgb, var(--gold) 16%, transparent); margin: 22px 0; }
.md-facts { display: grid; grid-template-columns: 6.2em 1fr; gap: 10px 14px; margin: 8px 0 14px; }
.md-facts dt { color: color-mix(in srgb, var(--gold) 80%, #000); font-size: 13px; }
.md-facts dd { margin: 0; color: #fff; }
.md-facts .sub, .md-ul .sub { display: block; font-size: 12px; color: #a99f8a; line-height: 1.6; }
.em { color: var(--gold); font-weight: 600; }
.md-ul { margin: 6px 0 12px; padding-left: 1.15em; }
.md-ul li { margin: 4px 0; }
.md-ul li::marker { color: var(--gold); }
.md-ul.warn li::marker { color: #ff7a6b; }
.md-note { margin: 10px 0 14px; padding: 12px 14px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.05); color: #e9e2cf; font-size: 13.5px; }
.md-foot { margin: 16px 0 0; font-size: 12px; line-height: 1.7; color: #a99f8a; }
.md-table-wrap { overflow-x: auto; margin: 8px 0 12px; }
.md-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md-table th, .md-table td { padding: 9px 8px; border-bottom: 1px solid color-mix(in srgb, var(--gold) 14%, transparent); text-align: left; vertical-align: top; }
.md-table th { color: var(--gold); font-weight: 500; font-size: 12px; }
.md-table td.label { color: #fff; white-space: nowrap; }
@media (max-width: 480px) {
  .md-table thead { display: none; }
  .md-table tr { display: block; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--gold) 14%, transparent); }
  .md-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; }
  .md-table td::before { content: attr(data-label); color: #a99f8a; font-size: 12px; flex: none; }
  .md-table td.label { font-weight: 600; }
  .md-table td.label::before { content: none; }
}
.md-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.md-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.07); border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent); color: var(--gold); text-decoration: none; font-size: 13px; }
.md-btn:hover { background: rgba(255, 255, 255, 0.12); }
.md-btn svg { width: 14px; height: 14px; flex: none; }
.md-imgs { margin: 10px 0 12px; }
.md-imgs.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.md-img { display: block; width: 100%; padding: 0; border: 0; background: rgba(255, 255, 255, 0.05); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; text-align: left; }
.md-img img { display: block; width: 100%; height: auto; }
.md-imgs.grid .md-img img { aspect-ratio: 3 / 4; object-fit: cover; }
.md-img span { display: block; padding: 6px 10px; font-size: 12px; color: #a99f8a; }
.info-panel-inner a:not(.md-btn) { color: var(--gold); }

/* 頁尾 */
.credits { text-align: center; padding: 18px 16px max(18px, var(--safe-bottom)); font-size: 11px; line-height: 1.6; color: var(--ui-muted); letter-spacing: 0.03em; }
.is-home .credits { color: color-mix(in srgb, var(--gold) 70%, #000); background: var(--bg-deep); }
.credits p { margin: 0 0 6px; white-space: pre-line; }
.credits nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.credits a { color: inherit; }

/* ═══════════════ 閱讀頁（指南、歌單） ═══════════════ */
.page { min-height: 100svh; background: var(--ui-bg); color: var(--ui-text); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-top)) 14px 10px; background: color-mix(in srgb, var(--ui-surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--ui-line);
}
.topbar-title { flex: 1; text-align: center; font-size: 15px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reading { max-width: 640px; margin: 0 auto; padding: 28px 16px 40px; }
.reading h1 { margin: 0; text-align: center; font-size: 22px; letter-spacing: 0.02em; }
.reading .lede { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--ui-muted); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 14px 0 0; font-size: 12px; color: var(--ui-muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.cue { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.cue .ic { width: 13px; height: 13px; }
.cue-chant { background: color-mix(in srgb, var(--chant) 18%, transparent); color: var(--ui-chant); }
.cue-clap { background: color-mix(in srgb, var(--clap) 18%, transparent); color: var(--clap); }
.cue-wave { background: color-mix(in srgb, var(--wave) 20%, transparent); color: color-mix(in srgb, var(--wave) 75%, var(--ui-text)); }
.cue-jump { background: color-mix(in srgb, var(--jump) 18%, transparent); color: var(--jump); }
.cue-spin { background: color-mix(in srgb, var(--spin) 18%, transparent); color: var(--spin); }

.help { margin: 22px 0 0; border-radius: var(--radius); background: var(--ui-surface); }
.help summary { list-style: none; cursor: pointer; padding: 12px 16px; font-size: 13px; display: flex; justify-content: space-between; }
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: "+"; color: var(--ui-muted); }
.help[open] summary::after { content: "−"; }
.help div { padding: 0 16px 14px; font-size: 13px; color: var(--ui-muted); white-space: pre-line; }

.search { margin-top: 22px; }
.search label { display: block; font-size: 12px; color: var(--ui-muted); margin-bottom: 6px; }
.search-field { display: flex; align-items: center; gap: 8px; height: var(--touch-h); padding: 0 14px; border-radius: var(--radius); background: var(--ui-raised); }
.search-field:focus-within { outline: 2px solid var(--ui-text); outline-offset: 1px; }
.search-field .ic { width: 16px; height: 16px; color: var(--ui-muted); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ui-text); font: inherit; font-size: 16px; }
.segmented { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; padding: 4px; margin-top: 14px; border-radius: 10px; background: var(--ui-raised); }
.segmented button { height: 36px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 13px; color: var(--ui-muted); }
.segmented button[aria-pressed="true"] { background: var(--ui-surface); color: var(--ui-text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.count { margin: 16px 2px 6px; font-size: 12px; color: var(--ui-muted); }
.song-list { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); overflow: hidden; background: var(--ui-surface); }
.song-row { width: 100%; display: flex; align-items: center; gap: 13px; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--ui-line); background: none; text-align: left; cursor: pointer; text-decoration: none; color: var(--ui-text); transition: background 0.15s; }
.song-list li:last-child .song-row { border-bottom: 0; }
.song-row:hover { background: color-mix(in srgb, var(--ui-raised) 50%, transparent); }
.song-no { font-size: 13px; color: var(--ui-muted); font-variant-numeric: tabular-nums; min-width: 22px; }
.song-name { flex: 1; min-width: 0; font-size: 15px; }
.song-name small { color: var(--ui-muted); font-size: 13px; margin-left: 4px; }
.song-tags { display: flex; align-items: center; gap: 8px; color: var(--ui-muted); font-size: 11px; }
.song-tags .chant-n { display: inline-flex; align-items: center; gap: 2px; color: var(--ui-chant); font-variant-numeric: tabular-nums; }
.song-tags .ic { width: 13px; height: 13px; }
.song-tags .muted { opacity: 0.55; }
.no-result { padding: 30px; text-align: center; color: var(--ui-muted); font-size: 14px; }

/* 劇透閘門 */
.gate { position: relative; min-height: calc(100svh - 61px); display: grid; place-items: center; padding: 30px 20px; overflow: hidden; }
.gate-bg { position: absolute; inset: 0; background: var(--poster, none) center / cover no-repeat; filter: grayscale(1); opacity: 0.12; }
.gate-inner { position: relative; max-width: 380px; width: 100%; text-align: center; }
.gate-icon { width: 44px; height: 44px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 10px; background: var(--ui-raised); }
.gate h2 { margin: 0 0 10px; font-size: 22px; }
.gate p { margin: 0 0 22px; font-size: 13px; color: var(--ui-muted); white-space: pre-line; }
.gate .btn { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 12px; margin-top: 10px; border-radius: var(--radius); border: 0; cursor: pointer; background: var(--ui-surface); color: var(--ui-text); text-decoration: none; font-size: 14px; }
.gate .btn small { font-size: 11px; color: var(--ui-muted); }
.gate .btn b small, .gate .btn .tag { color: #d4380d; font-size: 10px; margin-left: 4px; font-weight: 500; }
.gate .btn.primary { background: var(--gold); color: #1d1408; font-weight: 600; padding: 15px; }

/* ═══════════════ 歌曲頁 ═══════════════ */
.song-page { height: 100svh; display: flex; flex-direction: column; background: var(--ui-bg); }
.song-top { display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-top)) 12px 10px; }
.song-nav { flex: 1; min-width: 0; display: flex; align-items: center; height: var(--control-h); border-radius: var(--pill); background: var(--ui-raised); }
.song-nav .nav-btn { width: 40px; height: 40px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--ui-text); border-radius: 50%; }
.song-nav .nav-btn:disabled { opacity: 0.3; cursor: default; }
.song-nav .nav-btn .ic { width: 14px; height: 14px; }
.picker-btn { flex: 1; min-width: 0; height: 40px; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; }
.picker-btn span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.picker-btn small { color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.picker-btn .ic { width: 14px; height: 14px; color: var(--ui-muted); }

.song-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.video-col { padding: 0 12px; }
.video-box { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.video-box iframe, .video-box > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #aaa; font-size: 13px; text-align: center; padding: 16px; }
.video-meta { display: flex; justify-content: space-between; gap: 10px; margin: 8px 2px 0; font-size: 11.5px; color: var(--ui-muted); }
.video-meta a { color: var(--ui-muted); white-space: nowrap; }
.video-meta .hint::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--wave); margin-right: 6px; vertical-align: 1px; }
.song-note { margin: 10px 2px 0; padding: 10px 12px; border-radius: var(--radius); background: var(--ui-surface); font-size: 12.5px; color: var(--ui-muted); white-space: pre-line; }
.song-legend { justify-content: center; margin-top: 8px; }

.lyrics { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 40vh; scroll-behavior: smooth; overscroll-behavior: contain; }
.lyric {
  position: relative; display: block; width: 100%; padding: 10px 14px 10px 36px; margin: 2px 0; border: 0; border-radius: 10px; background: none;
  text-align: left; cursor: pointer; color: var(--ui-text); transition: opacity 0.25s, background 0.25s;
}
.lyrics.playing .lyric { opacity: 0.5; }
.lyrics.playing .lyric.current, .lyric:hover, .lyric:focus-visible { opacity: 1; }
.lyric.current { background: var(--ui-surface); box-shadow: inset 3px 0 0 var(--ui-accent); }
.lyric-cues { position: absolute; left: 8px; top: 12px; display: flex; flex-direction: column; gap: 3px; }
.lyric-cues .cue { width: 20px; height: 20px; }
.lyric.current .lyric-cues .cue { animation: beat var(--beat) ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.ly-ja, .ly-ro, .ly-zh { display: block; }
.ly-ja { font-family: var(--font-jp); font-size: 15px; line-height: 1.9; }
.ly-ja rt { font-size: 0.55em; color: var(--ui-muted); }
.ly-ro { font-size: 12px; color: var(--ui-muted); letter-spacing: 0.02em; }
.ly-zh { font-size: 14px; line-height: 1.6; color: var(--ui-text); margin-top: 1px; }
.lyric.chant .ly-ja, .lyric.chant .ly-zh { color: var(--ui-chant); font-weight: 600; }
.ly-note { display: inline-block; margin-top: 4px; font-size: 11.5px; color: var(--ui-accent); }
.lyric.blank { padding-top: 4px; padding-bottom: 4px; min-height: 14px; }
/* 卡拉 OK：目前行由左至右填色 */
.karaoke .lyric.current .ly-ja .fill {
  --k-done: var(--ui-chant);
  --k-todo: var(--ui-text);
  background: linear-gradient(90deg, var(--k-done) var(--p, 0%), var(--k-todo) var(--p, 0%));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.karaoke .lyric.chant.current .ly-ja .fill { --k-done: var(--ui-text); --k-todo: var(--ui-chant); }
.karaoke .lyric.current .ly-ja .fill rt { -webkit-text-fill-color: var(--ui-muted); }
.hide-ja .ly-ja, .hide-ja .ly-ro { display: none; }
.hide-zh .ly-zh { display: none; }
.read-off rt, .read-romaji rt { display: none; }
.read-off .ly-ro, .read-kana .ly-ro { display: none; }

.dock {
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px calc(8px + var(--safe-bottom)); border-top: 1px solid var(--ui-line);
  background: var(--ui-surface); scrollbar-width: none;
}
.dock::-webkit-scrollbar { display: none; }
.dock-item { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: var(--radius); border: 0; background: var(--ui-raised); font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ui-text); }
.dock-item select { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.dock-item .val { color: var(--ui-muted); font-weight: 500; }
.switch { width: 28px; height: 16px; border-radius: 8px; background: color-mix(in srgb, var(--ui-muted) 45%, transparent); position: relative; transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
[aria-pressed="true"] .switch { background: var(--ui-accent); }
[aria-pressed="true"] .switch::after { transform: translateX(12px); }

@media (min-width: 900px) {
  .song-body { flex-direction: row; }
  .video-col { flex: 1.15; display: flex; flex-direction: column; justify-content: center; padding: 0 18px 0 18px; overflow-y: auto; }
  .lyrics { flex: 1; padding: 30vh 16px 50vh; background: var(--ui-surface); border-left: 1px solid var(--ui-line); }
  .lyric.current { background: var(--ui-raised); }
}
@media (max-width: 899px) {
  .video-col { position: sticky; top: 0; z-index: 2; background: var(--ui-bg); padding-bottom: 8px; }
  .song-note, .song-legend { display: none; }
}

/* 選歌浮層 */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.4); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 80svh; display: flex; flex-direction: column; background: var(--ui-surface); border-radius: 16px 16px 0 0; box-shadow: var(--float); }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 16px; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--ui-line); }
.sheet-head h2 { flex: 1; margin: 0; font-size: 15px; }
.sheet .search { margin: 12px 16px 0; }
.sheet-list { overflow-y: auto; padding: 8px 0 calc(12px + var(--safe-bottom)); list-style: none; margin: 0; }
.sheet-list .song-row { padding: 13px 18px; }
.sheet-list .song-row[aria-current="true"] { background: var(--ui-raised); }

/* 圖片放大 */
.viewer { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: rgba(10, 10, 12, 0.94); color: #fff; }
.viewer-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-top)) 14px 10px; font-size: 13px; }
.viewer-head span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-scroll { flex: 1; overflow: auto; display: grid; place-items: center; padding: 10px; }
.viewer-scroll img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer.zoomed .viewer-scroll img { max-width: none; max-height: none; width: 200%; }
.viewer-nav { display: flex; justify-content: center; gap: 8px; padding: 10px 14px calc(14px + var(--safe-bottom)); }
.viewer .round-btn, .viewer .pill-btn { background: rgba(255, 255, 255, 0.14); color: #fff; }

/* 提示列 */
.toast { position: fixed; left: 50%; bottom: calc(80px + var(--safe-bottom)); transform: translateX(-50%); z-index: 70; padding: 10px 16px; border-radius: var(--pill); background: #1d1d1f; color: #fff; font-size: 13px; box-shadow: var(--float); }
body:has(.song-page) .demo-flag { display: none; }
.demo-flag { position: fixed; left: 8px; bottom: 8px; z-index: 80; padding: 4px 10px; border-radius: var(--pill); background: #ffd666; color: #3a2a00; font-size: 11px; font-weight: 600; text-decoration: none; }

/* 藝人總覽（網站根目錄） */
.directory { max-width: 640px; margin: 0 auto; padding: calc(40px + var(--safe-top)) 16px 40px; }
.directory h1 { font-size: 22px; text-align: center; margin: 0 0 24px; }
.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.artist-tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 3 / 4; padding: 14px; border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--t-cream); background: var(--t-deep) var(--t-poster, none) center / cover; isolation: isolate; }
.artist-tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(transparent 30%, color-mix(in srgb, var(--t-deep) 92%, transparent)); }
.artist-tile small { color: var(--t-gold); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.artist-tile b { font-size: 18px; color: #fff; }
.artist-tile span { color: var(--t-gold); font-size: 14px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
