/* ==========================================================================
   影视站点模板 style.css
   设计语言：简约现代 · 深色为主浅色为辅 · 柔和蓝强调色
   规范：样式统一在此文件，类名语义化，兼容苹果 CMS 结构
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量
   -------------------------------------------------------------------------- */
:root {
  /* 主题色 */
  --c-bg: #0d0f14;                 /* 页面背景 */
  --c-bg-soft: #11141b;            /* 次级背景 */
  --c-bg-card: #171c26;            /* 卡片背景 */
  --c-bg-hover: #1e2430;           /* 卡片悬浮背景 */
  --c-primary: #4d8cff;            /* 柔和蓝（强调色） */
  --c-primary-hover: #6ba3ff;
  --c-primary-soft: rgba(77, 140, 255, 0.14);
  --c-primary-line: rgba(77, 140, 255, 0.45);

  /* 文字层级：一级纯白 / 二级浅灰 / 辅助淡灰 */
  --c-text: #ffffff;
  --c-text-2: #a6adba;
  --c-text-3: #6c7480;

  /* 边框 / 分隔线 */
  --c-border: rgba(255, 255, 255, 0.08);
  --c-border-light: rgba(255, 255, 255, 0.05);

  /* 功能色 */
  --c-danger: #ff6b6b;
  --c-warn: #ffc53d;
  --c-success: #34d399;

  /* 圆角 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-full: 999px;

  /* 阴影 */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.5);
  --shadow-primary: 0 6px 20px rgba(77, 140, 255, 0.35);

  /* 间距 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 44px;

  /* 布局 */
  --container-w: 1280px;
  --header-h: 60px;
  --radius-card: var(--r-md);

  /* 字体 */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --f-xs: 12px;
  --f-sm: 13px;
  --f-base: 14px;
  --f-md: 16px;
  --f-lg: 18px;
  --f-xl: 22px;
  --f-2xl: 28px;

  /* 过渡 */
  --tr: 0.25s ease;
  --tr-fast: 0.18s ease;
}

/* --------------------------------------------------------------------------
   2. 基础重置
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--f-base);
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  border: 0;
  vertical-align: middle;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--tr-fast);
}

a:hover {
  color: var(--c-primary-hover);
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
}

::selection {
  background: var(--c-primary);
  color: #fff;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--c-bg);
}
::-webkit-scrollbar-thumb {
  background: #2a303c;
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #3a4252;
}

/* 隐藏滚动条的横向滚动容器 */
.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* --------------------------------------------------------------------------
   3. 布局基础
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 var(--s-4);
}

/* 页面主体：为固定导航让位 */
.page {
  padding-top: calc(var(--header-h) + var(--s-4));
  min-height: 70vh;
}

/* 区块容器 */
.section {
  margin-bottom: var(--s-6);
}

/* 卡片面板 */
.panel {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}

/* 区块容器（列表分区组合） */
.vod-section {
  display: grid;
  gap: var(--s-4);
}

/* 区块头部 */
.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}

.section__title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--f-lg);
  font-weight: 600;
  line-height: 1.2;
}

/* 标题前强调竖条 */
.section__title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--c-primary);
}

.stat-count {
  font-size: var(--f-sm);
  font-weight: 400;
  color: var(--c-text-3);
  margin-left: var(--s-2);
}

.section__more {
  font-size: var(--f-sm);
  color: var(--c-text-3);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: color var(--tr-fast);
}

.section__more::after {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--tr);
}

.section__more:hover {
  color: var(--c-primary-hover);
}

.section__more:hover::after {
  transform: rotate(45deg) translateX(2px);
}

/* 细分隔线 */
.divider {
  height: 1px;
  background: var(--c-border);
  border: 0;
}

/* --------------------------------------------------------------------------
   4. 按钮
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 42px;
  padding: 0 var(--s-5);
  font-size: var(--f-base);
  font-weight: 500;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: all var(--tr);
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--c-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--c-primary-hover);
  color: #fff;
  box-shadow: var(--shadow-primary);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  border-color: var(--c-border);
  color: var(--c-text-2);
}

.btn--ghost:hover {
  border-color: var(--c-primary-line);
  color: var(--c-primary-hover);
  background: var(--c-primary-soft);
}

.btn--sm {
  height: 34px;
  padding: 0 var(--s-4);
  font-size: var(--f-sm);
  border-radius: var(--r-sm);
}

.btn--lg {
  height: 48px;
  padding: 0 var(--s-6);
  font-size: var(--f-md);
  border-radius: var(--r-md);
}

/* --------------------------------------------------------------------------
   5. 顶部导航：半透明磨砂，滚动后实色
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-h);
  background: rgba(13, 15, 20, 0.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: background var(--tr), border-color var(--tr), box-shadow var(--tr);
}

.header.is-scrolled {
  background: rgba(13, 15, 20, 0.94);
  border-bottom-color: var(--c-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-5);
  height: 100%;
}

/* Logo */
.header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  font-size: var(--f-xl);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header__logo img {
  height: 34px;
  width: auto;
  display: block;
}

/* 主导航（PC）：绝对定位水平居中 */
.header__nav {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  transform: translateX(-50%);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  height: 100%;
}

.nav > li {
  position: relative;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--header-h);
  padding: 0 var(--s-3);
  font-size: var(--f-base);
  color: var(--c-text-2);
  transition: color var(--tr-fast);
}

.nav__link .nav__caret {
  width: 6px;
  height: 6px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg) translateY(-1px);
  transition: transform var(--tr);
}

.nav > li:hover > .nav__link,
.nav__link.is-active {
  color: var(--c-text);
}

.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: var(--s-3);
  right: var(--s-3);
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--c-primary);
}

/* 下拉菜单（延迟显示） */
.nav__dropdown {
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  min-width: 132px;
  padding: var(--s-2);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--tr), transform var(--tr), visibility var(--tr);
  transition-delay: 0.08s;
  z-index: 50;
}

.nav > li:hover .nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__dropdown a {
  display: block;
  padding: var(--s-2) var(--s-3);
  font-size: var(--f-sm);
  color: var(--c-text-2);
  border-radius: var(--r-sm);
  transition: all var(--tr-fast);
}

.nav__dropdown a:hover,
.nav__dropdown a.is-active {
  color: var(--c-primary-hover);
  background: var(--c-primary-soft);
}

/* 搜索框：桌面端常驻显示在导航右侧，手机端通过按钮展开 */
.header__search {
  position: relative;
  flex: 0 1 340px;
  min-width: 0;
  margin-left: auto;
}

/* 移动端操作按钮：桌面端隐藏 */
.header__btns {
  display: none;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
}

.header__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  color: var(--c-text-2);
  transition: all var(--tr-fast);
}

.header__icon-btn:hover,
body.nav-open .header__nav-toggle,
body.search-open .header__search-toggle {
  color: var(--c-text);
  background: var(--c-bg-hover);
}

.header__icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.header__nav-toggle {
  flex-direction: column;
  gap: 4px;
}

.header__nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: all var(--tr-fast);
}

body.nav-open .header__nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

body.nav-open .header__nav-toggle span:nth-child(2) {
  opacity: 0;
}

body.nav-open .header__nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* 移动端面板遮罩 */
.nav-mask {
  position: fixed;
  inset: 0;
  top: var(--header-h);
  z-index: 180;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: all var(--tr);
}

body.nav-open .nav-mask,
body.search-open .nav-mask {
  opacity: 1;
  visibility: visible;
}

.search-form {
  display: flex;
  gap: var(--s-2);
}

.search-form__input {
  flex: 1;
  height: 42px;
  padding: 0 var(--s-4);
  background: var(--c-bg-hover);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  transition: border-color var(--tr);
}

.search-form__input::placeholder {
  color: var(--c-text-3);
}

.search-form__input:focus {
  border-color: var(--c-primary-line);
  background: var(--c-bg);
}

.search-form__input.is-error {
  border-color: var(--c-danger);
}

.search-form__btn {
  flex-shrink: 0;
  height: 42px;
  padding: 0 var(--s-5);
  background: var(--c-primary);
  border-radius: var(--r-md);
  color: #fff;
  font-weight: 500;
  transition: all var(--tr);
}

.search-form__btn:hover {
  background: var(--c-primary-hover);
  box-shadow: var(--shadow-primary);
}

/* --------------------------------------------------------------------------
   6. 移动端抽屉菜单
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   7. 面包屑
   -------------------------------------------------------------------------- */
.crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  font-size: var(--f-sm);
  color: var(--c-text-3);
}

.crumb li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.crumb li:not(:last-child)::after {
  content: "/";
  color: var(--c-text-3);
  opacity: 0.5;
}

.crumb a {
  color: var(--c-text-3);
  transition: color var(--tr-fast);
}

.crumb a:hover {
  color: var(--c-primary-hover);
}

.crumb .is-current {
  color: var(--c-text);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   8. Banner 轮播
   -------------------------------------------------------------------------- */
.banner {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 21 / 5;
  margin-bottom: var(--s-6);
  background: var(--c-bg-card);
}

.banner__item {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.banner__item.is-active {
  opacity: 1;
  visibility: visible;
}

.banner__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 6s ease;
}

.banner__item.is-active .banner__bg {
  transform: scale(1);
}

.banner__mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(13, 15, 20, 0.92) 0%,
    rgba(13, 15, 20, 0.62) 46%,
    rgba(13, 15, 20, 0.15) 100%
  );
}

.banner__content {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 var(--s-7);
  max-width: 64%;
}

.banner__title {
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: var(--s-3);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.banner__meta {
  font-size: var(--f-sm);
  color: var(--c-text-2);
  margin-bottom: var(--s-3);
}

.banner__desc {
  font-size: var(--f-sm);
  color: var(--c-text-3);
  margin-bottom: var(--s-5);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 560px;
}

.banner__actions {
  display: flex;
  gap: var(--s-3);
}

.banner__dots {
  position: absolute;
  right: var(--s-5);
  bottom: var(--s-4);
  display: flex;
  gap: var(--s-2);
  z-index: 5;
}

.banner__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all var(--tr);
}

.banner__dot.is-active {
  width: 22px;
  background: var(--c-primary);
}

.banner__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: rgba(13, 15, 20, 0.5);
  border: 1px solid var(--c-border);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  transition: all var(--tr);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.banner:hover .banner__arrow {
  opacity: 1;
}

.banner__arrow:hover {
  background: var(--c-primary);
  border-color: var(--c-primary);
}

.banner__arrow--prev {
  left: var(--s-4);
}

.banner__arrow--next {
  right: var(--s-4);
}

/* --------------------------------------------------------------------------
   9. 视频卡片
   -------------------------------------------------------------------------- */
.vod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: var(--s-4);
}

.vod-card {
  min-width: 0;
}

/* 封面：统一 3:4 比例，圆角 */
.vod-card__cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-bg-hover);
  transform: translateZ(0);
  transition: transform var(--tr), box-shadow var(--tr);
}

.vod-card:hover .vod-card__cover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.vod-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.vod-card:hover .vod-card__img {
  transform: scale(1.06);
}

/* 渐变遮罩（hover 显示） */
.vod-card__mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(13, 15, 20, 0.85) 0%,
    rgba(13, 15, 20, 0.25) 45%,
    rgba(13, 15, 20, 0.05) 100%
  );
  opacity: 0;
  transition: opacity var(--tr);
}

.vod-card:hover .vod-card__mask {
  opacity: 1;
}

/* 角标（备注：更新至12集 / 新 / HD） */
.vod-card__badge {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  left: auto;
  z-index: 2;
  max-width: calc(100% - var(--s-4));
  padding: 2px 8px;
  font-size: var(--f-xs);
  line-height: 1.6;
  color: #fff;
  background: #ff7a18;
  border: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 封面底部人气 */
.vod-card__hits {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 18px 8px 6px;
  font-size: var(--f-xs);
  line-height: 1;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

.vod-card__hits svg {
  width: 12px;
  height: 12px;
  fill: #ff7a18;
  flex-shrink: 0;
}

/* 悬浮播放按钮 */
.vod-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 var(--s-4);
  font-size: var(--f-sm);
  font-weight: 500;
  color: #fff;
  background: rgba(77, 140, 255, 0.9);
  border-radius: var(--r-full);
  box-shadow: 0 8px 20px rgba(77, 140, 255, 0.4);
  opacity: 0;
  transition: all var(--tr);
  white-space: nowrap;
}

.vod-card__play svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.vod-card:hover .vod-card__play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* 文字信息 */
.vod-card__info {
  padding: var(--s-3) var(--s-1) 0;
}

.vod-card__title {
  font-size: var(--f-base);
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: var(--s-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vod-card__title a {
  color: var(--c-text);
  transition: color var(--tr-fast);
}

.vod-card__title a:hover {
  color: var(--c-primary-hover);
}

.vod-card__meta {
  display: block;
  font-size: var(--f-xs);
  color: var(--c-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vod-card__meta .tag {
  padding: 1px 6px;
  font-size: var(--f-xs);
  line-height: 1.5;
  color: var(--c-text-2);
  background: var(--c-bg-hover);
  border-radius: 4px;
  transition: color var(--tr-fast);
}

.vod-card__meta .tag--hot {
  color: var(--c-primary-hover);
  background: var(--c-primary-soft);
}

/* --------------------------------------------------------------------------
   10. 列表页筛选栏
   -------------------------------------------------------------------------- */
.filter-card {
  margin-bottom: var(--s-5);
}

.filter-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  padding: var(--s-3) 0;
}

.filter-row + .filter-row {
  border-top: 1px dashed var(--c-border-light);
}

.filter-row__label {
  flex-shrink: 0;
  width: 58px;
  padding-top: 6px;
  font-size: var(--f-sm);
  color: var(--c-text-3);
}

.filter-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  flex: 1;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 var(--s-3);
  font-size: var(--f-sm);
  color: var(--c-text-2);
  background: var(--c-bg-soft);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  transition: all var(--tr-fast);
  white-space: nowrap;
}

.filter-tag:hover {
  color: var(--c-primary-hover);
  border-color: var(--c-primary-line);
  background: var(--c-primary-soft);
}

.filter-tag.is-active {
  color: #fff;
  background: var(--c-primary);
  border-color: var(--c-primary);
}

/* 排序条 */
.sort-bar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-border-light);
}

.sort-bar__label {
  font-size: var(--f-sm);
  color: var(--c-text-3);
  margin-right: var(--s-2);
}

.sort-tab {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 var(--s-4);
  font-size: var(--f-sm);
  color: var(--c-text-2);
  background: var(--c-bg-soft);
  border-radius: var(--r-sm);
  transition: all var(--tr-fast);
}

.sort-tab:hover {
  color: var(--c-primary-hover);
}

.sort-tab.is-active {
  color: var(--c-primary-hover);
  background: var(--c-primary-soft);
}

/* 已选筛选标签 */
.selected-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) 0 0;
}

.selected-tags__label {
  font-size: var(--f-sm);
  color: var(--c-text-3);
}

.selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 var(--s-2) 0 var(--s-3);
  font-size: var(--f-sm);
  color: var(--c-text);
  background: var(--c-primary-soft);
  border: 1px solid var(--c-primary-line);
  border-radius: var(--r-full);
}

.selected-tag .remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: var(--r-full);
  color: var(--c-text-3);
  transition: all var(--tr-fast);
}

.selected-tag .remove:hover {
  color: #fff;
  background: var(--c-danger);
}

/* --------------------------------------------------------------------------
   11. 分页
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: var(--s-6) 0 var(--s-4);
}

.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 var(--s-3);
  font-size: var(--f-sm);
  color: var(--c-text-2);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  transition: all var(--tr);
}

.pagination__btn:hover {
  color: var(--c-primary-hover);
  border-color: var(--c-primary-line);
  transform: translateY(-2px);
}

.pagination__btn.is-active {
  color: #fff;
  background: var(--c-primary);
  border-color: var(--c-primary);
  box-shadow: var(--shadow-primary);
}

.pagination__btn.is-disabled {
  color: var(--c-text-3);
  opacity: 0.5;
  pointer-events: none;
}

.pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: var(--c-text-3);
}

.pagination__info {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 var(--s-3);
  font-size: var(--f-sm);
  color: var(--c-text-3);
}

/* --------------------------------------------------------------------------
   12. 详情页
   -------------------------------------------------------------------------- */
.detail__main {
  display: flex;
  gap: var(--s-6);
}

.detail__poster {
  flex-shrink: 0;
  width: 240px;
}

.detail__poster .vod-card__cover {
  border: 1px solid var(--c-border);
}

.detail__poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail__info {
  flex: 1;
  min-width: 0;
}

.detail__title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--s-1);
}

.detail__subtitle {
  font-size: var(--f-sm);
  color: var(--c-text-3);
  margin-bottom: var(--s-4);
}

.detail__meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-2) var(--s-5);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--c-border-light);
  border-bottom: 1px solid var(--c-border-light);
  font-size: var(--f-sm);
  color: var(--c-text-2);
}

.detail__meta-item {
  display: flex;
  min-width: 0;
}

.detail__meta-label {
  flex-shrink: 0;
  color: var(--c-text-3);
  margin-right: var(--s-2);
}

.detail__meta-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 操作按钮区 */
.detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding: var(--s-5) 0 var(--s-3);
}

/* 标签 */
.detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding-top: var(--s-2);
}

.detail__tags .tag {
  padding: 3px 10px;
  font-size: var(--f-xs);
  color: var(--c-text-2);
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  transition: all var(--tr-fast);
}

.detail__tags .tag:hover {
  color: var(--c-primary-hover);
  border-color: var(--c-primary-line);
}

/* 剧情简介：多行省略 + 展开 */
.detail__desc {
  margin-top: var(--s-5);
}

.detail__desc-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
  font-size: var(--f-md);
  font-weight: 600;
}

.detail__desc-head::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--c-primary);
}

.detail__desc-text {
  font-size: var(--f-sm);
  line-height: 1.9;
  color: var(--c-text-2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  transition: all var(--tr);
}

.detail__desc-text.is-expanded {
  -webkit-line-clamp: unset;
}

.detail__desc-toggle {
  margin-top: var(--s-2);
  font-size: var(--f-sm);
  color: var(--c-primary-hover);
  cursor: pointer;
  transition: color var(--tr-fast);
}

.detail__desc-toggle:hover {
  color: var(--c-primary-hover);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   13. 播放源 TAB 与剧集列表
   -------------------------------------------------------------------------- */
.play-source__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}

.play-source__tab {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--s-4);
  font-size: var(--f-sm);
  color: var(--c-text-2);
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  transition: all var(--tr);
}

.play-source__tab:hover {
  color: var(--c-primary-hover);
  border-color: var(--c-primary-line);
}

.play-source__tab.is-active {
  color: #fff;
  background: var(--c-primary);
  border-color: var(--c-primary);
}

.play-source__panel {
  display: none;
}

.play-source__panel.is-active {
  display: block;
  animation: slideDown var(--tr);
}

/* 剧集网格 */
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: var(--s-2);
  max-height: 150px;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.episode-grid.is-expanded {
  max-height: 2000px;
  overflow: visible;
}

.episode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  font-size: var(--f-sm);
  color: var(--c-text-2);
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  transition: all var(--tr-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-btn:hover {
  color: var(--c-primary-hover);
  border-color: var(--c-primary-line);
  background: var(--c-primary-soft);
}

.episode-btn.is-active {
  color: #fff;
  background: var(--c-primary);
  border-color: var(--c-primary);
}

.episode-toggle {
  margin-top: var(--s-3);
  font-size: var(--f-sm);
  color: var(--c-text-3);
  cursor: pointer;
  transition: color var(--tr-fast);
}

.episode-toggle:hover {
  color: var(--c-primary-hover);
}

/* --------------------------------------------------------------------------
   14. 播放页
   -------------------------------------------------------------------------- */
.player__wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--s-4);
}

.player__wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  color: var(--c-text-3);
  font-size: var(--f-md);
}

.player__info {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding-bottom: var(--s-4);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--c-border-light);
}

.player__title {
  flex: 1;
  min-width: 0;
  font-size: var(--f-lg);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__ep {
  flex-shrink: 0;
  font-size: var(--f-sm);
  color: var(--c-primary-hover);
  background: var(--c-primary-soft);
  padding: 2px 10px;
  border-radius: var(--r-full);
}

/* 剧集横向滚动 */
.episode-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-3);
}

.episode-row__title {
  font-size: var(--f-md);
  font-weight: 600;
}

.episode-scroll {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  padding-bottom: var(--s-2);
}

.episode-scroll .episode-btn {
  flex-shrink: 0;
  min-width: 76px;
  padding: 0 var(--s-3);
}

/* 上一集 / 下一集 */
.player__nav {
  display: flex;
  gap: var(--s-2);
  flex-shrink: 0;
}

.player__nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 var(--s-3);
  font-size: var(--f-sm);
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  transition: all var(--tr);
}

.player__nav a:hover {
  color: var(--c-primary-hover);
  border-color: var(--c-primary-line);
  background: var(--c-primary-soft);
}

.player__nav a.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   15. 页脚
   -------------------------------------------------------------------------- */
.footer {
  margin-top: var(--s-7);
  padding: var(--s-6) 0 var(--s-5);
  background: var(--c-bg-soft);
  border-top: 1px solid var(--c-border-light);
}

.footer__inner {
  text-align: center;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
  font-size: var(--f-sm);
}

.footer__links a {
  color: var(--c-text-3);
  transition: color var(--tr-fast);
}

.footer__links a:hover {
  color: var(--c-primary-hover);
}

.footer__copy {
  font-size: var(--f-xs);
  color: var(--c-text-3);
  line-height: 2;
}

.footer__copy a {
  color: var(--c-text-3);
}

.footer__copy a:hover {
  color: var(--c-primary-hover);
}

/* --------------------------------------------------------------------------
   16. 评论系统（mac_comment 暗色化）
   -------------------------------------------------------------------------- */
.mac_comment {
  color: var(--c-text-2);
}

.mac_comment .clearfix::after {
  content: "";
  display: block;
  clear: both;
  visibility: hidden;
  height: 0;
}

.mac_comment .cmt_form {
  margin-bottom: var(--s-4);
}

.mac_comment .face_wrap {
  float: left;
  margin-right: var(--s-3);
}

.mac_comment .face_wrap img {
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
}

.mac_comment .input_wrap {
  position: relative;
  overflow: hidden;
}

.mac_comment .input_wrap textarea {
  width: 100%;
  height: 74px;
  padding: var(--s-3);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md) var(--r-md) 0 0;
  color: var(--c-text);
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}

.mac_comment .input_wrap textarea:focus {
  border-color: var(--c-primary-line);
}

.mac_comment .input_wrap .handle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-top: 0;
  border-radius: 0 0 var(--r-md) var(--r-md);
  padding: var(--s-2) var(--s-3);
  box-sizing: border-box;
}

.mac_comment .input_wrap .face {
  cursor: pointer;
  position: relative;
  width: 30px;
  height: 30px;
  z-index: 2;
}

.mac_comment .icon-face {
  display: block;
  width: 24px;
  height: 24px;
  background: url("../images/gb.png") center / contain no-repeat;
  opacity: 0.7;
}

.mac_comment .face-box {
  display: none;
  position: absolute;
  bottom: 40px;
  left: 0;
  width: 300px;
  padding: var(--s-2);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 3;
}

.mac_comment .face-box img {
  width: 26px;
  height: 26px;
  margin: var(--s-1);
  cursor: pointer;
  border-radius: 4px;
}

.mac_comment .remaining-w {
  font-size: var(--f-xs);
  color: var(--c-text-3);
}

.mac_comment .smt_wrap {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-3);
  font-size: var(--f-sm);
  color: var(--c-text-2);
}

.mac_comment .smt_wrap .total {
  font-size: var(--f-md);
  font-weight: 600;
  color: var(--c-text);
}

.mac_comment .smt {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.mac_comment .smt .cmt_post {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 var(--s-5);
  background: var(--c-primary);
  border-radius: var(--r-sm);
  color: #fff;
  font-size: var(--f-sm);
  cursor: pointer;
  transition: all var(--tr);
}

.mac_comment .smt .cmt_post:hover {
  background: var(--c-primary-hover);
}

.mac_comment .smt .cmt_text {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 0 var(--s-2);
  height: 34px;
  line-height: 34px;
  color: var(--c-text-2);
}

.mac_comment .smt .cmt_verify {
  height: 34px;
}

.mac_comment .sort_wrap {
  display: flex;
  gap: var(--s-5);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--c-border);
  font-size: var(--f-sm);
}

.mac_comment .sort_wrap a {
  color: var(--c-text-3);
  transition: color var(--tr-fast);
}

.mac_comment .sort_wrap a:hover {
  color: var(--c-primary-hover);
}

.mac_comment .sort_wrap .current {
  color: var(--c-primary-hover);
  font-weight: 600;
}

.mac_comment .cmt_item {
  padding: var(--s-4) 0;
  border-bottom: 1px dashed var(--c-border);
  color: var(--c-text-3);
}

.mac_comment .cmt_wrap .item_con .cmt_item {
  border-bottom: 0;
}

.mac_comment .item_con {
  min-height: 44px;
}

.mac_comment .item_con p.top {
  margin-bottom: var(--s-2);
  font-size: var(--f-sm);
}

.mac_comment .item_con a {
  color: var(--c-text-2);
}

.mac_comment .item_con .name {
  color: var(--c-primary-hover);
  margin-right: var(--s-2);
}

.mac_comment .item_con .con {
  color: var(--c-text-2);
  line-height: 1.8;
  margin-top: var(--s-2);
  word-break: break-word;
}

.mac_comment .item_con .bottom {
  margin-top: var(--s-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  font-size: var(--f-xs);
}

.mac_comment .item_con .bottom li {
  display: inline-flex;
  align-items: center;
}

.mac_comment .item_con .bottom .reply {
  color: var(--c-text-3);
}

.mac_comment .inner {
  padding: var(--s-3);
  margin: var(--s-3) 0 0 var(--s-5);
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}

.mac_comment .mid_cmt_item {
  margin-top: 0;
}

.mac_comment .pages {
  margin-top: var(--s-4);
}

.mac_comment .click-ding-gw a {
  color: var(--c-warn);
}

.mac_comment .click-cai-gw a {
  color: var(--c-text-3);
}

/* 评论区头部（由 CMS 输出） */
.mac_comment .comment_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}

.mac_comment .comment_head h3 {
  font-size: var(--f-md);
  color: var(--c-text);
}

/* --------------------------------------------------------------------------
   17. 通用小部件
   -------------------------------------------------------------------------- */
/* 回到顶部 */
.backtop {
  position: fixed;
  right: var(--s-5);
  bottom: var(--s-5);
  z-index: 90;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-2);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--tr);
}

.backtop.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.backtop:hover {
  color: var(--c-primary-hover);
  border-color: var(--c-primary-line);
}

.backtop svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 空状态 */
.empty {
  padding: var(--s-7) 0;
  text-align: center;
  color: var(--c-text-3);
  font-size: var(--f-md);
}

/* 友情链接 */
.friend-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  padding: var(--s-2) 0;
}

.friend-link {
  font-size: var(--f-sm);
  color: var(--c-text-3);
  transition: color var(--tr-fast);
}

.friend-link:hover {
  color: var(--c-primary-hover);
}

/* --------------------------------------------------------------------------
   18. 响应式适配
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .banner {
    aspect-ratio: 16 / 9;
  }

  .banner__content {
    max-width: 78%;
    padding: 0 var(--s-5);
  }

  .detail__main {
    flex-direction: column;
  }

  .detail__poster {
    width: 100%;
    max-width: 200px;
  }

  .detail__poster .vod-card__cover {
    width: 100%;
  }
}

@media (max-width: 768px) {
  /* 导航与搜索收起为按钮，点击后从头部下方展开面板 */
  .header__nav,
  .header__search {
    display: none;
  }

  .header__btns {
    display: flex;
  }

  .header__inner {
    gap: var(--s-3);
    justify-content: space-between;
  }

  /* 展开面板 */
  body.nav-open .header__nav,
  body.search-open .header__search {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 190;
    display: block;
    margin: 0;
    height: auto;
    transform: none;
    background: var(--c-bg-soft);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-lg);
  }

  body.search-open .header__search {
    padding: var(--s-3);
  }

  body.search-open .header__search .search-form {
    width: 100%;
  }

  /* 导航面板：纵向排列，子分类直接展开 */
  body.nav-open .header__nav .nav {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    gap: var(--s-1);
    padding: var(--s-3);
  }

  body.nav-open .header__nav .nav > li {
    display: block;
  }

  body.nav-open .nav__link {
    height: auto;
    padding: var(--s-3);
  }

  body.nav-open .nav__caret {
    display: none;
  }

  body.nav-open .nav__dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0 0 var(--s-2);
    transition: none;
  }

  /* 卡片列表：移动端一排两个，封面在上、文字在下 */
  .vod-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
  }

  .vod-grid .vod-card {
    display: block;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .vod-grid .vod-card__cover {
    width: 100%;
    aspect-ratio: 3 / 4;
  }

  .vod-grid .vod-card:hover .vod-card__cover {
    transform: none;
    box-shadow: none;
  }

  .vod-grid .vod-card__info {
    padding: 8px 2px 0;
  }

  .vod-grid .vod-card__title {
    font-size: var(--f-sm);
    font-weight: 600;
    margin-bottom: 2px;
  }

  .vod-grid .vod-card__play {
    display: none;
  }

  .banner {
    aspect-ratio: 16 / 10;
    border-radius: var(--r-md);
    margin-bottom: var(--s-5);
  }

  .banner__desc {
    display: none;
  }

  .banner__content {
    max-width: 100%;
    padding: 0 var(--s-4);
  }

  .banner__title {
    font-size: 1.2rem;
    -webkit-line-clamp: 2;
    margin-bottom: var(--s-2);
  }

  .banner__meta {
    display: none;
  }

  .banner__actions .btn {
    height: 36px;
    padding: 0 var(--s-4);
    font-size: var(--f-sm);
  }

  .banner__dots {
    right: var(--s-3);
    bottom: var(--s-3);
  }

  .banner__arrow {
    display: none;
  }

  .section {
    margin-bottom: var(--s-5);
  }

  .panel {
    padding: var(--s-4);
  }

  .filter-row {
    flex-direction: column;
    gap: var(--s-2);
  }

  .filter-row__label {
    width: auto;
    padding-top: 0;
  }

  .sort-bar {
    flex-wrap: wrap;
  }

  .detail__poster {
    max-width: 100%;
  }

  .detail__poster .vod-card__cover {
    width: 140px;
  }

  .detail__meta {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-2) var(--s-4);
  }

  .player__info {
    flex-wrap: wrap;
  }

  .player__title {
    width: 100%;
  }

  .player__nav {
    width: 100%;
  }

  .backtop {
    right: var(--s-4);
    bottom: var(--s-4);
  }
}

@media (max-width: 480px) {
  .page {
    padding-top: calc(var(--header-h) + var(--s-3));
  }

  .crumb {
    margin-bottom: var(--s-3);
  }

  .episode-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  }

  .detail__actions .btn {
    height: 38px;
    padding: 0 var(--s-4);
    font-size: var(--f-sm);
  }

  .search-form__select {
    width: 80px;
  }
}

@media (hover: none) {
  .vod-card:hover .vod-card__cover {
    transform: none;
    box-shadow: none;
  }
  .vod-card:hover .vod-card__img {
    transform: none;
  }
  .vod-card:hover .vod-card__play,
  .vod-card:hover .vod-card__mask {
    opacity: 0;
  }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
