/* 像素電視 — the station page.
 *
 * A news portal, not a television in a living room: an app bar, a flat
 * player with a transport bar, the rundown beside it as a playlist, the day
 * as a vertical timeline, the anchors as a row of chips. The page is set in
 * an ordinary sans; pixels live only inside the picture, where the studio
 * is drawn, and in the station's mark.
 *
 * Themes are palettes on :root, switched by data-theme (config.json
 * `theme`, or ?theme= to try one; a viewer's 配色 pick wins in their browser).
 * forest (森林綠) is the default; mono (黑白) is the quiet one for an office screen.
 */

@font-face {
  font-family: "Fusion Pixel 12";
  src: url("vendor/fonts/fusion-pixel-12px-zh_hk.woff2") format("woff2");
  font-display: swap;
}

:root {
  --font: "Noto Sans HK", "PingFang HK", "Microsoft JhengHei", "Hiragino Sans", system-ui, -apple-system, sans-serif;
  --pixel: "Pixelify Sans", "Fusion Pixel 12", system-ui, sans-serif;

  /* forest — 森林綠: a light page, a deep-green bar, the yellow band */
  color-scheme: light;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #e9ebef;
  --text: #1a1a1a;
  --muted: #5f6368;
  --line: #dadce0;
  --brand: #0b6b3a;
  --brand-2: #00a852;
  --on-brand: #ffffff;
  --accent: #ffd200;
  --on-accent: #1a1a1a;
  --live: #e02020;
  --picture: #000000;
  --veil: rgba(243, 244, 246, 0.3);
  --veil-2: rgba(243, 244, 246, 0.72);
  --tv: #1d1f24;
  --tv-2: #2a2d34;
  --tv-chrome: #b8bec8;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
}

:root[data-theme="classic"] {
  color-scheme: dark;
  --bg: #11151c; --surface: #171d26; --surface-2: #0d1117; --text: #e7ecf3; --muted: #93a1b5; --line: #242c38;
  --brand: #1747a6; --brand-2: #2c5fd0; --on-brand: #ffffff; --accent: #f2c14e; --on-accent: #1a1a1a; --live: #d8262f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --veil: rgba(17, 21, 28, 0.45);
  --veil-2: rgba(17, 21, 28, 0.8);
}

:root[data-theme="cnn"] {
  color-scheme: dark;
  --bg: #0e0e10; --surface: #19191c; --surface-2: #111113; --text: #ececec; --muted: #9a9a9a; --line: #2a2a2e;
  --brand: #cc0000; --brand-2: #e01010; --on-brand: #ffffff; --accent: #ffffff; --on-accent: #1a1a1a; --live: #cc0000;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.5);
  --veil: rgba(14, 14, 16, 0.45);
  --veil-2: rgba(14, 14, 16, 0.8);
}

:root[data-theme="bloomberg"] {
  color-scheme: dark;
  --bg: #000000; --surface: #141416; --surface-2: #0a0a0b; --text: #ededed; --muted: #9b9b9b; --line: #2a2a2e;
  --brand: #1f1f24; --brand-2: #2f2f36; --on-brand: #ffffff; --accent: #ffb000; --on-accent: #1a1a1a; --live: #ff8c00;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.6);
  --veil: rgba(0, 0, 0, 0.45);
  --veil-2: rgba(0, 0, 0, 0.8);
}

:root[data-theme="mono"] {
  /* 黑白 — for an office screen: white paper, black type, nothing that glows.
     The picture and the scene behind the page go grey too (below, and tv.js). */
  color-scheme: light;
  --pixel: var(--font);
  --bg: #f2f2f2; --surface: #ffffff; --surface-2: #e8e8e8; --text: #141414; --muted: #5e5e5e; --line: #d4d4d4;
  --brand: #141414; --brand-2: #333333; --on-brand: #ffffff; --accent: #141414; --on-accent: #ffffff; --live: #141414;
  --picture: #0c0c0c;
  --veil: rgba(242, 242, 242, 0.82);
  --veil-2: rgba(242, 242, 242, 0.95);
  --tv: #1c1c1c; --tv-2: #2a2a2a; --tv-chrome: #b0b0b0;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 14px rgba(0, 0, 0, 0.05);
}
:root[data-theme="mono"] :is(canvas, .yt-player) { filter: grayscale(1); }
:root[data-theme="mono"] .tv-line { color: #d8d8d8; background: #111111; box-shadow: inset 0 0 0 1px #2a2a2a; }
:root[data-theme="mono"] .tv-line b { color: #f2f2f2; }
:root[data-theme="mono"] .tv-line i, :root[data-theme="mono"] .tv[data-on="true"] .tv-line i { color: #9a9a9a; }
:root[data-theme="mono"] .tv-led, :root[data-theme="mono"] .tv[data-on="true"] .tv-led { background: #d8d8d8; box-shadow: none; }
:root[data-theme="mono"] .tv[data-on="true"] .tv-power { color: #ffffff; border-color: #7a7a7a; }
:root[data-theme="mono"] .pbtn-sub { background: #141414; }
:root[data-theme="mono"] .transcript-who { color: var(--text) !important; } /* not the anchor's own colour */
:root[data-theme="mono"] :is(.pill-live i, .now-dot) { animation: none; }

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  /* The set on air, as a pixel scene behind the page (tv.js renderBackdrop), under a veil. */
  background-image: linear-gradient(var(--veil), var(--veil-2)), var(--backdrop, none);
  background-size: cover, cover;
  background-position: center top;
  background-attachment: fixed, fixed;
  image-rendering: pixelated;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

p { margin: 0; }
a { color: var(--brand-2); }
h2, h3 { margin: 0; font-weight: 700; }

/* ------------------------------------------------------------------ */
/* App bar                                                             */
/* ------------------------------------------------------------------ */

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 56px;
  padding: 0 max(16px, calc((100% - 1180px) / 2));
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }

/* The mark: T, C, N on a five-row pixel grid (logo.svg), tinted by currentColor
   through a mask, so one file serves the yellow box, the dark chin and the card. */
.mark {
  display: inline-block;
  width: 2.4em;
  height: 1em;
  vertical-align: -0.1em;
  background: currentColor;
  -webkit-mask: url("logo.svg") center / contain no-repeat;
  mask: url("logo.svg") center / contain no-repeat;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  padding: 5px 8px;
  font-size: 15px;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 4px;
}

.brand-text strong { display: block; font-size: 18px; line-height: 1.1; }
.brand-text small { display: block; font-size: 11px; opacity: 0.8; letter-spacing: 0.08em; }

.appnav { display: flex; gap: 2px; margin-left: 8px; }

.appnav a {
  padding: 6px 12px;
  color: inherit;
  text-decoration: none;
  font-size: 15px;
  border-radius: 999px;
  opacity: 0.9;
}

.appnav a:hover { background: rgba(255, 255, 255, 0.14); opacity: 1; }

.appask {
  display: flex;
  flex: 1 1 280px;
  max-width: 420px;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  overflow: hidden;
}

.appask input {
  flex: 1;
  min-width: 0;
  padding: 7px 14px;
  font: 14px var(--font);
  color: var(--on-brand);
  background: transparent;
  border: 0;
  outline: none;
}

.appask input::placeholder { color: rgba(255, 255, 255, 0.7); }

.appask button {
  padding: 0 14px;
  font: 700 14px var(--font);
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  cursor: pointer;
}

.appbar-right { display: flex; align-items: center; gap: 10px; }

.who { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.who img { width: 24px; height: 24px; border-radius: 50%; }
.who a { color: inherit; opacity: 0.8; font-size: 12px; }
.app-login { background: var(--accent); color: var(--on-accent); border-color: transparent; }

/* ------------------------------------------------------------------ */
/* Welcome: the page a visitor sees before they sign in                 */
/* ------------------------------------------------------------------ */

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: center; padding: 12px 0 8px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-2); }
.hero h1 { margin: 8px 0 12px; font-size: clamp(28px, 4.2vw, 44px); line-height: 1.15; text-wrap: balance; }
.hero-lede { max-width: 52ch; font-size: 16px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 18px; }
.btn-big { min-height: 48px; padding: 10px 26px; font-size: 16px; text-decoration: none; display: inline-flex; align-items: center; }
.hero-actions .fine { max-width: 32ch; }
.screen-attract { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--picture); border-radius: 10px; }
#attractScene { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.attract-bug { position: absolute; right: 3%; bottom: 4%; display: flex; font: 600 12px/1 var(--font); border-radius: 6px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.attract-bug span { padding: 5px 8px; background: rgba(10, 10, 12, 0.75); color: #fff; }
.attract-bug .bug-live { background: var(--live); }

.welcome-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; margin-top: 28px; }
.welcome-shows { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.welcome-shows li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; }
.welcome-shows .when { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.welcome-shows .lang { margin-left: 8px; padding: 1px 7px; font-size: 11px; color: var(--brand); background: var(--surface-2); border-radius: 999px; }
.welcome-shows .tag { display: block; font-size: 12px; color: var(--muted); }
.welcome-sets { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.welcome-sets li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.welcome-sets canvas { display: block; width: 100%; aspect-ratio: 16 / 9; image-rendering: pixelated; }
.welcome-sets b { display: block; padding: 8px 12px; font-size: 14px; }
.how { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: how; }
.how li { position: relative; padding: 14px 16px 14px 52px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); counter-increment: how; }
.how li::before { content: counter(how); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--on-accent); background: var(--accent); border-radius: 50%; }
.how b { display: block; margin-bottom: 2px; }
.how span { font-size: 13.5px; color: var(--muted); }
.welcome section { margin-top: 36px; }
html.locked .live, html.locked .columns, html.locked .services, html.locked .appask, html.locked .appnav { display: none; }
/* The welcome page sits on the harbour skyline (skyline.js): a thin veil at the
   top so the towers read, thickening lower down where the cards are. */
html.locked { --veil: rgba(0, 0, 0, 0.04); --veil-2: rgba(8, 12, 24, 0.42); }
html.locked[data-theme="mono"] { --veil: rgba(0, 0, 0, 0.12); --veil-2: rgba(0, 0, 0, 0.5); } /* the grey skyline, dim enough for white type */
html.locked body { background-position: center 56px; }
html.locked #welcome .sec-head h2, html.locked #welcome .sec-head p { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
/* The hero's words on a panel, since the backdrop behind them is a whole street */
.hero-text { padding: 22px 24px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(2px); }

@media (max-width: 900px) {
  .hero, .welcome-grid { grid-template-columns: 1fr; }
  .how, .welcome-sets { grid-template-columns: 1fr; }
}

.hk-clock { font-variant-numeric: tabular-nums; font-size: 14px; opacity: 0.9; }

.app-link {
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-brand);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

.app-link:hover { background: rgba(255, 255, 255, 0.14); }

/* ------------------------------------------------------------------ */
/* Page                                                                */
/* ------------------------------------------------------------------ */

.page {
  width: min(1180px, 100% - 32px);
  margin: 0 auto;
  padding: 20px 0 64px;
}

.sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px; }
.sec-head h2 { font-size: 20px; }
.sec-head p { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Live: the player and the rundown                                     */
/* ------------------------------------------------------------------ */

.live { display: grid; grid-template-columns: 1fr; gap: 20px; }

.player { min-width: 0; }

/* 收埋電視: the set folds away while it is on; the voice, the transcript and the
   buttons stay. Off, it shows anyway, so its power button can be reached. */
.player[data-tv-hidden="true"] .tv[data-on="true"] { display: none; }

/* The television: a dark plastic bezel round the picture, a chin with the
   brand, a speaker grille and a power light, two feet. */
.tv { position: relative; padding: 0 0 6px; }

.tv-bezel {
  padding: clamp(10px, 2vw, 18px);
  background: linear-gradient(180deg, var(--tv-2), var(--tv) 60%, #121317);
  border-radius: calc(var(--radius) + 10px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.5),
    0 20px 40px rgba(0, 0, 0, 0.35);
}

.tv-bezel .screen { border-radius: 10px; box-shadow: inset 0 0 0 2px #000, 0 0 0 3px #0a0a0c; }

.tv-chin {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 34px;
  margin: 0 clamp(10px, 2vw, 18px);
  padding: 0 16px;
  background: linear-gradient(180deg, var(--tv), #121317);
  border-radius: 0 0 12px 12px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.6);
}

.tv-brand { display: inline-grid; place-items: center; font-size: 12px; color: var(--tv-chrome); }

/* The set's own readout: what is on, and the time, like the display on a VCR */
.tv-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  font: 600 12px/1 var(--pixel);
  letter-spacing: 0.06em;
  color: #9ff0c0;
  background: #0a0e1c;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px #1a2238;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}
.tv-line b { font-weight: 600; color: #e8f5ec; overflow: hidden; text-overflow: ellipsis; }
.tv-line i { font-style: normal; color: #ff6b6b; }
.tv[data-on="true"] .tv-line i { color: #ff3b45; }
.tv-line span { font-variant-numeric: tabular-nums; }
.tv-grille { flex: 1; height: 12px; background: repeating-linear-gradient(90deg, #0b0c0f 0 2px, transparent 2px 5px); opacity: 0.8; }
.tv-led { width: 7px; height: 7px; border-radius: 50%; background: #ff3b45; box-shadow: 0 0 8px #ff3b45; }
.tv-model { font: 600 11px/1 var(--font); letter-spacing: 0.08em; color: #7d8390; }

/* The power switch on the chin: a round button, lit when the set is on */
.tv-power {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px 0 8px;
  font: 700 12px/1 var(--font);
  color: #c9ced8;
  background: #0d0f14;
  border: 1px solid #3a3e48;
  border-radius: 999px;
  cursor: pointer;
}
.tv-power span:first-child { font-size: 13px; }
.tv-power:hover { border-color: #7d8390; color: #fff; }
.tv[data-on="true"] .tv-power { color: #3ddc84; border-color: #2a7f4f; }
.tv-feet { display: flex; justify-content: space-between; margin: 0 14%; }
.tv-feet i { display: block; width: 40px; height: 6px; background: #121317; border-radius: 0 0 6px 6px; }

.tv[data-on="true"] .tv-led { background: #3ddc84; box-shadow: 0 0 8px #3ddc84; }

.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  overflow: hidden;
  background: var(--picture);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.picture { position: absolute; inset: 0; }
.screen[data-state="off"] .picture { opacity: 0.35; filter: saturate(0.4); }
.screen[data-state="on"] .picture { animation: fade-in 500ms ease-out both; }
@keyframes fade-in { from { opacity: 0.35; filter: saturate(0.4); } to { opacity: 1; filter: none; } }

#scene { display: block; width: 100%; height: 100%; image-rendering: pixelated; }

.power {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: #fff;
  font-size: clamp(12px, 1.8cqw, 16px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.screen[data-state="on"] .power, .screen[data-state="yt"] .power { display: none; }

.power button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.55em 1.4em;
  font: 700 clamp(16px, 3cqw, 24px) var(--font);
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.power button:hover { filter: brightness(1.05); }
.power-icon { font-size: 0.8em; }

.yt-player { position: absolute; inset: 0; background: #000; }
.yt-player iframe { display: block; width: 100%; height: 100%; border: 0; }

/* In-picture graphics, in the 320×180 studio's coordinates */

.ots {
  position: absolute;
  left: 70.3%;
  top: 8.3%;
  width: 25.6%;
  height: 31.1%;
  display: grid;
  grid-template-rows: 1fr 21%;
  text-align: center;
}

.ots-caption {
  align-self: center;
  padding: 0 4%;
  font: 600 3cqw/1.15 var(--pixel);
  color: #fff;
  text-shadow: 0.25cqw 0.25cqw 0 rgba(0, 0, 0, 0.5);
  overflow-wrap: anywhere;
}

.ots-source {
  align-self: center;
  padding: 0 4%;
  font: 1.35cqw var(--pixel);
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bug {
  position: absolute;
  right: 2%;
  bottom: 10.5%;
  display: flex;
  font: 600 2.2cqw/1 var(--font);
  border-radius: 0.6cqw;
  overflow: hidden;
  box-shadow: 0 0.3cqw 1cqw rgba(0, 0, 0, 0.4);
}

.bug > * { padding: 0.35em 0.6em 0.4em; }
.bug-show { background: rgba(10, 10, 12, 0.75); color: #fff; }
.bug-live { background: var(--live); color: #fff; text-transform: uppercase; }
.bug-clock { background: #fff; color: #111; font-variant-numeric: tabular-nums; }

.lower-third { position: absolute; left: 3%; bottom: 10.5%; max-width: 62%; }

.lt-tab {
  display: inline-block;
  padding: 0.15em 0.7em 0.2em;
  font: 600 2.2cqw/1.3 var(--font);
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 0.5cqw 0.5cqw 0 0;
}

.lt-name {
  display: flex;
  align-items: baseline;
  gap: 0.7em;
  padding: 0.25em 1em 0.35em 0.7em;
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 0 0.6cqw 0.6cqw 0.6cqw;
  box-shadow: 0 0.3cqw 1cqw rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.lt-name strong { font-size: 3.6cqw; line-height: 1.1; }
.lt-name span { font-size: 1.7cqw; opacity: 0.85; }

.ticker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8%;
  display: flex;
  background: var(--accent);
  color: var(--on-accent);
}

.ticker-label {
  display: grid;
  place-items: center;
  padding: 0 1.6cqw;
  font: 700 2.4cqw var(--font);
  color: var(--on-brand);
  background: var(--brand);
}

.ticker-track { position: relative; flex: 1; overflow: hidden; }

.ticker-text {
  position: absolute;
  top: 50%;
  left: 0;
  translate: 0 -50%;
  will-change: transform;
  white-space: nowrap;
  font: 2.3cqw var(--font);
}

.ticker-text b { font-weight: 700; opacity: 0.75; }

.standby { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); }
.standby p { padding: 0.4em 1em; font: 600 3cqw var(--font); color: #fff; background: rgba(0, 0, 0, 0.6); border-radius: 999px; }

/* What is being said, on the screen, beside whoever is saying it */
.bubble {
  --tail-x: 50%;
  position: absolute;
  top: 9%;
  width: 40%;
  padding: 1.2cqw 1.6cqw 1.4cqw;
  background: #fff;
  color: #1a1a1a;
  border-radius: 1cqw;
  box-shadow: 0 0.6cqw 2cqw rgba(0, 0, 0, 0.35);
}

.bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--tail-x);
  width: 2.6cqw;
  height: 2.2cqw;
  translate: -50% 0;
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 40% 100%);
}

.bubble p { font: 600 clamp(10px, 2.2cqw, 24px)/1.35 var(--font); min-height: 2.7em; }

/* Between segments: a card wipes up from the bottom */
.bumper {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.75));
}

.bumper-inner {
  margin: 0 4% 11%;
  padding: 2cqw 2.6cqw 2.2cqw;
  background: var(--surface);
  color: var(--text);
  border-left: 1cqw solid var(--accent);
  border-radius: 0.8cqw;
  box-shadow: 0 1cqw 3cqw rgba(0, 0, 0, 0.4);
  animation: card-up 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes card-up { from { transform: translateY(30cqw); opacity: 0; } to { transform: none; opacity: 1; } }

.bumper-mark { float: right; display: inline-grid; place-items: center; font-size: 2.2cqw; color: var(--on-accent); background: var(--accent); padding: 0.4em 0.6em; border-radius: 0.4cqw; }
.bumper-label { font: 600 1.9cqw var(--font); color: var(--brand-2); text-transform: uppercase; letter-spacing: 0.08em; }
.bumper-title { margin-top: 0.4cqw; font: 700 4.4cqw/1.15 var(--font); }
.bumper-tease { margin-top: 0.6cqw; font: 2cqw var(--font); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bumper-tease:empty { display: none; }

.screen:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; display: grid; place-items: center; background: #000; }
.screen:fullscreen .picture { position: relative; inset: auto; width: min(100vw, 100vh * 16 / 9); aspect-ratio: 16 / 9; container-type: inline-size; }

/* The transcript under the picture */
.transcript {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: baseline;
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.transcript-who { font-weight: 700; color: var(--brand-2); white-space: nowrap; }
.transcript-text { font-size: 16px; line-height: 1.6; min-height: 2.6em; }

/* Transport */
.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.tspacer { flex: 1; }

.tbtn, .tselect {
  min-height: 40px;
  padding: 6px 14px;
  font: 600 14px var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.tbtn:hover, .tselect:hover { border-color: var(--brand-2); }
.tbtn-primary { color: var(--on-brand); background: var(--brand-2); border-color: var(--brand-2); }
.tbtn[aria-pressed="false"] { color: var(--muted); }
.tselect { max-width: 240px; padding-right: 10px; }

.feed-status { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-2); }
.dot[data-state="stale"] { background: var(--accent); }
.dot[data-state="failing"] { background: var(--live); }

/* The rundown beside the player */
.rundown-panel { display: grid; grid-template-columns: 340px minmax(0, 1fr); grid-template-areas: 'now list' 'next list' 'heard list'; gap: 10px 20px; align-items: start; min-width: 0; }
.now-card { grid-area: now; }
.next-line { grid-area: next; }
.rundown { grid-area: list; }

.now-card {
  padding: 16px 18px 18px;
  background: var(--brand);
  color: var(--on-brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.now-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.9; }
.now-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08); } }
.now-show { margin-top: 8px; font-size: 13px; opacity: 0.85; }
.now-title { margin-top: 2px; font-size: 22px; line-height: 1.25; }
.now-meta { margin-top: 8px; font-size: 13px; line-height: 1.5; opacity: 0.85; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

.next-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 0 6px; font-size: 13px; color: var(--muted); }
.next-label { font-weight: 700; color: var(--text); }
.next-when { padding: 0 6px; font-size: 11px; font-weight: 700; color: var(--on-accent); background: var(--accent); border-radius: 999px; }
.next-title { color: var(--text); }

.rundown { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 260px; overflow: auto; }

.rundown li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.rundown li:hover { border-color: var(--brand-2); }
.rundown li[aria-current="true"] { border-color: var(--brand-2); background: color-mix(in srgb, var(--brand-2) 10%, var(--surface)); }
.rundown .kind { padding: 1px 7px; font-size: 11px; font-weight: 700; color: var(--brand); background: var(--surface-2); border-radius: 999px; white-space: nowrap; }
.rundown li[aria-current="true"] .kind { color: var(--on-brand); background: var(--brand-2); }
.rundown .title { font-size: 14px; line-height: 1.35; }
.rundown .who { display: block; font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Platforms                                                           */
/* ------------------------------------------------------------------ */

.platforms {
  display: flex;
  align-items: center;
  gap: 12px 20px;
  margin-top: 20px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--live);
  border-radius: var(--radius-sm);
}

.platforms[data-live="false"] { border-left-color: var(--line); }
.platforms-text { display: grid; gap: 2px; min-width: 0; }
.platforms-text b { font-size: 16px; }
.platforms-text small { font-size: 13px; color: var(--muted); }
.pill-live { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: #fff; background: var(--live); border-radius: 999px; }
.platforms[data-live="false"] .pill-live { background: var(--muted); }
.pill-live i { width: 6px; height: 6px; background: #fff; border-radius: 50%; animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.platforms-actions { display: flex; gap: 8px; margin-left: auto; }

.pbtn { padding: 9px 16px; font: 700 14px var(--font); text-decoration: none; border-radius: 999px; white-space: nowrap; }
.pbtn-yt { color: var(--on-accent); background: var(--accent); }
.pbtn-sub { color: #fff; background: #ff0033; }
.pbtn-x { color: #fff; background: #0f1419; }

/* ------------------------------------------------------------------ */
/* Schedule and anchors                                                */
/* ------------------------------------------------------------------ */

/* minmax(0, …): a plain 1fr track grows to the board's 1040px minimum and drags the page sideways on a phone; the board scrolls inside itself instead. */
.columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; margin-top: 36px; }
.columns > * { min-width: 0; }

/* The board: the day across, the needle where we are */
.board {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.board-scroll { min-width: 1040px; padding: 10px 12px 12px; }
.board { cursor: grab; }
.board.dragging { cursor: grabbing; user-select: none; }
/* A scrollbar that stays: macOS otherwise shows none until a trackpad touches the board. */
.board::-webkit-scrollbar { height: 10px; }
.board::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.board::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 999px; border: 2px solid var(--surface-2); }
.board-nav { display: flex; gap: 6px; margin-left: auto; align-self: center; }
.board-nav .tbtn { min-height: 32px; min-width: 40px; padding: 4px 12px; }
.board-nav .tbtn:disabled { opacity: 0.4; cursor: default; }

.board-row { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.board-row + .board-row { margin-top: 6px; }

.board-ch { display: grid; align-content: center; justify-items: start; padding-left: 4px; }
.board-ch b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-ch small { font-size: 11px; color: var(--muted); }

.board-track { position: relative; }
.board-times { height: 20px; }
.board-times .board-track span {
  position: absolute;
  top: 2px;
  padding-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  border-left: 1px solid var(--line);
}

.board-shows { height: 110px; }

.cell {
  position: absolute;
  top: 0;
  bottom: 0;
  padding: 8px 10px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-sizing: border-box;
}

.cell strong { display: block; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .hours { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cell .tag { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .hosts { display: flex; gap: 4px; margin-top: 6px; }
.cell .hosts canvas { width: 20px; height: 20px; image-rendering: pixelated; border-radius: 4px; background: var(--brand); }

.cell[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.cell[aria-current="true"] :is(.hours, .tag) { color: var(--on-brand); opacity: 0.85; }
.cell .now-badge { position: absolute; top: 6px; right: 6px; padding: 1px 6px; font-size: 10px; font-weight: 700; color: #fff; background: var(--live); border-radius: 999px; }

.needle {
  position: absolute;
  z-index: 2;
  top: -26px;
  bottom: 0;
  width: 2px;
  translate: -50% 0;
  background: var(--live);
  box-shadow: 0 0 6px color-mix(in srgb, var(--live) 70%, transparent);
  pointer-events: none;
}
.needle::before { content: ""; position: absolute; top: 0; left: 50%; width: 8px; height: 8px; translate: -50% 0; background: var(--live); border-radius: 50%; }

.cast { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.guests-head { margin-top: 24px; }   /* 客席主持, under the six */

.cast li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.cast li[data-on="true"] { border-color: var(--brand-2); box-shadow: inset 3px 0 0 var(--brand-2); }
.cast canvas { width: 56px; height: 56px; image-rendering: pixelated; border-radius: 10px; background: var(--brand); }
.cast h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.cast .on { font-size: 11px; font-weight: 700; color: #fff; background: var(--live); padding: 1px 7px; border-radius: 999px; }
.cast .role { font-size: 12px; font-weight: 700; color: var(--brand-2); }
.cast .bio { margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--muted); }

.source-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.source-list li { display: grid; grid-template-columns: 9em 1fr; gap: 10px; padding: 8px 10px; font-size: 13px; background: var(--surface); border-radius: var(--radius-sm); }
.source-list .outlet { font-weight: 700; color: var(--brand-2); }
.source-list a { color: var(--text); }

/* ------------------------------------------------------------------ */
/* Services                                                            */
/* ------------------------------------------------------------------ */

.services { margin-top: 36px; }

.panel { margin-top: 14px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.lede { max-width: 64ch; margin-bottom: 14px; font-size: 15px; color: var(--text); }

.form { display: grid; gap: 12px; max-width: 680px; }
.form .row { display: flex; flex-wrap: wrap; gap: 12px; }
.form label { display: grid; gap: 4px; flex: 1; min-width: 160px; font-size: 13px; font-weight: 700; color: var(--muted); }
#askForm .row label:first-child { flex: 2.4; }
.form :is(input, select, textarea) { padding: 10px 12px; font: 15px var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.form :is(input, select, textarea):focus { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.form textarea { resize: vertical; line-height: 1.5; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.fine { font-size: 12px; color: var(--muted); }
.form-status { min-height: 1.4em; font-size: 14px; color: var(--brand-2); }
.form-status[data-error] { color: var(--live); }
/* A refused login on the welcome page: loud, boxed, impossible to miss. */
.hero-text .form-status[data-error] {
  margin-top: 18px; padding: 14px 18px; font-size: 18px; font-weight: 700; line-height: 1.4;
  color: var(--live); background: color-mix(in srgb, var(--live) 12%, transparent);
  border: 2px solid var(--live); border-radius: var(--radius-sm);
}
.hero-text .form-status[data-error]::before { content: '⚠ '; }

.btn { min-height: 40px; padding: 8px 18px; font: 700 14px var(--font); border: 0; border-radius: 999px; cursor: pointer; }
.btn-primary { color: var(--on-accent); background: var(--accent); }
.btn[disabled] { opacity: 0.5; cursor: wait; }

/* ------------------------------------------------------------------ */
/* About                                                               */
/* ------------------------------------------------------------------ */

.site-footer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.site-footer .platforms { margin-top: 0; }
.about { margin-top: 28px; columns: 2 320px; column-gap: 36px; }
.about h2 { margin-bottom: 10px; font-size: 16px; column-span: all; }
.about p { margin-bottom: 10px; font-size: 13px; line-height: 1.65; color: var(--muted); break-inside: avoid; }
.about a { color: var(--text); }
.about code { font-size: 12px; }

:is(button, a, select, input, textarea):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ */
/* Phones                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .live, .columns { grid-template-columns: minmax(0, 1fr); }
  .rundown-panel { grid-template-columns: 1fr; grid-template-areas: 'now' 'next' 'heard' 'list'; }
  .rundown { grid-template-columns: 1fr; }
  .cast { grid-template-columns: repeat(2, 1fr); }
  .rundown { max-height: 300px; }
}

@media (max-width: 640px) {
  .appbar { gap: 10px; height: 52px; }
  .appnav { display: none; }
  .appask { flex: 1 1 120px; }
  .hk-clock { display: none; }
  .brand-text small { display: none; }
  .tv-line { max-width: 60%; }
  .tv-model { display: none; }
  .tv-power span:last-child { display: none; }
  .page { width: calc(100% - 16px); padding-top: 8px; }
  .screen { border-radius: var(--radius-sm); }
  .bug { font-size: max(2.2cqw, 10px); }
  .lt-name strong { font-size: max(3.6cqw, 14px); }
  .lt-name span { display: none; }
  .ticker { height: max(8%, 22px); }
  .ticker-text { font-size: max(2.3cqw, 12px); }
  .ticker-label { font-size: max(2.4cqw, 12px); }
  .transport .tselect { flex: 1 1 100%; max-width: none; }
  .transport .tbtn { flex: 1; }
  .platforms { flex-wrap: wrap; }
  .platforms-actions { flex: 1 0 100%; margin-left: 0; flex-wrap: wrap; }
  .pbtn { flex: 1; text-align: center; }
  .cast { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .screen[data-state="on"] .picture, .bumper-inner, .now-dot, .pill-live i { animation: none; }
}

/* 贊助: top right, above the over-the-shoulder box, for as long as a sponsor message is on. */
.sponsor-tag {
  position: absolute;
  top: 2.5%;
  right: 2%;
  margin: 0;
  padding: 0.35cqw 1.1cqw;
  font: 700 max(1.7cqw, 11px) / 1.2 var(--font);
  letter-spacing: 0.08em;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 0.6cqw;
  box-shadow: 0 0.2cqw 0.8cqw rgba(0, 0, 0, 0.35);
}

/* ------------------------------------------------------------------ */
/* Stream view (?stream): only the picture, full frame, for OBS         */
/* ------------------------------------------------------------------ */

.stream-badge { display: none; }
html.stream, html.stream body { margin: 0; overflow: hidden; background: #000; cursor: none; }
html.stream .appbar, html.stream .transcript, html.stream .transport, html.stream .feed-status,
html.stream .rundown-panel, html.stream .platforms, html.stream .columns, html.stream .services, html.stream .site-footer { display: none; }
html.stream .page { width: 100vw; margin: 0; padding: 0; }
html.stream .live { display: block; }
html.stream .tv, html.stream .tv-bezel { padding: 0; background: none; box-shadow: none; border-radius: 0; }
html.stream .tv-chin, html.stream .tv-feet { display: none; }
html.stream .screen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
html.stream .stream-badge {
  display: block;
  position: absolute;
  top: 2.5%;
  left: 2%;
  padding: 0.35em 0.7em;
  font: 600 2.2cqw/1 var(--font);
  color: #fff;
  background: rgba(10, 10, 12, 0.75);
  border-radius: 0.6cqw;
}
html.stream .stream-badge b { color: var(--accent); }

/* 聽過: what this browser has heard, above the plan (heard.js, scheduler.js) */
.heard-line { grid-area: heard; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 12px; font-size: 12px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.heard-line:has(.heard-stats:empty) { display: none; }
.heard-stats { font-variant-numeric: tabular-nums; }
.heard-clear { font: 600 12px var(--font); color: var(--brand); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.heard-clear:hover { border-color: var(--brand-2); }
.rundown li[data-tag="重溫"] .title { opacity: 0.72; }
.rundown li[data-tag="新"] .who::first-letter { color: var(--live); font-weight: 700; }
.rundown li[data-tag="突發"] .who::first-letter, .rundown li[data-tag="更新"] .who::first-letter { color: var(--live); font-weight: 700; }
.rundown li[data-tag="突發"] .title { font-weight: 700; }

/* 管理: only an admin-role account sees it (tv.js loadMe) */
.app-link.app-admin { border-color: var(--accent); color: var(--accent); }
