/* =========================================================
   极速影视 · 极简现代影视主题
   深色为主 / 浅色为辅 · 柔和蓝强调 · 流式弹性布局
   样式统一写入本文件，语义化类名
   ========================================================= */

/* ---------- 设计变量 ---------- */
:root {
  color-scheme: dark;

  /* 背景层级 */
  --bg-body: #0d1017;
  --bg-header: rgba(13, 16, 23, 0.72);
  --bg-header-solid: #10141c;
  --bg-card: #151a24;
  --bg-elevated: #1b2230;
  --bg-hover: #222b3c;
  --bg-input: #1b2230;
  --bg-mask: rgba(7, 9, 14, 0.55);

  /* 边框 / 分隔线 */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* 文字层级：一级纯白 / 二级浅灰 / 辅助淡灰 */
  --text-primary: #f3f5f9;
  --text-secondary: #a9b1bf;
  --text-tertiary: #6e7686;

  /* 柔和蓝强调色 */
  --accent: #4d8dff;
  --accent-hover: #6ea3ff;
  --accent-soft: rgba(77, 141, 255, 0.14);
  --accent-text: #7fb0ff;

  --success: #34d399;
  --danger: #ff6674;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);

  --header-height: 62px;
  --container: 1440px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.22s var(--ease);
}

/* 浅色为辅：一键切换 */
[data-theme="light"] {
  color-scheme: light;

  --bg-body: #f4f6fa;
  --bg-header: rgba(255, 255, 255, 0.78);
  --bg-header-solid: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #eef1f7;
  --bg-hover: #e4e9f2;
  --bg-input: #f0f3f8;
  --bg-mask: rgba(255, 255, 255, 0.6);

  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);

  --text-primary: #171b26;
  --text-secondary: #4a5262;
  --text-tertiary: #8b93a3;

  --accent: #3575e2;
  --accent-hover: #2a63c9;
  --accent-soft: rgba(53, 117, 226, 0.1);
  --accent-text: #2f6fd6;

  --shadow-sm: 0 1px 4px rgba(23, 27, 38, 0.06);
  --shadow-md: 0 8px 24px rgba(23, 27, 38, 0.1);
  --shadow-lg: 0 16px 48px rgba(23, 27, 38, 0.14);
}

/* ---------- 基础 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: clamp(14px, 0.9vw + 12px, 16px);
  line-height: 1.65;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input::placeholder {
  color: var(--text-tertiary);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* 布局容器 */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: clamp(14px, 2.5vw, 28px);
  padding-right: clamp(14px, 2.5vw, 28px);
}

main {
  padding-top: calc(var(--header-height) + 22px);
  min-height: 60vh;
}

/* 清除浮动（系统评论等遗留结构使用） */
.fn-clear::after {
  content: "";
  display: block;
  clear: both;
  visibility: hidden;
  height: 0;
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-header);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.site-header.scrolled {
  background: var(--bg-header-solid);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 26px);
}

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition);
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--text-primary);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-toggle:hover {
  background: var(--bg-hover);
}

/* LOGO */
.logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  line-height: 1;
}

.logo img {
  height: 34px;
  width: auto;
  max-height: 34px;
  object-fit: contain;
}

/* 主导航 */
.site-nav {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-item {
  position: relative;
}

.nav-item > a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95em;
  transition: color var(--transition), background-color var(--transition);
}

.nav-item > a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-item > a.active {
  color: var(--accent-text);
  font-weight: 600;
}

.nav-arrow {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
}

/* 二级下拉（延迟显示） */
.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 172px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease),
    visibility 0.2s, background-color 0.3s var(--ease);
  transition-delay: 0.12s;
  z-index: 20;
}

.nav-item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.92em;
  white-space: nowrap;
}

.dropdown a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.dropdown a.active {
  color: var(--accent-text);
}

/* 顶栏右侧操作区 */
.header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 14px);
}

/* 搜索框 */
.search-form {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: clamp(150px, 20vw, 260px);
}

.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 4px 8px 16px;
  font-size: 0.92em;
  color: var(--text-primary);
}

.search-form button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  color: var(--text-tertiary);
  transition: color var(--transition), background-color var(--transition);
}

.search-form button:hover {
  color: var(--accent-text);
}

/* 主题切换 / 历史 / 用户 */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: color var(--transition), background-color var(--transition);
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

[data-theme="light"] .icon-sun {
  display: none;
}
.icon-moon {
  display: none;
}
[data-theme="light"] .icon-moon {
  display: block;
}
html:not([data-theme="light"]) .icon-sun {
  display: block;
}

/* ---------- 移动端导航抽屉 ---------- */
@media (max-width: 1024px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-header-solid);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease),
      visibility 0.25s;
  }

  .site-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 14px 16px;
    max-height: calc(100vh - var(--header-height) - 20px);
    overflow-y: auto;
  }

  .nav-item > a {
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 1em;
  }

  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 4px 18px;
    transition: none;
  }

  .dropdown a {
    padding: 10px 14px;
  }

}

/* ---------- 首页轮播 ---------- */
.hero {
  margin-top: calc((var(--header-height) + 22px) * -1);
  position: relative;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  isolation: isolate;
}

.hero-carousel {
  position: relative;
  height: clamp(320px, 40vw, 500px);
  min-height: 300px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 6s linear;
}

.hero-slide.active .hero-bg img {
  transform: scale(1.08);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(8, 10, 15, 0.92) 0%,
    rgba(8, 10, 15, 0.55) 45%,
    rgba(8, 10, 15, 0.15) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: min(56%, 640px);
  padding: 0 clamp(18px, 4vw, 56px);
  gap: 12px;
}

.hero-tag {
  align-self: flex-start;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  border: 1px solid rgba(77, 141, 255, 0.4);
  color: var(--accent-text);
  font-size: 0.8em;
  letter-spacing: 1px;
}

.hero-title {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.92em;
}

.hero-meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 0.95em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-btns {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 0.95em;
  font-weight: 600;
  transition: background-color var(--transition), color var(--transition),
    transform var(--transition), box-shadow var(--transition);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(77, 141, 255, 0.35);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(77, 141, 255, 0.45);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-outline {
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-soft);
}

/* 轮播箭头 / 指示器 */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.3rem;
  opacity: 0;
  transition: opacity var(--transition), background-color var(--transition);
  cursor: pointer;
}

.hero:hover .hero-arrow {
  opacity: 1;
}

.hero-arrow:hover {
  background: var(--accent);
}

.hero-arrow.prev {
  left: 18px;
}
.hero-arrow.next {
  right: 18px;
}

.hero-dots {
  position: absolute;
  z-index: 3;
  bottom: 18px;
  left: clamp(18px, 4vw, 56px);
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.25s var(--ease), background-color 0.25s var(--ease);
}

.hero-dot.active {
  width: 24px;
  background: var(--accent);
}

@media (max-width: 640px) {
  .hero-carousel {
    height: 320px;
  }

  .hero-content {
    max-width: 82%;
    gap: 9px;
  }

  .hero-desc {
    display: none;
  }

  .hero-arrow {
    display: none;
  }
}

/* ---------- 区块 ---------- */
.section {
  margin-top: clamp(28px, 4vw, 44px);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 3px;
  background: var(--accent);
}

.section-title a {
  transition: color var(--transition);
}

.section-title a:hover {
  color: var(--accent-text);
}

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-tertiary);
  font-size: 0.88em;
  transition: color var(--transition), gap var(--transition);
}

.section-more:hover {
  color: var(--accent-text);
  gap: 8px;
}

/* ---------- 封面卡片 ---------- */
.vod-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px 18px;
}

@media (min-width: 641px) {
  .vod-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  }
}

.vod-card {
  display: block;
  min-width: 0;
}

/* 封面 */
.vod-card__cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.vod-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

/* 角标 */
.vod-card__tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  max-width: calc(100% - 16px);
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  background: rgba(10, 13, 19, 0.72);
  color: #fff;
  font-size: 0.75em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* hover 渐变遮罩 + 标题标签 */
.vod-card__play {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(10, 13, 19, 0.1) 0%,
    rgba(10, 13, 19, 0.55) 45%,
    rgba(10, 13, 19, 0.9) 100%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.vod-card__play i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(77, 141, 255, 0.5);
  transform: scale(0.85);
  transition: transform 0.3s var(--ease);
}

.vod-card__play i::after {
  content: "";
  margin-left: 3px;
  border-left: 10px solid #fff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.vod-card__play span {
  font-size: 0.92em;
  font-weight: 600;
  color: #fff;
  transform: translateY(4px);
  transition: transform 0.3s var(--ease);
}

.vod-card:hover .vod-card__cover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.vod-card:hover .vod-card__cover img {
  transform: scale(1.06);
}

.vod-card:hover .vod-card__play {
  opacity: 1;
}

.vod-card:hover .vod-card__play i {
  transform: scale(1);
}

.vod-card:hover .vod-card__play span {
  transform: translateY(0);
}

/* 卡片信息 */
.vod-card__info {
  padding: 9px 2px 0;
}

.vod-card__title {
  font-size: 0.95em;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
}

.vod-card__title:hover {
  color: var(--accent-text);
}

.vod-card__meta {
  margin-top: 3px;
  font-size: 0.78em;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 移动端：单列横版卡片 */
@media (max-width: 640px) {
  .vod-card {
    display: flex;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    transition: border-color var(--transition), background-color var(--transition);
  }

  .vod-card__cover {
    flex: 0 0 96px;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-sm);
  }

  .vod-card__play {
    display: none;
  }

  .vod-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
  }

  .vod-card__title {
    font-size: 1em;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .vod-card__meta {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: 5px;
  }

  .vod-card__desc {
    margin-top: 6px;
    font-size: 0.8em;
    color: var(--text-tertiary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (min-width: 641px) {
  .vod-card__desc {
    display: none;
  }
}

/* ---------- 通用盒子 ---------- */
.ui-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 2.4vw, 24px);
  transition: background-color 0.3s var(--ease);
}

.ui-box + .ui-box {
  margin-top: 20px;
}

.box-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.box-title h2,
.box-title h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.08rem;
  font-weight: 700;
}

.box-title h2::before,
.box-title h3::before {
  content: "";
  width: 4px;
  height: 17px;
  border-radius: 3px;
  background: var(--accent);
}

.box-title span {
  color: var(--text-tertiary);
  font-size: 0.82em;
  font-weight: 400;
}

/* ---------- 列表页布局 ---------- */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (min-width: 1200px) {
  .page-layout.with-aside {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

.page-main {
  min-width: 0;
}

.page-aside {
  min-width: 0;
}

@media (min-width: 1200px) {
  .page-aside {
    position: sticky;
    top: calc(var(--header-height) + 20px);
  }
}

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.page-title {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title small {
  font-size: 0.62em;
  font-weight: 400;
  color: var(--text-tertiary);
}

.page-count {
  color: var(--text-tertiary);
  font-size: 0.88em;
}

.page-count b {
  color: var(--accent-text);
  font-weight: 600;
  margin: 0 3px;
}

/* 二级分类 chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 18px;
}

.chip {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.88em;
  transition: color var(--transition), border-color var(--transition),
    background-color var(--transition);
}

.chip:hover {
  color: var(--accent-text);
  border-color: var(--accent);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* 筛选卡片 */
.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px clamp(14px, 2vw, 22px);
  margin-bottom: 20px;
  transition: background-color 0.3s var(--ease);
}

.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
}

.filter-row + .filter-row {
  border-top: 1px solid var(--border);
}

.filter-label {
  flex-shrink: 0;
  width: 3.2em;
  padding-top: 7px;
  color: var(--text-tertiary);
  font-size: 0.88em;
}

.filter-options {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.filter-options a {
  padding: 4px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88em;
  transition: color var(--transition), background-color var(--transition);
}

.filter-options a:hover {
  color: var(--accent-text);
  background: var(--accent-soft);
}

.filter-options a.active {
  color: var(--accent-text);
  background: var(--accent-soft);
  font-weight: 600;
}

/* 已选筛选 */
.filter-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.filter-selected .filter-label {
  padding-top: 4px;
}

.selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  border: 1px solid rgba(77, 141, 255, 0.35);
  color: var(--accent-text);
  font-size: 0.85em;
}

.selected-tag a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(77, 141, 255, 0.2);
  color: var(--accent-text);
  font-size: 0.95em;
  line-height: 1;
  transition: background-color var(--transition);
}

.selected-tag a:hover {
  background: var(--accent);
  color: #fff;
}

/* 排序条 */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 18px;
  padding: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.sort-bar a {
  flex-shrink: 0;
  padding: 7px 18px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.9em;
  transition: color var(--transition), background-color var(--transition);
}

.sort-bar a:hover {
  color: var(--text-primary);
}

.sort-bar a.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* 子分类小节标题 */
.subsection-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
}

.subsection-head::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 3px;
  background: var(--accent);
}

/* 侧栏小横卡 */
.mini-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mini-item {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mini-item img {
  flex-shrink: 0;
  width: 52px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.mini-item__info {
  flex: 1;
  min-width: 0;
}

.mini-item__name {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
}

.mini-item__name:hover {
  color: var(--accent-text);
}

.mini-item__meta {
  margin-top: 3px;
  font-size: 0.76em;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 13px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9em;
  transition: color var(--transition), border-color var(--transition),
    background-color var(--transition);
}

.page-link:hover {
  color: var(--accent-text);
  border-color: var(--accent);
}

.page-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: default;
}

.page-link.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-link.disabled:hover {
  color: var(--text-secondary);
  border-color: var(--border);
}

.page-info {
  width: 100%;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.82em;
  margin-top: 10px;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--text-tertiary);
}

/* ---------- 详情页 ---------- */
.detail-hero {
  display: flex;
  gap: clamp(18px, 2.6vw, 30px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 2.4vw, 26px);
  transition: background-color 0.3s var(--ease);
}

.detail-poster {
  flex-shrink: 0;
  width: clamp(140px, 15vw, 210px);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

.detail-info {
  flex: 1;
  min-width: 0;
}

.detail-title {
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 700;
  line-height: 1.3;
}

.detail-sub {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 0.9em;
}

.detail-meta {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 22px;
  font-size: 0.92em;
}

.detail-meta .meta-item {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.detail-meta .meta-label {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.detail-meta .meta-value {
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-meta .meta-value a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.detail-meta .meta-value a:hover {
  color: var(--accent-text);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-link {
  padding: 3px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82em;
  transition: color var(--transition), border-color var(--transition);
}

.tag-link:hover {
  color: var(--accent-text);
  border-color: var(--accent);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

/* 剧情简介：多行省略 */
.plot {
  position: relative;
  color: var(--text-secondary);
  font-size: 0.95em;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plot.expanded {
  display: block;
}

.plot-toggle {
  margin-top: 8px;
  color: var(--accent-text);
  font-size: 0.88em;
  transition: opacity var(--transition);
}

.plot-toggle:hover {
  opacity: 0.8;
}

/* 播放源 Tab */
.play-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.play-tab {
  padding: 7px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9em;
  transition: color var(--transition), border-color var(--transition),
    background-color var(--transition);
}

.play-tab:hover {
  color: var(--accent-text);
  border-color: var(--accent);
}

.play-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* 剧集网格（详情页） */
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.episode-btn {
  display: block;
  text-align: center;
  padding: 9px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.88em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition), border-color var(--transition),
    background-color var(--transition);
}

.episode-btn:hover {
  color: var(--accent-text);
  border-color: var(--accent);
}

.episode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Tab 面板显隐：默认隐藏，active 显示 */
[data-tab-panel]:not(.active) {
  display: none;
}

.episode-grid[data-tab-panel].active {
  display: grid;
}

.episode-list[data-tab-panel].active {
  display: flex;
}

/* ---------- 播放页 ---------- */
/* 播放器容器：占满宽度，16:9 */
.player-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.player-box iframe,
.player-box video,
.player-box object,
.player-box embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.player-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 700;
}

.player-title small {
  color: var(--text-tertiary);
  font-size: 0.72em;
  font-weight: 400;
}

/* 播放器占满宽度，16:9 */
.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.player-wrap iframe,
.player-wrap video,
.player-wrap object,
.player-wrap embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.player-tip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95em;
  background: var(--bg-elevated);
  border-radius: 0;
}

.player-nav {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.player-nav .btn {
  padding: 8px 18px;
  font-size: 0.88em;
}

/* 播放页信息条 */
.player-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 16px 20px;
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.player-info__title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-info__title h1 {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-now {
  flex-shrink: 0;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.82em;
  font-weight: 500;
}

/* 剧集横向滚动 */
.episode-scroll {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.episode-list {
  min-width: 0;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.episode-list .episode-btn {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 8px 13px;
}

.scroll-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: color var(--transition), border-color var(--transition),
    background-color var(--transition);
}

.scroll-btn:hover:not(:disabled) {
  color: var(--accent-text);
  border-color: var(--accent);
}

.scroll-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .scroll-btn {
    display: none;
  }
}

/* ---------- 友情链接 ---------- */
.friend-links {
  margin-top: clamp(32px, 5vw, 52px);
}

.friend-links .section-head {
  margin-bottom: 12px;
}

.friend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.friend-list a {
  color: var(--text-tertiary);
  font-size: 0.85em;
  transition: color var(--transition);
}

.friend-list a:hover {
  color: var(--accent-text);
}

/* ---------- 尾部 ---------- */
.site-footer {
  margin-top: clamp(40px, 6vw, 64px);
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 34px 0 40px;
  transition: background-color 0.3s var(--ease);
}

.footer-copy {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.82em;
  line-height: 2;
}

.footer-copy p {
  opacity: 0.9;
}

/* ---------- 回到顶部 ---------- */
.back-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
    visibility 0.3s, background-color var(--transition), color var(--transition);
}

.back-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  background: var(--accent);
  color: #fff;
}

.back-top svg {
  width: 18px;
  height: 18px;
}

/* ---------- 404 ---------- */
.not-found {
  text-align: center;
  padding: 60px 20px 80px;
}

.not-found h1 {
  font-size: clamp(3rem, 8vw, 5rem);
  color: var(--accent);
  font-weight: 800;
}

.not-found p {
  color: var(--text-secondary);
  margin: 14px 0 26px;
}

/* ---------- 动画 ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: fadeInUp 0.5s var(--ease) both;
}

.section:nth-of-type(2) {
  animation-delay: 0.06s;
}
.section:nth-of-type(3) {
  animation-delay: 0.12s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}
