/* ==========================================================================
   华影 HUAYING —— 东方简约影视模板
   主色：朱砂红  辅色：鎏金  底色：宣纸白 / 墨夜黑（可切换）
   ========================================================================== */

:root {
  --primary: #e0352b;
  --primary-hover: #c72a21;
  --primary-soft: rgba(224, 53, 43, 0.08);
  --primary-line: rgba(224, 53, 43, 0.32);
  --gold: #c9a063;
  --score: #ff8a00;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f3;
  --line: #ebedf0;
  --line-2: #dfe2e7;

  --text: #18191c;
  --text-2: #4e5560;
  --text-3: #8c929b;

  --header-bg: rgba(255, 255, 255, 0.94);
  --shadow-sm: 0 1px 3px rgba(20, 24, 31, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 24, 31, 0.08);
  --shadow-lg: 0 16px 40px rgba(20, 24, 31, 0.14);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --header-h: 64px;
  --container: 1400px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;

  /* 兼容旧模板中的内联变量 */
  --accent-gold: var(--primary);
  --accent-crimson: var(--primary);
  --accent-emerald: #17a673;
  --text-primary: var(--text);
  --text-secondary: var(--text-2);
  --text-muted: var(--text-3);
  --bg-surface: var(--surface-2);
  --bg-elevated: var(--surface);
  --border-subtle: var(--line);
  --border-light: var(--line-2);
  --border-accent: var(--primary-line);
}

html[data-theme="dark"] {
  --primary: #f0473c;
  --primary-hover: #ff5a4f;
  --primary-soft: rgba(240, 71, 60, 0.12);
  --primary-line: rgba(240, 71, 60, 0.4);

  --bg: #0f1013;
  --surface: #17181c;
  --surface-2: #1d1f24;
  --surface-3: #25272d;
  --line: #24262b;
  --line-2: #30333a;

  --text: #ececef;
  --text-2: #a9adb6;
  --text-3: #6f747e;

  --header-bg: rgba(18, 19, 23, 0.92);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s, color .3s;
}
a { color: inherit; text-decoration: none; transition: color .2s, background-color .2s, border-color .2s; }
img { display: block; max-width: 100%; border: 0; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; background: none; border: 0; outline: 0; }
button { cursor: pointer; }
::selection { background: var(--primary); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.main-wrap, .main-wrap--hero { flex: 1 0 auto; padding-top: var(--header-h); }

/* ==========================================================================
   页头
   ========================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s, background-color .3s;
}
.site-header.is-scrolled { box-shadow: var(--shadow-md); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.header-left { display: flex; align-items: center; gap: 32px; min-width: 0; flex: 1; }

.brand-logo { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 21px; font-weight: 900; line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.22), 0 4px 12px rgba(224,53,43,.28);
}
.brand-mark svg { display: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-serif); font-size: 20px; font-weight: 900; letter-spacing: 2px; color: var(--text); }
.brand-sub { font-size: 10px; letter-spacing: 2.5px; color: var(--text-3); margin-top: 2px; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.nav-item {
  position: relative; padding: 8px 12px; font-size: 15px; font-weight: 500;
  color: var(--text-2); white-space: nowrap;
}
.nav-item:hover { color: var(--primary); }
.nav-item.is-active { color: var(--text); font-weight: 700; }
.nav-item.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%);
  width: 18px; height: 3px; border-radius: 3px; background: var(--primary);
}

.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* 搜索 */
.search-box { position: relative; width: 300px; }
.search-form {
  display: flex; align-items: center; height: 38px;
  background: var(--surface-3);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 4px 0 16px;
  transition: all .2s;
}
.search-form:focus-within { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-input { flex: 1; min-width: 0; font-size: 13px; }
.search-input::placeholder { color: var(--text-3); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-btn {
  width: 52px; height: 30px; border-radius: 999px;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.search-btn:hover { background: var(--primary-hover); }
.search-btn svg { width: 15px; height: 15px; }

.search-dropdown, .history-popover {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: all .2s var(--ease); z-index: 950;
}
.search-dropdown { width: 100%; min-width: 300px; padding: 14px; }
.search-dropdown.is-open, .history-popover.is-open { opacity: 1; visibility: visible; transform: none; }
.search-drop-title { font-size: 12px; color: var(--text-3); margin-bottom: 10px; display: flex; justify-content: space-between; }
.hot-tags { display: flex; flex-direction: column; }
.hot-tag {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 6px; border-radius: 6px; font-size: 13px; color: var(--text-2);
  counter-increment: hot;
}
.hot-tags { counter-reset: hot; }
.hot-tag::before {
  content: counter(hot); width: 18px; text-align: center;
  font-weight: 700; font-style: italic; color: var(--text-3);
}
.hot-tag:nth-child(1)::before { color: var(--primary); }
.hot-tag:nth-child(2)::before { color: #ff6a2b; }
.hot-tag:nth-child(3)::before { color: #ffa12b; }
.hot-tag:hover { background: var(--surface-2); color: var(--primary); }
.suggest-list { display: flex; flex-direction: column; }
.suggest-item { display: flex; justify-content: space-between; padding: 8px 6px; border-radius: 6px; font-size: 13px; }
.suggest-item:hover { background: var(--surface-2); color: var(--primary); }

.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-3); color: var(--primary); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-icon-dark { display: none; }
html[data-theme="dark"] .theme-icon-dark { display: block; }
html[data-theme="dark"] .theme-icon-light { display: none; }

.history-wrap { position: relative; }
.history-popover { width: 340px; max-height: 440px; display: flex; flex-direction: column; overflow: hidden; }
.popover-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; font-weight: 600; }
.popover-clear { font-size: 12px; color: var(--text-3); }
.popover-clear:hover { color: var(--primary); }
.history-list { overflow-y: auto; padding: 8px; }
.history-item { display: flex; gap: 12px; padding: 8px; border-radius: 8px; }
.history-item:hover { background: var(--surface-2); }
.history-thumb { width: 44px; height: 60px; border-radius: 4px; object-fit: cover; background: var(--surface-3); flex-shrink: 0; }
.history-meta { min-width: 0; flex: 1; }
.history-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-ep { font-size: 12px; color: var(--primary); margin-top: 3px; }
.history-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.history-empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.mobile-menu-btn { display: none; }

/* ==========================================================================
   首页焦点图（腾讯视频式：左大图 + 右侧片单）
   ========================================================================== */
.hero { padding: 20px 0 8px; }
.hero-box {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  height: 460px; border-radius: var(--radius-lg); overflow: hidden;
  background: #0d0e12; box-shadow: var(--shadow-md);
}
.hero-slides { position: relative; overflow: hidden; }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .7s var(--ease), visibility .7s; }
.hero-slide.is-active { opacity: 1; visibility: visible; z-index: 2; }
.hero-backdrop {
  position: absolute; inset: -40px;
  background-size: cover; background-position: center 30%;
  filter: blur(40px) saturate(150%) brightness(.55);
  transform: scale(1.1); transition: transform 6s ease-out;
}
.hero-slide.is-active .hero-backdrop { transform: scale(1); }
.hero-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(10,11,14,.92) 0%, rgba(10,11,14,.6) 48%, rgba(10,11,14,.15) 100%),
    linear-gradient(0deg, rgba(10,11,14,.7) 0%, rgba(10,11,14,0) 45%);
}
.hero-content-wrap { position: relative; z-index: 3; height: 100%; display: flex; align-items: center; padding: 0 52px; }
.hero-grid { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.hero-info { max-width: 560px; color: #fff; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; letter-spacing: 3px; color: var(--gold); margin-bottom: 16px;
}
.hero-eyebrow svg { display: none; }
.hero-eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--gold); }
.hero-title {
  font-family: var(--font-serif);
  font-size: 40px; font-weight: 900; line-height: 1.25; letter-spacing: 1px;
  margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin-bottom: 16px; font-size: 13px; color: rgba(255,255,255,.72); }
.hero-meta .meta-pill { background: none; padding: 0; border: 0; color: inherit; }
.hero-meta .meta-pill + .meta-pill::before { content: "/"; margin: 0 10px; color: rgba(255,255,255,.3); }
.hero-meta .meta-pill--gold { color: var(--score); font-weight: 700; font-style: italic; font-size: 15px; }
.hero-desc {
  font-size: 14px; line-height: 1.85; color: rgba(255,255,255,.7);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 28px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-poster-card {
  flex-shrink: 0; width: 220px; aspect-ratio: 2/3;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.12);
  transition: transform .5s var(--ease);
}
.hero-poster-card:hover { transform: translateY(-4px); }
.hero-poster-card img { width: 100%; height: 100%; object-fit: cover; }

.hero-controls { position: relative; z-index: 4; background: rgba(18,19,24,.96); border-left: 1px solid rgba(255,255,255,.06); }
.hero-controls > .container { padding: 0; height: 100%; }
.hero-thumbs { display: flex; flex-direction: column; height: 100%; padding: 10px 0; }
.hero-thumb-btn {
  position: relative; flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 0 18px; text-align: left; color: rgba(255,255,255,.62);
  transition: background-color .2s, color .2s;
}
.hero-thumb-btn:hover { color: #fff; background: rgba(255,255,255,.04); }
.hero-thumb-btn.is-active { color: #fff; background: linear-gradient(90deg, rgba(224,53,43,.22), rgba(224,53,43,0)); }
.hero-thumb-btn.is-active::before {
  content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px;
  background: var(--primary); border-radius: 0 3px 3px 0;
}
.hero-thumb-img { width: 36px; height: 50px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: #222; }
.hero-thumb-info { min-width: 0; flex: 1; }
.hero-thumb-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-thumb-sub { font-size: 12px; opacity: .6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 28px; border-radius: 999px;
  font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: all .2s var(--ease);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(224,53,43,.3); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-glass { background: var(--surface-3); color: var(--text); }
.btn-glass:hover { color: var(--primary); }
.hero .btn-glass, .detail-hero .btn-glass {
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.18);
}
.hero .btn-glass:hover, .detail-hero .btn-glass:hover { background: rgba(255,255,255,.2); color: #fff; }
.btn-sm { height: 36px; padding: 0 18px; font-size: 13px; }

/* ==========================================================================
   分类导航（门户式）
   ========================================================================== */
.quick-channels, .cat-nav {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 4px 28px;
  margin: 16px 0 32px; padding: 18px 24px;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.cat-row { display: flex; align-items: center; gap: 14px; min-width: 0; height: 36px; }
.cat-name {
  flex-shrink: 0; font-size: 15px; font-weight: 700; color: var(--text);
  display: inline-flex; align-items: center; gap: 6px; min-width: 64px;
}
.cat-name::before { content: ""; width: 6px; height: 6px; transform: rotate(45deg); background: var(--primary); }
.cat-name:hover { color: var(--primary); }
.cat-subs { display: flex; gap: 14px; overflow: hidden; white-space: nowrap; min-width: 0; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
.cat-subs a { font-size: 13px; color: var(--text-2); }
.cat-subs a:hover { color: var(--primary); }

/* ==========================================================================
   板块标题
   ========================================================================== */
.section-block { margin-bottom: 40px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-title-group { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; min-width: 0; }
.section-title {
  font-size: 22px; font-weight: 800; letter-spacing: 1px; color: var(--text);
  display: inline-flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ""; width: 4px; height: 20px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), #ff7a45);
}
.section-subtabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.subtab-link { font-size: 14px; color: var(--text-2); padding: 2px 10px; position: relative; }
.subtab-link + .subtab-link::before { content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 12px; margin-top: -6px; background: var(--line-2); }
.subtab-link:hover { color: var(--primary); }
.section-more { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--text-3); }
.section-more:hover { color: var(--primary); }
.section-more svg { width: 14px; height: 14px; }

/* ==========================================================================
   影片卡片
   ========================================================================== */
.vod-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px 18px; }
.vod-grid--5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.vod-card { display: flex; flex-direction: column; min-width: 0; }
.vod-poster {
  position: relative; aspect-ratio: 2/3; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-3);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.vod-card:hover .vod-poster { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.vod-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.vod-card:hover .vod-poster img { transform: scale(1.05); }
.vod-poster::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: linear-gradient(0deg, rgba(0,0,0,.72), rgba(0,0,0,0));
  pointer-events: none;
}
.vod-play-overlay { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; opacity: 0; background: rgba(0,0,0,.18); transition: opacity .3s; }
.vod-card:hover .vod-play-overlay { opacity: 1; }
.vod-play-circle {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.95); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  transform: scale(.85); transition: transform .3s var(--ease);
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
}
.vod-card:hover .vod-play-circle { transform: scale(1); }
.vod-play-circle svg { width: 20px; height: 20px; margin-left: 3px; }
.badge-type {
  position: absolute; top: 0; left: 0; z-index: 4;
  padding: 2px 8px; font-size: 11px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #e0352b, #ff6a3d);
  border-radius: var(--radius) 0 var(--radius) 0;
}
.badge-remarks {
  position: absolute; left: 8px; right: 44px; bottom: 7px; z-index: 4;
  font-size: 12px; color: rgba(255,255,255,.95);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.badge-score {
  position: absolute; right: 8px; bottom: 6px; z-index: 4;
  font-size: 15px; font-weight: 800; font-style: italic; color: var(--score);
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.vod-card-info { padding-top: 10px; }
.vod-card-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vod-card:hover .vod-card-title { color: var(--primary); }
.vod-card-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* 横向滚动 */
.rail-wrap { position: relative; }
.vod-rail { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 4px 0 8px; }
.vod-rail::-webkit-scrollbar { display: none; }
.vod-rail .vod-card { flex: 0 0 calc((100% - 18px * 7) / 8); min-width: 140px; scroll-snap-align: start; }
.rail-nav-btn {
  position: absolute; top: 38%; transform: translateY(-50%); z-index: 10;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s, color .2s;
}
.rail-wrap:hover .rail-nav-btn { opacity: 1; }
.rail-nav-btn:hover { color: var(--primary); }
.rail-nav-btn--prev { left: -18px; }
.rail-nav-btn--next { right: -18px; }
.cw-section { display: none; margin-bottom: 36px; }
.cw-section.is-visible { display: block; }

/* ==========================================================================
   频道 + 排行
   ========================================================================== */
.channel-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.channel-split .vod-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rank-panel { background: var(--surface); border-radius: var(--radius-lg); padding: 18px 18px 12px; box-shadow: var(--shadow-sm); }
.rank-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rank-panel-title { font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.rank-panel-title svg { width: 16px; height: 16px; color: var(--primary); }
.rank-list { display: flex; flex-direction: column; }
.rank-row { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 4px; border-radius: 6px; }
.rank-row:hover { background: var(--surface-2); }
.rank-num { width: 22px; text-align: center; font-size: 16px; font-weight: 800; font-style: italic; color: var(--text-3); flex-shrink: 0; font-family: Georgia, "Times New Roman", serif; }
.rank-num--1 { color: var(--primary); font-size: 19px; }
.rank-num--2 { color: #ff6a2b; font-size: 18px; }
.rank-num--3 { color: #ffa12b; font-size: 17px; }
.rank-name { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row:hover .rank-name { color: var(--primary); }
.rank-remark { font-size: 12px; color: var(--text-3); max-width: 84px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   列表 / 筛选页
   ========================================================================== */
.page-banner { padding: 32px 0 24px; }
.page-title { font-family: var(--font-serif); font-size: 30px; font-weight: 900; letter-spacing: 2px; }
.page-subtitle { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.filter-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 10px 24px; margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.filter-row { display: flex; align-items: flex-start; gap: 16px; padding: 10px 0; }
.filter-row + .filter-row { border-top: 1px dashed var(--line); }
.filter-label { width: 48px; flex-shrink: 0; font-size: 14px; color: var(--text-3); line-height: 30px; }
.filter-options { display: flex; flex-wrap: wrap; gap: 4px 6px; flex: 1; }
.filter-chip { padding: 0 12px; line-height: 30px; border-radius: 6px; font-size: 14px; color: var(--text-2); }
.filter-chip:hover { color: var(--primary); }
.filter-chip.is-active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.sort-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.sort-tabs { display: inline-flex; gap: 24px; }
.sort-tab { position: relative; font-size: 15px; color: var(--text-2); padding-bottom: 4px; }
.sort-tab:hover { color: var(--primary); }
.sort-tab.is-active { color: var(--text); font-weight: 700; }
.sort-tab.is-active::after { content: ""; position: absolute; left: 50%; bottom: -2px; width: 16px; height: 3px; margin-left: -8px; border-radius: 3px; background: var(--primary); }
.result-count { font-size: 13px; color: var(--text-3); }
.result-count strong { color: var(--primary); }

/* 分页 */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 40px 0 20px; }
.page-btn {
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm);
}
.page-btn:hover { color: var(--primary); }
.page-btn.is-active { background: var(--primary); color: #fff; }
.page-btn.is-disabled { opacity: .4; pointer-events: none; }

/* ==========================================================================
   详情页（深色电影头图）
   ========================================================================== */
.detail-hero { position: relative; overflow: hidden; padding: 44px 0 48px; margin-bottom: 32px; background: #0d0e12; color: #fff; }
.detail-backdrop { position: absolute; inset: -40px; background-size: cover; background-position: center 25%; filter: blur(46px) saturate(140%) brightness(.45); }
.detail-backdrop-mask { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,14,18,.9) 0%, rgba(13,14,18,.55) 100%); }
.detail-hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
.detail-poster { aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.5); background: #222; }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { font-family: var(--font-serif); font-size: 34px; font-weight: 900; line-height: 1.3; letter-spacing: 1px; margin-bottom: 8px; }
.detail-sub-title { font-size: 13px; color: rgba(255,255,255,.55); margin-bottom: 14px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.meta-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 4px; font-size: 12px; background: var(--surface-3); color: var(--text-2); }
.detail-hero .meta-pill { background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); }
.meta-pill--gold, .detail-hero .meta-pill--gold { background: rgba(255,138,0,.14); color: var(--score); font-weight: 700; }
.detail-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 28px; margin-bottom: 18px; font-size: 14px; }
.detail-meta-item { display: flex; gap: 6px; line-height: 1.7; min-width: 0; }
.detail-meta-item--full { grid-column: 1 / -1; }
.detail-meta-label { color: rgba(255,255,255,.45); flex-shrink: 0; }
.detail-meta-val { color: rgba(255,255,255,.85); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.detail-meta-val a { color: rgba(255,255,255,.85); margin-right: 6px; }
.detail-meta-val a:hover { color: var(--primary); }
.detail-synopsis {
  font-size: 14px; line-height: 1.85; color: rgba(255,255,255,.68); margin-bottom: 26px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 860px;
}
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* 选集 */
.playlist-box { background: var(--surface); border-radius: var(--radius-lg); padding: 20px 24px 24px; margin-bottom: 40px; box-shadow: var(--shadow-sm); }
.playlist-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.source-tabs { display: flex; flex-wrap: wrap; gap: 24px; }
.source-tab { position: relative; font-size: 15px; font-weight: 500; color: var(--text-2); padding: 4px 0; }
.source-tab:hover { color: var(--primary); }
.source-tab.is-active { color: var(--primary); font-weight: 700; }
.source-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -15px; height: 2px; background: var(--primary); }
.source-count { font-size: 12px; color: var(--text-3); margin-left: 2px; }
.playlist-panel { display: none; }
.playlist-panel.is-active { display: block; }
.episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; max-height: 380px; overflow-y: auto; }
.ep-btn {
  display: flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 10px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid transparent;
  font-size: 13px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ep-btn:hover { color: var(--primary); border-color: var(--primary-line); }
.ep-btn.is-active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); font-weight: 700; }

/* ==========================================================================
   播放页（始终深色剧场）
   ========================================================================== */
.theater-wrap { background: #0d0e12; padding: 20px 0 24px; margin-bottom: 32px; color: #e8e8ec; }
.theater-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; border-radius: var(--radius); overflow: hidden; background: #16171c; }
.player-stage { min-width: 0; display: flex; flex-direction: column; }
.player-frame-box { position: relative; aspect-ratio: 16/9; background: #000; z-index: 20; }
.player-frame-box .MacPlayer, .player-frame-box iframe, .player-frame-box video { width: 100% !important; height: 100% !important; border: 0; }
.player-gate { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 28px; background: radial-gradient(circle, #1c1d23, #08090b); }
.player-gate p { color: rgba(255,255,255,.6) !important; }
.player-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; background: #16171c; }
.player-now { min-width: 0; flex: 1; }
.player-now-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: #fff; }
.player-now-title a:hover { color: var(--primary); }
.player-now-ep { font-size: 13px; font-weight: 500; color: rgba(255,255,255,.55); }
.player-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: 6px;
  font-size: 13px; color: var(--text-2); background: var(--surface-2);
}
.tool-btn:hover { color: var(--primary); }
.tool-btn svg { width: 15px; height: 15px; }
.theater-wrap .tool-btn { background: transparent; color: rgba(255,255,255,.65); }
.theater-wrap .tool-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.theater-sidebar { display: flex; flex-direction: column; background: #1b1c22; border-left: 1px solid rgba(255,255,255,.05); min-height: 0; max-height: 100%; overflow: hidden; }
.sidebar-head { padding: 18px 20px 12px; }
.sidebar-vod-title { font-size: 17px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-vod-meta { font-size: 12px; color: rgba(255,255,255,.45); margin-top: 4px; }
.sidebar-sources { display: flex; gap: 8px; padding: 0 20px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-sources::-webkit-scrollbar { display: none; }
.sidebar-source-btn { padding: 4px 12px; border-radius: 999px; font-size: 12px; white-space: nowrap; color: rgba(255,255,255,.6); background: rgba(255,255,255,.06); }
.sidebar-source-btn.is-active { background: var(--primary); color: #fff; }
.sidebar-ep-tools { display: flex; justify-content: space-between; padding: 12px 20px 4px; font-size: 12px; color: rgba(255,255,255,.4); }
.sidebar-ep-tools button { color: rgba(255,255,255,.7) !important; }
.sidebar-episodes { flex: 1; overflow-y: auto; padding: 8px 20px 18px; }
.sidebar-ep-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.theater-sidebar .ep-btn { height: 38px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.75); }
.theater-sidebar .ep-btn:hover { color: #fff; background: rgba(255,255,255,.1); border-color: transparent; }
.theater-sidebar .ep-btn.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
body.lights-off::before { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 15; }
body.lights-off .player-stage { position: relative; z-index: 25; }

/* ==========================================================================
   搜索页
   ========================================================================== */
.search-hero-box { max-width: 680px; margin: 0 auto 16px; }
.search-hero-form {
  display: flex; align-items: center; height: 52px; padding: 5px 5px 5px 22px;
  background: var(--surface); border: 2px solid var(--primary); border-radius: 999px; box-shadow: var(--shadow-md);
}
.search-hero-input { flex: 1; font-size: 15px; }
.search-list { display: flex; flex-direction: column; gap: 16px; }
.search-card { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 24px; padding: 20px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: box-shadow .3s; }
.search-card:hover { box-shadow: var(--shadow-md); }
.search-card-poster { position: relative; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.search-card-poster img { width: 100%; height: 100%; object-fit: cover; }
.search-card-poster::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(0deg, rgba(0,0,0,.6), transparent); }
.search-card-poster .badge-remarks { right: 8px; text-align: right; }
.search-card-body { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-width: 0; }
.search-card-title { font-size: 20px; font-weight: 700; }
.search-card-title:hover { color: var(--primary); }
.search-card-desc { font-size: 13px; color: var(--text-2); line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ==========================================================================
   通用面板 / 表单 / 评论
   ========================================================================== */
.rank-grid-boards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.glass-panel { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.form-control { width: 100%; padding: 11px 14px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--text); }
.form-control:focus { border-color: var(--primary); background: var(--surface); }
textarea.form-control { resize: vertical; }
.comment-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-item:last-child { border-bottom: 0; }
.comment-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.comment-author { font-weight: 600; color: var(--text); }
.comment-time { color: var(--text-3); font-size: 12px; }
.comment-text { font-size: 14px; color: var(--text-2); line-height: 1.75; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-3); background: var(--surface); border-radius: var(--radius-lg); }
.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer { margin-top: 56px; background: var(--surface); border-top: 1px solid var(--line); padding: 44px 0 28px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.footer-desc { font-size: 13px; color: var(--text-3); line-height: 1.8; margin-top: 14px; max-width: 400px; }
.footer-col-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.footer-links a { font-size: 13px; color: var(--text-3); }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-3); }

.back-top-btn {
  position: fixed; right: 24px; bottom: 32px; z-index: 800;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .25s var(--ease);
}
.back-top-btn.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-top-btn:hover { background: var(--primary); color: #fff; }
.aurora-toast {
  position: fixed; left: 50%; top: 90px; transform: translate(-50%, -10px); z-index: 2000;
  padding: 10px 22px; border-radius: 999px; font-size: 14px;
  background: rgba(24,25,28,.92); color: #fff; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transition: all .25s var(--ease);
}
.aurora-toast.is-show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* 移动端抽屉 / 底栏 */
.mobile-drawer { position: fixed; inset: 0; z-index: 1100; visibility: hidden; pointer-events: none; }
.mobile-drawer.is-open { visibility: visible; pointer-events: auto; }
.mobile-drawer-mask { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .3s; }
.mobile-drawer.is-open .mobile-drawer-mask { opacity: 1; }
.mobile-drawer-panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: 270px; max-width: 80vw;
  background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
  transform: translateX(-100%); transition: transform .3s var(--ease);
}
.mobile-drawer.is-open .mobile-drawer-panel { transform: none; }
.mobile-nav-list { display: flex; flex-direction: column; gap: 2px; }
.mobile-nav-list a { padding: 11px 12px; border-radius: 8px; font-size: 15px; color: var(--text-2); }
.mobile-nav-list a.is-active, .mobile-nav-list a:hover { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.mobile-tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 880;
  height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--header-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.mobile-tabbar-inner { height: 56px; display: grid; grid-template-columns: repeat(5, 1fr); }
.mobile-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--text-3); }
.mobile-tab svg { width: 21px; height: 21px; }
.mobile-tab.is-active { color: var(--primary); }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1280px) {
  .vod-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .channel-split .vod-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .search-box { width: 240px; }
  .vod-rail .vod-card { flex-basis: calc((100% - 18px * 5) / 6); }
}
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .header-left { gap: 12px; }
  .hero-box { grid-template-columns: 1fr; }
  .hero-controls { display: none; }
  .channel-split { grid-template-columns: 1fr; }
  .channel-split .vod-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .theater-grid { grid-template-columns: 1fr; }
  .theater-sidebar { max-height: 420px; border-left: 0; border-top: 1px solid rgba(255,255,255,.05); }
  .rank-grid-boards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vod-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  :root { --header-h: 56px; }
  body { padding-bottom: 60px; }
  .container { padding: 0 14px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 17px; letter-spacing: 1px; }
  .brand-mark { width: 30px; height: 30px; font-size: 17px; }
  .search-box { width: auto; flex: 1; }
  .header-right { flex: 1; justify-content: flex-end; }
  .header-left { flex: 0 0 auto; }
  .header-right .icon-btn:not(#themeToggleBtn) { display: none; }
  .search-btn { width: 40px; }

  .hero { padding: 12px 0 0; }
  .hero-box { height: 260px; border-radius: var(--radius); }
  .hero-content-wrap { padding: 0 20px; }
  .hero-poster-card { width: 110px; }
  .hero-title { font-size: 22px; margin-bottom: 8px; }
  .hero-desc { display: none; }
  .hero-meta { margin-bottom: 14px; font-size: 12px; }
  .hero-eyebrow { margin-bottom: 8px; }
  .btn { height: 38px; padding: 0 18px; font-size: 13px; }
  .hero-actions .btn-glass { display: none; }

  .cat-nav { grid-template-columns: 1fr; padding: 10px 14px; margin: 12px 0 24px; }
  .section-title { font-size: 18px; }
  .section-subtabs { display: none; }
  .vod-grid, .channel-split .vod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
  .vod-rail .vod-card { flex: 0 0 31%; min-width: 0; }
  .rail-nav-btn { display: none; }
  .vod-card-title { font-size: 13px; }

  .detail-hero { padding: 24px 0 30px; }
  .detail-hero-inner { grid-template-columns: 110px minmax(0, 1fr); gap: 16px; }
  .detail-title { font-size: 20px; }
  .detail-meta-grid { grid-template-columns: 1fr; font-size: 13px; }
  .detail-synopsis { grid-column: 1 / -1; }
  .detail-actions .btn { height: 36px; padding: 0 14px; }

  .theater-wrap { padding: 0 0 16px; }
  .theater-wrap > .container { padding: 0; }
  .theater-grid { border-radius: 0; }
  .sidebar-ep-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .search-card { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .search-card-title { font-size: 16px; }
  .rank-grid-boards { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 22px; }
  .mobile-tabbar { display: block; }
  .back-top-btn { bottom: 76px; right: 14px; width: 40px; height: 40px; }
  .page-title { font-size: 24px; }
  .filter-card { padding: 6px 14px; }
  .filter-row { gap: 8px; }
  .filter-options { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filter-options::-webkit-scrollbar { display: none; }
  .filter-chip { white-space: nowrap; }
}
@media (max-width: 420px) {
  .episode-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
}

/* 侧栏高度跟随播放器，不撑高行 */
.theater-sidebar { height: 0; min-height: 100%; }
@media (max-width: 1080px) { .theater-sidebar { height: auto; min-height: 0; } }

/* ---- 细节修正 ---- */
@media (max-width: 1280px) { .nav-item { padding: 8px 9px; font-size: 14px; } }
@media (max-width: 768px) {
  .header-inner { gap: 10px; }
  .header-right { min-width: 0; gap: 2px; }
  .search-box { min-width: 0; }
  .search-form { padding-left: 12px; }
  .search-dropdown { min-width: 0; width: calc(100vw - 28px); right: -40px; }
  .hero-box { height: 300px; }
  .hero-title { font-size: 21px; }
  .hero-meta .meta-pill:nth-child(n+3) { display: none; }
  .hero-eyebrow { font-size: 11px; letter-spacing: 1px; }
  .hero-grid { gap: 16px; }
  .cat-row { height: 34px; }
}
