:root {
  --bg-deep: #07080d;
  --bg-elevated: #0f1118;
  --bg-card: #141824;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaef;
  --text-muted: #8b92a8;
  --accent: #c9a227;
  --accent-soft: rgba(201, 162, 39, 0.15);
  --glow: rgba(201, 162, 39, 0.35);
  --radius: 14px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(201, 162, 39, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(88, 101, 242, 0.06), transparent),
    var(--bg-deep);
}

.site-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(7, 8, 13, 0.75);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
a.site-brand {
  text-decoration: none;
  color: inherit;
}
a.site-brand:hover strong {
  color: var(--accent);
}
.site-brand strong {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.site-brand span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.site-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.nav-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 200px;
}
.nav-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}
.nav-user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 500;
}

.nav-cta {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(135deg, #d4af37, #a67c00);
  color: #0a0a0a;
  box-shadow: 0 0 24px var(--glow);
}
.nav-cta:hover { filter: brightness(1.08); }

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: clamp(32px, 6vw, 72px) clamp(20px, 4vw, 48px) 40px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }
}

.hero-visual {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55), 0 0 0 1px var(--border);
}
.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7,8,13,0.95) 0%, transparent 55%);
  pointer-events: none;
}

.hero-body { position: relative; z-index: 1; }
.hero-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.2;
}
.hero-desc {
  color: var(--text-muted);
  max-width: 36rem;
  margin-bottom: 24px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.hero-meta span {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.hero-play {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  background: linear-gradient(135deg, #fff, #e0e0e0);
  color: #111;
  font-size: 1rem;
  box-shadow: 0 12px 40px rgba(255,255,255,0.12);
}
.hero-play:hover { transform: translateY(-1px); }

.section-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(20px, 4vw, 48px);
  max-width: 1400px;
  margin: 0 auto 20px;
}
.section-bar h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.search-form {
  display: flex;
  gap: 8px;
}
.search-form input {
  min-width: 200px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
}
.search-form button {
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.cat-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 clamp(20px, 4vw, 48px) 28px;
  max-width: 1400px;
  margin: 0 auto;
}
.cat-pill {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: transparent;
  transition: all 0.2s;
}
.cat-pill:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.cat-pill.active {
  color: #111;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 0 clamp(20px, 4vw, 48px) 64px;
  max-width: 1400px;
  margin: 0 auto;
}

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  border-color: rgba(201, 162, 39, 0.35);
}
.card a { display: block; }
.card .thumb-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #1a1d28;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.card:hover img { transform: scale(1.05); }
.card .play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.25s;
  font-size: 2.5rem;
  color: #fff;
}
.card:hover .play-icon { opacity: 1; }
.card-body { padding: 14px 16px 18px; }
.card-body h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}
.card-body p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.empty-state a { color: var(--accent); text-decoration: underline; }

.watch-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 3vw, 32px) 64px;
}

.watch-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.watch-back:hover { color: var(--accent); }
.watch-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.875rem;
}
.watch-bc-sep { color: var(--text-muted); opacity: 0.5; }
.watch-bc-current { color: var(--text-muted); }

.series-ep-list { list-style: none; margin: 0; padding: 0; }
.series-ep-list li { border-bottom: 1px solid var(--border); }
.series-ep-list a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 8px;
  color: var(--text);
}
.series-ep-list a:hover { background: rgba(255,255,255,0.04); }
.series-ep-idx { color: var(--accent); font-weight: 600; min-width: 5rem; }
.series-ep-title { flex: 1; }
.series-ep-meta { color: var(--text-muted); font-size: 0.8rem; }

.watch-hero {
  position: relative;
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.watch-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(48px) brightness(0.35);
  transform: scale(1.1);
}
.watch-inner {
  position: relative;
  padding: clamp(16px, 3vw, 28px);
}
.watch-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0 0 10px;
}
.watch-desc {
  color: var(--text-muted);
  max-width: 52rem;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

#player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.watch-lock-card {
  padding: 24px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  max-width: 36rem;
}
.watch-lock-card.flex-watch-lock {
  max-width: none;
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}
.watch-lock-msg { margin: 0 0 16px; color: var(--text-muted); line-height: 1.5; }
.watch-lock-balance { margin: 0 0 12px; font-size: 0.9rem; color: var(--text-muted); }
.watch-unlock-err { color: #f87171; margin-bottom: 16px; }
.watch-preview-hint { color: var(--accent); font-size: 0.875rem; margin-bottom: 12px; }
.watch-mock-hint { color: #86efac; font-size: 0.875rem; margin-bottom: 14px; max-width: 40rem; line-height: 1.45; }
.watch-mock-order-desc { margin: 14px 0 0; font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; max-width: 32rem; }

.ad-slots-wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); }
.ad-slot {
  margin: 10px auto 16px;
  max-width: 728px;
  min-height: 50px;
  border-radius: var(--radius);
  border: 1px dashed rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.15);
}

.membership-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.membership-card {
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.membership-card-title { margin: 0 0 8px; font-size: 1.15rem; }
.membership-card-tier {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.membership-card-price { margin: 0 0 6px; font-size: 1.25rem; font-weight: 700; }
.membership-card-dur { margin: 0 0 8px; font-size: 0.85rem; color: var(--text-muted); }

.pay-page { max-width: 1280px; }
.pay-hero-slider {
  border-radius: calc(var(--radius) + 8px);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 22px;
  background: #0a0a0a;
}
.pay-hero-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.pay-hero-track img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  filter: saturate(1.08);
}
.pay-panel {
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 20px;
}
.pay-plans-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.pay-plans-grid .pay-week-card {
  margin-top: 0;
  flex-direction: column;
  align-items: stretch;
}
.pay-plans-grid .pay-week-card > div:last-child .pay-cta {
  width: 100%;
  margin-top: 10px;
}
.pay-week-card {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius);
  background: rgba(212, 175, 55, 0.08);
  padding: 16px;
}
.pay-week-card h3 { margin: 0 0 2px; font-size: 1.05rem; }
.pay-week-card p { margin: 0; }
.pay-week-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px !important; }
.pay-cta { min-width: 120px; border: none; cursor: pointer; }

.pay-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.pay-pack {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  padding: 14px;
}
.pay-pack h4 { margin: 0 0 6px; font-size: 1.15rem; }
.pay-pack p { margin: 0 0 10px; color: var(--text-muted); font-size: 0.9rem; }
.pay-pack p span { color: var(--accent); }
.pay-pack-btn {
  width: 100%;
  height: 36px;
  border: none;
  border-radius: 9px;
  color: #111;
  background: linear-gradient(135deg, #d4af37, #b8860b);
  font-weight: 700;
  cursor: pointer;
}
.pay-methods { margin-top: 16px; color: var(--text-muted); font-size: 0.9rem; }
.pay-methods h4 { margin: 0 0 8px; color: var(--text); font-size: 0.95rem; }

.ledger-table-wrap { overflow-x: auto; margin-top: 12px; }
.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.ledger-table th,
.ledger-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.ledger-table th { color: var(--text-muted); font-weight: 600; }

.nav-inline-form { display: inline; margin: 0; padding: 0; vertical-align: middle; }
.nav-text-btn {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
}
.nav-text-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}
.login-card h1 { margin: 0 0 8px; font-size: 1.5rem; }
.login-card .sub { margin: 0 0 24px; color: var(--text-muted); font-size: 0.875rem; }
.admin-form input,
.admin-form textarea,
.admin-form button {
  width: 100%;
}
.error { color: #f87171; margin-bottom: 12px; }

.site-page-wrap { padding-bottom: 48px; }
.site-page-article.genres-page .site-page-title {
  margin-top: 0;
  margin-bottom: 1rem;
}
.site-page-header {
  padding: 18px 0 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 28px;
}
.site-page-article { max-width: 48rem; }
.site-page-title {
  margin: 0 0 20px;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
}
.site-page-body {
  color: rgba(255,255,255,0.88);
  line-height: 1.65;
  font-size: 0.98rem;
}
.site-page-body h1 { font-size: 1.45rem; margin: 1.4em 0 0.6em; }
.site-page-body h2 { font-size: 1.2rem; margin: 1.3em 0 0.5em; }
.site-page-body h3 { font-size: 1.05rem; margin: 1.2em 0 0.45em; }
.site-page-body p { margin: 0 0 1em; }
.site-page-body ul, .site-page-body ol { margin: 0 0 1em 1.2em; padding: 0; }
.site-page-body a { color: var(--accent, #fb3867); }
.site-page-body code {
  font-size: 0.88em;
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
}
.site-page-body pre {
  overflow: auto;
  clear: both;
  padding: 12px 14px;
  border-radius: var(--radius, 10px);
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  margin: 0 0 1em;
}
.site-page-body pre code { background: none; padding: 0; }
.site-page-body table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: 0.92rem; }
.site-page-body th, .site-page-body td { border: 1px solid rgba(255,255,255,0.12); padding: 8px 10px; text-align: left; }
.site-page-empty { color: var(--text-muted, rgba(255,255,255,0.45)); }
