/* ═══════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════ */
:root {
  --bg:        #0d0d0d;
  --bg2:       #1a1a1a;
  --bg3:       #161616;
  --surface:   #1c1c1c;
  --line:      rgba(255,255,255,0.08);
  --line2:     rgba(255,255,255,0.15);
  --text:      #ffffff;
  --muted:     rgba(255,255,255,0.64);
  --faint:     rgba(255,255,255,0.38);
  --primary:   linear-gradient(135deg, #ec4899, #ef4444);
  --primary-s: #ec4899;
  --primary-e: #ef4444;
  --gold:      #facc15;
  --shadow:    0 20px 60px rgba(0,0,0,0.5);
  /* Safe bottom clearance for fixed/anchored mobile UI. Android Chrome reports
     env(safe-area-inset-bottom)=0, so a bare inset leaves zero gap above the
     gesture bar; max() guarantees a minimum. Use this everywhere a bottom-
     anchored surface needs to clear the system bar / browser chrome. */
  --safe-bottom: max(10px, env(safe-area-inset-bottom));
  /* Visual-viewport vars, kept in sync by syncViewportVars(). Chrome on iOS has
     a persistent bottom toolbar that overlays content and that svh/vh/dvh do NOT
     exclude (Safari does), hiding bottom-anchored UI behind it. --vvh = real
     visible height (sizes the full-screen player); --vv-bottom = the toolbar
     overlay below the layout viewport that fixed bottom UI must clear. JS
     overrides these; the svh/0 fallbacks keep Safari/older browsers correct. */
  --vvh: 100svh;
  --vvw: 100vw;
  --vv-bottom: 0px;
  color-scheme: dark;
}

/* ═══════════════════════════════════════
   RESET
═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
body.is-booting { opacity: 0; }
body.is-ready   { opacity: 1; transition: opacity 200ms ease; }

button, input { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--primary-s);
  outline-offset: 3px;
}
img { display: block; max-width: 100%; }
h1,h2,h3 { font-weight: 700; line-height: 1.2; }
p { line-height: 1.6; }
a { color: inherit; text-decoration: none; }

.is-hidden { display: none !important; }

/* ExoClick mobile in-feed banner (300x250) — centered between home sections.
   text-align centering is the most reliable for ad-injected iframes/<ins> (which
   the ad script may set to full width with a left-aligned creative inside). */
.home-banner-ad {
  text-align: center;
  margin: 8px 0 24px;
}
.home-banner-ad ins {
  display: inline-block;
  margin: 0 auto;
  text-align: center;
}

/* ExoClick mobile detail outstream video — centered between summary and episodes. */
.detail-outstream-ad {
  max-width: 1280px;
  margin: 12px auto 0;
  padding: 0 20px;
  text-align: center;
}
.detail-outstream-ad ins {
  display: inline-block;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}
@media (min-width: 641px) {
  .detail-outstream-ad { display: none !important; }
}

/* ═══════════════════════════════════════
   COMMON COMPONENTS
═══════════════════════════════════════ */

/* Gradient text for accents */
.grad-text {
  background: var(--primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 150ms, transform 150ms;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; transform: none; cursor: default; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: background 150ms, border-color 150ms, transform 150ms;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.14); transform: translateY(-1px); }

.text-btn {
  font-size: 14px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 150ms, background 150ms;
}
.text-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

.pill-btn {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  transition: opacity 150ms;
}
.pill-btn:hover { opacity: 0.88; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--muted);
  transition: color 150ms, background 150ms;
}
.icon-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.install-btn { position: relative; }
.install-reward-badge {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 12px;
  height: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #facc15;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.78)) drop-shadow(0 0 5px rgba(250,204,21,0.45));
  pointer-events: none;
}
.install-reward-badge svg { width: 12px; height: 12px; }
.install-btn.has-reward .install-reward-badge { display: flex; }

/* Tag pills */
.tag-pill {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.3);
  color: #d1d5db;
}
.vip-only-pill,
.vip-only-badge {
  border-color: rgba(250,204,21,0.44);
  background: rgba(250,204,21,0.14);
  color: var(--gold);
}
.vip-only-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 16px);
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(250,204,21,0.44);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0,0,0,0.28);
}

/* Gem icon color */
.gem-icon { color: var(--gold); fill: var(--gold); }

/* Section bar accent */
.section-bar {
  display: inline-block;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   SITE HEADER
═══════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,13,0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}
.logo-text {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 480px) { .logo-text { display: none; } }

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
@media (max-width: 768px) { .header-nav { display: none; } }

.nav-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
  color: var(--muted);
  transition: color 150ms, background 150ms;
}
.nav-pill:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-pill.is-active {
  background: var(--primary);
  color: #fff;
}

.header-spacer { flex: 1; min-width: 0; }
@media (min-width: 768px) { .header-spacer { display: none; } }

.nav-overflow { position: relative; flex-shrink: 0; }
.nav-overflow-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-overflow-caret { transition: transform 150ms; }
.nav-overflow.is-open .nav-overflow-caret { transform: rotate(180deg); }
.nav-overflow-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(20, 20, 24, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 4px;
  min-width: 320px;
  max-width: 480px;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.nav-overflow-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.nav-overflow-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-overflow-item.is-active { background: var(--primary); color: #fff; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Language switcher (zh / en) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line2);
  border-radius: 999px;
  overflow: hidden;
  margin-right: 2px;
}
.lang-opt {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 9px;
  color: var(--muted);
  background: transparent;
  transition: color 150ms, background 150ms;
}
.lang-opt:hover { color: #fff; }
.lang-opt.is-active {
  color: #fff;
  background: var(--primary);
}

/* Search */
.search-wrap { position: relative; }
.search-field {
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-field input {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  width: 200px;
  color: #fff;
  transition: border-color 150ms;
}
.search-field input::placeholder { color: var(--faint); }
.search-field input:focus { border-color: var(--primary-s); outline: none; }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 200;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 150ms;
}
.search-result-item:hover { background: rgba(255,255,255,0.06); }
.search-result-thumb {
  width: 32px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg2);
  flex-shrink: 0;
}
.search-result-name { font-size: 14px; }

/* Auth actions */
.auth-actions { display: flex; align-items: center; gap: 4px; }
.auth-account-btn { display: none; }

/* User menu */
.user-menu-wrap { position: relative; }
.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  transition: background 150ms;
}
.user-avatar-btn:hover { background: rgba(255,255,255,0.08); }
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-diamonds {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 500;
}
@media (max-width: 480px) { .user-diamonds { display: none; } }

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 210px;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 200;
}
.dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.dropdown-name { font-size: 14px; font-weight: 600; }
.dropdown-account-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 7px;
  row-gap: 3px;
  margin-top: 2px;
  font-size: 12px;
}
.dropdown-account { color: var(--muted); }
.dropdown-bind-jump {
  display: inline-flex;
  width: fit-content;
  color: var(--gold);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dropdown-bind-jump:hover { color: #fde68a; }
.dropdown-diamonds {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-size: 13px;
  margin-top: 6px;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--muted);
  transition: color 150ms, background 150ms;
  text-align: left;
}
.dropdown-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.dropdown-logout { color: #f87171; }
.dropdown-logout:hover { color: #fca5a5; background: rgba(248,113,113,0.08); }

/* Hamburger (mobile only) */
.hamburger { display: none; }
@media (max-width: 768px) {
  .header-inner {
    padding: 0 12px;
    gap: 8px;
  }
  .hamburger {
    display: flex;
    flex-shrink: 0;
  }
  .header-actions {
    gap: 3px;
  }
  .history-btn {
    display: none;
  }
  .auth-actions .text-btn,
  .auth-actions .pill-btn {
    display: none;
  }
  .auth-account-btn {
    display: flex;
  }
}

/* Mobile nav drawer */
.mobile-nav {
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ═══════════════════════════════════════
   PAGE SYSTEM
═══════════════════════════════════════ */
.page {
  display: none;
  min-height: calc(100vh - 56px);
}
.page.is-active { display: block; }

/* ═══════════════════════════════════════
   HOME: HERO
═══════════════════════════════════════ */
.hero-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 20px 0;
}
@media (max-width: 640px) { .hero-container { padding: 12px 12px 0; } }

.hero {
  position: relative;
  height: 340px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
}
@media (max-width: 640px) { .hero { height: 220px; border-radius: 12px; } }

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 15%;
  transition: background-image 400ms ease;
  transform: scale(1.04);
  animation: hero-drift 20s ease-in-out infinite alternate;
}
@keyframes hero-drift { from { transform: scale(1.04) translateX(0); } to { transform: scale(1.04) translateX(-2%); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Foreground key-art layer — only used on the mobile portrait hero (see the
   ≤768px block). Hidden on desktop, which uses the coverflow below. */
.hero-fg {
  position: absolute;
  inset: 0;
  display: none;
}

/* ── Hero coverflow (desktop + mobile) ────────────────────────
   A 3D poster carousel. The centred card is bright; flanking cards are dimmed
   and rotated back. On desktop the title + watch button overlay the centre card;
   on mobile they move to a bar below a smaller stage, so the content sections
   show beneath the hero and dimmed prev/next cards peek at the edges. */
.hero { display: none; }   /* legacy banner/portrait hero, replaced by the coverflow */
.hero-coverflow {
  display: block;
  position: relative;
  height: 420px;
  overflow: hidden;
}
.cf-stage {
  position: relative;
  height: 100%;
  perspective: 1500px;
  transform-style: preserve-3d;
}
.cf-card {
  position: absolute;
  top: 50%; left: 50%;
  width: 250px;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  cursor: pointer;
  transform:
    translate(-50%, -50%)
    translateX(calc(var(--off, 0) * 218px))
    translateZ(calc(var(--abs, 0) * -170px))
    rotateY(calc(var(--off, 0) * -28deg))
    scale(calc(1 - var(--abs, 0) * 0.05));
  transition: transform 460ms cubic-bezier(.22,.7,.28,1), opacity 460ms;
  will-change: transform;
}
.cf-card.is-hidden { opacity: 0; pointer-events: none; }
.cf-poster {
  position: absolute; inset: 0;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg2, #1a1a2e);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
/* Dim the flanking cards so the centred one pops. */
.cf-card:not(.is-center) .cf-poster::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 14px;
  background: rgba(0,0,0,0.45);
}
.cf-card.is-center .cf-poster { box-shadow: 0 30px 72px rgba(0,0,0,0.7); }

/* Desktop: title + watch button overlay the centre card. */
.cf-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px 16px 16px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.88), rgba(0,0,0,0.1) 80%, transparent);
  display: none;
}
.cf-card.is-center .cf-meta { display: block; }
.cf-title {
  font-size: 18px; font-weight: 700; color: #fff;
  margin-bottom: 12px; line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cf-play { width: 100%; justify-content: center; }
.cf-label-short { display: none; }   /* desktop shows the full "Watch Now" label */

.cf-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 200;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(0,0,0,0.45); color: #fff;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 160ms;
}
.cf-arrow:hover { background: rgba(0,0,0,0.72); }
.cf-prev { left: 18px; }
.cf-next { right: 18px; }

/* Mobile: title + Play live in a bar below the stage (overlay hidden). */
.cf-bar { display: none; }

@media (max-width: 768px) {
  .hero-container { padding: 12px 0 0; }       /* let side cards reach the screen edges */
  .hero-coverflow { height: auto; }
  .cf-stage {
    height: 424px;                              /* fits a ~400px-tall centre card */
    perspective: 1200px;
    touch-action: pan-y;                        /* horizontal swipe switches; vertical scrolls */
  }
  .cf-card {
    width: min(68vw, 280px);                    /* 2:3 → ~400px tall, clearly bigger than the rails */
    transform:
      translate(-50%, -50%)
      translateX(calc(var(--off, 0) * 150px))
      translateZ(calc(var(--abs, 0) * -120px))
      rotateY(calc(var(--off, 0) * -28deg))
      scale(calc(1 - var(--abs, 0) * 0.07));
  }
  /* Title + Play stay inside the card (overlay). Centre them and use a normal
     button width (not full-card) with a short "Play" label. */
  .cf-meta { text-align: center; }
  .cf-play { width: auto; display: inline-flex; padding: 11px 34px; }
  .cf-label-full { display: none; }
  .cf-label-short { display: inline; }
  .cf-arrow { display: none; }                  /* swipe / tap a side card instead */
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.45) 50%, rgba(0,0,0,0.1) 100%),
    linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px 40px;
  max-width: 680px;
}
@media (max-width: 640px) { .hero-content { padding: 20px; } }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  width: fit-content;
  margin-bottom: 10px;
}
.hero-count {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.hero-title {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.15;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.72);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 640px) { .hero-desc { display: none; } }

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.hero-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-dots {
  position: absolute;
  bottom: 16px;
  right: 32px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.3);
  transition: width 250ms, background 250ms;
  cursor: pointer;
  border: none;
}
.hero-dot.is-active {
  width: 24px;
  background: var(--primary-s);
}

/* Hero "Play" button shows the full label on desktop, a short one on mobile. */
.hero-btn-short { display: none; }

/* Mobile hero (ReelShort-style): a tall portrait key-art image with only the
   title + a centered Play button. Badge/count/tags/desc are hidden so the cover
   art is the focus, and the image prefers the portrait mobileHeroCover (see
   renderHero). */
@media (max-width: 768px) {
  .hero {
    aspect-ratio: 3 / 4;
    height: auto;
    border-radius: 14px;
    touch-action: pan-y;     /* horizontal swipe → switch series; vertical → scroll */
  }
  .hero-bg {
    /* Becomes a blurred, dimmed backdrop that fills the 3:4 frame behind the
       uncropped foreground key art. */
    background-position: center;
    animation: none;
    filter: blur(26px) brightness(0.5);
    transform: scale(1.2);
  }
  .hero-fg {
    display: block;
    background-position: center;
    background-repeat: no-repeat;
    /* contain → the full portrait poster shows with no crop; the blurred backdrop
       fills the side gaps. A radial mask feathers the edges into the backdrop. */
    background-size: contain;
    -webkit-mask-image: radial-gradient(122% 110% at 50% 44%, #000 56%, transparent 100%);
    mask-image: radial-gradient(122% 110% at 50% 44%, #000 56%, transparent 100%);
  }
  .hero-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 45%, transparent 72%);
  }
  .hero-content {
    align-items: center;
    text-align: center;
    max-width: none;
    padding: 20px 20px 40px;
  }
  .hero-badge, .hero-count, .hero-tags { display: none; }
  .hero-title {
    font-size: 24px;
    margin-bottom: 16px;
    -webkit-line-clamp: 2;
  }
  .hero-btns { justify-content: center; width: 100%; }
  .hero-play-btn { padding: 13px 52px; font-size: 16px; }
  .hero-btn-full { display: none; }
  .hero-btn-short { display: inline; }
  .hero-dots {
    left: 0; right: 0; bottom: 14px;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════
   HOME: CONTENT SECTIONS
═══════════════════════════════════════ */
.content-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 0;
}
/* Home sections own their inter-section gap via a uniform top margin; the pager
   (when present) is internal to its block and does not affect the gap, so paged
   and pager-less sections sit the same distance apart. Scoped to home so the
   detail page's .content-section is unaffected. */
#pageHome .content-section { margin-top: 40px; padding-top: 0; }
/* 「猜你喜欢」「最近更新」是仅有的两个无翻页器区块；为它们补上等效尾部占位
   （≈ .section-pager 的 margin-top 18px + 控件高度 ~30px），使最后一行卡片到
   下一区块的间距与带翻页器的区块一致。 */
#forYouSection, #recentSection { padding-bottom: 48px; }
.section-header { margin-bottom: 16px; }
.section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}
.section-count {
  font-size: 13px;
  color: var(--faint);
}

/* Series grid — responsive card layout */
.series-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 12px;
}
@media (min-width: 480px)  { .series-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px)  { .series-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px)  { .series-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1100px) { .series-grid { grid-template-columns: repeat(6, 1fr); } }

/* Mobile home: each section becomes a single-row, swipeable rail showing ~2.25
   cards (2 full + a 25% peek), ReelShort/TikTok style. Only home "rail" grids opt
   in (.series-rail, set in JS); the full single-tag browse view stays a grid, and
   desktop keeps the multi-row grid regardless. */
@media (max-width: 768px) {
  #pageHome .series-grid.series-rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: var(--vvw, 100vw);
    max-width: none;
    margin-left: calc((100% - var(--vvw, 100vw)) / 2);
    margin-right: calc((100% - var(--vvw, 100vw)) / 2);
    padding: 0 20px;
    scroll-padding-left: 20px;
  }
  #pageHome .series-grid.series-rail::-webkit-scrollbar { display: none; }
  #pageHome .series-grid.series-rail > .series-card {
    /* 2 full cards + a 25% peek of the 3rd, accounting for the 20px side gutters. */
    flex: 0 0 calc((var(--vvw, 100vw) - 40px) / 2.25);
    scroll-snap-align: start;
  }
  /* Home rails show at most 12 series; the rest live behind "View all". */
  #pageHome .series-grid.series-rail > .series-card:nth-child(n+13) { display: none; }
  /* Horizontal swipe replaces paging on mobile. */
  #pageHome .section-pager { display: none; }
  /* With no pager, drop the desktop tail compensation so sections sit evenly. */
  #forYouSection, #recentSection { padding-bottom: 0; }
  /* Cleaner ReelShort-style header: title + View all only. */
  #pageHome .section-count { display: none; }
}

/* Series card — poster on top, title below */
.series-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  background: transparent;
  color: inherit;
  text-decoration: none;
}
.card-poster {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 2/3;
  background: var(--bg2);
  transition: transform 200ms;
}
.series-card:hover .card-poster { transform: translateY(-3px); }
.series-card:hover .card-hover { opacity: 1; }
.series-card:hover .card-img { transform: scale(1.08); }

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms;
}
.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 28px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.card-hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 200ms;
}
.card-play-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-play-circle svg { margin-left: 2px; }

.card-title {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  min-height: calc(15px * 1.35 * 2);
  margin-top: 8px;
}

/* ═══════════════════════════════════════
   SERIES DETAIL PAGE
═══════════════════════════════════════ */
.detail-hero {
  position: relative;
  min-height: 280px;
  overflow: hidden;
}
.detail-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(20px) saturate(0.8);
  transform: scale(1.1);
}
.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(13,13,13,0.6) 0%, rgba(13,13,13,0.92) 100%);
}
.detail-hero-content {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  gap: 32px;
}
@media (max-width: 640px) {
  .detail-hero-content { flex-direction: column; gap: 20px; align-items: center; padding: 28px 16px; }
}

.detail-cover-wrap { flex-shrink: 0; }
.detail-cover {
  width: 160px;
  height: 240px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg2);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  background-size: cover;
  background-position: center;
}
@media (max-width: 640px) { .detail-cover { width: 120px; height: 180px; } }

.detail-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
}

.detail-status {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(100,100,100,0.5);
  color: #d1d5db;
  border: 1px solid rgba(255,255,255,0.12);
  width: fit-content;
}
.detail-status.is-ongoing {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  border-color: rgba(34,197,94,0.3);
}
.detail-title {
  font-size: clamp(24px, 3.5vw, 40px);
  font-weight: 800;
  color: #fff;
}
.detail-desc {
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.detail-episodes-wrap {
  padding: 16px 0 40px;
}

/* Episode number grid */
.episode-number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 6px;
  padding-bottom: 8px;
}
.ep-num-btn {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.ep-num-btn:hover { background: rgba(236,72,153,0.12); border-color: var(--primary-s); color: #fff; }
.ep-num-btn.is-active {
  background: rgba(236,72,153,0.18);
  border-color: var(--primary-s);
  color: #fff;
}
.ep-num-btn.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 10px 0 0 10px;
  background: var(--primary);
}
.ep-num-btn.is-free .ep-status-dot { background: #22c55e; }
.ep-num-btn.is-unlocked .ep-status-dot { background: var(--gold); }
.ep-num-btn.is-locked { color: var(--faint); }
.ep-num-btn.is-locked:hover { color: var(--muted); }

.ep-status-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Login CTA */
.login-cta {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 40px;
}
.login-cta-inner {
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(236,72,153,0.1), rgba(239,68,68,0.1));
  border: 1px solid rgba(236,72,153,0.2);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.login-cta-inner p {
  flex: 1 1 280px;
  min-width: 0;
  font-size: 14px;
  color: var(--muted);
}
.login-cta-btns {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  gap: 10px;
}
.login-cta-btns .btn-ghost,
.login-cta-btns .btn-primary {
  max-width: 100%;
}
@media (max-width: 768px) {
  .login-cta {
    padding: 0 16px 32px;
  }
  .login-cta-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }
  .login-cta-inner p {
    flex: 0 1 auto;
    width: 100%;
  }
  .login-cta-btns {
    display: grid;
    grid-template-columns: 1fr;
    flex: 0 1 auto;
    width: 100%;
  }
  .login-cta-btns .btn-ghost,
  .login-cta-btns .btn-primary {
    width: 100%;
    min-width: 0;
    padding: 10px 16px;
    line-height: 1.3;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

/* Detail unlock state */
.detail-unlock-state {
  font-size: 13px;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* ═══════════════════════════════════════
   VIDEO PLAYER PAGE
═══════════════════════════════════════ */
.page-player { background: var(--bg); }

.player-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
@media (max-width: 900px) { .player-wrap { flex-direction: column; padding: 12px; gap: 12px; } }

.player-main { flex: 1; min-width: 0; }

/* Video box */
.video-box {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}
video { width: 100%; height: 100%; object-fit: contain; display: block; }
video::-webkit-media-controls { display: none !important; }
video::-webkit-media-controls-enclosure { display: none !important; }
.stream-frame { width: 100%; height: 100%; border: none; }

/* Pre-roll ad overlay — sits above the content video and custom controls */
.ad-container {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: #000;
}
.ad-container > * { width: 100%; height: 100%; }

/* Ad play gate (desktop): cover image + centered play button over the player; the
   click starts the pre-roll (with sound) + the episode. Above controls so it's the
   only target until tapped. Cover image is set inline by showDesktopAdGate(). */
.ad-gate {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
  background-size: contain;       /* whole cover, no crop */
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  cursor: pointer;
}
.ad-gate::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0.35); }
.ad-gate-play {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  transition: background 150ms, transform 150ms;
}
.ad-gate:hover .ad-gate-play { background: var(--primary-s, #ec4899); transform: scale(1.05); }

/* Custom video controls */
.video-controls {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 200ms;
  pointer-events: none;
}
.video-controls.is-visible,
.video-controls.is-paused {
  opacity: 1;
  pointer-events: auto;
}
.video-box:hover .video-controls { opacity: 1; pointer-events: auto; }

.controls-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}
.ctrl-title {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.9);
  transition: color 150ms, transform 120ms;
  background: none;
  border: none;
  padding: 6px;
}
.ctrl-btn:hover { color: #fff; transform: scale(1.1); }
.ctrl-play-pause { width: 52px; height: 52px; border-radius: 50%; background: rgba(0,0,0,0.4); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.2); }
.back-btn { border-radius: 50%; }

.controls-bottom {
  padding: 0 14px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
}
.progress-bar {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  appearance: none;
  background: rgba(255,255,255,0.25);
  accent-color: var(--primary-s);
  cursor: pointer;
  margin-bottom: 8px;
}
.progress-bar::-webkit-slider-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--primary-s); cursor: pointer; }
.controls-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ctrl-time { font-size: 12px; color: rgba(255,255,255,0.75); }
.ctrl-spacer { flex: 1; }

/* Subtitle selector */
.subtitle-wrap {
  position: relative;
  display: inline-flex;
}
/* Visible label next to the CC icon so the control reads as "subtitles, click to
   change": shows the active language (e.g. EN) or the localized word when off. */
.ctrl-subtitles { gap: 5px; }
.ctrl-subtitles-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}
.subtitle-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: rgba(20, 20, 24, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
  z-index: 30;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.subtitle-menu-item {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  text-align: left;
  white-space: nowrap;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.subtitle-menu-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.subtitle-menu-item.is-active { background: var(--primary); color: #fff; }

/* Lock screen */
.lock-screen {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.lock-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  margin-bottom: 4px;
}
.lock-title { font-size: 22px; font-weight: 700; }
.lock-series { font-size: 14px; color: var(--muted); }
.lock-cost { font-size: 14px; color: var(--primary-s); }
.lock-unlock-btn { min-width: 160px; }

/* Auto-play overlay */
.autoplay-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.autoplay-ring {
  position: relative;
  width: 64px;
  height: 64px;
}
.autoplay-svg {
  width: 64px;
  height: 64px;
  transform: rotate(-90deg);
}
.autoplay-track { fill: none; stroke: rgba(255,255,255,0.15); stroke-width: 3; }
.autoplay-progress {
  fill: none;
  stroke: var(--primary-s);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 176;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 950ms linear;
}
.autoplay-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.autoplay-label { font-size: 14px; color: var(--muted); }
.autoplay-btns { display: flex; gap: 10px; }

/* Video error */
.video-error {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}

/* Episode info below player */
.episode-info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 4px 0;
}
.episode-info-left { flex: 1; min-width: 0; }
.ep-kicker { font-size: 12px; color: var(--primary-s); margin-bottom: 4px; }
.ep-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.ep-desc { font-size: 14px; color: var(--muted); }
.ep-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Player sidebar */
.player-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg2);
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  max-height: 600px;
  display: flex;
  flex-direction: column;
}
@media (max-width: 900px) {
  .player-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    max-height: none;
    border-radius: 0;
    z-index: 150;
    transform: translateX(100%);
    transition: transform 250ms ease;
  }
  .player-sidebar.is-open { transform: translateX(0); }
}

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  gap: 8px;
}
.sidebar-series-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-close { display: none; }
@media (max-width: 900px) { .sidebar-close { display: flex; } }

.sidebar-balance {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--gold);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.player-sidebar .episode-number-grid {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}
.player-sidebar .episode-number-grid::-webkit-scrollbar { width: 4px; }
.player-sidebar .episode-number-grid::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 99px; }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 140;
}
@media (min-width: 900px) { .sidebar-backdrop { display: none !important; } }

/* ═══════════════════════════════════════
   SHOP PAGE
═══════════════════════════════════════ */
.shop-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* Mall tabs (钻石 / VIP) */
.mall-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}
.mall-tab {
  padding: 8px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--line2);
  background: var(--bg2);
  transition: color 150ms, background 150ms, border-color 150ms;
}
.mall-tab:hover { color: #fff; }
.mall-tab.is-active { color: #fff; background: var(--primary); border-color: transparent; }
.shop-header {
  text-align: center;
  margin-bottom: 36px;
}
.shop-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, #facc15, #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(250,204,21,0.25);
  color: #fff;
}
.shop-icon .gem-icon { color: #fff; fill: #fff; }
.shop-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.shop-subtitle { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.shop-balance {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  font-weight: 600;
}

/* Pack grid */
.shop-packs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
@media (min-width: 500px) { .shop-packs { grid-template-columns: repeat(3, 1fr); } }

.shop-pack {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--line2);
  background: var(--bg2);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms, background 150ms, transform 150ms;
}
.shop-pack:hover { border-color: rgba(236,72,153,0.5); transform: translateY(-2px); }
.shop-pack.is-popular {
  border-color: rgba(250,204,21,0.5);
  background: linear-gradient(135deg, rgba(250,204,21,0.08), var(--bg2));
}
/* Selected wins over the popular gold border (higher specificity). */
.shop-pack.is-selected,
.shop-pack.is-popular.is-selected {
  border-color: var(--primary-s);
  background: rgba(236,72,153,0.08);
}

.pack-popular-badge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, #facc15, #f97316);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 3px 0;
  text-align: center;
}
.pack-popular-badge ~ .pack-diamonds { margin-top: 20px; }

.pack-diamonds {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.pack-bonus {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(34,197,94,0.12);
  color: #4ade80;
  margin-bottom: 8px;
}
.pack-price {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}
.pack-per-unit { font-size: 11px; color: var(--faint); }

/* Custom amount */
.shop-custom {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 24px;
}
.custom-label { font-size: 14px; color: var(--muted); display: block; margin-bottom: 10px; }
.custom-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.currency-prefix { font-size: 16px; color: var(--muted); }
.custom-input-row input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 15px;
  color: #fff;
}
.custom-input-row input:focus { border-color: var(--primary-s); outline: none; }
.custom-input-row input::placeholder { color: var(--faint); }
.custom-preview { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }
.custom-preview .amt { color: var(--gold); font-weight: 800; }

/* Checkout */
.shop-checkout {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 24px;
}
.checkout-summary {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 14px;
  text-align: center;
}
.wallet-button-slot { margin-bottom: 10px; }
.wallet-status { font-size: 13px; color: var(--muted); text-align: center; }

/* Benefits */
.shop-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 480px) { .shop-benefits { grid-template-columns: 1fr; } }
.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.benefit-item svg { color: var(--primary-s); flex-shrink: 0; margin-top: 2px; }
.benefit-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.benefit-desc { font-size: 12px; color: var(--faint); }

/* ═══════════════════════════════════════
   AUTH MODAL
═══════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: 20px;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--faint);
  z-index: 1;
}
.modal-close:hover { color: #fff; }

.auth-top {
  padding: 28px 24px 20px;
  background: linear-gradient(135deg, rgba(236,72,153,0.08), transparent);
  text-align: center;
}
.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  overflow: hidden;
}
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-heading { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.auth-sub { font-size: 13px; color: var(--muted); }

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  margin-bottom: 4px;
  background: var(--bg);
  border-radius: 10px;
  margin: 0 24px 4px;
  padding: 4px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--faint);
  transition: color 150ms, background 150ms;
}
.auth-tab.is-active {
  background: var(--primary);
  color: #fff;
}

.auth-form { padding: 16px 24px 24px; }
.auth-field { margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  color: #fff;
  transition: border-color 150ms;
}
.auth-field input:focus { border-color: var(--primary-s); outline: none; }
.auth-field input::placeholder { color: var(--faint); }

.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  padding: 4px;
}
.pw-toggle:hover { color: var(--muted); }

.auth-error {
  font-size: 13px;
  font-weight: 600;
  color: #ff4d4f;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 12px;
  border-radius: 12px;
  font-size: 15px;
}
.auth-error.is-info {
  color: #93c5fd;
  border-color: rgba(96,165,250,0.26);
  background: rgba(96,165,250,0.1);
}
.auth-guest {
  padding: 0 24px 24px;
  display: grid;
  gap: 8px;
}
.auth-guest-btn {
  width: 100%;
  border-color: rgba(250,204,21,0.28);
  background: rgba(250,204,21,0.09);
}
.auth-guest p {
  font-size: 12px;
  color: var(--faint);
  text-align: center;
  line-height: 1.45;
}

/* ═══════════════════════════════════════
   SITE FOOTER
═══════════════════════════════════════ */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--line);
  padding: 28px 20px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-inner p {
  font-size: 12px;
  color: var(--faint);
  line-height: 1.6;
}

/* ═══════════════════════════════════════
   ACCOUNT FEATURES (email-auth-and-account-features)
═══════════════════════════════════════ */

/* Forgot-password flow + auth links */
.auth-link {
  font-size: 13px;
  color: var(--muted);
  transition: color 150ms;
}
.auth-link:hover { color: var(--primary-s); }
.auth-forgot-link-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.auth-forgot { padding: 4px 24px 24px; }
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--faint);
  margin-bottom: 12px;
}
.auth-back:hover { color: var(--muted); }
.auth-forgot .auth-form { padding: 0; }
.auth-forgot-intro { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.auth-resend { display: block; width: 100%; text-align: center; margin-top: 12px; }
.auth-done { text-align: center; padding: 12px 0 4px; }
.auth-done-icon {
  width: 56px; height: 56px; line-height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
  font-size: 26px;
}
.auth-done-msg { font-size: 14px; color: var(--muted); margin-bottom: 18px; }

/* Section "查看全部" jump */
.section-header { display: flex; align-items: center; justify-content: space-between; }
.section-viewall {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  color: var(--muted);
  transition: color 150ms;
  white-space: nowrap;
}
.section-viewall:hover { color: var(--primary-s); }
.section-actions { display: inline-flex; align-items: center; gap: 12px; }
.section-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }
.section-pager.is-hidden { display: none; }
.pager-btn {
  font-size: 13px; color: #e8e8ea;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px; padding: 6px 14px; cursor: pointer;
  transition: opacity 150ms, border-color 150ms;
}
.pager-btn:hover { border-color: var(--primary-s); }
.pager-btn:disabled { opacity: 0.4; cursor: default; }
.pager-info { font-size: 13px; color: var(--muted); min-width: 56px; text-align: center; }

/* Notification bell */
.notif-wrap { position: relative; }
.notif-btn { position: relative; }
.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 200;
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.notif-head-title { font-size: 14px; font-weight: 600; }
.notif-head-actions { display: flex; gap: 8px; }
.notif-head-btn { color: var(--faint); padding: 2px; }
.notif-head-btn:hover { color: #fff; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.notif-item:last-child { border-bottom: 0; }
.notif-item.is-unread { background: rgba(255,255,255,0.03); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.notif-dot-success { background: #4ade80; }
.notif-dot-info { background: #60a5fa; }
.notif-dot-warning { background: var(--gold); }
.notif-body { flex: 1; min-width: 0; }
.notif-msg { font-size: 13px; color: var(--text); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--faint); margin-top: 3px; }
.notif-empty { padding: 32px 16px; text-align: center; font-size: 13px; color: var(--faint); }

/* Profile page */
.profile-wrap { max-width: 640px; margin: 0 auto; padding: 24px 20px 48px; }
.profile-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--muted); margin-bottom: 18px;
}
.profile-back:hover { color: #fff; }
.profile-h1 { font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.profile-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
}
.profile-id { display: flex; align-items: center; gap: 16px; }
.profile-avatar {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-id-text { flex: 1; min-width: 0; }
.profile-name { font-size: 17px; font-weight: 600; }
.profile-email { font-size: 13px; color: var(--muted); margin-top: 3px; }
.profile-bind-jump {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.profile-bind-jump:hover { color: #fde68a; }
.profile-diamonds { text-align: right; flex-shrink: 0; }
.profile-diamond-count { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); font-weight: 600; }
.profile-recharge-link { display: block; font-size: 12px; color: var(--faint); margin-top: 4px; }
.profile-recharge-link:hover { color: var(--primary-s); }
.profile-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
  .profile-stat {
    background: var(--bg);
    border: 0;
    border-radius: 12px;
    color: inherit;
    font: inherit;
    padding: 12px;
    text-align: center;
    width: 100%;
  }
  .profile-stat-btn { cursor: pointer; transition: background 150ms, outline-color 150ms; }
  .profile-stat-btn:hover { background: var(--bg2); }
  .profile-stat-btn:focus-visible { outline: 2px solid var(--primary-s); outline-offset: 2px; }
  .profile-stat-num { font-size: 18px; font-weight: 600; }
.profile-stat-label { font-size: 12px; color: var(--faint); margin-top: 2px; }
.profile-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.profile-link-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  text-align: left;
  transition: border-color 150ms;
}
.profile-link-card:hover { border-color: var(--line2); }
.profile-link-title { display: block; font-size: 14px; font-weight: 500; }
.profile-link-sub { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }
.profile-section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.guest-bind-card {
  border-color: rgba(250,204,21,0.22);
  background: linear-gradient(135deg, rgba(250,204,21,0.08), rgba(255,255,255,0.02)), var(--bg2);
}
.guest-bind-copy {
  color: var(--muted);
  font-size: 13px;
  margin: -8px 0 12px;
}
.guest-bind-card .auth-form {
  padding: 0;
}
.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.code-send-btn {
  height: 41px;
  padding-inline: 14px;
  border-radius: 12px;
}
.profile-pw-success {
  font-size: 13px; color: #4ade80;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px;
}

/* PWA install nudge */
.pwa-nudge {
  position: fixed;
  right: 18px;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 240;
  width: min(420px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(250,204,21,0.24);
  border-radius: 16px;
  background: rgba(22,22,22,0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.pwa-nudge-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  border-radius: 50%;
}
.pwa-nudge-close:hover { color: #fff; background: rgba(255,255,255,0.08); }
.pwa-nudge-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--gold);
  background: rgba(250,204,21,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pwa-nudge-copy {
  min-width: 0;
  padding-right: 20px;
}
.pwa-nudge-copy strong {
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
}
.pwa-nudge-copy p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.pwa-guide-line,
.pwa-guide-reward {
  display: block;
}
.pwa-guide-line {
  margin-bottom: 4px;
}
.pwa-guide-reward {
  color: #d6d3d1;
}
.pwa-guide-highlight {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-weight: 700;
}
.pwa-guide-arrow {
  display: inline-block;
  margin: 0 5px;
  color: rgba(250,204,21,0.7);
}
.pwa-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--gold);
  vertical-align: -3px;
}
.pwa-inline-icon-taskbar {
  border-radius: 5px;
  background: rgba(250,204,21,0.12);
}
.pwa-nudge-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.pwa-nudge-actions .btn-ghost,
.pwa-nudge-actions .btn-primary {
  min-width: 88px;
  padding: 8px 14px;
  border-radius: 12px;
}

@media (max-width: 640px) {
  .code-row { grid-template-columns: 1fr; }
  .pwa-nudge {
    left: 12px;
    right: 12px;
    bottom: calc(76px + var(--safe-bottom));
    width: auto;
    border-radius: 14px;
  }
  .pwa-nudge-actions {
    justify-content: stretch;
  }
  .pwa-nudge-actions .btn-ghost,
  .pwa-nudge-actions .btn-primary {
    flex: 1;
  }
}

/* Watch history page */
.history-wrap { max-width: 760px; margin: 0 auto; padding: 24px 20px 48px; }
.history-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.history-head-text { flex: 1; }
.history-head .profile-back { margin-bottom: 0; }
.history-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.history-clear {
  font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 12px; transition: color 150ms, border-color 150ms;
}
.history-clear:hover { color: #f87171; border-color: rgba(248,113,113,0.3); }
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item {
  display: flex; gap: 14px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 150ms;
}
.history-item:hover { border-color: var(--line2); }
.history-cover {
  position: relative;
  width: 60px; height: 90px;
  border-radius: 10px;
  background: var(--bg) center/cover no-repeat;
  flex-shrink: 0;
}
.history-lock {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); color: #ddd; border-radius: 10px;
}
.history-info { flex: 1; min-width: 0; }
.history-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.history-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-time { font-size: 11px; color: var(--faint); flex-shrink: 0; }
.history-ep { font-size: 12px; color: var(--muted); margin-top: 6px; }
.history-ep b { color: var(--primary-s); }
.history-prog-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 10px; margin-bottom: 4px; }
.history-prog { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.history-prog-fill { height: 100%; background: var(--primary); border-radius: 2px; }
.history-state { text-align: center; padding: 60px 20px; }
.history-state-title { font-size: 16px; color: var(--muted); margin-bottom: 6px; }
.history-state-sub { font-size: 13px; color: var(--faint); margin-bottom: 20px; }

/* ═══════════════════════════════════════
   VIP — header icon, shimmer, avatar badge
═══════════════════════════════════════ */
/* Non-member: white diamond outline + a pale-gold V (static). */
.vip-btn { color: #fff; position: relative; }
.vip-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.vip-glyph { display: flex; align-items: center; justify-content: center; }
.vip-btn .vip-v { stroke: #fde68a; }

/* Member: outline AND V both become full gold, with a soft pulse/流光. */
.vip-btn.is-vip { color: var(--gold); }
.vip-btn.is-vip:hover { color: var(--gold); background: rgba(250,204,21,0.18); }
.vip-btn.is-vip .vip-v { stroke: var(--gold); }
.vip-btn.is-vip .vip-glyph {
  filter: drop-shadow(0 0 5px rgba(250,204,21,0.7));
  animation: vipPulse 2.6s ease-in-out infinite;
}
@keyframes vipPulse {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(250,204,21,0.45)); }
  50% { filter: drop-shadow(0 0 8px rgba(250,204,21,0.95)); }
}

/* Avatar member badge: a small gold "V" subscript + shimmering ring. */
.user-avatar.is-vip {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--gold);
}
.user-avatar.is-vip::after {
  content: "V";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #facc15, #f97316);
  background-size: 200% 100%;
  color: #1a1a1a;
  font-size: 9px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  border: 1.5px solid var(--bg);
  animation: shimmerSweep 2.4s linear infinite;
}
.user-avatar-btn .user-avatar { position: relative; }

@keyframes shimmerSweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════
   VIP PAGE
═══════════════════════════════════════ */
.vip-wrap { max-width: 640px; margin: 0 auto; padding: 40px 20px 60px; }
.vip-header { text-align: center; margin-bottom: 32px; }
.vip-header-icon {
  width: 72px; height: 72px; border-radius: 18px;
  background: linear-gradient(135deg, #facc15, #f97316);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; color: #fff;
  box-shadow: 0 8px 24px rgba(250,204,21,0.25);
}
.vip-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.vip-subtitle { font-size: 14px; color: var(--muted); }
.vip-status {
  display: inline-block; margin-top: 12px; padding: 4px 14px;
  border-radius: 999px; font-size: 13px; font-weight: 600; color: #1a1a1a;
  background: linear-gradient(90deg, #facc15, #f97316);
}

.vip-tiers {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; margin-bottom: 24px;
}
@media (min-width: 540px) { .vip-tiers { grid-template-columns: repeat(4, 1fr); } }
.vip-tier {
  position: relative; border-radius: 16px; border: 1px solid var(--line2);
  background: var(--bg2); padding: 18px 14px 16px; text-align: center; cursor: pointer;
  transition: border-color 150ms, background 150ms, transform 150ms;
}
.vip-tier:hover { border-color: rgba(250,204,21,0.5); transform: translateY(-2px); }
.vip-tier.is-value, .vip-tier.is-lowest { border-color: rgba(250,204,21,0.4); }
/* Selected state matches the diamond packs — primary pink-red frame. The
   combined-class selectors override the gold badge borders (higher specificity). */
.vip-tier.is-selected,
.vip-tier.is-value.is-selected,
.vip-tier.is-lowest.is-selected { border-color: var(--primary-s); background: rgba(236,72,153,0.08); }
.vip-tier-badge {
  position: absolute; top: 0; right: 0;
  border-radius: 0 16px 0 12px;
  font-size: 11px; font-weight: 800; color: #1a1a1a; padding: 2px 9px;
  background-image: linear-gradient(90deg, #facc15, #f97316);
  background-size: 200% 100%; animation: shimmerSweep 2.4s linear infinite;
}
/* 最低价: purple→indigo→purple flowing loop — distinct from 超值's gold sweep. */
.vip-tier-badge-lowest {
  color: #fff;
  background-image: linear-gradient(90deg, #a855f7, #6366f1, #a855f7);
  background-size: 200% 100%;
  animation: lowestFlow 3.5s linear infinite;
}
@keyframes lowestFlow {
  from { background-position: 0 0; }
  to { background-position: -200% 0; }
}
.vip-hl {
  font-weight: 800;
  background: var(--primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* VIP expiry line in the user dropdown header. */
.dropdown-vip {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}
.vip-tier-days { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.vip-tier-price { font-size: 20px; font-weight: 800; color: var(--gold); }
.vip-tier-perday { font-size: 11px; color: var(--faint); margin-bottom: 8px; }
.vip-tier-desc { font-size: 11px; color: var(--muted); margin-top: 8px; }

.vip-checkout {
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px; margin-bottom: 24px;
}
.vip-checkout-summary { font-size: 14px; color: var(--muted); margin-bottom: 14px; text-align: center; }
.vip-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 480px) { .vip-benefits { grid-template-columns: 1fr; } }
.vip-benefits .benefit-item svg { color: var(--gold); }

/* ═══════════════════════════════════════
   BULK UNLOCK (lock screen tiers)
═══════════════════════════════════════ */
.bulk-unlock { margin-top: 22px; width: 100%; max-width: 460px; }
.bulk-unlock-title { font-size: 13px; color: var(--muted); margin-bottom: 10px; text-align: center; }
.bulk-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bulk-tier {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  border-radius: 12px; border: 1px solid var(--line2); background: var(--bg2);
  padding: 22px 8px 10px; cursor: pointer; text-align: center;
  transition: border-color 150ms, background 150ms, transform 150ms;
}
.bulk-tier:hover:not(.is-disabled) { border-color: rgba(236,72,153,0.5); transform: translateY(-2px); }
.bulk-tier.is-value { border-color: rgba(250,204,21,0.4); }
.bulk-tier.is-disabled { opacity: 0.42; cursor: not-allowed; }

/* Discount tag — pink-red primary gradient, clipped corner like a sticker. */
.bulk-tier-tag {
  position: absolute; top: 0; left: 0;
  background: linear-gradient(135deg, #ec4899, #ef4444);
  color: #fff; font-size: 11px; font-weight: 800;
  padding: 2px 8px; border-radius: 12px 0 8px 0;
}
/* Great-value tag — gold-orange shimmer. */
.bulk-tier-value {
  position: absolute; top: 0; right: 0;
  background: linear-gradient(90deg, #facc15, #f97316);
  background-size: 200% 100%; animation: shimmerSweep 2.4s linear infinite;
  color: #1a1a1a; font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 0 12px 0 8px;
}
.bulk-tier-count { font-size: 13px; font-weight: 700; }
.bulk-tier-cost { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; font-weight: 800; color: var(--gold); }
.bulk-tier-original { font-size: 11px; color: var(--faint); text-decoration: line-through; }
.bulk-tier-hint { font-size: 10px; color: var(--faint); }

/* Episode grid: VIP/all-access episodes read like an accessible (gold) state. */
.ep-num-btn.is-vip { border-color: rgba(250,204,21,0.4); color: var(--gold); }
.ep-num-btn.is-vip .ep-status-dot { background: var(--gold); }

/* ═══════════════════════════════════════
   MOBILE VERTICAL PLAYER (竖屏全屏上滑播放器)
═══════════════════════════════════════ */
/* The mobile player is an immersive full-screen overlay above the header. The
   wrapper itself is dynamic-viewport tall (handles the mobile toolbar show/hide)
   and the feed + slides fill it at 100%, so all three heights stay in lock-step
   and scroll-snap aligns exactly one episode per screen. */
.page-player-m { padding: 0; }
.page-player-m.is-active {
  display: block;
  position: fixed;
  top: 0; left: 0; right: 0;
  /* Size to the real visible area. svh works in Safari, but Chrome on iOS keeps
     a persistent bottom toolbar that svh does not exclude — so we prefer --vvh
     (visualViewport.height). svh/vh remain as fallbacks for older browsers. */
  height: 100vh;        /* fallback for browsers without svh */
  height: 100svh;
  height: var(--vvh, 100svh);
  /* Override .page's min-height: calc(100vh - 56px). On Chrome iOS 100vh is the
     LARGE viewport (toolbar excluded), so that min-height (717) would beat our
     visible-area height (665) and push the bottom ~52px behind the toolbar —
     exactly hiding the last bottom-sheet item. Let height win. */
  min-height: 0;
  z-index: 200;
  background: #000;
}

.vfeed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: #000;
}
.vfeed::-webkit-scrollbar { display: none; }

.vslide {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #000;
}

/* Cover backdrop behind/around the video (and for not-yet-played slides). */
.vslide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(22px) brightness(0.4);
  transform: scale(1.12);
}
.vslide-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vslide-video {
  width: 100%;
  height: 100%;
  object-fit: cover;     /* 9:16 fills the slide, cropping as needed */
  background: #000;
}
.vslide-ad { position: absolute; inset: 0; z-index: 6; }

/* While a pre-roll plays, hide the episode chrome (z-index 7) and lift the ad
   above everything so the whole ad is clean and tappable — otherwise the chrome
   paints over the z-index 6 ad and swallows IMA clickthrough taps on mobile.
   IMA's own skip/CTA UI lives inside .vslide-ad and is unaffected. */
.vslide.ad-playing .vslide-top,
.vslide.ad-playing .vslide-rail,
.vslide.ad-playing .vslide-meta,
.vslide.ad-playing .vslide-cc,
.vslide.ad-playing .vslide-playicon { display: none !important; }
/* Ad play gate (mobile): the slide rests on its cover with a larger play indicator
   (shown by showMobileAdGate); the stage tap starts the pre-roll with sound. The
   empty content <video> is hidden so the slide's cover backdrop shows behind the
   play button instead of a black box. */
.vslide.is-ad-gate .vslide-playicon { width: 88px; height: 88px; background: rgba(0, 0, 0, 0.55); }
.vslide.is-ad-gate .vslide-video { opacity: 0; }
/* On the play gate, show the current episode cover clearly. */
.vslide.is-ad-gate .vslide-bg { filter: brightness(0.82); transform: none; }
/* No background here: on mobile IMA often plays the ad in the content <video>
   (below this container) while its UI renders inside .vslide-ad — a background on
   this top layer would paint over the playing ad and leave a black screen. */
/* Mobile pre-rolls match the episode player: full-bleed portrait video with the
   IMA UI layer on the exact same rect. */
.vslide.ad-playing {
  --vad-w: 100%;
  --vad-h: 100%;
}
.vslide.ad-playing .vslide-ad {
  z-index: 9;
  inset: 0;
  width: var(--vad-w);
  height: var(--vad-h);
  transform: none;
  overflow: hidden;
}
/* IMA may render through the content <video>; cover matches normal episode
   playback and removes side gutters on mobile browser viewports. */
.vslide.ad-playing .vslide-video {
  position: absolute;
  inset: 0;
  width: var(--vad-w);
  height: var(--vad-h);
  transform: none;
  object-fit: cover !important;
}
.vslide.ad-playing .vslide-ad iframe,
.vslide.ad-playing .vslide-ad video {
  width: 100% !important;
  height: 100% !important;
}

.vslide-playicon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: rgba(0,0,0,0.36);
  color: rgba(255,255,255,0.95);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}

.vslide-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 7;
  padding: 14px 12px;
  padding-top: max(14px, env(safe-area-inset-top));
  padding-left: max(12px, env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
}
.vslide-back { color: #fff; }

.vslide-rail {
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  bottom: 24%;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.vrail-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.32);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 120ms;
}
.vrail-btn:active { transform: scale(0.9); }

.vslide-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 7;
  padding: 16px;
  padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 16px));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: linear-gradient(to top, rgba(0,0,0,0.78), transparent);
  color: #fff;
}
.vslide-kicker { font-size: 12px; opacity: 0.85; margin-bottom: 4px; }
.vslide-title { font-size: 16px; font-weight: 600; }

/* Subtitles: painted by JS (renderMobileCue) into a fixed band above the meta,
   so the position is identical across Safari/Chrome and independent of each
   VTT's own cue line/position settings. Empty = no active cue → hidden. */
.vslide-cc {
  position: absolute;
  left: 50%;
  bottom: var(--vcc-bottom, 18%);
  transform: translateX(-50%);
  z-index: 7;
  width: min(72%, 600px);
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  white-space: pre-line;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.75);
  pointer-events: none;
}
.vslide-cc:empty { display: none; }

/* Subtitle-position adjust mode: a full-screen backdrop is the drag surface
   (drag anywhere to move the band — a large, forgiving touch target), the cue
   band is preview-only (outlined, non-interactive), and the controls live in a
   bottom bar clear of the browser's top address bar. */
.vfeed.is-sub-adjust .vslide.is-active .vslide-cc {
  z-index: 7;
  outline: 1px dashed rgba(255,255,255,0.65);
  outline-offset: 6px;
  border-radius: 6px;
}
.vfeed.is-sub-adjust .vslide.is-active .vslide-cc:empty { display: block; min-height: 1.35em; }
.vsub-adjust {
  position: absolute;
  inset: 0;
  z-index: 6;
  touch-action: none;   /* drags move the band, never scroll the page */
}
.vsub-adjust-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(to top, rgba(0,0,0,0.88), rgba(0,0,0,0.4) 70%, transparent);
}
.vsub-adjust-hint {
  flex: 1;
  font-size: 13px;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  pointer-events: none;
}
.vsub-adjust-done {
  flex: none;
  padding: 9px 22px;
  border: none;
  border-radius: 999px;
  background: var(--gold);
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* TikTok-style scrubber: an idle thin line that expands into a draggable bar
   only on a deliberate horizontal drag (vertical drags switch episodes). Sits
   above the meta text so its idle line clears the mobile browser's toolbar. */
.vslide-scrub {
  position: relative;
  margin-bottom: 12px;
  padding: 9px 0;            /* generous touch band around the thin line */
  touch-action: pan-y;       /* let vertical drags scroll the feed */
  cursor: pointer;
}
.vslide-scrub-time {
  position: absolute;
  left: 0; bottom: 100%;
  margin-bottom: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  opacity: 0;
  transition: opacity 140ms;
  pointer-events: none;
}
.vslide-scrub-time .dur { opacity: 0.7; }
.vslide-scrub-track {
  position: relative;
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,0.28);
  transition: height 120ms;
}
.vslide-scrub-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  border-radius: 3px;
  background: #fff;
}
.vslide-scrub-thumb {
  position: absolute;
  top: 50%; left: 0;
  width: 14px; height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transform: translateY(-50%) scale(0);
  transition: transform 120ms;
}
.vslide-scrub.is-scrubbing .vslide-scrub-track { height: 5px; }
.vslide-scrub.is-scrubbing .vslide-scrub-thumb { transform: translateY(-50%) scale(1); }
.vslide-scrub.is-scrubbing .vslide-scrub-time { opacity: 1; }

/* Per-slide lock overlay (Group 5 adds bulk-unlock + forward-swipe block). */
.vslide-lock {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: rgba(0,0,0,0.62);
  color: #fff;
}
.vslide-lock-icon { color: var(--gold); }
.vslide-lock-cost { color: var(--gold); font-size: 14px; }
.vslide-bulk { width: 100%; max-width: 360px; margin-top: 8px; }
.vslide-bulk-title { font-size: 12px; color: var(--muted, #9ca3af); margin-bottom: 8px; }
.vslide-bulk .bulk-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* Tap-for-sound hint (top-center, while muted). */
.vslide-sound {
  position: absolute;
  top: max(58px, calc(env(safe-area-inset-top) + 44px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 12px;
  pointer-events: none;
}

/* Episode picker bottom sheet. */
.vsheet { position: absolute; inset: 0; z-index: 20; }
.vsheet.is-hidden { display: none; }
.vsheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.vsheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 60dvh;
  overflow-y: auto;
  background: var(--bg2, #1a1a1a);
  border-radius: 16px 16px 0 0;
  padding: 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
.vsheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px;
}
.vsheet-ep {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.vsheet-ep.is-active { background: var(--gold); color: #1a1a1a; border-color: transparent; }

/* Subtitle-language list inside the bottom sheet. */
.vsub-list { display: flex; flex-direction: column; gap: 6px; }
.vsub-item {
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
.vsub-item.is-active { background: var(--gold); color: #1a1a1a; border-color: transparent; }
.vsub-item.vsub-adjust-entry { margin-top: 10px; }

/* ═══════════════════════════════════════
   MOBILE BOTTOM TAB BAR
═══════════════════════════════════════ */
.bottom-tabs { display: none; }
@media (max-width: 768px) {
  .bottom-tabs {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 150;
    background: var(--bg2, #141414);
    border-top: 1px solid rgba(255,255,255,0.08);
    /* Lift above Chrome-iOS's overlaying bottom toolbar (--vv-bottom); 0 elsewhere. */
    bottom: var(--vv-bottom, 0px);
    padding-bottom: var(--safe-bottom);
  }
  /* Leave room so page content isn't hidden behind the fixed bar (kept in sync
     with the bar's 56px row + its bottom padding + any toolbar lift). */
  body.has-tabs { padding-bottom: calc(56px + var(--safe-bottom) + var(--vv-bottom)); }
}
.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 56px;
  background: none;
  border: none;
  color: var(--muted, #9ca3af);
  font-size: 11px;
  cursor: pointer;
}
.bottom-tab.is-active { color: var(--gold); }
