:root {
  color-scheme: light;
  --bg: #f6f1e7;
  --bg-soft: #efe8d9;
  --surface: #fffdf7;
  --surface-2: #f3ecdc;
  --line: rgba(30,28,24,.14);
  --line-strong: rgba(30,28,24,.35);
  --text: #1e1c18;
  --muted: #6b655a;
  --accent: #b3202a;
  --accent-2: #8c1620;
  --on-accent: #fff;
  --grad: linear-gradient(135deg,#b3202a,#c24b2a);
  --shadow: 0 10px 30px rgba(40,30,10,.12);
  --radius: 3px;
  --maxw: 1180px;
  --font: "Noto Serif SC","Songti SC","SimSun","STSong",serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
main { width: min(var(--maxw, 1320px), calc(100% - 32px)); margin: 0 auto; }
.section { margin: 30px 0; }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 16px; }
.section-head h1, .section-head h2 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; }
.text-link { padding: 8px 12px; color: var(--accent); font-weight: 800; white-space: nowrap; border-radius: 8px; transition: background .18s ease; }
.text-link:hover { background: var(--surface-2); }
.poster-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.empty-state { grid-column: 1 / -1; padding: 48px; text-align: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.primary-btn, .ghost-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 11px 20px; border-radius: var(--radius); font-weight: 900; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.primary-btn { color: var(--on-accent); background: var(--accent); }
.primary-btn:hover { background: var(--accent-2); transform: translateY(-2px); }
.ghost-btn { border: 1px solid var(--line-strong); color: var(--text); background: var(--surface-2); }
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.badge { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); }
.badge.score { color: var(--on-accent); background: var(--accent); border-color: transparent; }

.detail-hero { position: relative; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(24px, 5vw, 54px); align-items: center; padding: clamp(22px, 5vw, 52px); margin: 24px 0; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-soft); }
.detail-hero .hero-bg { position: absolute; inset: 0; background: radial-gradient(120% 120% at 12% 0%, var(--tone-a, #1e2433), transparent 55%), radial-gradient(120% 120% at 100% 100%, var(--tone-b, #33202a), transparent 55%), var(--bg-soft); opacity: .55; }
.detail-poster, .detail-copy { position: relative; z-index: 1; }
.detail-poster img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; box-shadow: var(--shadow); }
.detail-copy h1 { margin: 0; font-size: clamp(32px, 5.5vw, 56px); line-height: 1.1; }
.detail-copy > p { max-width: 760px; color: var(--muted); font-size: 16px; }
.info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0 14px; }
.info-grid div { padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.info-grid dt { color: var(--muted); font-size: 13px; }
.info-grid dd { margin: 3px 0 0; font-size: 22px; font-weight: 900; }
.cast-line { color: var(--muted); }
.episode-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; }
.episode-chip { display: grid; place-items: center; min-height: 42px; padding: 0 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); font-weight: 800; transition: border-color .18s ease, color .18s ease, background .18s ease; }
.episode-chip:hover, .episode-chip.active { border-color: var(--accent); color: var(--on-accent); background: var(--accent); }

.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; margin-top: 24px; }
.player-wrap { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.player-screen { display: grid; place-items: center; min-height: 520px; padding: 30px; text-align: center; background: radial-gradient(120% 120% at 50% 0%, var(--tone-a, #1e2433), transparent 70%), radial-gradient(120% 120% at 50% 100%, var(--tone-b, #33202a), transparent 70%), var(--bg); }
.play-symbol { display: grid; place-items: center; width: 88px; height: 88px; padding-left: 6px; color: var(--on-accent); background: var(--accent); border-radius: 50%; font-size: 38px; box-shadow: 0 12px 30px rgba(0,0,0,.3); }
.player-screen strong { margin-top: 18px; font-size: clamp(22px, 4vw, 38px); }
.player-screen span { color: var(--muted); }
.player-meta { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 18px; }
.player-meta h1 { margin: 0; font-size: clamp(20px, 3vw, 30px); line-height: 1.2; }
.episode-panel { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.episode-grid.small { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1080px) {
  .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-hero, .play-layout { grid-template-columns: 1fr; }
  .detail-poster { max-width: 260px; }
}
@media (max-width: 720px) {
  main { width: min(100% - 24px, var(--maxw, 1320px)); }
  .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .episode-grid, .episode-grid.small { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .player-screen { min-height: 340px; }
}
@media (max-width: 430px) {
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .episode-grid, .episode-grid.small { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

body { background: var(--bg); }
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 3px double var(--line-strong); }
.masthead { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 14px 0 10px; text-align: center; }
.masthead .brand { display: inline-flex; align-items: baseline; gap: 10px; font-weight: 900; }
.masthead .brand-text { font-size: 34px; letter-spacing: 6px; }
.masthead .brand-tag { color: var(--muted); font-size: 13px; letter-spacing: 2px; }
.masthead .dateline { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.navbar { border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); background: var(--bg-soft); }
.main-nav { width: min(1180px, calc(100% - 32px)); margin: 0 auto; display: flex; justify-content: center; gap: 0; }
.main-nav a { padding: 10px 20px; color: var(--text); font-weight: 800; font-size: 15px; border-right: 1px solid var(--line); }
.main-nav a:last-child { border-right: 0; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--accent); }
.top-search { width: min(1180px, calc(100% - 32px)); margin: 10px auto; display: flex; border: 1px solid var(--line-strong); background: var(--surface); }
.top-search input { width: 100%; padding: 9px 12px; border: 0; outline: 0; background: transparent; }
.top-search button { padding: 0 20px; border: 0; color: var(--on-accent); background: var(--accent); font-weight: 800; cursor: pointer; }
.nav-toggle { display: none; }
.lead { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 240px; gap: 24px; padding: 26px; margin: 22px 0; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); }
.lead .eyebrow { color: var(--accent); font-family: var(--font); letter-spacing: 3px; }
.lead h1 { margin: 0 0 8px; font-size: clamp(30px,5vw,50px); line-height: 1.15; }
.lead .lead-meta { color: var(--muted); font-size: 13px; }
.lead .lead-desc { color: var(--text); font-size: 16px; margin: 12px 0 0; }
.lead-poster { grid-row: 1; grid-column: 2; align-self: start; }
.lead-poster img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.rule { border: 0; border-top: 3px double var(--line-strong); margin: 26px 0; }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 28px; }
.col-title { font-size: 20px; font-weight: 900; padding-bottom: 8px; border-bottom: 3px solid var(--text); margin: 0 0 12px; }
.headline { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); transition: background .15s ease; }
.headline:hover { background: var(--bg-soft); }
.headline img { width: 66px; height: 88px; object-fit: cover; flex: 0 0 auto; }
.headline .hl-title { font-weight: 800; font-size: 16px; line-height: 1.35; }
.headline .hl-title:hover { color: var(--accent); }
.headline .hl-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.headline .hl-score { color: var(--accent); font-weight: 800; }
.classified { display: flex; flex-wrap: wrap; gap: 10px; }
.classified a { padding: 7px 14px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; font-weight: 700; }
.classified a:hover { border-color: var(--accent); color: var(--accent); }
.page-title { padding: 36px 0 6px; }
.page-title h1 { margin: 0; font-size: clamp(32px,5.5vw,52px); }
.page-title p { max-width: 760px; color: var(--muted); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; padding: 14px; margin: 18px 0; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--text); }
.filter-bar label { display: grid; gap: 6px; flex: 1 1 160px; min-width: 150px; color: var(--muted); font-size: 13px; font-weight: 800; }
.filter-bar input, .filter-bar select { min-height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); outline: 0; }
.library-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; color: var(--muted); }
.library-meta strong { color: var(--text); font-size: 20px; }
.poster-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.site-footer { padding: 36px clamp(18px,4vw,56px) 28px; margin-top: 44px; background: var(--bg-soft); border-top: 3px double var(--line-strong); }
.footer-grid { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 16px 40px; align-items: start; width: min(1180px,100%); margin: 0 auto; }
.site-footer .about { max-width: 680px; margin: 10px 0 0; color: var(--muted); }
.footer-cols { display: flex; flex-direction: column; gap: 8px; font-weight: 800; }
.footer-cols a { color: var(--muted); }
.footer-cols a:hover { color: var(--accent); }
.footer-cols .col-title { border-bottom: 0; font-size: 15px; }
.copyright { grid-column: 1/-1; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
@media (max-width: 860px) {
  .masthead .brand-text { font-size: 26px; letter-spacing: 3px; }
  .main-nav { flex-wrap: wrap; }
  .main-nav a { padding: 8px 12px; font-size: 14px; }
  .lead { grid-template-columns: 1fr; }
  .lead-poster { grid-row: auto; grid-column: auto; max-width: 200px; }
  .cols { grid-template-columns: 1fr; }
  .nav-toggle { display: none; }
}
