/* ═══════════════════════════════════════
   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);
  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; }

/* ═══════════════════════════════════════
   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); }

/* 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;
}

/* 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; }

/* 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 { font-size: 12px; color: var(--muted); margin-top: 2px; }
.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) { .hamburger { 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%); } }

.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);
}

/* ═══════════════════════════════════════
   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); } }

/* Series card — poster on top, title below */
.series-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  background: transparent;
}
.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-bottom: 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 { font-size: 14px; color: var(--muted); }
.login-cta-btns { display: flex; gap: 10px; }

/* 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%; }

/* 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;
}
.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;
  color: #f87171;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 12px;
  border-radius: 12px;
  font-size: 15px;
}

/* ═══════════════════════════════════════
   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-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-radius: 12px; padding: 12px; text-align: center; }
.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; }
.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;
}

/* 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-bonus {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #4ade80;
  background: rgba(34,197,94,0.12); border-radius: 999px; padding: 2px 8px; margin-bottom: 8px;
}
.vip-tier-desc { font-size: 11px; color: var(--muted); }

.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 temporary-free 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); }
