/* VideoCrawler · 影院式外观
   The page is a dark screening room lit by the film in focus (immersive.js):
   a blurred, saturated poster glows behind everything, glass surfaces float
   over it, and the colours of an opened film come from its poster when the
   host allows it. The --imm-* colours are registered so a change of film
   blends over a second instead of jumping. */

@property --imm-bg { syntax: "<color>"; inherits: true; initial-value: #07080c; }
@property --imm-fg { syntax: "<color>"; inherits: true; initial-value: #f5f6fa; }
@property --imm-accent { syntax: "<color>"; inherits: true; initial-value: #ff6b45; }
@property --imm-sub { syntax: "<color>"; inherits: true; initial-value: #a3a9b8; }

:root {
  --background: #07080c;
  --surface: rgba(16, 18, 26, 0.62);
  --surface-raised: rgba(255, 255, 255, 0.06);
  --glass: rgba(14, 16, 23, 0.52);
  --glass-strong: rgba(14, 16, 23, 0.78);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f6fa;
  --muted: rgba(226, 230, 240, 0.62);
  --faint: rgba(226, 230, 240, 0.42);
  --accent: var(--imm-accent);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-ink: #120805;
  --success: #52d6a0;
  --radius: 16px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.3, 1.4, 0.5, 1);
  --page: min(1180px, calc(100% - 40px));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  transition: --imm-accent 1.2s ease, --imm-bg 1.2s ease, --imm-fg 1.2s ease, --imm-sub 1.2s ease;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { min-width: 320px; scroll-behavior: smooth; color-scheme: dark; }

body {
  min-height: 100vh;
  margin: 0;
  background: transparent;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
::selection { color: var(--accent-ink); background: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==== Ambient light ====
   Two poster layers cross-fade (immersive.js swaps .on); a veil keeps text
   readable, a vignette darkens the edges and a fine grain gives the film look. */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--background);
}

/* A canvas a few dozen pixels wide (immersive.js), scaled up: soft without a
   full-screen blur filter. Only cheap colour filters remain. */
.backdrop-layer {
  position: absolute;
  top: -8%;
  left: -8%;
  width: 116%;
  height: 116%;
  filter: saturate(1.8) brightness(0.95);
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.2s ease, transform 2.4s var(--ease-out);
  will-change: opacity;
}

/* Kept still once shown: a large blurred surface moving every frame would keep
   the GPU busy on small devices for no visible gain. */
.backdrop-layer.on {
  opacity: 0.72;
  transform: scale(1.1);
}

.ambient-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 95% at 65% 10%, transparent 0%, rgba(7, 8, 12, 0.24) 45%, rgba(7, 8, 12, 0.84) 100%),
    linear-gradient(90deg, rgba(7, 8, 12, 0.42) 0%, rgba(7, 8, 12, 0.1) 55%, transparent 100%),
    linear-gradient(180deg, rgba(7, 8, 12, 0.12) 0%, rgba(7, 8, 12, 0.4) 55%, rgba(7, 8, 12, 0.56) 100%);
}

.ambient-grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.ambient .imm-shapes { background: none; }

/* Drifting outlines and rising specks (after MusicCrawler's 沉浸式播放). */
.imm-shapes {
  --shape: color-mix(in srgb, color-mix(in srgb, var(--imm-sub) 70%, var(--imm-accent)) 40%, var(--imm-bg));
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.imm-shape { position: absolute; animation: imm-drift linear infinite; }
.imm-shape.circle, .imm-shape.square { border: 1px solid var(--shape); }
.imm-shape.circle { border-radius: 50%; }
.imm-shape.triangle, .imm-shape.cross, .imm-shape.filled { background: var(--shape); }
.imm-shape.triangle { clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.imm-shape.cross { clip-path: polygon(20% 0%, 0% 20%, 30% 50%, 0% 80%, 20% 100%, 50% 70%, 80% 100%, 100% 80%, 70% 50%, 100% 20%, 80% 0%, 50% 30%); }

@keyframes imm-drift {
  0% { transform: translate(calc(-15px * var(--dir)), calc(30px * var(--dir))) rotate(var(--turn)); }
  50% { transform: translate(calc(15px * var(--dir)), calc(-30px * var(--dir))) rotate(calc(var(--turn) + 180deg)); }
  100% { transform: translate(calc(-15px * var(--dir)), calc(30px * var(--dir))) rotate(calc(var(--turn) + 360deg)); }
}

.imm-speck {
  position: absolute;
  border-radius: 50%;
  background: var(--imm-accent);
  box-shadow: 0 0 8px var(--imm-accent);
  animation: imm-rise linear infinite;
}

@keyframes imm-rise {
  0% { transform: translateY(0); opacity: 0; }
  50% { opacity: var(--peak); }
  100% { transform: translateY(-110px); opacity: 0; }
}

/* Blur-in characters (titles). */
.imm-char {
  display: inline-block;
  white-space: pre;
  animation: char-in 0.9s var(--ease-out) both;
}

@keyframes char-in {
  from { opacity: 0; transform: translateY(0.28em) scale(1.12); }
}

/* ==== Header ==== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-inline: max(20px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}

:root.scrolled .site-header {
  background: rgba(7, 8, 12, 0.55);
  border-bottom-color: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
}

main,
footer {
  width: var(--page);
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding-left: 2px;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent), #ffd27a 45%));
  border-radius: 10px;
  font-size: 12px;
  box-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 45%, transparent);
}

.sync-status {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-button,
.tvbox-button,
.source-settings-button {
  min-height: 36px;
  padding: 0 14px;
  color: #e4e7ee;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.admin-button:hover,
.tvbox-button:hover,
.source-settings-button:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: rgba(255, 255, 255, 0.1); }
.admin-button.active { color: var(--success); border-color: rgba(82, 214, 160, 0.35); }
.tvbox-button { color: var(--success); border-color: rgba(82, 214, 160, 0.25); }
.tvbox-button:hover { border-color: rgba(82, 214, 160, 0.55); }
.admin-button[hidden],
.tvbox-button[hidden],
.source-settings-button[hidden] { display: none; }

.sync-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(82, 214, 160, 0.1);
}

/* ==== Hero: the headline, the 焦点影片 deck and the search ==== */
.hero { padding: 52px 0 40px; }

.hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 48px;
  align-items: center;
  margin-bottom: 36px;
}

.hero.has-spotlight .hero-stage {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  min-height: 500px;
}

.hero-text > * { animation: rise-in 0.9s var(--ease-out) both; }
.hero-text > :nth-child(2) { animation-delay: 80ms; }
.hero-text > :nth-child(3) { animation-delay: 160ms; }
.hero-text > :nth-child(4) { animation-delay: 260ms; }

/* Fade and slide only: animating filter: blur makes every element a separate
   layer that is dropped again when it ends, which phones show as a flash. */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
}

.eyebrow {
  margin: 0 0 14px;
  color: color-mix(in oklab, var(--accent), #fff 35%);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(44px, 6.8vw, 88px);
  font-weight: 820;
  line-height: 1;
  letter-spacing: -0.055em;
}

/* Plain coloured text with a text-shadow glow: gradient-clipped text
   (background-clip: text) under a filter flickers in mobile WebKit whenever
   the layers around it repaint, e.g. while the spotlight deck changes. */
.h1-glow {
  display: block;
  padding-bottom: 0.06em;
  color: color-mix(in oklab, var(--accent), #ffd9b0 26%);
  text-shadow: 0 0 36px color-mix(in srgb, var(--accent) 42%, transparent);
}

/* Desktops keep the gradient sheen. */
@media (hover: hover) and (pointer: fine) {
  .h1-glow {
    color: transparent;
    background: linear-gradient(100deg, #fff 0%, color-mix(in oklab, var(--accent), #fff 30%) 38%, var(--accent) 62%, color-mix(in oklab, var(--accent), #ffd27a 55%) 100%);
    background-size: 200% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 10px 40px color-mix(in srgb, var(--accent) 30%, transparent));
    animation: glow-pan 2.8s var(--ease-out) 0.2s both;
  }
}

@keyframes glow-pan { from { background-position: 0 0; } }

/* Once the page has come in, its entrance animations are dropped: a finished
   animation that keeps filling holds its element on a layer of its own, which
   WebKit re-renders (and can flash) as the content around it changes. */
:root.intro-done :is(.hero-text > *, .h1-glow, .search-panel, .spotlight-deck) { animation: none; }

.hero-copy {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.spotlight-info {
  position: relative;
  max-width: 520px;
  margin-top: 30px;
  padding: 18px 20px 16px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
}

.spotlight-info[hidden] { display: none; }

.spotlight-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.spotlight-pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.spotlight-pulse::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse { from { opacity: 0.9; transform: scale(0.5); } to { opacity: 0; transform: scale(1.6); } }

.spotlight-counter {
  margin-left: auto;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.spotlight-title {
  min-height: 1.2em;
  margin: 10px 0 6px;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.spotlight-meta {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.glow-button,
.ghost-button {
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
  transition: transform 0.25s var(--spring), box-shadow 0.25s, background-color 0.2s, border-color 0.2s;
}

.glow-button {
  color: #0b0c10;
  background: #fff;
  border: 0;
  box-shadow: 0 10px 34px -6px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}

.glow-button::before { content: "▶"; margin-right: 8px; font-size: 10px; }
.glow-button:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 44px -6px color-mix(in srgb, var(--accent) 85%, transparent); }

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
}

.ghost-button:hover { background: rgba(255, 255, 255, 0.12); }
.ghost-button[hidden] { display: none; }

/* The progress bar is the deck's clock (see showSpotlight in app.js). */
.spotlight-progress {
  height: 2px;
  margin-top: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

.spotlight-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 40%, transparent), var(--accent), #fff);
  transform: scaleX(0);
  transform-origin: left;
}

.spotlight-progress span.run { animation: spotlight-clock 8s linear forwards; }
.hero.paused .spotlight-progress span.run { animation-play-state: paused; }

@keyframes spotlight-clock { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* The deck: the front poster faces you, the next ones fan out behind it. */
.spotlight-deck {
  --w: clamp(220px, 23vw, 320px);
  position: relative;
  height: calc(var(--w) * 1.5 + 60px);
  perspective: 1400px;
  animation: rise-in 1.1s var(--ease-out) 0.15s both;
}

.spotlight-deck[hidden] { display: none; }

.deck-card {
  --tx: 0%; --ty: 0%; --tz: 0px; --rz: 0deg; --sry: 0deg;
  position: absolute;
  top: calc(50% - var(--w) * 0.75);
  left: calc(50% - var(--w) / 2);
  width: var(--w);
  aspect-ratio: 2 / 3;
  padding: 0;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 22px;
  transform:
    translate3d(var(--tx), var(--ty), var(--tz))
    rotateZ(var(--rz))
    rotateY(calc(var(--sry) + var(--ry, 0deg)))
    rotateX(var(--rx, 0deg));
  transition: transform 1s var(--ease-out), opacity 1s ease, filter 1s ease;
}

.deck-card img,
.deck-card .poster-fallback {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
  background: linear-gradient(145deg, #1b1f2a, #0f1117);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
}

.deck-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 12% -4% -8%;
  background: var(--poster) center / cover;
  border-radius: 40px;
  filter: blur(42px) saturate(1.9);
  opacity: 0;
  transition: opacity 1s ease;
}

.deck-card[data-slot="0"] {
  z-index: 4;
  animation: deck-float 7s ease-in-out infinite;
}

.deck-card[data-slot="0"]::before { opacity: 0.85; }
.deck-card[data-slot="1"] { --tx: 46%; --ty: -3%; --tz: -140px; --rz: 7deg; --sry: -14deg; z-index: 3; filter: brightness(0.55) saturate(0.85); }
.deck-card[data-slot="2"] { --tx: -44%; --ty: 3%; --tz: -220px; --rz: -8deg; --sry: 14deg; z-index: 2; filter: brightness(0.42) saturate(0.8); }
.deck-card[data-slot="3"] { --ty: 8%; --tz: -360px; z-index: 1; opacity: 0; pointer-events: none; }
.deck-card[data-slot="1"]:hover,
.deck-card[data-slot="2"]:hover { filter: brightness(0.8); }
.deck-card.tilting { transition: transform 0.14s ease-out, opacity 1s ease, filter 1s ease; }
.hero.paused .deck-card { animation-play-state: paused; }

@keyframes deck-float { 50% { translate: 0 -10px; } }

/* Glare and edge for posters that tilt (cards, deck, detail). */
.poster-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(5, 6, 10, 0.5));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.poster-glare::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.32), transparent 55%);
  mix-blend-mode: overlay;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tilting .poster-glare::before,
.tilting > .poster-glare::before { opacity: 1; }

/* ==== Search ==== */
.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 14px 10px;
  padding: 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 30px 80px -34px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(26px) saturate(1.4);
  -webkit-backdrop-filter: blur(26px) saturate(1.4);
  animation: rise-in 0.9s var(--ease-out) 0.3s both;
}

.search-box {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.2s, box-shadow 0.3s;
}

.search-box:focus-within {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 40px -8px color-mix(in srgb, var(--accent) 50%, transparent);
}

.search-box svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; }

.search-box input {
  min-width: 0;
  flex: 1;
  padding: 0 12px;
  color: var(--text);
  background: none;
  border: 0;
  outline: 0;
}

.search-box input::placeholder { color: var(--faint); }

.primary-button {
  width: 104px;
  min-height: 54px;
  margin: 0;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent), #ffd27a 40%));
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  box-shadow: 0 12px 32px -10px color-mix(in srgb, var(--accent) 80%, transparent);
  transition: transform 0.25s var(--spring), box-shadow 0.25s, filter 0.2s;
}

.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 16px 40px -10px color-mix(in srgb, var(--accent) 95%, transparent); }
.primary-button:active { transform: translateY(1px) scale(0.98); }

.filters {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding-top: 0;
}

.filters.admin { grid-template-columns: repeat(5, minmax(0, 1fr)) auto; }

.filters label > span {
  display: block;
  margin: 0 0 6px 4px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.filters select,
.sort-control select {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 13px;
  color: #e4e7ee;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3a9b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") right 13px center / 12px no-repeat,
    rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.filters select:hover,
.sort-control select:hover { border-color: var(--border-strong); background-color: rgba(255, 255, 255, 0.08); }
.filters select option,
.sort-control select option { color: var(--text); background: #12141b; }

.text-button {
  min-height: 40px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 12px;
}

.text-button:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.facet-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #ff9c87;
  font-size: 12px;
}

.facet-status[hidden] { display: none; }

.facet-status button {
  padding: 3px 10px;
  color: var(--accent);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  font-size: 12px;
}

.filters select:disabled { color: #777d89; cursor: wait; }

/* ==== TVBox ==== */
.tvbox-source {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  gap: 42px;
  padding: 42px;
  background: linear-gradient(135deg, rgba(82, 214, 160, 0.1), transparent 60%);
}

.tvbox-source h2 { font-size: 26px; }
.tvbox-source p { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.tvbox-source code { color: #dfe2e8; }
.tvbox-copy-list { display: grid; gap: 13px; min-width: 0; }
.tvbox-copy-list label > span:first-child { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 11px; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.copy-field input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  color: #dfe2e8;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 12px 0 0 12px;
  outline: 0;
}
.copy-field input:focus { border-color: rgba(82, 214, 160, 0.5); }
.copy-field button {
  min-width: 88px;
  color: var(--success);
  background: rgba(82, 214, 160, 0.1);
  border: 1px solid rgba(82, 214, 160, 0.25);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  font-size: 12px;
  font-weight: 700;
}
.copy-field button:hover { background: rgba(82, 214, 160, 0.16); }
.tvbox-copy-list .primary-button {
  display: inline-flex;
  width: auto;
  min-height: 42px;
  padding: 0 20px;
  align-items: center;
  justify-content: center;
  justify-self: start;
  text-decoration: none;
  border-radius: 999px;
}
.tvbox-copy-list .copy-message { min-height: 18px; margin: -3px 0 0; color: var(--success); }

/* ==== Results ==== */
.results { padding: 30px 0 90px; }

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

h2 { margin: 0; font-size: 32px; letter-spacing: -0.035em; }

.result-count {
  margin: 0;
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.result-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.sort-control select { width: auto; border-radius: 999px; padding-left: 16px; }

.month-group-control {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #e4e7ee;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}

.month-group-control.disabled { cursor: not-allowed; opacity: 0.45; }
.month-group-control input { margin: 0; accent-color: var(--accent); }

.video-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 34px 20px;
}

.video-grid.grouped { display: block; }
.month-group + .month-group { margin-top: 54px; }

.month-heading {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.month-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 72px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.month-heading h3 { margin: 0; font-size: 21px; letter-spacing: -0.025em; }
.month-heading span { color: var(--muted); font-size: 12px; }

.month-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 34px 20px;
}

/* A card comes in out of a blur, lifts and leans toward the mouse, and its
   poster's colours glow underneath it. */
.video-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  perspective: 900px;
  animation: card-in 0.8s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(22px) scale(0.95); }
}

/* Desktops have the headroom for the blur-in look. */
@media (hover: hover) and (pointer: fine) {
  @keyframes char-in {
    from { opacity: 0; filter: blur(12px); transform: translateY(0.28em) scale(1.12); }
  }
  @keyframes card-in {
    from { opacity: 0; transform: translateY(22px) scale(0.95); filter: blur(10px); }
  }
}

.video-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 4%;
  left: 8%;
  width: 84%;
  aspect-ratio: 2 / 3;
  background: var(--poster, none) center / cover;
  border-radius: 30px;
  filter: blur(28px) saturate(1.9);
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s var(--ease-out);
}

.video-card:hover::before { opacity: 0.85; transform: translateY(22px) scale(1); }

.poster-button {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: linear-gradient(145deg, #1b1f2a, #0f1117);
  border: 0;
  border-radius: var(--radius);
  text-align: left;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.55s var(--ease-out), box-shadow 0.55s ease;
}

.poster-button:hover,
.poster-button.tilting {
  transform: translateY(-8px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  box-shadow: 0 34px 60px -24px rgba(0, 0, 0, 0.95);
}

.poster-button.tilting { transition: transform 0.14s ease-out, box-shadow 0.55s ease; }

.poster-button::after {
  content: "▶  查看详情";
  position: absolute;
  inset: auto 10px 10px;
  padding: 10px 12px;
  text-align: center;
  white-space: pre;
  color: #0b0c10;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.35s var(--spring);
}

.poster-button:hover::after,
.poster-button:focus-visible::after { opacity: 1; transform: none; }

.poster-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out), filter 0.4s ease;
}

.poster-button:hover img { transform: scale(1.06); filter: saturate(1.12); }

.poster-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  padding: 4px 9px;
  color: #fff;
  background: rgba(8, 9, 14, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.poster-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #8a90a0;
  text-align: center;
  font-weight: 700;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    linear-gradient(145deg, #1b1f2a, #0f1117);
}

.card-body { padding: 14px 4px 0; }

.card-body h3 {
  margin: 0 0 7px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}

.video-card:hover .card-body h3 { color: #fff; text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 50%, transparent); }

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta span:first-child { color: #d6d9e0; }

.card-published {
  display: block;
  margin-top: 7px;
  color: var(--faint);
  font-size: 11px;
}

.message {
  padding: 46px 20px;
  color: var(--muted);
  background: var(--glass);
  border: 1px dashed var(--border-strong);
  border-radius: 22px;
  text-align: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.skeleton {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite, fade-in 0.5s ease both;
  animation-delay: 0s, calc(var(--i, 0) * 40ms);
}

@keyframes shimmer { to { background-position-x: -220%; } }
@keyframes fade-in { from { opacity: 0; } }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin: 52px auto 0;
  padding: 6px;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.pagination[hidden] { display: none; }
.pagination span { padding: 0 14px; }

.pagination button {
  min-height: 40px;
  padding: 0 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  border-radius: 999px;
  transition: background-color 0.2s, color 0.2s;
}

.pagination button:hover:not(:disabled) { color: var(--accent-ink); background: var(--accent); }
.pagination button:disabled { cursor: not-allowed; opacity: 0.35; }

/* ==== Dialogs (admin, source access, TVBox): glass sheets ==== */
.admin-dialog,
.source-settings-dialog,
.tvbox-dialog {
  padding: 0;
  color: var(--text);
  background: rgba(16, 18, 26, 0.8);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(32px) saturate(1.4);
  -webkit-backdrop-filter: blur(32px) saturate(1.4);
}

.admin-dialog[open],
.source-settings-dialog[open],
.tvbox-dialog[open] { animation: dialog-pop 0.45s var(--spring) both; }

@keyframes dialog-pop { from { opacity: 0; transform: translateY(14px) scale(0.96); } }

.admin-dialog { width: min(430px, calc(100% - 28px)); }
.source-settings-dialog { width: min(520px, calc(100% - 28px)); }

.tvbox-dialog {
  width: min(900px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border-color: rgba(82, 214, 160, 0.22);
}

.admin-dialog::backdrop,
.source-settings-dialog::backdrop,
.tvbox-dialog::backdrop { background: rgba(3, 4, 7, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

.admin-form { padding: 38px 36px 34px; }
.admin-form h2 { margin-bottom: 24px; font-size: 28px; }

.admin-form label span {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--muted);
  font-size: 12px;
}

.admin-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: 0;
}

.admin-form input:focus { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.admin-submit { width: 100%; min-height: 48px; margin-top: 18px; }
.admin-submit:disabled { cursor: wait; opacity: 0.6; }
.admin-message { margin: 10px 0 -8px; color: #ff8d76; font-size: 12px; }

.source-settings-form { padding: 38px 36px 34px; }
.source-settings-form h2 { margin: 0 0 10px; font-size: 28px; }
.source-settings-copy { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.source-settings-list { display: grid; gap: 10px; padding: 0; border: 0; }
.source-setting {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.source-setting:hover { background: rgba(255, 255, 255, 0.08); }
.source-setting:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.source-setting input { width: 18px; height: 18px; accent-color: var(--accent); }
.source-setting span { display: grid; gap: 3px; font-size: 14px; }
.source-setting small { color: var(--muted); font-size: 11px; }
.source-settings-message { min-height: 18px; margin: 14px 0 0; color: var(--success); font-size: 12px; }
.source-settings-message.error { color: #ff8d76; }
.source-settings-save { width: 100%; min-height: 48px; margin-top: 4px; }
.source-settings-save:disabled { cursor: wait; opacity: 0.6; }

.dialog-close {
  position: sticky;
  z-index: 2;
  top: 14px;
  float: right;
  width: 40px;
  height: 40px;
  margin: 14px 14px -54px 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 23px;
  line-height: 1;
  transition: background-color 0.2s, transform 0.3s var(--spring);
}

.dialog-close:hover { background: rgba(255, 255, 255, 0.16); transform: rotate(90deg); }

/* ==== 沉浸式详情 ====
   The film fills the screen: its poster, blurred, is the room; its colours
   (--imm-*, from the poster when the host allows) tint the text and controls. */
.detail-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--imm-fg);
  background: transparent;
  border: 0;
  border-radius: 0;
  transition: --imm-accent 1.2s ease, --imm-bg 1.2s ease, --imm-fg 1.2s ease, --imm-sub 1.2s ease;
}

/* Opening: the dialog itself is see-through and its room (the backdrop) fades
   in over the page while the poster flies in fully opaque; nothing dims the
   page before the view has painted. */
.detail-dialog::backdrop { background: transparent; }

.detail-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--imm-bg);
  animation: fade-in 0.32s ease both;
}

.detail-chrome,
.detail-nav { animation: fade-in 0.3s ease 0.12s both; }

.detail-backdrop .backdrop-layer { filter: saturate(1.6) brightness(0.85); }
.detail-backdrop .backdrop-layer.on { opacity: 0.92; }

.detail-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 85% 75% at 26% 40%, transparent 0%, color-mix(in srgb, var(--imm-bg) 30%, transparent) 55%, color-mix(in srgb, var(--imm-bg) 88%, transparent) 100%),
    linear-gradient(90deg, color-mix(in srgb, var(--imm-bg) 12%, transparent), color-mix(in srgb, var(--imm-bg) 58%, transparent) 75%);
}

.detail-backdrop .imm-shapes { z-index: 2; }

.detail-chrome {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(16px, env(safe-area-inset-top)) clamp(16px, 3vw, 36px) 16px;
  background: linear-gradient(color-mix(in srgb, var(--imm-bg) 60%, transparent), transparent);
  pointer-events: none;
}

.detail-chrome > * { pointer-events: auto; }

.detail-theme {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 12px;
  color: var(--imm-sub);
  background: color-mix(in srgb, var(--imm-fg) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--imm-fg) 12%, transparent);
  border-radius: 999px;
  font-size: 12px;
  animation: fade-in 0.8s ease both;
}

.detail-theme::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--imm-accent);
  box-shadow: 0 0 10px var(--imm-accent);
}

.detail-theme[hidden] { display: none; }

.detail-position {
  margin-left: auto;
  color: color-mix(in srgb, var(--imm-fg) 55%, transparent);
  font-size: 12px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.detail-chrome .dialog-close {
  position: static;
  float: none;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: 0;
  color: var(--imm-fg);
  background: color-mix(in srgb, var(--imm-fg) 9%, transparent);
  border-color: color-mix(in srgb, var(--imm-fg) 16%, transparent);
}

.detail-chrome .dialog-close:hover { background: color-mix(in srgb, var(--imm-fg) 18%, transparent); }

.detail-nav {
  position: absolute;
  z-index: 6;
  top: 50%;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0 0 4px;
  color: var(--imm-fg);
  background: color-mix(in srgb, var(--imm-bg) 40%, transparent);
  border: 1px solid color-mix(in srgb, var(--imm-fg) 16%, transparent);
  border-radius: 50%;
  font-size: 32px;
  line-height: 1;
  opacity: 0.6;
  translate: 0 -50%;
  transition: opacity 0.2s, background-color 0.2s, transform 0.3s var(--spring);
}

.detail-nav:hover { opacity: 1; background: color-mix(in srgb, var(--imm-fg) 14%, transparent); transform: scale(1.08); }
.detail-nav.prev { left: clamp(8px, 1.8vw, 26px); }
.detail-nav.next { right: clamp(8px, 1.8vw, 26px); }
.detail-nav[hidden] { display: none; }

.detail-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(80px, 11vh, 120px) clamp(20px, 7vw, 110px) 64px;
}

.detail-content > .message { max-width: 520px; margin: 18vh auto 0; color: var(--imm-sub); }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}

.detail-layout[data-direction] { animation: detail-swap 0.6s var(--ease-out) both; }
.detail-layout[data-direction="next"] { --from-x: 48px; }
.detail-layout[data-direction="prev"] { --from-x: -48px; }

@keyframes detail-swap {
  from { opacity: 0; transform: translateX(var(--from-x, 0)) scale(0.98); }
}

.detail-poster-wrap { perspective: 1100px; }

.detail-poster-frame {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 22px;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s var(--ease-out);
  box-shadow: 0 50px 100px -34px rgba(0, 0, 0, 0.9);
}

.detail-poster-frame.tilting { transition: transform 0.14s ease-out; }

.detail-poster-frame::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 10% -8% -10%;
  background: var(--poster, none) center / cover;
  border-radius: 50px;
  filter: blur(54px) saturate(2);
  opacity: 0.75;
}

.detail-poster {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
  background: color-mix(in srgb, var(--imm-fg) 6%, transparent);
}

.detail-main { min-width: 0; padding-top: clamp(0px, 3vh, 28px); }
.detail-main > * { animation: rise-in 0.8s var(--ease-out) both; }
.detail-main > :nth-child(1) { animation-delay: 60ms; }
.detail-main > :nth-child(2) { animation: none; }
.detail-main > :nth-child(3) { animation-delay: 380ms; }
.detail-main > :nth-child(4) { animation-delay: 480ms; }
.detail-main .eyebrow { color: var(--imm-accent); }

.detail-title {
  margin: 0;
  font-size: clamp(34px, 5.2vw, 70px);
  font-weight: 820;
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-shadow: 0 6px 50px color-mix(in srgb, var(--imm-accent) 35%, transparent);
}

.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 26px; }

.detail-tags span {
  padding: 6px 12px;
  color: color-mix(in srgb, var(--imm-fg) 88%, transparent);
  background: color-mix(in srgb, var(--imm-fg) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--imm-fg) 14%, transparent);
  border-radius: 999px;
  font-size: 12px;
}

.detail-tags span:first-child {
  color: var(--imm-bg);
  background: var(--imm-accent);
  border-color: transparent;
  font-weight: 700;
}

.detail-body { display: grid; gap: 10px; max-width: 70ch; }
.detail-body.ready > * { animation: rise-in 0.6s var(--ease-out) both; }
.detail-body.ready > :nth-child(2) { animation-delay: 80ms; }
.detail-body.ready > :nth-child(3) { animation-delay: 160ms; }

.line-skeleton {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--imm-fg) 6%, transparent) 30%, color-mix(in srgb, var(--imm-fg) 14%, transparent) 50%, color-mix(in srgb, var(--imm-fg) 6%, transparent) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite;
}

.line-skeleton:nth-child(2) { width: 92%; }
.line-skeleton:nth-child(3) { width: 84%; }
.line-skeleton:nth-child(4) { width: 46%; }

.detail-copy {
  margin: 0;
  color: color-mix(in srgb, var(--imm-fg) 80%, transparent);
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-line;
}

.detail-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  margin: 18px 0 0;
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, var(--imm-fg) 10%, transparent);
  font-size: 13px;
  line-height: 1.6;
}

.detail-facts:empty { display: none; }
.detail-facts dt { color: var(--imm-sub); }
.detail-facts dd { margin: 0; color: color-mix(in srgb, var(--imm-fg) 90%, transparent); }

.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.action-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  color: var(--imm-bg);
  background: var(--imm-accent);
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
  transition: transform 0.25s var(--spring), box-shadow 0.25s;
}

.action-link:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px var(--imm-accent); }

.action-link.secondary {
  color: var(--imm-fg);
  background: color-mix(in srgb, var(--imm-fg) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--imm-fg) 14%, transparent);
}

.episodes {
  grid-column: 1 / -1;
  margin-top: clamp(12px, 3vh, 30px);
  padding: 24px;
  background: color-mix(in srgb, var(--imm-bg) 62%, transparent);
  border: 1px solid color-mix(in srgb, var(--imm-fg) 10%, transparent);
  border-radius: 26px;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
  animation: rise-in 0.7s var(--ease-out) both;
}

.episodes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.episodes h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }

.line-tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  background: color-mix(in srgb, var(--imm-fg) 7%, transparent);
  border-radius: 999px;
  scrollbar-width: none;
}

.line-tabs::-webkit-scrollbar { display: none; }

.line-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  color: var(--imm-sub);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.25s;
}

.line-tab small {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--imm-fg) 10%, transparent);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.line-tab:hover { color: var(--imm-fg); }
.line-tab[aria-selected="true"] { color: var(--imm-bg); background: var(--imm-fg); font-weight: 700; }
.line-tab[aria-selected="true"] small { background: color-mix(in srgb, var(--imm-bg) 15%, transparent); }

.episode-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

.episode-list[hidden] { display: none; }

.episode-list .action-link {
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  overflow: hidden;
  color: var(--imm-fg);
  background: color-mix(in srgb, var(--imm-fg) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--imm-fg) 12%, transparent);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  animation: rise-in 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 16ms);
  transition: transform 0.25s var(--spring), background-color 0.2s, color 0.2s, box-shadow 0.25s, border-color 0.2s;
}

.episode-list .action-link:hover {
  color: var(--imm-bg);
  background: var(--imm-accent);
  border-color: transparent;
  box-shadow: 0 12px 30px -10px var(--imm-accent);
  transform: translateY(-3px);
}

.episode-list .action-link:visited:not(:hover) { color: var(--imm-sub); }

/* Once the view has opened (and only while it is open: closing shows the page
   in the same frame), the page under it is neither drawn nor animated. */
:root.detail-open:has(#detail-dialog[open]) :is(.ambient, .site-header, main, footer) { visibility: hidden; }
:root.detail-open:has(#detail-dialog[open]) :is(.ambient, .site-header, main, footer) * { animation-play-state: paused; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 42px;
  color: var(--faint);
  border-top: 1px solid var(--border);
  font-size: 12px;
}

/* ==== Narrower screens ==== */
@media (max-width: 1080px) {
  .hero.has-spotlight .hero-stage { grid-template-columns: minmax(0, 1fr) minmax(280px, 0.85fr); }
  .spotlight-deck { --w: clamp(200px, 25vw, 280px); }
}

@media (max-width: 920px) {
  .video-grid, .month-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filters, .filters.admin { grid-template-columns: repeat(2, 1fr); }
  .tvbox-source { grid-template-columns: 1fr; gap: 24px; }
  .text-button { justify-self: start; }

  /* One column; the deck sits between the headline and the spotlight card. */
  .hero.has-spotlight .hero-stage { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 0; }
  .hero-text { display: contents; }
  .hero-text > .eyebrow { order: 1; }
  .hero-text > h1 { order: 2; }
  .hero-text > .hero-copy { order: 3; }
  .spotlight-deck { order: 4; --w: clamp(180px, 34vw, 250px); margin-top: 20px; }
  .spotlight-info { order: 5; max-width: none; margin-top: 8px; }

  .detail-layout { grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); }
}

@media (max-width: 680px) {
  :root { --page: min(100% - 28px, 1180px); }
  .site-header { min-height: 62px; padding-inline: 14px; }
  .sync-status { max-width: 160px; }
  .header-tools { gap: 6px; }
  .hero { padding: 28px 0 30px; }
  .hero-copy { display: none; }
  .search-box { width: 100%; }
  .search-panel { grid-template-columns: 1fr; border-radius: 22px; }
  .primary-button { width: 100%; }
  .filters, .filters.admin { grid-column: auto; grid-template-columns: 1fr 1fr; }
  .tvbox-source { padding: 34px 22px 26px; }
  .video-grid, .month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 12px; }
  .poster-button::after { display: none; }
  .spotlight-deck { --w: 44vw; }
  .deck-card[data-slot="1"] { --tx: 38%; }
  .deck-card[data-slot="2"] { --tx: -36%; }

  .detail-content { padding: 78px 18px 96px; }
  .detail-layout { grid-template-columns: 1fr; gap: 26px; }
  .detail-poster-wrap { width: min(62vw, 280px); margin: 0 auto; }
  .detail-main { padding-top: 0; text-align: center; }
  .detail-tags, .detail-actions { justify-content: center; }
  .detail-body { text-align: left; }
  .detail-veil { background: linear-gradient(180deg, color-mix(in srgb, var(--imm-bg) 20%, transparent), color-mix(in srgb, var(--imm-bg) 80%, transparent) 55%); }
  .episodes { padding: 18px 14px; border-radius: 22px; }
  .episode-list { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
  .detail-nav { top: max(16px, env(safe-area-inset-top)); width: 44px; height: 44px; font-size: 28px; translate: none; opacity: 0.9; }
  .detail-nav.prev { left: 16px; }
  .detail-nav.next { left: 68px; right: auto; }
  .detail-chrome { padding-left: 124px; }
  footer { flex-direction: column; }
}

@media (max-width: 440px) {
  .brand > span:last-child { display: none; }
  .filters, .filters.admin { grid-template-columns: 1fr; }
  .copy-field { grid-template-columns: 1fr; gap: 7px; }
  .copy-field input, .copy-field button { border: 1px solid var(--border); border-radius: 12px; }
  .copy-field button { min-height: 40px; border-color: rgba(82, 214, 160, 0.25); }
  .video-grid, .month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-heading { align-items: start; flex-direction: column; }
  .result-tools { justify-content: flex-start; }
  .pagination { gap: 4px; }
  .pagination button { padding: 0 12px; }
  .sync-status { display: none; }
  .admin-form { padding: 34px 24px 28px; }
}

@media (hover: none) {
  /* No frosted glass on phones, anywhere (dialogs and their backdrops too):
     each blurred surface would re-blur what is behind it on every frame the
     poster light changes. That background is already a blur, so a denser
     shared tint (--glass) looks the same. */
  :root { --glass: rgba(14, 16, 23, 0.74); }
  *, *::before, *::after, ::backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  :root.scrolled .site-header { background: rgba(7, 8, 12, 0.86); }
  .poster-badge { background: rgba(8, 9, 14, 0.72); }
  .video-card:hover::before { opacity: 0; }
  .poster-button:hover { transform: none; }
  /* The page's own poster light carries the colour on a phone; a blurred glow
     under each deck card would be repainted on every frame of a switch. */
  .deck-card::before { display: none; }
  /* Touch feedback in place of the browser's tap highlight. */
  .poster-button { transition: transform 0.18s ease; }
  .poster-button:active { transform: scale(0.97); }
  .deck-card[data-slot="0"]:active { scale: 0.97; }
  .detail-poster-frame::before { filter: blur(32px) saturate(1.8); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
  .backdrop-layer { transition: opacity 0.4s ease !important; }
}

/* ---- 内嵌播放器 (player.js) ----
   Covers the detail view. On a wide screen the picture fills the space above a
   short episode strip; on a phone held upright it sits at the top in 16:9 with
   the episodes scrolling below. Controls float over the picture and fade out
   while playing. */

.play-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  color: var(--accent-ink);
  font-weight: 700;
  background: var(--imm-accent);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 10px 28px -12px var(--imm-accent);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease;
}
.play-button:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -10px var(--imm-accent); }
.play-button-icon { font-size: 12px; }
.episode-list .action-link.last-watched {
  color: var(--imm-fg);
  border-color: color-mix(in srgb, var(--imm-accent) 70%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--imm-accent) 50%, transparent);
}

.vp {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: #000;
  outline: none;
  animation: fade-in 0.2s ease both;
}
.vp[hidden] { display: none; }
:root.vp-open .detail-chrome, :root.vp-open .detail-nav { visibility: hidden; }

.vp-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #000;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.vp-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.vp.idle .vp-stage { cursor: none; }
.vp-gestures {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Horizontal swipes and long presses are ours; vertical ones still scroll. */
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.vp-top, .vp-bar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
}
.vp-top {
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 28px max(10px, env(safe-area-inset-left));
  background: linear-gradient(rgba(0, 0, 0, 0.72), transparent);
}
.vp-bar {
  bottom: 0;
  padding: 34px max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
}
/* Only the controls themselves take touches; the shaded edges let swipes
   and long presses through to the picture. */
.vp-top, .vp-bar { pointer-events: none; }
.vp-top > *, .vp-bar > * { pointer-events: auto; }
.vp.idle .vp-top > *, .vp.idle .vp-bar > * { pointer-events: none; }
.vp.idle .vp-top { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.vp.idle .vp-bar { opacity: 0; transform: translateY(8px); pointer-events: none; }

.vp-heading { display: grid; min-width: 0; line-height: 1.3; }
.vp-title { overflow: hidden; font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
.vp-subtitle { overflow: hidden; color: rgba(255, 255, 255, 0.7); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }

.vp-btn {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: transparent;
  border: 0;
  border-radius: 10px;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.vp-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.vp-btn:disabled { opacity: 0.35; cursor: default; }
.vp-btn[hidden] { display: none; }
.vp-close { font-size: 22px; }
.vp-play { min-width: 46px; font-size: 18px; }
.vp-back, .vp-forward { font-size: 13px; }

.vp-progress { position: relative; height: 18px; margin: 0 4px 2px; }
.vp-buffered {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  transform: translateY(-50%);
  pointer-events: none;
}
.vp-seek {
  --played: 0%;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.vp-seek::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(90deg, var(--imm-accent) var(--played), rgba(255, 255, 255, 0.2) var(--played));
  border-radius: 4px;
}
.vp-seek::-moz-range-track {
  height: 4px;
  background: linear-gradient(90deg, var(--imm-accent) var(--played), rgba(255, 255, 255, 0.2) var(--played));
  border-radius: 4px;
}
.vp-seek::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--imm-accent) 45%, transparent);
  -webkit-appearance: none;
}
.vp-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #fff;
  border: 0;
  border-radius: 50%;
}

.vp-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.vp-time {
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vp-spacer { flex: 1; }
.vp-speed {
  height: 32px;
  padding: 0 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 8px;
}
.vp-speed option { color: #111; }

.vp-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  animation: vp-spin 0.9s linear infinite;
}
.vp-spinner.on { opacity: 1; }
@keyframes vp-spin { to { transform: rotate(360deg); } }

.vp-btn.vp-big-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 68px;
  min-width: 68px;
  height: 68px;
  aspect-ratio: 1;
  padding: 0 0 0 5px;
  line-height: 1;
  font-size: 26px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.vp-toast {
  position: absolute;
  top: 18%;
  left: 50%;
  z-index: 4;
  width: max-content;
  max-width: calc(100% - 40px);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 18px;
  opacity: 0;
  transform: translate(-50%, -6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.vp-toast.on { opacity: 1; transform: translate(-50%, 0); }

.vp-scrub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.62);
  border-radius: 14px;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.vp-scrub.on { opacity: 1; }
.vp-scrub.on ~ .vp-big-play { opacity: 0; pointer-events: none; }
.vp-scrub-time { font-size: 20px; font-variant-numeric: tabular-nums; }
.vp-scrub-delta { color: rgba(255, 255, 255, 0.75); font-size: 13px; font-variant-numeric: tabular-nums; }

.vp-seek-hint {
  position: absolute;
  top: 50%;
  z-index: 2;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
}
.vp-seek-hint[data-side="left"] { left: 12%; }
.vp-seek-hint[data-side="right"] { right: 12%; }
.vp-seek-hint.on { animation: vp-hint 0.6s ease both; }
@keyframes vp-hint { 0% { opacity: 0; } 20%, 60% { opacity: 1; } 100% { opacity: 0; } }

.vp-error {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 70px 24px 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.82);
  overflow-y: auto;
}
.vp-error[hidden] { display: none; }
.vp-error-text { max-width: 420px; margin: 0; font-size: 15px; line-height: 1.6; }
.vp-error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.vp-error-button {
  padding: 9px 18px;
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
  background: var(--imm-accent);
  border: 0;
  border-radius: 999px;
}
.vp-error-button.secondary { color: #fff; background: rgba(255, 255, 255, 0.14); }
.vp-alternatives { display: grid; justify-items: center; gap: 8px; }
.vp-alt-note { margin: 0; color: rgba(255, 255, 255, 0.65); font-size: 13px; }
.vp-alt-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.vp-alt {
  display: grid;
  gap: 2px;
  min-width: 140px;
  padding: 10px 14px;
  color: #fff;
  text-align: left;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
}
.vp-alt span { color: rgba(255, 255, 255, 0.6); font-size: 12px; }
.vp-alt:hover:not(:disabled) { background: rgba(255, 255, 255, 0.18); }

.vp-panel {
  display: grid;
  gap: 12px;
  flex: 0 0 auto;
  max-height: 30vh;
  padding: 14px max(18px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow-y: auto;
  background: #0b0c11;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.vp-lines { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.vp-lines[hidden] { display: none; }
.vp-line {
  flex: none;
  padding: 6px 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 999px;
}
.vp-line[aria-selected="true"] { color: #111; background: #fff; }
.vp-line.failed { text-decoration: line-through; opacity: 0.55; }
.vp-episodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.vp-episodes[hidden] { display: none; }
.vp-episode {
  min-width: 0;
  padding: 8px 6px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid transparent;
  border-radius: 10px;
}
.vp-episode:hover { background: rgba(255, 255, 255, 0.14); }
.vp-episode.current { color: var(--accent-ink); font-weight: 700; background: var(--imm-accent); }
.vp-external { justify-self: start; color: rgba(255, 255, 255, 0.6); font-size: 13px; }
.vp-help { margin: 0; color: rgba(255, 255, 255, 0.4); font-size: 12px; }

.vp.fullscreen .vp-panel, .vp:fullscreen .vp-panel { display: none; }

@media (hover: none) {
  .vp-help { display: none; }
  .vp-mute { display: none; }
}

/* A phone held upright: picture on top, episodes below. */
@media (max-width: 760px) and (orientation: portrait) {
  .vp-stage { flex: 0 0 auto; aspect-ratio: 16 / 9; }
  .vp-panel { flex: 1 1 auto; max-height: none; }
  .vp-top { padding-top: max(6px, env(safe-area-inset-top)); }
  .vp-bar { padding-top: 22px; padding-bottom: 4px; }
  .vp-btn { min-width: 34px; height: 34px; padding: 0 4px; font-size: 14px; }
  .vp-prev, .vp-next, .vp-pip { display: none; }
  .vp-time { margin-left: 4px; font-size: 12px; }
  .vp-speed { height: 28px; padding: 0 4px; font-size: 12px; }
  .vp-episodes { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  /* The page does not scroll under the picture here, so vertical swipes on
     it are free for brightness and volume. */
  .vp-gestures { touch-action: none; }
}

/* Landscape on a phone: the picture takes the whole screen, episodes below it. */
@media (max-height: 520px) and (orientation: landscape) {
  .vp { overflow-y: auto; }
  .vp-stage { flex: 0 0 auto; height: 100dvh; }
  .vp-panel { max-height: none; }
}

/* Page full screen (phones): the player covers the screen without the
   browser's own full screen, which would swap in the browser's player. */
:root.vp-webfull, :root.vp-webfull body { overflow: hidden; }
/* With the whole page in the browser's full screen, the page is drawn above
   the player's dialog: hide everything else, or the site header covers the
   top of the picture (and the long-press speed picker shown there). */
:root.vp-webfull body > :not(dialog[open]) { visibility: hidden; }
.vp.webfull {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  overflow: hidden;
}
.vp.webfull .vp-panel { display: none; }
.vp.webfull .vp-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; }
.vp.webfull .vp-gestures { touch-action: none; }
/* An upright phone: the picture is turned a quarter clockwise to fill it. */
.vp.webfull.rotated .vp-stage {
  position: fixed;
  top: 0;
  left: 0;
  flex: none;
  width: var(--vp-h, 100vh);
  height: var(--vp-w, 100vw);
  transform-origin: 0 0;
  transform: translateX(var(--vp-w, 100vw)) rotate(90deg);
}

/* Long press: the speeds a held finger can slide between. */
.vp-rates {
  position: absolute;
  top: 16%;
  left: 50%;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 12px 7px;
  background: rgba(0, 0, 0, 0.66);
  border-radius: 16px;
  opacity: 0;
  transform: translate(-50%, -6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.vp-rates.on { opacity: 1; transform: translate(-50%, 0); }
.vp-rates-label { font-size: 13px; font-weight: 700; }
.vp-rates-list { display: flex; gap: 4px; }
.vp-rate {
  min-width: 46px;
  padding: 5px 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  border-radius: 999px;
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}
.vp-rate.current { color: var(--accent-ink, #111); background: var(--imm-accent, #fff); transform: scale(1.08); }
.vp-rates-hint { color: rgba(255, 255, 255, 0.55); font-size: 11px; }
.vp-rates.on ~ .vp-big-play { opacity: 0; pointer-events: none; }

/* Vertical swipe: brightness (left half) or volume (right half). */
.vp-level {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 150px;
  padding: 10px 16px 12px;
  background: rgba(0, 0, 0, 0.62);
  border-radius: 14px;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.vp-level.on { opacity: 1; }
.vp-level-label { font-size: 15px; font-variant-numeric: tabular-nums; }
.vp-level-track { width: 100%; height: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.25); border-radius: 999px; }
.vp-level-fill { height: 100%; background: #fff; border-radius: 999px; }
.vp-level.on ~ .vp-big-play { opacity: 0; pointer-events: none; }
