:root {
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --ink: #121418;
  --muted: #5A616C;
  --line: #D6DAE0;
  --accent: #E0431A;
  --accent-ink: #FFFFFF;
  --chan: #1D6B57;
  --tick: #9BA2AD;
  --shadow: 0 1px 0 rgba(0,0,0,.04);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0D0F12;
  --surface: #15181D;
  --ink: #ECEEF1;
  --muted: #98A0AB;
  --line: #2A2F37;
  --accent: #FF6A3D;
  --accent-ink: #0D0F12;
  --chan: #4FC3A1;
  --tick: #4A515C;
  --shadow: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D0F12; --surface: #15181D; --ink: #ECEEF1; --muted: #98A0AB; --line: #2A2F37;
    --accent: #FF6A3D; --accent-ink: #0D0F12; --chan: #4FC3A1; --tick: #4A515C; --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* SVG 的 hidden 屬性預設不生效 */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom);
}
.mono { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top bar */
.top {
  max-width: 760px; margin: 0 auto; padding: 14px 16px 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand-mark {
  width: 22px; height: 22px; border: 2px solid var(--ink); position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 2px; margin-top: -1px; background: var(--accent);
}
.brand-name { font-weight: 900; letter-spacing: .12em; font-size: 18px; }
.icon-btn {
  min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; font-weight: 700;
}

/* channels: underline tabs */
.channels {
  max-width: 760px; margin: 0 auto; padding: 0 16px;
  display: flex; gap: 22px; border-bottom: 1px solid var(--line); overflow-x: auto;
}
.channel {
  position: relative; min-height: 48px; padding: 0 2px; white-space: nowrap;
  font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 8px;
}
.channel .freq { font-size: 12px; color: var(--tick); }
.channel[aria-selected="true"] { color: var(--ink); }
.channel[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--chan);
}

main { max-width: 760px; margin: 0 auto; padding: 16px; }

/* deck */
.deck {
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 18px 18px 14px;
}
.deck-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modes { display: flex; border: 1px solid var(--line); }
.mode {
  min-height: 44px; min-width: 76px; padding: 0 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; color: var(--muted); font-size: 15px;
}
.mode + .mode { border-left: 1px solid var(--line); }
.mode[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.onair-dot { width: 8px; height: 8px; background: var(--tick); display: inline-block; }
.mode[data-mode="live"][aria-pressed="true"] .onair-dot { background: var(--accent); }
body.playing .mode[data-mode="live"][aria-pressed="true"] .onair-dot { animation: blink 1.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.clock { font-size: 22px; font-weight: 600; letter-spacing: .04em; }

.now-book { margin: 16px 0 2px; color: var(--muted); font-size: 14px; }
.now-title { margin: 0; font-size: 24px; line-height: 1.35; font-weight: 900; letter-spacing: .01em; }
.now-label { margin: 6px 0 0; font-size: 14px; color: var(--chan); font-weight: 700; }

/* tuning dial: one tick per episode in the channel loop */
.dial { position: relative; height: 34px; margin: 18px 0 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.dial-ticks { position: absolute; inset: 0; display: flex; }
.dial-ticks span { position: relative; height: 100%; border-left: 1px solid var(--tick); }
.dial-ticks span.brief { border-left: 2px solid var(--ink); }
.dial-ticks span::after { content: ""; position: absolute; left: 50%; top: 0; width: 1px; height: 30%; background: var(--line); }
.dial-needle { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--accent); left: 0; transition: left .6s linear; }

.scrub { margin-top: 8px; }
input[type=range] { width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: var(--line); }
input[type=range]::-moz-range-track { height: 4px; background: var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; background: var(--accent); border: 0; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; background: var(--accent); border: 0; border-radius: 0; }
input[type=range]:disabled::-webkit-slider-thumb { background: var(--tick); }
.times { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: -6px; }
/* 換集、緩衝、重新連線時的一行提示（讓人知道不用手動按） */
.status { margin: 6px 0 0; font-size: 13px; color: var(--muted); text-align: center; }

.controls { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 12px 0 10px; }
.ctl { min-width: 56px; min-height: 56px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 15px; font-weight: 600; }
.ctl.play { width: 76px; height: 76px; background: var(--accent); color: var(--accent-ink); border: 0; }
.ctl:disabled { opacity: .35; cursor: default; }

.subcontrols { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.chip { min-height: 46px; font-size: 14px; font-weight: 600; color: var(--ink); padding: 0 4px; }
.chip + .chip { border-left: 1px solid var(--line); }
.chip.on { color: var(--accent); }
.chip:disabled { color: var(--tick); cursor: default; }

.notes { margin-top: 14px; border-top: 1px solid var(--line); }
.notes summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; list-style: none; }
.notes summary::-webkit-details-marker { display: none; }
.notes summary::after { content: "+"; margin-left: auto; font-family: "IBM Plex Mono", monospace; font-size: 20px; color: var(--muted); }
.notes[open] summary::after { content: "−"; }
.notes-body { font-size: 15px; color: var(--ink); padding-bottom: 6px; }
.notes-body h4 { margin: 10px 0 4px; font-size: 14px; color: var(--muted); }
.notes-body ul { margin: 0; padding-left: 20px; }
/* 播放數據：給凱文複製給 agent 看的診斷文字 */
.stats-hint { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.stats-actions { display: flex; border: 1px solid var(--line); }
.stats-actions .chip { flex: 1; }
.stats-text {
  margin: 10px 0 6px; padding: 10px; max-height: 50vh; overflow: auto;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
  -webkit-user-select: text; user-select: text;
}
.notes-body li { margin: 3px 0; }

/* library */
.library { margin-top: 26px; }

/* 本週節目表（09-29）：日期分頁＋一天的清單；正在播的那列標「播放中」 */
.deck-side { display: flex; align-items: center; gap: 10px; }
.schedule { margin-top: 26px; }
.schedule-head { margin-bottom: 12px; }
.schedule-title { margin: 0; font-size: 18px; font-weight: 900; }
.schedule-note { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.schedule-days { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); }
.schedule-day { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 13px; font-weight: 700; }
.schedule-day + .schedule-day { border-left: 1px solid var(--line); }
.schedule-day.on { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.schedule-date { font-size: 12px; font-weight: 500; }
.schedule-days { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); }
/* 清單：左邊 52px 時間、一條時間軸（每列一個點）、右邊內容；同一本書一組，組頭是書名首字色塊 */
.schedule-list { list-style: none; margin: 12px 0 0; padding: 0; position: relative; }
.schedule-list::before { content: ""; position: absolute; left: 63px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.schedule-book-head { display: grid; grid-template-columns: 52px auto 1fr; gap: 12px; align-items: center; padding: 18px 0 8px; position: relative; }
.schedule-book-head:first-child { padding-top: 6px; }
.schedule-mono {
  grid-column: 1; justify-self: end; width: 36px; height: 36px; display: grid; place-items: center;
  background: hsl(var(--hue) 45% 38%); color: #fff; font-weight: 900; font-size: 18px; position: relative; z-index: 1;
}
.schedule-book-title { font-size: 15px; font-weight: 900; }
.schedule-book-author { font-size: 12px; color: var(--muted); grid-column: 3; justify-self: end; }
.schedule-row { display: grid; grid-template-columns: 52px 22px 1fr; gap: 0 4px; align-items: start; padding: 8px 0; position: relative; }
.schedule-row + .schedule-row { border-top: 1px solid var(--line); }
.schedule-row.past { opacity: .5; }
.schedule-row.now { background: var(--surface); margin: 4px -8px; padding: 12px 8px; border-top: 0; box-shadow: inset 3px 0 0 var(--accent); }
.schedule-row.now + .schedule-row { border-top: 0; }
.schedule-time { font-size: 14px; font-weight: 600; padding-top: 2px; color: var(--muted); }
.schedule-row.now .schedule-time { color: var(--ink); }
.schedule-dot { width: 9px; height: 9px; margin: 7px auto 0; background: var(--bg); border: 2px solid var(--tick); position: relative; z-index: 1; }
.schedule-row.past .schedule-dot { border-color: var(--line); }
.schedule-row.now .schedule-dot { background: var(--accent); border-color: var(--accent); }
body.playing .schedule-row.now .schedule-dot { animation: blink 1.6s steps(1) infinite; }
.schedule-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.schedule-ep { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.schedule-row.now .schedule-ep { font-size: 18px; font-weight: 900; }
.schedule-tag { font-size: 12px; color: hsl(var(--hue) 45% 34%); font-weight: 700; }
:root[data-theme="dark"] .schedule-tag { color: hsl(var(--hue) 55% 70%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .schedule-tag { color: hsl(var(--hue) 55% 70%); } }
.schedule-onair { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; margin-top: 2px; }
.schedule-onair .onair-dot { background: var(--accent); }
.schedule-bar { display: block; height: 3px; background: var(--line); margin-top: 6px; }
.schedule-bar i { display: block; height: 100%; background: var(--accent); }
.schedule-empty { padding: 16px 0; color: var(--muted); font-size: 14px; }
/* 電台模式：進度拉桿藏起來後，時間那行不用再往上貼 */
#seek[hidden] + .times { margin-top: 6px; }
.book { margin-bottom: 30px; }
.book-head { border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 4px; }
.book-title { margin: 0; font-size: 20px; font-weight: 900; }
.book-meta { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.book-stats { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.book-stats .bar { height: 3px; background: var(--line); margin-top: 6px; }
.book-stats .bar i { display: block; height: 100%; background: var(--chan); }
.chapter { border-bottom: 1px solid var(--line); }
.ep { display: flex; align-items: center; gap: 4px; }
.ep-main {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  text-align: left; padding: 12px 0; min-height: 64px;
}
.ep-text { display: flex; flex-direction: column; min-width: 0; }
.fav { width: 44px; height: 44px; font-size: 20px; color: var(--tick); flex: none; }
.fav.on { color: var(--accent); }
.ep-play { width: 44px; height: 44px; border: 1px solid var(--line); display: grid; place-items: center; }
.ep.current .ep-play { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ep-title { font-weight: 700; font-size: 16px; line-height: 1.4; }
.ep-sub { font-size: 13px; color: var(--muted); }
.ep-prog { height: 3px; background: var(--line); margin-top: 6px; }
.ep-prog i { display: block; height: 100%; background: var(--chan); }
.ep-right { font-size: 13px; color: var(--muted); text-align: right; min-width: 44px; }
.ep-right .done { color: var(--chan); font-weight: 700; }
.deep-toggle {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 0 10px 56px;
  font-size: 14px; font-weight: 700; color: var(--chan); text-align: left;
}
.deep-toggle .mono { font-weight: 400; }
.deep-list { display: none; padding-left: 8px; border-left: 2px solid var(--chan); margin: 0 0 12px 21px; }
.deep-list.open { display: block; }
.deep-list .ep-main { padding: 8px 0 8px 12px; }

/* account */
.top { position: relative; }
.top-right { display: flex; align-items: center; gap: 8px; flex: none; }
.text-btn {
  min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.brand-name { white-space: nowrap; }
.login-short { display: none; }
/* 09-29 手機頁首多了「電台」鈕後擠到換行：縮間距與內距，登入鈕只寫「登入」 */
@media (max-width: 430px) {
  .top { padding-left: 12px; padding-right: 12px; }
  .top-right { gap: 6px; }
  .text-btn { padding: 0 10px; font-size: 13px; }
  .brand-name { font-size: 16px; letter-spacing: .08em; }
  .login-long { display: none; }
  .login-short { display: inline; }
}
.text-btn.login { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.text-btn.on { border-color: var(--chan); color: var(--chan); }
/* 09-29 凱文：登入後的 Google 相片被裁成 44px 方框不好看 ⇒ 圓形、32px、無外框；沒相片時圓形字母 */
.avatar-btn { width: 44px; height: 44px; border: 0; padding: 0; display: grid; place-items: center; background: transparent; font-weight: 900; }
.avatar-btn img, .avatar-btn span { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; }
.avatar-btn span { background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.avatar-btn span:empty { display: none; }
.account-menu {
  position: absolute; right: 16px; top: 62px; z-index: 10; background: var(--surface); border: 1px solid var(--line);
  padding: 12px; min-width: 220px; box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.account-email { margin: 0 0 10px; font-size: 13px; color: var(--muted); word-break: break-all; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.channel .lock { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 0 6px; font-weight: 500; }
.deck.locked .dial, .deck.locked .scrub, .deck.locked .subcontrols, .deck.locked .notes, .deck.locked #back15, .deck.locked #fwd30 { opacity: .35; pointer-events: none; }
.locked-box { padding: 16px 0; color: var(--muted); }
.locked-box p { margin: 0 0 12px; }
.login-cta { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.mine-row { border-bottom: 1px solid var(--line); padding-top: 8px; }
.mine-from { margin: 0; font-size: 12px; color: var(--muted); padding-left: 56px; }
.empty { color: var(--muted); font-size: 14px; }
.deep-intro { font-size: 13px; color: var(--muted); padding: 6px 0 2px 12px; }

.foot { max-width: 760px; margin: 0 auto; padding: 8px 16px 28px; font-size: 12px; color: var(--muted); }

/* ===== 首頁：電台列表（09-29）===== */
.hero { padding: 14px 0 22px; }
.hero-kicker { margin: 0 0 6px; font-size: 12px; letter-spacing: .18em; color: var(--muted); font-weight: 700; }
.hero-title { margin: 0; font-size: 26px; line-height: 1.3; font-weight: 900; letter-spacing: .01em; text-wrap: balance; }
.hero-sub { margin: 10px 0 0; font-size: 15px; color: var(--muted); max-width: 34em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card-link { display: block; color: inherit; text-decoration: none; min-height: 44px; }
.card-link:hover .card-name, .card-link:focus-visible .card-name { color: hsl(var(--h) 45% 36%); }
/* 卡片上半：SVG 生成的抽象圖，顏色走每台的色相；清淡、留白，日夜各一組 */
.card-art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.card-art svg { display: block; width: 100%; height: 100%; }
.card-art .art-bg { fill: hsl(var(--h) 32% 92%); }
.card-art .art-c1 { fill: hsl(var(--h) 38% 80%); }
.card-art .art-c2 { fill: hsl(var(--h) 48% 62% / .55); }
.card-art .art-lines line { stroke: hsl(var(--h) 30% 70% / .7); stroke-width: 1; }
.card-art .art-sq { fill: hsl(var(--h) 50% 36%); }
:root[data-theme="dark"] .card-art .art-bg { fill: hsl(var(--h) 22% 16%); }
:root[data-theme="dark"] .card-art .art-c1 { fill: hsl(var(--h) 30% 26%); }
:root[data-theme="dark"] .card-art .art-c2 { fill: hsl(var(--h) 45% 45% / .45); }
:root[data-theme="dark"] .card-art .art-lines line { stroke: hsl(var(--h) 25% 40% / .7); }
:root[data-theme="dark"] .card-art .art-sq { fill: hsl(var(--h) 55% 68%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card-art .art-bg { fill: hsl(var(--h) 22% 16%); }
  :root:not([data-theme="light"]) .card-art .art-c1 { fill: hsl(var(--h) 30% 26%); }
  :root:not([data-theme="light"]) .card-art .art-c2 { fill: hsl(var(--h) 45% 45% / .45); }
  :root:not([data-theme="light"]) .card-art .art-lines line { stroke: hsl(var(--h) 25% 40% / .7); }
  :root:not([data-theme="light"]) .card-art .art-sq { fill: hsl(var(--h) 55% 68%); }
}
.card-lock { position: absolute; right: 10px; top: 10px; font-size: 12px; font-weight: 700; padding: 3px 8px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.card-name { margin: 0; font-size: 20px; font-weight: 900; }
.card-tag { margin: 0; font-size: 14px; color: var(--ink); }
.card-meta { margin: 0; font-size: 12px; color: var(--muted); }
.card-now { margin: 4px 0 0; font-size: 13px; color: hsl(var(--h) 45% 36%); font-weight: 700; display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.card-now .onair-dot { background: hsl(var(--h) 50% 40%); flex: none; }
:root[data-theme="dark"] .card-now, :root[data-theme="dark"] .card-link:hover .card-name { color: hsl(var(--h) 55% 70%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card-now, :root:not([data-theme="light"]) .card-link:hover .card-name { color: hsl(var(--h) 55% 70%); } }

/* 首頁（09-30 v2）：介紹下面一顆大播放鍵＋「現在播」；台的色相走左邊那條 */
.home-play { display: flex; align-items: center; gap: 16px; padding: 16px; margin-top: 4px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid hsl(var(--h, 150) 45% 40%); box-shadow: var(--shadow); }
.home-play-btn { width: 84px; height: 84px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.home-play-btn svg { width: 40px; height: 40px; }
.home-now { flex: 1; min-width: 0; min-height: 44px; display: flex; flex-direction: column; gap: 3px; text-align: left; color: var(--ink); padding: 0; }
.home-now-ch { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: hsl(var(--h, 150) 45% 36%); }
.home-now-title { font-size: 18px; font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
.home-now-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
:root[data-theme="dark"] .home-now-ch { color: hsl(var(--h, 150) 55% 70%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .home-now-ch { color: hsl(var(--h, 150) 55% 70%); } }
.home-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.text-btn.nav-btn.on { border-color: var(--chan); color: var(--chan); }

/* 節目頁（09-30 v2）：篩選列（媒介、電台、搜尋）＋一列一個系列（色塊首字＋媒介＋標題＋作者／台／集數＋進度） */
.prog-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { min-height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); }
.chips .chip.on { border-color: var(--accent); color: var(--accent); }
.prog-search { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.prog-list { display: flex; flex-direction: column; gap: 10px; }
.prog { background: var(--surface); border: 1px solid var(--line); }
.prog-link { display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-height: 76px; color: inherit; text-decoration: none; }
.prog-link:hover .prog-title, .prog-link:focus-visible .prog-title { color: hsl(var(--h) 45% 36%); }
.book-mono { flex: none; width: 48px; height: 48px; display: grid; place-items: center; background: hsl(var(--h) 45% 38%); color: #fff; font-weight: 900; font-size: 22px; }
:root[data-theme="dark"] .book-mono { background: hsl(var(--h) 40% 34%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .book-mono { background: hsl(var(--h) 40% 34%); } }
.prog-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.prog-kind { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: hsl(var(--h) 45% 36%); }
:root[data-theme="dark"] .prog-kind { color: hsl(var(--h) 55% 70%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .prog-kind { color: hsl(var(--h) 55% 70%); } }
.prog-title { font-size: 16px; font-weight: 900; overflow-wrap: anywhere; }
.prog-meta { font-size: 12px; color: var(--muted); }
.prog-play { flex: none; width: 44px; height: 44px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); }
.book-card-prog { display: block; height: 3px; background: var(--line); margin-top: 4px; }
.book-card-prog i { display: block; height: 100%; background: hsl(var(--h) 45% 40%); }
.book-card-done { font-size: 11px; color: var(--muted); }
/* ===== 09-30：onair 站、許願板、選領域、我的電台 ===== */
/* onair 頁首多一顆「許願」：手機上放不下日夜切換（390px 實測「日」貼到畫面邊緣）⇒ 手機收起來，日夜跟系統設定 */
@media (max-width: 430px) {
  body[data-site="onair"] #themeBtn { display: none; }
  body[data-site="onair"] .top-right { gap: 4px; }
  body[data-site="onair"] .top-right .text-btn { padding: 0 8px; }
}
.text-btn.primary-btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.home-empty { padding: 20px 16px; margin-top: 4px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.home-empty-title { margin: 0; font-size: 20px; font-weight: 900; }
.home-empty-sub { margin: 0 0 6px; font-size: 14px; color: var(--muted); }

.wish-form { display: flex; flex-direction: column; gap: 8px; padding: 14px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); }
.wish-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.wish-form input, .wish-form textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; line-height: 1.5; padding: 10px; min-height: 44px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.wish-form textarea { resize: vertical; }
.wish-login { margin: 0 0 18px; }
.wish-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wish { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); }
.wish-vote { flex: none; width: 52px; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted); }
.wish-vote[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.wish-vote:disabled { cursor: default; opacity: .7; }
.wish-arrow { font-size: 12px; line-height: 1; }
.wish-count { font-size: 17px; font-weight: 700; color: var(--ink); }
.wish-vote[aria-pressed="true"] .wish-count { color: var(--accent); }
.wish-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.wish-status { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 1px 8px; border: 1px solid var(--line); color: var(--muted); }
.wish-pending .wish-status { border-color: var(--accent); color: var(--accent); }
.wish-done .wish-status { border-color: var(--chan); color: var(--chan); }
.wish-title { margin: 0; font-size: 16px; font-weight: 900; overflow-wrap: anywhere; }
.wish-text { margin: 0; font-size: 14px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.wish-reply { margin: 2px 0 0; font-size: 14px; border-left: 3px solid var(--chan); padding-left: 8px; overflow-wrap: anywhere; }

.interest-chips { margin: 4px 0 8px; }
.chip.interest { font-size: 16px; padding: 0 18px; }
.chip.interest[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.interest-actions { margin-top: 10px; flex-wrap: wrap; }

.pref-hint { margin: 8px 0; font-size: 13px; color: var(--muted); }
.pref-warn { color: var(--accent); }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--line);
  border-left: 4px solid hsl(var(--h, 150) 45% 40%); padding-left: 12px; cursor: pointer; }
.pref-name { font-weight: 700; }
.pref-switch { width: 22px; height: 22px; accent-color: var(--accent); }

/* 節目單書頭的「原始來源」連結（文章／課程系列） */
.book-src { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 700; color: var(--chan); }

/* ===== 其他頁面的頁首 ===== */
/* 書籤鈕與訊息（標題下方） */
.now-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; min-height: 0; flex-wrap: wrap; }
.now-actions:empty { display: none; }
.text-btn.bookmark { border-color: var(--ink); }
.bookmark-msg { font-size: 13px; color: var(--muted); flex: 1; min-width: 12em; }
.note { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.note-meta { margin: 0; font-size: 12px; color: var(--muted); }
.note-text { margin: 0; font-size: 15px; line-height: 1.6; }
.note-raw { color: var(--muted); font-size: 14px; }
.note-pending { color: var(--muted); }
.note-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.note-kind { font-weight: 700; color: var(--chan); }
.note-body { margin: 0; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; border-left: 3px solid var(--line); padding-left: 10px; }
.note-edit { display: flex; flex-direction: column; gap: 8px; }
.note-ta, .mynote textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; line-height: 1.6; padding: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; }
.book-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mynote { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.mynote-actions { display: flex; align-items: center; gap: 10px; }
.mynote-msg { font-size: 13px; color: var(--muted); }
.mynote-tools { display: flex; border: 1px solid var(--line); }
.mynote-tools .chip { flex: 1; min-height: 44px; }
.mynote-tools .chip + .chip { border-left: 1px solid var(--line); }
.note-body ul, .note-body ol { margin: 4px 0; padding-left: 22px; }
.note-body p { margin: 0 0 4px; }
.note-ts { display: inline-block; min-height: 32px; padding: 0 6px; border: 1px solid var(--line); background: var(--surface); color: var(--chan); font-weight: 700; font-size: 13px; }
.note-ts-plain { color: var(--chan); font-weight: 700; }
.bookmark-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding: 10px; border: 1px solid var(--line); background: var(--bg); }
.bookmark-edit textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; line-height: 1.5; padding: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); resize: vertical; }
.account-toggle { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); min-height: 44px; }
.account-toggle input { width: 18px; height: 18px; }
/* 電台模式的「接下來」（取代整份書單） */
.upnext-list { list-style: none; margin: 8px 0 0; padding: 0; }
.upnext-row { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.upnext-row.now .upnext-title { font-size: 17px; font-weight: 900; }
.upnext-time { font-size: 14px; color: var(--muted); padding-top: 2px; }
.upnext-row.now .upnext-time { color: var(--accent); font-weight: 700; }
.upnext-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.upnext-title { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.upnext-meta { font-size: 12px; color: var(--muted); }
.upnext-hint { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.mynote-others { display: flex; flex-direction: column; gap: 6px; }
.mynote-others:empty { display: none; }
.mynote-others-head { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.note-actions .text-btn, .note-sum { font-size: 13px; }
.page-head { padding: 6px 0 14px; }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.schedule-head { margin-bottom: 0; }
.page-title { margin: 0; font-size: 24px; font-weight: 900; }
.page-sub { margin: 6px 0 0; font-size: 14px; color: var(--muted); }

/* ===== 小播放器：底部固定一條，只有播放／暫停 ===== */
/* 10-01 凱文：iPhone 主畫面 App 模式（或瀏覽器下方工具列收起時）最下面有一條白邊。
   原因：安全區的留白（Home 手勢條那段）加在整條 .mini 上，那段只有白底，色條與橘色播放鍵沒延伸下去。
   ⇒ 整條不留白；色條改成整條的左邊框（自然延伸到最底），文字區與播放鍵各自往下留安全區，背景跟著延伸 */
.mini {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.08);
  border-left: 10px solid hsl(var(--h, 150) 45% 40%);
}
.mini { display: flex; align-items: stretch; }
.mini-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 16px env(safe-area-inset-bottom, 0px) 12px; text-align: left; color: var(--ink); }
.mini-chip { display: none; }
.mini-play { padding-bottom: env(safe-area-inset-bottom, 0px); }
.mini-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini-book { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-play { width: 64px; min-height: 60px; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
body.has-mini main, body.has-mini .foot { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }

@media (min-width: 720px) {
  .now-title { font-size: 30px; }
  .deck { padding: 26px 28px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .dial-needle { transition: none; }
  body.playing .mode .onair-dot { animation: none; }
}
