:root {
  --bg: #0b0b0f;
  --bg-soft: #141419;
  --panel: #1a1a22;
  --line: #2a2a33;
  --text: #f4f4f6;
  --muted: #9a9aa6;
  --accent: #effe3e;
  --accent-2: #d4e62e;
  --radius: 10px;
  --header-h: 62px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ---------- header ---------- */
#site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  transition: background 0.25s ease, border-color 0.25s ease;
  border-bottom: 1px solid transparent;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
}
#site-header.solid { background: rgba(11, 11, 15, 0.96); border-bottom-color: var(--line); }
.header-inner {
  max-width: 1500px;
  height: 100%;
  margin: 0 auto;
  padding: 0 4vw;
  display: flex;
  align-items: center;
  gap: 26px;
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; letter-spacing: 0.5px; }
.logo-icon { width: 34px; height: 34px; display: block; flex: 0 0 auto; }
.logo-text {
  font-family: Georgia, "Times New Roman", "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 1.5px;
}
.footer-brand .logo-icon { width: 26px; height: 26px; }
.nav { display: flex; gap: 22px; margin-left: 8px; }
.nav a { color: #d9d9e0; font-size: 15px; transition: color 0.2s; }
.nav a:hover { color: #fff; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 16px; color: #d9d9e0; }
.search-link:hover { color: #fff; }
.badge-18 {
  border: 1px solid #6a6a76;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12px;
  font-weight: 700;
  color: #cfcfd8;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 7px;
  border: 1px solid #3a3a45;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.18s, border-color 0.18s;
}
.btn:hover { background: rgba(255, 255, 255, 0.16); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0b0b0f; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 40vh; display: flex; align-items: flex-end; overflow: hidden; padding-top: var(--header-h); }
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 22%;
  filter: blur(10px) brightness(0.55) saturate(1.05);
  transform: scale(1.12);
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 11, 15, 1) 0%, rgba(11, 11, 15, 0.72) 42%, rgba(11, 11, 15, 0.15) 70%),
    linear-gradient(0deg, var(--bg) 2%, rgba(11, 11, 15, 0) 55%);
}
.hero-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  align-items: end;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 0 4vw 3.5vh;
}
.hero-main { display: flex; gap: 30px; align-items: flex-end; min-width: 0; }
.hero-quote {
  position: relative;
  align-self: center;
  max-width: 400px;
  min-width: 0;
  padding: 0 36px;
}
.hero-quote::before,
.hero-quote::after {
  position: absolute;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 60px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}
.hero-quote::before { content: "“"; top: -18px; left: 0; }
.hero-quote::after { content: "”"; bottom: -34px; right: 0; }
.hero-desc {
  margin: 0;
  color: #cfcfd8;
  font-size: 14px;
  line-height: 1.85;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-poster {
  width: 150px;
  aspect-ratio: 2 / 3;
  flex: 0 0 auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.6);
}
.hero-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-info { max-width: 680px; padding-bottom: 6px; }
.hero-kicker { color: var(--accent-2); font-weight: 700; letter-spacing: 2px; font-size: 13px; margin: 0 0 8px; }
.hero-info h1,
.hero-info .hero-title { font-size: clamp(24px, 3.4vw, 42px); line-height: 1.05; margin: 0 0 12px; font-weight: 900; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.hero-btns { display: flex; gap: 12px; margin-bottom: 16px; }
.hero-info .chips { flex-wrap: nowrap; overflow: hidden; }
.footer-stats { margin: 0 0 14px; }

.hero-carousel { display: grid; align-items: stretch; touch-action: pan-y; }
.hero-slide {
  grid-area: 1 / 1;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 4;
}
.hero-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.2s, background 0.2s;
}
.hero-dot:hover { background: rgba(255, 255, 255, 0.6); }
.hero-dot.active { background: var(--accent); width: 22px; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid #3a3a45;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 13px;
  color: #cfcfd8;
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.18s;
  white-space: nowrap;
  flex: 0 0 auto;
}
.chip:hover { border-color: #6a6a76; color: #fff; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #0b0b0f; }

/* ---------- rows ---------- */
.rows { padding: 10px 0 60px; }
.row { margin: 30px 0; }
.row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 4vw;
  margin-bottom: 12px;
}
.row-head h2 { font-size: 21px; margin: 0; font-weight: 800; }
.row-more { color: var(--muted); font-size: 13px; }
.row-more:hover { color: #fff; }
.row-wrap { position: relative; }
.row-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 4vw 10px;
}
.row-track::-webkit-scrollbar { display: none; }
.row-nav {
  position: absolute;
  top: 28%;
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 20, 25, 0.85);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.row-wrap:hover .row-nav { opacity: 1; }
.row-nav:hover { background: var(--accent); color: #0b0b0f; }
.row-nav.prev { left: 1vw; }
.row-nav.next { right: 1vw; }

/* ---------- poster card ---------- */
.card { flex: 0 0 auto; width: 176px; }
.grid .card { width: auto; }
.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover .card-poster { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(0, 0, 0, 0.55); }
.card-poster img { width: 100%; height: 100%; object-fit: cover; }
.card-noimg { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; }
.card-soon {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 7px;
  backdrop-filter: blur(4px);
  background: rgba(229, 9, 20, 0.9);
  color: #fff;
}
.card-brief {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.45;
  max-height: calc(1.45em * 3);
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title { margin-top: 9px; font-size: 14px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-eps {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #e8e8ef;
  backdrop-filter: blur(4px);
}

/* ---------- grids / pages ---------- */
.page { max-width: 1500px; margin: 0 auto; padding: calc(var(--header-h) + 28px) 4vw 70px; }
.page-title { font-size: 28px; font-weight: 900; margin: 0 0 20px; }
.section-title { font-size: 19px; font-weight: 800; margin: 28px 0 14px; }
/* Fixed column counts (2/3/5/6 — deliberately never 4 or >6) so a 30-item page
   always fills whole rows at every width. Each breakpoint keeps cards ~150px+. */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
@media (min-width: 520px)  { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 885px)  { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filter-search,
.filter-select {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 14px;
}
.filter-search { flex: 1; min-width: 180px; }
.tagbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.result-line { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 40px 0 0; color: var(--muted); }

/* ---------- rank ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rank-item { display: flex; align-items: center; gap: 16px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; }
.rank-no { width: 34px; text-align: center; font-size: 20px; font-weight: 900; color: var(--muted); }
.rank-no.top { color: var(--accent); }
.rank-cover { width: 46px; height: 66px; border-radius: 6px; overflow: hidden; background: var(--panel); flex: 0 0 auto; }
.rank-cover img { width: 100%; height: 100%; object-fit: cover; }
.rank-info { min-width: 0; flex: 1; }
.rank-title { font-weight: 700; font-size: 16px; }
.rank-title:hover { color: var(--accent-2); }
.rank-meta { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.rank-plays { color: #ffd166; font-weight: 700; font-size: 14px; }

/* ---------- search ---------- */
.search-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.search-top .page-title { margin: 0; }
.search-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.16s;
}
.search-close:hover { border-color: var(--accent); background: var(--accent); color: #0b0b0f; }
.search-hero { display: flex; gap: 10px; margin-bottom: 26px; }
.search-hero input {
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9px;
  padding: 14px 16px;
  font-size: 16px;
}

/* ---------- watch (detail) ---------- */
.watch {
  max-width: 1500px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 20px) 4vw 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 12px 34px;
  align-items: start;
}
.watch-stage { position: sticky; top: calc(var(--header-h) + 14px); }
.watch-side { min-width: 0; }
.crumbs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 9px 16px;
  font-size: 15px;
  letter-spacing: 0.2px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.crumbs a { color: #c5c5d0; transition: color 0.18s; }
.crumbs a:hover { color: #fff; }
.crumbs .sep { color: #5a5a66; font-size: 14px; }
.crumbs .cur { color: #fff; font-weight: 700; }
.crumbs + .page-title { margin-top: 22px; }
.watch-title { font-size: 26px; font-weight: 900; margin: 0 0 12px; line-height: 1.25; }
.side-h2 { font-size: 16px; font-weight: 800; margin: 22px 0 10px; }
.watch-desc { color: #cfcfd8; font-size: 14px; line-height: 1.8; margin: 0; white-space: pre-line; }
.ep-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.watch-related { margin-top: 24px; }
.tag-orig { color: #ffd166; }

.now-playing {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.now-center { grid-column: 2; display: flex; align-items: baseline; justify-content: center; gap: 10px; }
#ep-prev { justify-self: start; }
#ep-next { justify-self: end; }
.ep-nav[hidden] { display: none; }
.ep-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.16s;
}
.ep-nav:hover:not(:disabled) { border-color: var(--accent); color: #fff; }
.ep-nav:disabled { opacity: 0.4; cursor: not-allowed; }
.player-frame {
  position: relative;
  margin: 0 auto;
  width: min(100%, 440px);
  aspect-ratio: var(--ar, 9 / 16);
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  transition: width 0.25s ease, height 0.25s ease;
}
.player-frame.landscape { width: 100%; }
.player-frame video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-mask { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 18px; background: rgba(0, 0, 0, 0.55); }
.player-ep { margin: 0; font-size: 15px; color: #d9d9e0; }

.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.ep-grid.scroll { max-height: 46vh; overflow-y: auto; padding-right: 6px; }
.ep-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.16s;
}
.ep-btn small { color: var(--muted); font-size: 11px; font-weight: 400; }
.ep-btn:hover:not(:disabled):not(.active) { border-color: var(--accent); color: #fff; }
.ep-btn.active { background: var(--accent); border-color: var(--accent); color: #0b0b0f; }
.ep-btn.active:hover:not(:disabled) { background: var(--accent-2); color: #0b0b0f; }
.ep-btn.active small { color: rgba(11, 11, 15, 0.72); }
.ep-btn.soon { opacity: 0.55; cursor: not-allowed; }
.ep-btn.soon small { color: var(--accent-2); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #08080b; margin-top: 40px; }
.footer-inner { max-width: 1500px; margin: 0 auto; padding: 40px 4vw; color: var(--muted); font-size: 13px; }
.footer-brand { color: var(--text); font-family: Georgia, "Times New Roman", "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif; font-weight: 700; font-size: 19px; letter-spacing: 1px; display: flex; align-items: center; gap: 9px; margin: 0 0 10px; }
.footer-note { max-width: 680px; margin: 0 0 14px; line-height: 1.7; }
.footer-links { display: flex; gap: 18px; margin: 0 0 16px; }
.footer-links a:hover { color: #fff; }
.footer-copy { margin: 0; }

/* ---------- misc ---------- */
.notfound { min-height: 60vh; display: grid; place-content: center; text-align: center; gap: 10px; padding-top: var(--header-h); }
.notfound h1 { font-size: 64px; margin: 0; color: var(--accent); }
.prose { max-width: 820px; }
.prose h1 { font-size: 30px; }
.prose h2 { font-size: 20px; margin-top: 30px; }
.prose li { margin: 6px 0; }
.muted { color: var(--muted); }

@media (max-width: 1080px) {
  .watch { grid-template-columns: 1fr; gap: 22px; }
  .watch-stage { position: static; }
  .ep-grid.scroll { max-height: none; overflow: visible; }
  .hero-body { grid-template-columns: 1fr; }
  .hero-quote { display: none; }
}

@media (max-width: 780px) {
  :root { --header-h: 98px; }
  .header-inner { flex-wrap: wrap; align-content: center; row-gap: 5px; column-gap: 12px; }
  .header-right { order: 1; }
  .nav { flex-basis: 100%; order: 2; margin: 8px 0 0; gap: 18px; justify-content: space-between; }
  .nav a { font-size: 14px; }
  .logo-text { font-size: 19px; letter-spacing: 0.5px; }
  .logo-icon { width: 30px; height: 30px; }
  .hero-main { gap: 16px; }
  .hero-poster { width: 110px; }
  .hero-meta { display: none; }
  .card { width: 132px; }
  .row-nav { display: none; }
  .hero { min-height: 32vh; }
  .watch-title { font-size: 21px; }
}

/* ---------- 18+ age gate ---------- */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 5, 8, 0.94);
  backdrop-filter: blur(8px);
}
html.age-ok .age-gate { display: none; }
/* Lock scrolling only on the front site while the gate is up (admin bodies are
   .admin and never render the gate). */
html:not(.age-ok) body:not(.admin) { overflow: hidden; }
.age-gate-box {
  width: 100%;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 28px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.age-gate-badge {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 900;
  font-size: 15px;
  margin-bottom: 14px;
}
.age-gate-box h2 { margin: 0 0 12px; font-size: 20px; }
.age-gate-box p { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0 0 22px; }
.age-gate-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
