/* ==========================================================================
   小凡影视 · 全站样式
   两端自适应：移动端优先排布，宽屏自动展开为多列
   ========================================================================== */

/* ── 1. 设计令牌 ────────────────────────────────────────────── */
:root {
  --bg: #08090f;
  --bg-2: #0d0f18;
  --surface: #141724;
  --surface-2: #1b1f30;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #e9edf7;
  --muted: #8b93a9;
  --muted-2: #646c81;

  --brand: #ff3d71;
  --brand-2: #ff8b3d;
  --violet: #6d5bff;
  --cyan: #22d3ee;

  --grad: linear-gradient(100deg, var(--violet), var(--brand) 52%, var(--brand-2));
  --grad-soft: linear-gradient(140deg, rgba(109, 91, 255, .35), rgba(255, 61, 113, .28) 55%, rgba(255, 139, 61, .22));

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 18px 44px rgba(0, 0, 0, .45);
  --container: 1280px;
  /* 手机侧 8px 左右留白，随视口缓慢涨到宽屏的 34px */
  --pad: clamp(8px, 2.2vw, 34px);
  --topbar-h: 62px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  /* 这里绝不能写 height:100% —— body 盒子被钉在一屏高，
     顶栏的 sticky 只能在 body 范围内活动，滚过一屏就跟着页面走了。
     用 min-height 让 body 随内容长高。 */
  min-height: 100vh;
  min-height: 100svh;
}

main { flex: 1 0 auto; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
  /* 刘海屏/圆角安全区也要留出边距，写在后面覆盖上一行；
     老浏览器不认 max()+env() 时会退回上面的 padding-inline。 */
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}

::selection { background: rgba(255, 61, 113, .35); }

/* ── 2. 顶栏 ────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(8, 9, 15, .72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
}

.brand { display: flex; align-items: center; gap: 9px; flex: none; }

.brand__mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 61, 113, .35);
}

.brand__text { font-size: 19px; letter-spacing: .5px; }
.brand__text b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand__text i { font-style: normal; color: var(--text); margin-left: 2px; font-weight: 500; }

/* 搜索框 + 搜索按钮 */
.searchbar {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 4px 4px 16px;
  transition: border-color .2s, box-shadow .2s;
}

.searchbar:focus-within {
  border-color: rgba(255, 61, 113, .55);
  box-shadow: 0 0 0 4px rgba(255, 61, 113, .12);
}

.searchbar__input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  font-size: 15px;
}
.searchbar__input::placeholder { color: var(--muted-2); }
.searchbar__input::-webkit-search-cancel-button { -webkit-appearance: none; }

.searchbar__btn {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; cursor: pointer;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-weight: 600;
  transition: filter .2s, transform .1s;
}
.searchbar__btn:hover { filter: brightness(1.12); }
.searchbar__btn:active { transform: scale(.97); }

/* 首页搜索按钮旁的「收藏」：点一下直接出浏览器原生的「添加到桌面」框。
   由 app.js 的 mountInstall() 插进 .hero__search，吸顶栏不放这个入口。 */
.hero__fav { gap: 5px; }
/* 手上还有可用的安装事件时点亮：点它就能立刻弹原生框 */
.hero__fav.is-ready { color: var(--brand); border-color: rgba(255, 61, 113, .55); }

/* 短提示 */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: min(84vw, 420px);
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13.5px; text-align: center;
}

/* 首页顶栏搜索框：默认藏起来，滚过 hero 背景后淡入，回到顶部再消失。
   由 index.html 给 .topbar 加/去 .is-search。 */
.searchbar--lazy {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .26s ease, transform .26s ease;
}
.topbar.is-search .searchbar--lazy { opacity: 1; transform: none; pointer-events: auto; }

/* 分类导航 */
.nav { border-top: 1px solid var(--line); }
.nav__inner {
  display: flex; gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav__inner::-webkit-scrollbar { display: none; }

.nav__link {
  position: relative;
  flex: none;
  padding: 11px 15px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s;
}
.nav__link:hover { color: var(--text); }
.nav__link.is-active { color: var(--text); font-weight: 600; }
.nav__link.is-active::after {
  content: "";
  position: absolute; left: 15px; right: 15px; bottom: 6px;
  height: 2px; border-radius: 2px;
  background: var(--grad);
}

/* ── 3. 首页顶部装饰（渐变 + 光带 + 胶片齿孔） ──────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 6vw, 64px) 0 clamp(34px, 5vw, 56px);
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(109, 91, 255, .55), transparent 60%),
    radial-gradient(110% 85% at 88% 8%, rgba(255, 61, 113, .48), transparent 58%),
    radial-gradient(90% 70% at 60% 100%, rgba(34, 211, 238, .28), transparent 62%),
    linear-gradient(160deg, #141132 0%, #1a0f22 45%, #0a0b12 100%);
}

/* 缓慢漂移的彩色光斑 */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
  pointer-events: none;
}
.hero::before {
  width: 46vw; height: 46vw; min-width: 280px; min-height: 280px;
  left: -8vw; top: -16vw;
  background: radial-gradient(circle, var(--violet), transparent 68%);
  animation: drift-a 18s ease-in-out infinite alternate;
}
.hero::after {
  width: 40vw; height: 40vw; min-width: 240px; min-height: 240px;
  right: -6vw; top: -10vw;
  background: radial-gradient(circle, var(--brand), transparent 68%);
  animation: drift-b 22s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(6vw, 4vw, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(-5vw, 6vw, 0) scale(1.08); } }

/* 斜向光带 */
.hero__beams {
  position: absolute; inset: -20% -10%;
  pointer-events: none;
  background:
    repeating-linear-gradient(115deg,
      rgba(255, 255, 255, .055) 0 2px,
      transparent 2px 130px),
    repeating-linear-gradient(65deg,
      rgba(255, 255, 255, .03) 0 1px,
      transparent 1px 90px);
  mask-image: linear-gradient(to bottom, #000 10%, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000 10%, transparent 85%);
}

/* 颗粒质感 */
.hero__grain {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
}

/* 底部胶片齿孔条 */
.hero__film {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 22px;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .55), rgba(0, 0, 0, .75)),
    repeating-linear-gradient(90deg,
      transparent 0 18px,
      rgba(255, 255, 255, .16) 18px 30px);
  background-blend-mode: normal;
  border-top: 1px solid rgba(255, 255, 255, .1);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.hero__inner { position: relative; z-index: 2; }

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
  font-size: 12.5px; color: #fff;
  backdrop-filter: blur(6px);
}
.hero__eyebrow i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 10px #4ade80;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.hero__title {
  margin: 16px 0 8px;
  font-size: clamp(28px, 6.4vw, 54px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.5px;
}
.hero__title em {
  font-style: normal;
  background: linear-gradient(100deg, #fff, #ffd9e4 40%, #ffe2c4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hero__sub {
  margin: 0 0 22px;
  max-width: 640px;
  color: rgba(233, 237, 247, .74);
  font-size: clamp(13.5px, 2.6vw, 16px);
}

/* Hero 内的大搜索框：输入框与按钮始终左右排列，手机上也不换行 */
.hero__search {
  display: flex; align-items: stretch; gap: 8px;
  max-width: 620px;
  padding: 7px;
  border-radius: var(--r);
  background: rgba(12, 13, 20, .58);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(10px);
}
.hero__search input {
  flex: 1 1 auto; min-width: 0;
  background: none; border: 0; outline: none;
  padding: 0 12px; font-size: 15.5px;
}
.hero__search input::placeholder { color: var(--muted-2); }
.hero__search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.hero__search .btn { flex: none; padding: 10px 20px; font-size: 14.5px; }

.hero__stats {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  margin-top: 18px;
  font-size: 12.5px; color: rgba(233, 237, 247, .6);
}
.hero__stats b { color: #fff; font-weight: 700; font-size: 15px; margin-right: 5px; }

/* ── 4. 区块标题 ────────────────────────────────────────────── */
/* 只写纵向 padding；横向留给 .container，否则简写会把左右内边距清零，
   手机上正文就贴到屏幕边了（.section 与 .container 特异度相同、写在后面会覆盖）。 */
.section { padding-top: clamp(22px, 4vw, 34px); padding-bottom: clamp(22px, 4vw, 34px); }
.section + .section { border-top: 1px solid var(--line); }

.section__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.section__title {
  margin: 0;
  font-size: clamp(18px, 3.4vw, 23px);
  font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.section__title::before {
  content: ""; width: 4px; height: 1.05em; border-radius: 3px;
  background: var(--grad);
}
.section__hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.section__more { color: var(--muted); font-size: 13.5px; transition: color .2s; }
.section__more:hover { color: var(--brand); }

/* ── 5. 海报网格 ────────────────────────────────────────────── */
.grid {
  display: grid;
  /* 最小 96px：左右边距加大后，360px 的小屏仍能排下 3 列 */
  grid-template-columns: repeat(auto-fill, minmax(clamp(96px, 26vw, 176px), 1fr));
  gap: clamp(12px, 2.4vw, 22px);
}

.card { display: block; }

.card__pic {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .25s cubic-bezier(.2, .8, .3, 1), box-shadow .25s, border-color .25s;
}
.card__pic img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s, transform .5s;
}
.card__pic.is-ready img { opacity: 1; }
.card:hover .card__pic {
  transform: translateY(-4px);
  border-color: rgba(255, 61, 113, .45);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 61, 113, .18);
}
.card:hover .card__pic img { transform: scale(1.05); }

/* 图片未加载 / 加载失败时的兜底 */
.card__ph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 30px; font-weight: 800;
  color: rgba(255, 255, 255, .5);
  background: var(--grad-soft);
  z-index: -1;
}
.card__pic.is-fail img { display: none; }
.card__pic.is-fail .card__ph { z-index: 0; }

.card__tag {
  position: absolute; left: 7px; bottom: 7px;
  padding: 3px 8px;
  font-size: 11px; font-weight: 600;
  border-radius: 999px;
  background: rgba(8, 9, 15, .78);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(4px);
  max-width: calc(100% - 14px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.card__body { padding: 9px 2px 0; }
.card__name {
  margin: 0;
  font-size: 13.5px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card:hover .card__name { color: var(--brand); }
.card__meta {
  margin: 3px 0 0;
  font-size: 11.5px; color: var(--muted-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── 5.1 播放记录：只显示一行，左右滑动 ─────────────────────── */
.hrow {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hrow::-webkit-scrollbar { display: none; }
.hrow > .card {
  flex: 0 0 clamp(104px, 30vw, 150px);
  scroll-snap-align: start;
}
.hcard__go {
  position: absolute; inset: 0; margin: auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(8, 9, 15, .55);
  border: 1px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(4px);
  transition: transform .2s, background .2s, border-color .2s;
}
.hcard:hover .hcard__go { background: var(--grad); border-color: transparent; transform: scale(1.08); }

/* 文字型按钮（如「清空记录」） */
.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--muted); font-family: inherit; font-size: 13.5px;
  transition: color .2s;
}
.linkbtn:hover { color: var(--brand); }

/* 骨架屏 */
.sk { background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 220% 100%; animation: shine 1.4s linear infinite; border-radius: var(--r-sm); }
.sk--poster { aspect-ratio: 3 / 4; }
.sk--row { height: 172px; border-radius: var(--r); }
@keyframes shine { to { background-position: -220% 0; } }

/* ── 6. 搜索结果：左图右详情 ────────────────────────────────── */
.rows { display: flex; flex-direction: column; gap: 14px; }

.row {
  /* 33vw：右侧只剩主演一行后实测等高的档位——海报 172px，
     内容 150~180px，按钮由 margin-top:auto 钉在卡片底部与海报底边齐平。 */
  --pic-w: clamp(124px, 33vw, 168px);
  display: grid;
  grid-template-columns: var(--pic-w) 1fr;
  gap: clamp(12px, 2.4vw, 20px);
  padding: clamp(12px, 2vw, 16px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color .2s, background .2s, transform .2s;
  align-items: stretch;
}
.row:hover { border-color: rgba(255, 61, 113, .38); background: var(--surface-2); transform: translateY(-2px); }

/* 海报一律保持 3:4 不变形：align-self:start 不参与拉伸，
   两侧高度靠精简右侧内容来对齐，而不是靠裁切图片。 */
.row__pic {
  position: relative;
  align-self: start;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-2);
}
.row__pic img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .35s;
}
.row__pic.is-ready img { opacity: 1; }
.row__ph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 800; color: rgba(255, 255, 255, .45);
  background: var(--grad-soft); z-index: -1;
}
.row__pic.is-fail img { display: none; }
.row__pic.is-fail .row__ph { z-index: 0; }

.row__main { min-width: 0; display: flex; flex-direction: column; }

.row__title {
  margin: 0 0 7px;
  font-size: clamp(16px, 3.2vw, 20px);
  font-weight: 700; line-height: 1.3;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.row__title a:hover { color: var(--brand); }
/* 超长无空格片名（英文/数字串）不允许把整行撑出横向滚动 */
.row__title a { min-width: 0; overflow-wrap: anywhere; }

.row__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }

.pill {
  padding: 2px 9px;
  font-size: 11.5px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  white-space: nowrap;
}
.pill--cat { color: #fff; border-color: transparent; background: linear-gradient(100deg, rgba(109, 91, 255, .85), rgba(255, 61, 113, .85)); }
.pill--state { color: #ffd166; border-color: rgba(255, 209, 102, .35); background: rgba(255, 209, 102, .08); font-weight: 600; }

.row__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3px 20px;
  font-size: 13px;
  margin-bottom: 8px;
}
.row__field { display: flex; gap: 7px; min-width: 0; }
.row__field span { color: var(--muted-2); flex: none; }
.row__field b { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row__desc {
  margin: 0 0 10px;
  font-size: 13px; line-height: 1.7; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.row__actions { display: flex; gap: 9px; margin-top: auto; flex-wrap: wrap; }

/* ── 7. 通用按钮 ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: filter .2s, transform .1s, border-color .2s, background .2s;
  white-space: nowrap;
}
.btn--primary { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(255, 61, 113, .3); }
.btn--primary:hover { filter: brightness(1.1); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: scale(.97); }
/* .btn 的作者样式会盖掉 [hidden] 的 UA 样式，首集/末集时按钮得显式藏起来 */
.btn[hidden] { display: none; }
/* line-height 必须一起压，否则继承 body 的 1.65；
   8px 上下内边距 → 高度 31px（27px 当触摸目标偏小） */
.btn--sm { padding: 8px 16px; font-size: 13px; line-height: 1; }

/* ── 8. 详情页 ──────────────────────────────────────────────── */
.brief {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 4vw, 40px) 0 clamp(22px, 4vw, 36px);
  border-bottom: 1px solid var(--line);
}
.brief__bg {
  position: absolute; inset: -40% 0 auto;
  height: 140%;
  background-size: cover; background-position: center 22%;
  filter: blur(46px) saturate(150%) brightness(.42);
  opacity: .85;
  transform: scale(1.15);
  mask-image: linear-gradient(to bottom, #000 30%, transparent 92%);
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 92%);
}
.brief__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(109, 91, 255, .3), rgba(255, 61, 113, .22) 50%, rgba(8, 9, 15, .9));
}
.brief__inner { position: relative; z-index: 2; }

/* 海报与信息列等高。
   注意：这里不能再用 aspect-ratio + stretch —— 浏览器会反过来用行高推算海报宽度，
   海报就会溢出压到文字列上。改成占满列宽，只用 min-height 守住 3:4 的下限。 */
.brief__grid {
  --poster-w: clamp(132px, 36vw, 236px);
  display: grid;
  grid-template-columns: var(--poster-w) 1fr;
  gap: clamp(16px, 3.4vw, 34px);
  align-items: stretch;
}
.brief__info { min-width: 0; }

.brief__poster {
  position: relative;
  width: 100%;
  min-height: calc(var(--poster-w) * 4 / 3);
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: var(--shadow);
  background: var(--grad-soft);
}
.brief__poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.brief__title { margin: 0 0 8px; font-size: clamp(21px, 4.6vw, 38px); font-weight: 800; line-height: 1.2; }
.brief__alias { margin: 0 0 14px; color: var(--muted-2); font-size: 13px; }

.brief__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

.brief__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 7px 24px;
  font-size: 13.5px;
  margin-bottom: 12px;
}
.brief__field { display: flex; gap: 8px; }
.brief__field span { color: var(--muted-2); flex: none; width: 40px; }
/* 演员名单最多两行，避免把顶部区域撑得过高 */
.brief__field b {
  font-weight: 500; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.brief__field a:hover { color: var(--brand); }

/* 手机上两个按钮撑满信息列、左右并排；宽屏不至于被拉到整行宽 */
.brief__actions { display: flex; gap: 11px; flex-wrap: nowrap; max-width: 380px; }
.brief__actions .btn { flex: 1 1 0; min-width: 0; }

.brief__note { margin: 12px 0 0; font-size: 12px; color: var(--muted-2); }

/* 选集区 */
.players { margin-top: 26px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(14px, 2.6vw, 22px);
}
.panel__title {
  margin: 0 0 14px;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.panel__title small { color: var(--muted-2); font-weight: 400; font-size: 12.5px; }

/* 面板标题行：标题靠左，切集按钮靠右，挤不下就换行 */
.panel__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.panel__bar .panel__title { margin-bottom: 0; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.tab:hover { color: var(--text); border-color: var(--brand); }
.tab.is-active { color: #fff; border-color: transparent; background: var(--grad); }

.eps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(78px, 21vw, 116px), 1fr));
  gap: 9px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}
.eps::-webkit-scrollbar { width: 6px; }
.eps::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.ep {
  display: block;
  padding: 9px 6px;
  text-align: center;
  font-size: 12.5px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: all .18s;
}
.ep:hover { color: #fff; border-color: var(--brand); background: rgba(255, 61, 113, .16); }
.ep.is-active { color: #fff; border-color: transparent; background: var(--grad); font-weight: 700; }

/* 详情正文 / 剧照 / 推荐 */
.prose { font-size: 14px; line-height: 1.9; color: rgba(233, 237, 247, .82); white-space: pre-wrap; word-break: break-word; }
.prose--fold { max-height: 7.6em; overflow: hidden; position: relative; transition: max-height .3s; }
.prose--fold:not(.is-open)::after {
  content: ""; position: absolute; inset: auto 0 0; height: 3.4em;
  background: linear-gradient(to bottom, transparent, var(--surface));
}
.fold-btn { margin-top: 10px; background: none; border: 0; color: var(--brand); font-size: 13px; cursor: pointer; padding: 0; }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(130px, 30vw, 220px), 1fr)); gap: 11px; }
.shots img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }

/* ── 9. 播放页 ──────────────────────────────────────────────── */
.player-wrap { padding-top: clamp(12px, 2.4vw, 22px); }

.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.player iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  display: block;
}
.player__tip {
  position: absolute; inset: 0;
  display: grid; place-content: center; gap: 12px; text-align: center;
  color: var(--muted);
  background: var(--grad-soft);
  padding: 20px;
}

/* 播放器下方只剩片名与当前集，竖排 */
.now { display: flex; flex-direction: column; gap: 2px; margin: 14px 0 0; min-width: 0; }
.now__title { margin: 0; font-size: clamp(17px, 3.6vw, 24px); font-weight: 700; }
.now__ep { color: var(--brand); font-size: 13.5px; }
.now__tools { display: flex; gap: 9px; flex-wrap: wrap; }

/* ── 10. 分页 / 状态 / 页脚 ─────────────────────────────────── */
.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 7px; flex-wrap: wrap;
  margin-top: 26px;
}
.pager__num {
  min-width: 38px; padding: 8px 12px;
  text-align: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
  transition: all .18s;
}
.pager__num:hover { color: #fff; border-color: var(--brand); }
.pager__num.is-active { color: #fff; border-color: transparent; background: var(--grad); font-weight: 700; }
.pager__gap { color: var(--muted-2); padding: 0 2px; }
.pager__total { color: var(--muted-2); font-size: 12.5px; margin-left: 8px; }

.state {
  display: grid; justify-items: center; gap: 12px;
  padding: 56px 20px;
  color: var(--muted);
  text-align: center;
}
.state__icon {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--muted-2);
  font-size: 24px; font-weight: 700;
}
.state--error .state__icon { color: var(--brand); border-color: rgba(255, 61, 113, .45); }
.state p { margin: 0; max-width: 460px; }

.hotwords { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; }
.hotwords b {
  flex: none;
  color: rgba(255, 255, 255, .55); font-weight: 500; font-size: 12.5px;
  line-height: 26px;
}
.hotwords__list { display: flex; flex-wrap: wrap; gap: 8px; }
.hotwords__list a {
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .07);
  font-size: 12.5px; color: #fff;
  transition: all .2s;
}
.hotwords__list a:hover { background: var(--grad); border-color: transparent; }

.crumb { padding: 14px 0 0; font-size: 13px; color: var(--muted-2); }
.crumb a:hover { color: var(--brand); }
.crumb span { margin: 0 6px; opacity: .5; }

.footer {
  flex-shrink: 0;
  margin-top: 40px;
  padding: 22px 0 26px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.footer__line { margin: 0; font-size: 12.5px; color: var(--muted-2); line-height: 1.9; }
.footer__line + .footer__line { margin-top: 2px; }
.footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--brand); }

.hl { font-style: normal; color: var(--brand); }

/* ── 11. 自适应微调 ─────────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --topbar-h: 56px; }
  .searchbar__btn span { display: none; }
  .searchbar__btn { padding: 8px 12px; }
  /* 收藏按钮窄屏只留图标，别把搜索框挤没 */
  .hero__fav span { display: none; }
  .brand__text { font-size: 17px; }
  /* hero 搜索框：手机上依然是一行，按钮贴在输入框右侧 */
  .hero__search { padding: 6px; gap: 6px; }
  .hero__search input { padding: 0 8px; font-size: 15px; }
  .hero__search .btn { padding: 9px 15px; font-size: 14px; }
  /* 热门搜索：手机端只显示一行，放不下的由 JS 直接隐藏 */
  .hotwords__list { flex-wrap: nowrap; overflow: hidden; }
  /* 右侧内容收窄到与 3:4 海报等高：简介只留一行，字段自动单列 */
  .row__desc { -webkit-line-clamp: 1; }
  .brief__fields { grid-template-columns: 1fr; }
  .eps { max-height: 260px; }
}

@media (min-width: 1024px) {
  .row { grid-template-columns: 148px 1fr; padding: 18px 20px; }
  .row__desc { -webkit-line-clamp: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
