:root {
  /* 高光叠色：hover 底、细边框、滚动条都用它。
     深色下是白色，浅色下翻转成黑色，一处改动全局跟着变。 */
  --hl: 255, 255, 255;

  /* 底色：中性偏冷，拉开与点缀色的对比 */
  --bg: #0a0b0e;
  --bg-soft: #101216;
  --card: #15181d;
  --card-hover: #1c2026;
  --line: #23262c;
  --line-strong: #31353d;
  --text: #eceef1;
  --muted: #878d97;

  /* 点缀色：低饱和暗金。只用于强调（标签/当前项/链接），不做大面积填充 */
  --brand: #c9a96a;
  --brand-light: #e2c894;
  --brand-dark: #a98a4f;
  --brand-soft: rgba(201, 169, 106, 0.12);

  /* 主操作：近白填充 + 深色文字，暗色界面里最高级的对比方案 */
  --solid: #e9eaed;
  --solid-hover: #ffffff;
  --solid-active: #d6d8dc;
  --solid-text: #0b0c0f;

  --accent: #e5677a;
  --radius: 12px;
  --max: 1240px;
  /* 顶栏底色：半透明 + 毛玻璃，滚动时压在内容上方 */
  --hdr-bg: rgba(10, 12, 17, 0.92);
  /* 阴影强度：浅色底上同样的黑影会显得很脏，按倍数压下去 */
  --shadow-k: 1;
}

/* 白天模式：只覆盖颜色变量，布局与尺寸全部沿用。
   --hl 翻转成黑色，28 处 rgba(var(--hl), …) 的 hover / 边框会自动跟着变。
   点缀色在浅底上压深一档，保证文字对比度。 */
html[data-theme="light"] {
  --hl: 0, 0, 0;

  --bg: #f4f5f7;
  --bg-soft: #e9ebef;
  --card: #ffffff;
  --card-hover: #f2f4f7;
  --line: #e1e4e9;
  --line-strong: #cbd0d8;
  --text: #1b1e24;
  --muted: #6b7280;

  --brand: #9a7a3a;
  --brand-light: #b8934d;
  --brand-dark: #7d612c;
  --brand-soft: rgba(154, 122, 58, 0.12);

  --solid: #1b1e24;
  --solid-hover: #2c313a;
  --solid-active: #0f1115;
  --solid-text: #ffffff;

  --accent: #cf4a60;
  --hdr-bg: rgba(255, 255, 255, 0.92);
  --shadow-k: .3;
}

* { box-sizing: border-box; }

/* 移动端点击时浏览器会叠一层高亮（默认是灰/白方块），与深色界面冲突。
   这里彻底关掉系统高亮，交互反馈全部由 :hover / :active 自己控制，
   避免出现「点一下闪一块白」或「留一圈亮框」的廉价感。 */
* { -webkit-tap-highlight-color: transparent; }

/* 鼠标/触摸点击不显示聚焦环，只有键盘 Tab 导航才显示 ——
   避免「点一下按钮就留一圈框」的廉价感，同时保留无障碍支持 */
a:focus,
button:focus,
.btn:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
  outline: none;
}
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
  border-radius: 4px;
}
/* 输入框保留可见的聚焦边框（否则不知道当前在哪输入） */
input:focus-visible,
textarea:focus-visible {
  outline: none;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 全站滚动条：始终占位 + 深色细条 ----------
   scrollbar-gutter: stable 让滚动条槽位常驻，
   页面高度变化（如筛选、展开）时内容不再左右晃动 */
html {
  scrollbar-gutter: stable;      /* 槽位常驻，页面不左右晃 */
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
html::-webkit-scrollbar { width: 12px; height: 12px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
  /* 用主题变量：border 与页面同色，做出「悬浮细条」的观感 */
  background: var(--line);
  border-radius: 6px;
  border: 3px solid var(--bg);
  background-clip: padding-box;
  transition: background .2s;
}
html::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
  background-clip: padding-box;
}
html::-webkit-scrollbar-corner { background: transparent; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- 头部 ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: var(--hdr-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.hdr-in { display: flex; align-items: center; gap: 24px; height: 62px; min-width: 0; }
.logo {
  font-size: 19px; font-weight: 500; letter-spacing: .5px; white-space: nowrap;
  display: inline-flex; align-items: center; flex: none;
}
/* 自定义 Logo：限制高度，宽度自适应，不撑破头部 */
.logo-img {
  height: 32px; width: auto; max-width: 180px;
  object-fit: contain; display: block;
}
/* 双 Logo：白天/黑夜各一张，靠 data-theme 切换，不需要 JS 参与 */
.logo-img--light { display: none; }
html[data-theme="light"] .logo-img--dark { display: none; }
html[data-theme="light"] .logo-img--light { display: block; }
.logo span { color: var(--brand); }
.nav { display: flex; gap: 4px; flex: 1; overflow: hidden; }
.nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--muted);
  font-size: 14px; white-space: nowrap; transition: .15s;
}
.nav a:hover { color: var(--text); background: var(--bg-soft); }
.nav a.on { color: var(--brand); background: var(--brand-soft); }
.hdr-right { display: flex; align-items: center; gap: 12px; }

.search-box {
  display: flex; align-items: center; gap: 2px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 4px 0 12px;
  min-width: 0;
}
.search-box input {
  background: none; border: 0; outline: none; color: var(--text);
  width: 170px; min-width: 0; height: 34px;
  text-overflow: ellipsis;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  /* 图标按钮：发丝描边 + 金色图标，与扁平体系一致 */
  background: transparent;
  border: 1px solid rgba(201, 169, 106, .32);
  color: var(--brand-light);
  width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center;
  border-radius: 999px; cursor: pointer; flex: none;
  transition: background .16s, border-color .16s;
}
.search-box button:hover { background: var(--brand-soft); border-color: rgba(201, 169, 106, .5); }
.search-box button:active { transform: scale(.94); }
.search-box button svg { display: block; }

.user-link { display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.user-link:hover { color: var(--text); }
.avatar {
  /* 已登录：程序化生成的动漫头像（SVG 图片） */
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  object-fit: cover; display: block;
  background: var(--card-hover);
  border: 1px solid var(--line-strong);
  transition: border-color .16s, transform .16s;
}
.user-link:hover .avatar { border-color: rgba(var(--hl), .22); transform: scale(1.04); }
/* 未登录：中性灰底，比原来稍亮一档，保证图标看得清 */
.avatar-guest {
  /* 游客图标是 span（不是 img），而 .avatar 现在是 display:block，
     必须单独恢复 grid 居中，否则 SVG 会贴在圆框顶部 */
  display: grid; place-items: center;
  background: var(--card-hover);
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.user-link.is-guest:hover .avatar-guest { color: var(--text); border-color: rgba(var(--hl), .22); }
.user-link.is-guest .avatar-guest svg { display: block; width: 15px; height: 15px; }
.uname { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 用户入口与下拉菜单 ---------- */
.user-wrap { position: relative; }
/* 按钮形态的入口：去掉默认按钮样式，加按压反馈
   注意：不用负 margin —— 负 margin 会让 .user-wrap 比按钮窄，
   导致菜单 right:0 对齐的是 wrap 而不是按钮，视觉上偏左 */
.user-btn {
  background: none; border: 0; padding: 4px 6px;
  border-radius: 999px; font-family: inherit; font-size: inherit;
  cursor: pointer;
  transition: background .16s;
}
.user-btn:hover { background: rgba(var(--hl), .06); }
.user-btn:active { transform: scale(.94); }
.user-btn[aria-expanded="true"] { background: rgba(var(--hl), .08); }

.user-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  width: 208px; padding: 8px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, calc(.5 * var(--shadow-k)));
  animation: umIn .16s ease;
}
@keyframes umIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.um-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 12px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.um-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.um-info b {
  font-size: 13.5px; font-weight: 500; color: var(--text);
  max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.um-info span { font-size: 11.5px; color: var(--muted); }
.user-menu a {
  display: block; padding: 8px 10px; border-radius: 6px;
  color: var(--muted); font-size: 13.5px;
  transition: background .14s, color .14s;
}
.user-menu a:hover { background: rgba(var(--hl), .06); color: var(--text); }
.um-line { height: 1px; background: var(--line); margin: 6px 4px; }
.user-menu a.um-out { color: #f08a99; }
.user-menu a.um-out:hover { background: rgba(229, 103, 122, .12); color: #ff9aa8; }

/* ---------- 按钮体系（扁平 / 发丝描边）----------
   主按钮：近白实心 + 深色文字，靠对比而非光影取胜
   次按钮：完全透明 + 1px 发丝描边，hover 才淡淡铺一层
   全程无渐变、无发光，靠留白和描边精度表现质感 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 18px; border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-size: 14px; font-weight: 450;
  letter-spacing: .2px;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s;
}
/* 触碰反馈只用「底色微亮 + 边框提亮一档」，
   不换成高对比的亮边框，避免在深色界面上显得突兀 */
.btn:hover {
  background: rgba(var(--hl), .055);
  border-color: rgba(var(--hl), .16);
}
.btn:active {
  background: rgba(var(--hl), .09);
  border-color: rgba(var(--hl), .22);
}

/* 聚焦环：改成与按钮相近的中性色，替代浏览器默认的深色描边 */
.btn:focus { outline: none; }
.btn:focus-visible {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
}
.btn-primary:focus-visible {
  outline-color: rgba(233, 234, 237, .45);   /* 与近白按钮同色系 */
}

.btn-primary {
  background: var(--solid);
  border-color: var(--solid);
  color: var(--solid-text);
  font-weight: 550;
}
.btn-primary:hover { background: var(--solid-hover); border-color: var(--solid-hover); }
.btn-primary:active { background: var(--solid-active); border-color: var(--solid-active); }

.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 5px; }
.btn-danger {
  background: transparent;
  border-color: rgba(229, 103, 122, .38);
  color: #f08a99;
}
.btn-danger:hover { background: rgba(229, 103, 122, .1); border-color: rgba(229, 103, 122, .6); }

/* ---------- 主区 ---------- */
main.wrap { padding-top: 44px; padding-bottom: 64px; }
main { min-height: 60vh; }

/* ---------- 首页轮播（推荐播放）---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 0; margin-bottom: 34px;
}
.hero-track { position: relative; }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transition: opacity .5s ease;
}
.hero-slide.on { position: relative; opacity: 1; visibility: visible; }
/* 只有一张时不需要过渡，直接显示 */
.hero-track:only-child .hero-slide,
.hero-slide:only-child { transition: none; }

/* 轮播可拖拽：手型光标 + 禁止拖动时选中文字/图片 */
.hero-track {
  cursor: grab;
  touch-action: pan-y;        /* 允许纵向滚动页面，横向交给我们处理 */
  -webkit-user-select: none; user-select: none;
}
.hero-track:active { cursor: grabbing; }
.hero-track img { -webkit-user-drag: none; user-select: none; pointer-events: none; }

.hero-slide-in {
  display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 30px;
  /* 顶部对齐而非居中：内容从固定顶线开始排，切换时不会整体上下浮动 */
  align-items: stretch; padding: 30px;
  /* 整个轮播固定 350px：内容差异由简介区吸收，
     片名/元信息/按钮位置都稳定 */
  height: 350px;
}
/* 左列用普通块流：
   不能用 flex —— flex 子项会被 blockify，display:-webkit-box 变成 flow-root，
   -webkit-line-clamp 就失效了（简介会露出第 4 行半截） */
.hero-slide-in > div:first-child {
  display: block; min-width: 0;
}
.hero-tag {
  display: inline-block;
  font-size: 12px; font-weight: 500; letter-spacing: .3px;
  color: var(--brand-light);
  background: var(--brand-soft);
  border: 1px solid rgba(201, 169, 106, .26);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 14px;
}
.hero h1 {
  font-size: 34px; line-height: 1.45; letter-spacing: .5px;
  margin: 0 0 10px;
  /* 片名固定单行 + 省略号：永不换行，高度恒定 49px，
     下方元信息/简介位置因此绝对稳定 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 元信息：固定一行高度，不换行 */
.hero-meta {
  display: flex; align-items: center; gap: 14px;
  height: 22px; margin: 0 0 18px;
  color: var(--muted); font-size: 13px;
  white-space: nowrap; overflow: hidden;
}
.hero-meta b { color: #ffc857; font-weight: 500; }
/* 简介：固定占 3 行高度。这是消除切换时高度跳动的关键 ——
   短简介留空、长简介截断，高度恒定，下方按钮位置就不动 */
.hero p {
  /* 简介固定占 3 行：短简介留空、长简介省略号截断，
     保证下方按钮位置恒定（min-height 与 clamp 可共存） */
  color: var(--muted);
  margin: 0 0 20px; max-width: 520px;
  font-size: 14px; line-height: 1.75;
  /* 高度必须精确等于 clamp 的 3 行，多一点点就会露出第 4 行的半截 */
  height: 5.25em;                  /* 3 × 1.75 */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 按钮组：跟在简介后，块流中自然定位 */
.hero-slide-in > div:first-child > .detail-actions { margin: 0; }
.hero-poster {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 3 / 4; align-self: center;
}
.hero-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 圆点指示器：视觉上仍是 7px 小圆点，但热区放大到 26x26，
   鼠标靠近就能切换，不用精确点中 */
.hero-dots {
  position: absolute; left: 21px; bottom: 6px; z-index: 3;
  display: flex; align-items: center;
}
.hero-dot {
  position: relative; width: 26px; height: 26px; padding: 0; border: 0;
  background: none; cursor: pointer; display: grid; place-items: center;
}
.hero-dot::after {
  content: ''; width: 7px; height: 7px; border-radius: 999px;
  background: rgba(var(--hl), .28);
  transition: all .25s ease;
}
.hero-dot:hover::after { background: rgba(var(--hl), .6); }
.hero-dot.on::after {
  width: 20px;
  background: var(--brand);
}

/* 移动端：海报显示在左侧，文字在右，整体高度固定不跳动 */
@media (max-width: 900px) {
  .hero { padding: 0; }
  /* 文字列在左、海报在右：标签「推荐」自然贴左侧 */
  .hero-slide-in {
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 16px; padding: 18px; height: 268px;
    align-items: stretch;
  }
  .hero-poster {
    display: block;
    width: 120px; height: 170px;
    align-self: center;
  }
  .hero-tag { font-size: 11px; padding: 2px 8px; margin-bottom: 8px; }
  .hero h1 { font-size: 22px; line-height: 1.35; margin-bottom: 8px; }
  .hero-meta { font-size: 12px; gap: 8px; height: 18px; margin-bottom: 10px; }
  .hero p { font-size: 13px; line-height: 1.7; margin-bottom: 12px; height: 5.1em; }
  .hero-slide-in > div:first-child > .detail-actions { margin: 0; }
  .hero .btn { padding: 6px 14px; font-size: 12.5px; }
  .hero-dots { left: 16px; bottom: 8px; }
}
@media (max-width: 640px) {
  .hero { padding: 0; }
  .hero-slide-in {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 12px; padding: 16px; height: 250px;
  }
  .hero-poster { width: 96px; height: 136px; }
  .hero h1 { font-size: 19px; }
  .hero-meta { font-size: 11.5px; gap: 6px; }
  .hero p { font-size: 12.5px; line-height: 1.65; height: 4.95em; }
  .hero .btn { padding: 5px 11px; font-size: 12px; }
  .hero-dots { left: 14px; bottom: 6px; }
}


/* ---------- 区块容器与网格 ---------- */
.sec { margin-bottom: 38px; }
.sec:last-child { margin-bottom: 0; }

.sec-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.sec-hd h2 {
  display: flex; align-items: center; gap: 9px;
  font-size: 17px; font-weight: 500; margin: 0; line-height: 1.3;
}
.sec-hd h2 i {
  width: 3px; height: 15px; border-radius: 2px; flex: none;
  background: var(--brand);
}
.sec-hd a { color: var(--muted); font-size: 12.5px; }
.sec-hd a:hover { color: var(--brand); }

.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }

/* ---------- 播放页解析线路 ---------- */
.dm-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px;
}
.parse-btn { cursor: pointer; }

/* ---------- 卡片 ---------- */
.card { display: block; transition: transform .18s; }
.card:hover { transform: translateY(-3px); }
.card-pic {
  position: relative; padding-bottom: 133.333%; border-radius: 10px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
}
.card-pic img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top; display: block;
}
img { min-width: 0; }
.card-note {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 7px;
  font-size: 12px; color: #fff; text-align: right;
  background: linear-gradient(transparent, rgba(0, 0, 0, .82));
}
.card-body { padding: 9px 2px 0; }
.card-body h3 { font-size: 13.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card:hover h3 { color: var(--brand); }
.card-body p { margin: 2px 0 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 筛选 ---------- */
.filter {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 18px; margin-bottom: 22px;
}
.filter-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filter-row:last-child { border-bottom: 0; }
.filter-row > span { color: var(--muted); font-size: 13px; min-width: 46px; }
.filter-row a { padding: 3px 11px; border-radius: 6px; font-size: 13px; color: var(--muted); }
.filter-row a:hover { color: var(--text); background: var(--card); }
.filter-row a.on { color: var(--brand); background: var(--brand-soft); }

/* ---------- 分页 ---------- */
.pager { display: flex; justify-content: center; gap: 8px; margin: 36px 0 0; }
.pager a, .pager span {
  /* 配色对齐「查看详情」（.btn）：描边 var(--line-strong)、文字 var(--text)。
     圆角保持分页原有的 8px，不改样式。 */
  min-width: 36px; height: 36px; padding: 0 12px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: transparent;
  color: var(--text); font-size: 13px;
  transition: background .16s, border-color .16s, color .16s;
}
.pager a:hover {
  border-color: rgba(var(--hl), .16);
  background: rgba(var(--hl), .055);
}
.pager a:active { background: rgba(var(--hl), .09); }
/* 不可点的序号（如省略号）弱化，但仍沿用同一描边 */
.pager span { color: var(--muted); }
/* 当前页：颜色与「查看详情」一致（透明底 + 深灰描边 + 亮白文字），
   只靠描边更亮 + 加粗来区分，不再用金色填充 */
.pager .on {
  background: transparent;
  border-color: rgba(var(--hl), .34);
  color: var(--text);
  font-weight: 600;
}

/* ---------- 详情 ---------- */
.detail-top {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-areas: "poster main";
  gap: 22px 32px;
  align-items: start;
  margin-bottom: 34px;
}
/* 右列：信息 + 简介纵向排列，简介紧跟按钮，不会被海报高度撑开 */
.detail-main {
  grid-area: main;
  display: flex; flex-direction: column;
  row-gap: 22px; min-width: 0;
}
.detail-poster { grid-area: poster; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 3/4; background: var(--bg-soft); }
.detail-info { grid-area: info; min-width: 0; }
.detail-desc { grid-area: desc; }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info h1 { font-size: 28px; margin-bottom: 6px; }

/* 完结/更新状态：统一显示在剧名后面（桌面、手机一致），原独立行隐藏 */
.title-remarks {
  display: inline-block;
  margin-left: 10px; padding: 3px 9px;
  font-size: 12.5px; font-weight: 500; line-height: 1.4;
  color: var(--brand-light);
  background: var(--brand-soft);
  border: 1px solid rgba(201, 169, 106, .26);
  border-radius: 5px; vertical-align: 3px;
  white-space: nowrap;
}
.detail-sub { display: none; color: var(--muted); }
/* 主演行：单行显示，超出省略（桌面手机一致） */
.meta-actor {
  flex: 1 1 100%; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.detail-meta b { color: var(--text); font-weight: 400; }
.detail-actions { display: flex; gap: 12px; margin-bottom: 0; }
.detail-desc { color: var(--muted); line-height: 1.85; max-width: 820px; }
.detail-desc p { margin: 0 0 10px; }

/* 简介正文：默认只显示 2 行，超出显示省略号。
   white-space: pre-wrap 保留简介里的换行 —— 简介现在是纯文本转义输出
   （以前是 raw HTML），不加这条的话源站简介里的换行会被浏览器合并成空格。 */
.desc-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
.desc-body.open {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
/* 展开/收起按钮 */
.desc-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; padding: 0;
  background: none; border: 0; cursor: pointer;
  color: var(--brand); font-size: 13px; font-family: inherit;
}
.desc-toggle:hover { opacity: .8; }
.desc-toggle[hidden] { display: none; }
.desc-arrow {
  width: 6px; height: 6px; flex: none;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform .2s ease;
}
.desc-toggle.open .desc-arrow { transform: rotate(-135deg) translate(-1px, -1px); }
/* 简介标题：与全站 .sec-hd h2 的小竖条风格保持一致 */
.desc-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 500; color: var(--text);
  margin: 0 0 10px; line-height: 1.4;
}
.desc-title::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px;
  background: var(--brand); flex: none;
}

.panel { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 24px; }
.panel h2 { font-size: 16px; margin-bottom: 14px; }

.lines { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.lines a, .lines span { padding: 6px 14px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.lines a:hover { color: var(--text); border-color: rgba(var(--hl), .18); }
.lines a.on { color: var(--brand-light); border-color: var(--brand); }

.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; max-height: 320px; overflow-y: auto; }
.eps a {
  padding: 8px 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eps a:hover { color: var(--text); border-color: rgba(var(--hl), .18); }
.eps a.on { background: var(--brand); border-color: var(--brand); color: var(--solid-text); font-weight: 600; }

/* ---------- 播放器 ---------- */
.player-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--line); }
.player-wrap > video, .player-wrap > iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-tip { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }

/* 手机端播放器精简。窄屏下这些要么没意义、要么把工具栏挤得没地方：
   - 网页全屏：手机「全屏」本来就是铺满窗口，和网页全屏一样，留一个就够
   - 音量：手机用物理音量键，网页音量条白占 46px
   - 画中画：手机系统自带小窗，网页 PiP 大多不支持
   - .apd-emitter 弹幕输入框 + 发送按钮：手机打字费劲，还占满一整行
   - .apd-style 颜色/模式选择：手机上点不准
   保留：播放/暂停、时间、设置（含弹幕开关）、全屏，以及弹幕开关图标。 */
@media (max-width: 1000px) {
  .art-control-fullscreenWeb,
  .art-control-volume,
  .art-control-pip,
  .apd-emitter,
  .apd-style { display: none !important; }

  .art-controls-center .artplayer-plugin-danmuku {
    justify-content: flex-end;
    gap: 16px;
  }

  /* 弹幕配置面板默认靠 :hover 显示，手机没有 hover。
     JS 点图标时 toggle .apd-open，靠这个 class 让面板持续显示。

     不要改定位：插件原本是
       .apd-config-panel { position:absolute; bottom:24px; left:0; width:320px }
     也就是面板从图标往上伸（bottom 定位），这已经是朝上弹出。
     之前试过 top:0 + translateY(-100%)，会把它推出播放器边界
     （.player-wrap 是 overflow:hidden），面板直接被裁掉看不见。
     这里只覆盖可见性和宽度：320px 在 390px 宽的手机上会溢出，
     改成按容器宽度收窄。 */
  .apd-config.apd-open .apd-config-panel {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .apd-config-panel {
    width: min(320px, calc(100vw - 32px)) !important;
  }
}


/* ---------- 表单页 ---------- */
.auth { max-width: 400px; margin: 40px auto; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 16px; padding: 34px; }
.auth h1 { font-size: 22px; margin-bottom: 6px; }
.auth .sub { color: var(--muted); margin-bottom: 24px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; height: 40px; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 0 14px; color: var(--text); outline: none;
}
.field input:focus { border-color: var(--brand); }
.auth .btn { width: 100%; margin-top: 8px; }
.auth-tip { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }
.auth-tip a { color: var(--brand); }
.alert { background: rgba(255, 93, 115, .12); border: 1px solid rgba(255, 93, 115, .35); color: #ff9aa8; padding: 9px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ---------- 用户中心 ---------- */
.uc-head {
  display: flex; align-items: center; gap: 16px; padding: 22px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 20px;
}
/* 大头像：与顶栏同一个生成头像，只是尺寸更大 */
.uc-ava {
  width: 56px; height: 56px; flex: none; border-radius: 50%;
  object-fit: cover; display: block;
  background: var(--card-hover);
  border: 1px solid var(--line-strong);
}
.uc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.uc-tabs a {
  padding: 10px 18px; color: var(--muted); font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: color .16s, border-color .16s;
}
.uc-tabs a:hover { color: var(--text); }
.uc-tabs a.on { color: var(--brand-light); border-color: var(--brand); }

/* 用户中心工具条 */
.uc-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.uc-count { color: var(--muted); font-size: 13px; }

/* 收藏卡片上的「取消收藏」：悬停才显现，避免干扰浏览 */
.fav-cell { position: relative; }
.fav-remove {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 26px; height: 26px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%; cursor: pointer;
  background: rgba(10, 11, 14, .72);
  border: 1px solid rgba(var(--hl), .18);
  color: #fff;
  opacity: 0; transform: scale(.9);
  transition: opacity .16s, transform .16s, background .16s;
}
.fav-cell:hover .fav-remove,
.fav-remove:focus-visible { opacity: 1; transform: scale(1); }
.fav-remove:hover { background: rgba(229, 103, 122, .9); border-color: transparent; }
/* 触屏设备没有 hover，直接常显 */
@media (hover: none) {
  .fav-remove { opacity: 1; transform: none; }
}

.hist-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hist-pic { width: 64px; height: 86px; border-radius: 8px; overflow: hidden; flex: none; background: var(--card); }
.hist-pic img { width: 100%; height: 100%; object-fit: cover; }
.hist-body { flex: 1; min-width: 0; }
.hist-body h3 { font-size: 14px; font-weight: 400; margin-bottom: 4px; }
.hist-body p { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; max-width: 260px; }
.bar i { display: block; height: 100%; background: var(--brand); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--muted); padding: 70px 0; }
.empty svg { opacity: .35; margin-bottom: 12px; }

/* ---------- 页脚 ---------- */
.ftr { border-top: 1px solid var(--line); padding: 30px 0; color: var(--muted); font-size: 13px; }
.ftr-in { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ftr a { color: var(--muted); }
.ftr a:hover { color: var(--brand); }
.notice { background: rgba(255, 200, 87, .07); border: 1px solid rgba(255, 200, 87, .18); color: #d9b06a; border-radius: 10px; padding: 10px 16px; font-size: 13px; margin-bottom: 24px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nav { display: none; }
  .detail-top { grid-template-columns: 150px minmax(0, 1fr); gap: 18px 22px; }
  .detail-info h1 { font-size: 22px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  main.wrap { padding-top: 26px; padding-bottom: 44px; }
  .grid, .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .search-box { flex: 1; min-width: 0; }
  .search-box input { width: 100%; }
  .detail-top { grid-template-columns: 110px minmax(0, 1fr); gap: 14px 18px; }
  .player-wrap { border-radius: 8px; }
}

/* 超小屏（320~360）海报再缩一档，避免文字列太窄 */
@media (max-width: 380px) {
  .hero-slide-in { grid-template-columns: minmax(0, 1fr) 78px; gap: 10px; padding: 14px; }
  .hero-poster { width: 78px; height: 110px; }
  .hero h1 { font-size: 16px; }
  .hero p { font-size: 12px; line-height: 1.6; height: 4.8em; }
}

@media (max-width: 480px) {
  .logo { font-size: 16px; }
  .logo-img { height: 28px; max-width: 140px; }
  .hdr-in { gap: 12px; }
  .user-link .uname { display: none; }
  /* 小屏文字继续收窄，避免片名把海报挤掉 */
  .hero h1 { font-size: 17px; }
  .hero .btn { padding: 5px 10px; font-size: 11.5px; }
  .hero-meta { font-size: 11px; gap: 5px; }
  /* 手机端保持「左封面 + 右信息」，简介在两列下方通栏，
     不堆成单列（单列会让封面独占一行、片名孤零零落在下面） */
  .detail-top {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas:
      "poster info"
      "desc   desc";
    gap: 12px 14px;
  }
  /* 手机上把 main 拆平，让简介能横跨两列 */
  .detail-main { display: contents; }
  .detail-info { grid-area: info; }
  .detail-desc { grid-area: desc; }
  .detail-info h1 { font-size: 17px; line-height: 1.35; }
  .detail-meta { font-size: 11.5px; gap: 6px 14px; margin-bottom: 12px; }
  .title-remarks { margin-left: 8px; padding: 2px 7px; font-size: 11px; vertical-align: 2px; }
  .detail-actions .btn { padding: 6px 12px; font-size: 12.5px; }
}

/* 超小屏详情页：封面再缩一档，给文字更多宽度 */
@media (max-width: 380px) {
  .detail-top {
    grid-template-columns: 82px minmax(0, 1fr);
    grid-template-areas:
      "poster info"
      "desc   desc";
    gap: 10px 12px;
  }
  .detail-main { display: contents; }
  .detail-info { grid-area: info; }
  .detail-desc { grid-area: desc; }
  .detail-info h1 { font-size: 16px; }
  .title-remarks { margin-left: 6px; font-size: 10.5px; padding: 1px 6px; }
  .detail-meta { font-size: 11px; gap: 5px 10px; }
  .detail-actions .btn { padding: 5px 10px; font-size: 12px; }
  .detail-desc { font-size: 12.5px; line-height: 1.75; }
}

/* ---------- 播放历史面板 ---------- */
.hdr-right { margin-left: auto; }
.hist-wrap { position: relative; }
.hist-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap;
}
.hist-btn:hover { color: var(--text); border-color: rgba(var(--hl), .18); }
.hist-btn.on { color: var(--text); border-color: var(--brand); }

/* 日夜切换按钮的图标：默认显太阳，白天显月亮 */
[data-theme-toggle] .i-sun { display: block; }
[data-theme-toggle] .i-moon { display: none; }
html[data-theme="light"] [data-theme-toggle] .i-sun { display: none; }
html[data-theme="light"] [data-theme-toggle] .i-moon { display: block; }

/* 侧边悬浮按钮组：日夜切换 / 回到顶部 / 到底部
   竖排在右下角；上下箭头到了对应那一端会淡出，避免点了没反应。 */
.side-fabs {
  position: fixed; right: 18px; bottom: 84px; z-index: 45;
  display: flex; flex-direction: column; gap: 8px;
}
.side-fabs[hidden] { display: none; }

.side-fab {
  width: 40px; height: 40px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%; cursor: pointer;
  background: var(--card); border: 1px solid var(--line);
  color: var(--muted);
  box-shadow: 0 6px 18px rgba(0, 0, 0, calc(.26 * var(--shadow-k)));
  transition: color .15s, border-color .15s, transform .15s, opacity .18s, visibility .18s;
}
.side-fab:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.side-fab:active { transform: translateY(0); }
.side-fab svg { width: 16px; height: 16px; }

/* 已在顶部 / 已在底部：对应箭头淡出且不可点 */
.side-fab.is-off {
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(4px);
}

/* 窄屏：整体缩一圈，仍然保持竖排（上 / 切换 / 下） */
@media (max-width: 1100px) {
  .side-fabs {
    right: 10px; bottom: 14px; gap: 6px;
  }
  .side-fab { width: 34px; height: 34px; }
  .side-fab svg { width: 14px; height: 14px; }
}
.hist-pop {
  position: absolute; right: 0; top: 42px; width: 340px; z-index: 60;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, calc(.45 * var(--shadow-k))); overflow: hidden;
}
.hist-pop[hidden] { display: none; }
.hist-pop-hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.hist-pop-hd a { color: var(--brand); font-size: 12px; }
.hist-acts { display: flex; align-items: center; gap: 12px; }
#hist-clear {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--muted); font-size: 12px; font-family: inherit;
}
#hist-clear:hover { color: var(--accent); }
.hist-pop-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.hp-item { display: flex; gap: 10px; padding: 8px; border-radius: 8px; }
.hp-item:hover { background: var(--card-hover); }
.hp-thumb {
  width: 42px; height: 56px; flex: none; border-radius: 6px; overflow: hidden; background: var(--card);
}
.hp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hp-info { flex: 1; min-width: 0; }
.hp-info h4 {
  font-size: 13px; font-weight: 400; margin: 0 0 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hp-info p { margin: 0 0 6px; font-size: 11.5px; color: var(--muted); }
.hp-bar { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.hp-bar i { display: block; height: 100%; background: var(--brand); }
.hp-empty { padding: 30px 0; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .hist-pop { width: 300px; }
}
@media (max-width: 640px) {
  /* 小屏把「播放历史」收成纯图标，把宽度让给搜索框 */
  .hist-btn { padding: 0; width: 34px; justify-content: center; }
  .hist-btn .hist-label { display: none; }
  .search-box { min-width: 120px; }
  .hist-pop { width: 280px; right: -40px; }
}

/* ---------- 播放页布局：视频 + 右侧选集（参考站机制）----------
   播放器靠 margin-right 让位，选集面板绝对定位浮在右侧，
   折叠时 margin-right 归零，播放器全宽，只剩右侧开关条 */
.play-layout {
  --side-w: 340px;
  --gap: 16px;
  position: relative;
}
.play-stage { position: relative; margin-right: calc(var(--side-w) + var(--gap)); transition: margin-right .2s ease; }
.play-layout.collapsed .play-stage { margin-right: 22px; }

/* 播放器容器：开关条的定位基准 */
.player-box { position: relative; }

/* 折叠开关：单个按钮，位于播放器内部右边缘、垂直居中
   展开态箭头朝右（点它收起），折叠态箭头朝左（点它展开） */
.side-switch {
  position: absolute; top: 50%; right: 0; z-index: 99;
  width: 20px; height: 46px; margin-top: -23px; padding: 0 0 0 4px;
  display: inline-flex; align-items: center; justify-content: flex-start;
  border: 0; border-right: 0; border-radius: 111px 0 0 111px;
  background: rgba(24, 26, 30, .82); color: #fff;
  cursor: pointer; transition: background .18s;
}
.side-switch:hover { background: rgba(24, 26, 30, .96); }
.side-switch svg { width: 12px; height: 12px; transition: transform .2s ease; }
.play-layout.collapsed .side-switch svg { transform: rotate(180deg); }

/* 选集面板：绝对定位浮在右侧，高度=播放器高度 */
.play-side {
  position: absolute; top: 0; right: 0; z-index: 9;
  width: var(--side-w); height: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .2s ease;
}
.play-layout.collapsed .play-side { width: 0; border-color: transparent; background: none; overflow: visible; }

.side-body { display: flex; flex-direction: column; min-height: 0; flex: 1; width: var(--side-w); }
.play-layout.collapsed .side-body { display: none; }

/* 面板头部：片名 + 评分 + 元信息 */
.side-hd {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 13px 14px 10px; border-bottom: 1px solid var(--line); flex: none;
}
.side-hd-main { min-width: 0; }
.side-title {
  font-size: 15px; font-weight: 500; margin: 0 0 5px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.side-detail { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.side-detail:hover { color: var(--brand); }
.side-btn {
  width: 24px; height: 24px; flex: none; display: grid; place-items: center; cursor: pointer;
  background: none; border: 0; border-radius: 6px; color: var(--muted); padding: 0;
}
.side-btn:hover { background: var(--card-hover); color: var(--text); }

/* 资源列表工具行 */
.side-tools {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid var(--line); flex: none;
}
.side-tools-t { font-size: 12.5px; color: var(--muted); }
.side-tools-t em { font-style: normal; color: var(--text); }
.side-tools-r { display: flex; gap: 4px; }
.side-tool {
  background: none; border: 0; padding: 2px 6px; border-radius: 5px; cursor: pointer;
  font-size: 12px; color: var(--muted); font-family: inherit;
}
.side-tool:hover { background: var(--card-hover); color: var(--text); }
.side-tool.on { color: var(--brand); }

/* 线路 */
.side-lines { display: flex; gap: 6px; padding: 10px 12px 4px; flex-wrap: wrap; flex: none; }
.side-lines a {
  padding: 3px 9px; border-radius: 6px; font-size: 12px;
  color: var(--muted); background: var(--card); border: 1px solid transparent;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-lines a:hover { color: var(--text); }
.side-lines a.on { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.dead-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #ff5d73; vertical-align: 1px; }

/* 剧集列表 */
.side-eps {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px; padding: 8px 12px 14px;
  overflow-y: auto; overscroll-behavior: contain;
  align-content: start;
  /* 用细滚动条并预留槽位，避免滚动条出现时内容宽度突变、选集被挤压 */
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--hl),.18) transparent;
  scrollbar-gutter: stable;
}
/* 自定义滚动条（WebKit / Chrome / Edge / Safari） */
.side-eps::-webkit-scrollbar { width: 6px; }
.side-eps::-webkit-scrollbar-track { background: transparent; }
.side-eps::-webkit-scrollbar-thumb {
  background: rgba(var(--hl), .16);
  border-radius: 3px;
  transition: background .2s;
}
.side-eps:hover::-webkit-scrollbar-thumb { background: rgba(var(--hl), .3); }
.side-eps::-webkit-scrollbar-thumb:hover { background: var(--brand); }
.side-eps::-webkit-scrollbar-corner { background: transparent; }
.side-eps.cols1 { grid-template-columns: minmax(0, 1fr); }
.side-eps a {
  /* 用 block + line-height 居中，不用 flex：
     flex 容器里的直接文本会成为匿名 flex item，text-overflow:ellipsis 不生效，
     长集名会被硬裁掉（没有省略号）。block 才能让省略号正常显示。
     min-height 保住 34px 行高，避免 grid 子项塌缩（曾把 1033 集压成 16px）。 */
  display: block;
  min-height: 34px; line-height: 32px;
  padding: 0 8px; border-radius: 6px; background: var(--card); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-eps a:hover { color: var(--text); border-color: rgba(var(--hl), .18); }
.side-eps a.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #0b0c0f; font-weight: 600;
}

/* 播放器下方信息条 */
.play-meta {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  margin-top: 14px; flex-wrap: wrap;
}
.play-title { font-size: 19px; margin: 0 0 4px; line-height: 1.4; }
.play-sub { margin: 0; color: var(--muted); font-size: 12.5px; display: flex; gap: 12px; flex-wrap: wrap; }
.play-sub .cur-ep { color: var(--brand); }
.play-acts { display: flex; gap: 8px; flex: none; }

/* 窄屏：改为上下堆叠 */
@media (max-width: 1100px) {
  .play-stage, .play-layout.collapsed .play-stage { margin-right: 0; }
  .play-side {
    position: relative; top: auto; right: auto; width: auto; height: auto;
    margin-top: 14px;
  }
  .play-layout.collapsed .play-side { width: auto; height: auto; background: var(--bg-soft); border-color: var(--line); }
  .side-body { width: auto; }
  .side-switch { display: none !important; }
  .side-eps { max-height: 300px; }
}
@media (max-width: 640px) {
  .side-eps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .play-title { font-size: 16px; }
  .play-acts { width: 100%; }
}

/* ============================================================
   弹窗公告
   ============================================================ */
.popup-mask {
  position: fixed; inset: 0; z-index: 900;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(6, 7, 10, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .22s ease;
}
/* display:grid 会顶掉 UA 的 [hidden]{display:none}，必须显式声明，
   否则 JS 还没跑起来的那一瞬间，这层透明遮罩会挡住整页点击。 */
.popup-mask[hidden] { display: none; }
.popup-mask.show { opacity: 1; }
/* 弹窗打开时锁住页面滚动，避免背景跟着滑动 */
body.popup-lock { overflow: hidden; }

.popup-box {
  width: 100%; max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, calc(.6 * var(--shadow-k)));
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.98);
  transition: opacity .26s ease, transform .3s cubic-bezier(.2, .7, .3, 1);
}
.popup-mask.show .popup-box { opacity: 1; transform: none; }

.popup-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 10px 18px;
}
.popup-hd h3 {
  flex: 1; min-width: 0;
  margin: 0;
  font-size: 15px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 关闭按钮：只做背景/颜色变化，不加描边、不加焦点环。
   之前 hover 会给一圈白色边框，视觉上就是「按钮外一圈光环」，已去掉。 */
.popup-x {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  padding: 0;
  border: 0; border-radius: 7px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background .16s, color .16s;
}
.popup-x:hover { background: rgba(var(--hl), .07); color: var(--text); }
.popup-x:active { background: rgba(var(--hl), .12); }

/* 弹窗内的按钮一律不显示焦点环：弹窗是模态的，只有两个按钮，
   一圈 outline 会在深色卡片上显得脏；键盘仍可用 Tab/Enter/Esc 操作。 */
.popup-box button:focus,
.popup-box button:focus-visible {
  outline: none;
}

.popup-body {
  padding: 0 18px 4px;
  max-height: 46vh; overflow-y: auto;
  color: var(--muted);
  font-size: 13.5px; line-height: 1.8;
  /* 公告里填的换行要保留，但不解析 HTML —— 后台是纯文本框，避免注入 */
  white-space: pre-wrap;
  word-break: break-word;
}
.popup-body::-webkit-scrollbar { width: 6px; }
.popup-body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

.popup-ft {
  display: flex; justify-content: flex-end;
  padding: 16px 18px 18px;
}
.popup-ft .btn { min-width: 104px; justify-content: center; }

@media (max-width: 420px) {
  .popup-mask { padding: 16px; align-items: center; }
  .popup-box { max-width: 100%; }
  .popup-body { max-height: 52vh; }
}

/* ============================================================
   维护页
   ============================================================ */
.maint-body {
  min-height: 100vh;
  margin: 0;
  display: grid; place-items: center;
  padding: 40px 20px;
  background: var(--bg);
  color: var(--text);
}
.maint { width: 100%; max-width: 520px; text-align: center; }

.maint-logo {
  margin-bottom: 26px;
  font-size: 18px; font-weight: 700; letter-spacing: .4px;
  color: var(--text);
}
.maint-logo img { max-height: 34px; width: auto; display: inline-block; }

.maint-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 32px 30px;
}
.maint-icon {
  display: grid; place-items: center;
  margin-bottom: 18px;
  color: var(--brand);
}
.maint-card h1 {
  margin: 0 0 14px;
  font-size: 20px; font-weight: 600; letter-spacing: .3px;
}
.maint-text {
  color: var(--muted);
  font-size: 14px; line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}
.maint-eta {
  display: inline-block;
  margin-top: 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-light);
  font-size: 12.5px;
}
.maint-foot {
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  opacity: .8;
}

@media (max-width: 520px) {
  .maint-card { padding: 32px 22px 24px; }
  .maint-card h1 { font-size: 18px; }
}

/* ============================================================
   验证码
   ============================================================ */
.cap-row {
  display: flex; align-items: center; gap: 8px;
}
/* 验证码输入框自带基础样式，不依赖外层 .field。
   搜索页的 .cap-row 不在 .field 里，如果只靠 .field input，
   会退化成浏览器默认的 25px 高无边框输入框。 */
.cap-row input[type="text"] {
  flex: 1; min-width: 0;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .16s;
}
.cap-row input[type="text"]:focus { border-color: var(--brand); }
/* 请输入验证码的占位文案在小尺寸下容易被截断，弱化一下 */
.cap-row input[type="text"]::placeholder { color: var(--muted); font-size: 13px; }
.cap-img {
  flex: none;
  display: block;
  width: 132px; height: 44px;
  border-radius: 8px;
  background: var(--bg-soft);
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
}
.cap-refresh {
  flex: none;
  height: 34px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, color .16s, border-color .16s;
}
.cap-refresh:hover { background: rgba(var(--hl), .055); border-color: rgba(var(--hl), .16); color: var(--text); }
.cap-refresh:active { background: rgba(var(--hl), .09); }
.cap-refresh:disabled { opacity: .55; cursor: default; }

/* 搜索页的验证码门。
   搜索页本身不提供关键词输入框（顶部搜索栏每页都有），
   所以这里只有验证码一块：关键词由 URL 带过来，放在 hidden 里。 */
.cap-gate {
  max-width: 520px;
  margin-bottom: 26px;
  padding: 20px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cap-gate-tip {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
/* 提示里嵌的关键词：提亮 + 加粗，一眼看到自己搜的是什么 */
.cap-kw { color: var(--text); font-weight: 600; }

.cap-gate-err { margin: 0 0 12px; }
.cap-gate .cap-row { margin-bottom: 14px; }
.cap-gate .btn { width: 100%; justify-content: center; }

@media (max-width: 480px) {
  /* 窄屏：输入框独占一行，图片与「换一张」并排在下 */
  .cap-row { flex-wrap: wrap; }
  .cap-row input[type="text"] { flex: 1 1 100%; }
  .cap-img { width: 118px; height: 40px; }
  .cap-refresh { height: 40px; }
}

/* ============================================================
   浮层提示（toast）
   用在「直接进搜索页但没关键词」这类场景：只短暂提示一下，
   几秒后自己消失，不占版面、不逼用户点关闭。
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  top: 76px;                 /* JS 会按 header 实际高度改写 */
  z-index: 700;
  transform: translate(-50%, -10px);
  display: flex; align-items: center; gap: 9px;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 38px rgba(0, 0, 0, calc(.55 * var(--shadow-k))), 0 2px 8px rgba(0, 0, 0, calc(.35 * var(--shadow-k)));
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .34s cubic-bezier(.2, .7, .3, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { flex: none; color: var(--muted); }
.toast span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 提示消失后页面会变空，用 min-height 撑住，避免 footer 一下跳到顶部 */
.page-empty { min-height: 46vh; }

@media (max-width: 480px) {
  /* 窄屏：给一个明确的宽度上限，避免 fixed 元素按 min-content 收缩成
     很窄的一条、把中文折成两行；一句话能一行放下就一行 */
  .toast {
    width: max-content;
    max-width: calc(100vw - 40px);
    font-size: 13px;
    padding: 10px 15px;
    gap: 7px;
  }
  .page-empty { min-height: 40vh; }
}
