/* ==========================================================================
   琉璃影视 · 网页版设计系统
   与安卓端保持同一套观感：暗色 + 毛玻璃 + 跟随海报的动态主色。
   网页这里用真正的 backdrop-filter（安卓端为了低端机是手写预模糊，网页不用将就）。
   ========================================================================== */

:root {
  /* 底色 */
  --night: #07070b;
  --night-soft: #0d0d13;
  --night-elevated: #14141c;

  /* 玻璃 */
  --glass-fill: linear-gradient(160deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045));
  --glass-fill-strong: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.22);
  --blur: 18px;

  /* 文字 */
  --text-1: #f5f5f7;
  --text-2: rgba(245, 245, 247, 0.74);
  --text-3: rgba(245, 245, 247, 0.5);
  --text-4: rgba(245, 245, 247, 0.32);

  /* 语义色 */
  --danger: #ff5a6a;
  --warning: #ffc46b;
  --success: #52d0a0;

  /* 主色：由海报动态写入，这里是兜底 */
  --accent: #8b8cf0;
  --accent-2: #6f7bf7;
  --accent-soft: rgba(139, 140, 240, 0.22);

  /* 尺寸 */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;
  --gutter: 16px;
  --topbar: 58px;
  --tabbar: 62px;

  /* 卡片比例 */
  --poster-ratio: 0.68;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--night);
  color: var(--text-1);
  /*
    手机端专项：安卓 Chrome 的**字体自动放大（Text Autosizing）**会在大块内容配小字时
    自动把文字放大 —— 用户反馈"手机端分类点进去就自动放大了"就是这个：
    海报栅格被放大、标签挤成两行。规范做法是显式声明不做文字缩放。
  */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /*
    ⚠️ 千万别在这里（html+body 同时）加 overflow-x: hidden。
    CSS 规定某一轴为非 visible 时，另一轴的计算值会变成 auto ——
    于是 body 自己也成了滚动容器，**页面级竖向滚动直接失效**（实测：所有板块都滑不动了）。
    横向溢出要治就治根：真正撑宽的元素各自加 min-width: 0（搜索框、卡片都已加）。
  */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* 兜底防横向溢出：clip 不会创建滚动容器（hidden 会），所以不会影响竖向滚动 */
html { overflow-x: clip; }
body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }
img { display: block; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; }

::selection { background: var(--accent); color: #fff; }

/* 滚动条（桌面端） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.24); background-clip: content-box; }

/* ---------------------------------------------------------------- 氛围底图 */
/* 模糊海报 + 三个跟随主色的光晕 + 从上到下的暗化蒙版。
   底图是 position:fixed，所以滚动时它不动（和 App 一致：切页面也不重建）。 */
#ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--night);
  pointer-events: none;
}
#ambient-poster {
  position: absolute;
  inset: -8%;
  background-size: cover;
  background-position: center 22%;
  filter: blur(46px) saturate(1.5) brightness(0.5);
  opacity: 0;
  transition: opacity 0.7s ease, background-image 0.3s;
  transform: scale(1.15);
  animation: drift 26s ease-in-out infinite alternate;
}
#ambient-poster.on { opacity: 0.85; }
@keyframes drift {
  from { transform: scale(1.15) translate3d(-1.2%, -0.8%, 0); }
  to { transform: scale(1.22) translate3d(1.2%, 1%, 0); }
}
#ambient-blobs {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 40% at 12% 6%, var(--accent-soft), transparent 70%),
    radial-gradient(50% 36% at 96% 38%, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent 72%),
    radial-gradient(58% 42% at 18% 96%, rgba(120, 90, 220, 0.18), transparent 74%);
  animation: breathe 22s ease-in-out infinite alternate;
}
@keyframes breathe { from { opacity: 0.85; } to { opacity: 1; } }
#ambient-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(7, 7, 11, 0.62) 0%,
    rgba(7, 7, 11, 0.42) 34%,
    rgba(7, 7, 11, 0.78) 72%,
    rgba(7, 7, 11, 0.94) 100%);
}
@media (prefers-reduced-motion: reduce) {
  #ambient-poster, #ambient-blobs { animation: none; }
}

/* ------------------------------------------------------------------ 布局 */

/*
   这里踩过一个很隐蔽的坑，值得写清楚：

   #ambient 是 <body> 的直接子元素，position: fixed + z-index: 0。
   按 CSS 绘制顺序，**定位元素（第 6 步）画在普通文档流内容（第 3 步）之上** ——
   于是那层 62% 不透明的 #ambient-scrim 蒙版盖住了整页文字：
   亮色的海报图还能透出来（所以看着"像是能显示"），浅色小字则完全看不见。
   实测：直播页/分类页只有带 backdrop-filter（会各自成层）的元素可见，
   把 #ambient 一隐藏，整页内容立刻全部出现。

   原来写了一条 `#app { z-index: 1 }`，但 HTML 里根本没有 #app，是条死规则。
   正确的做法是给真正的内容容器显式定位并抬高：下面 .page 的 position+z-index。
   不能用负 z-index 把氛围层压下去 —— body 有背景色，会把负层直接盖住。
*/
.page {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--topbar) + 14px);
  padding-bottom: calc(var(--tabbar) + 26px);
  animation: pageIn 0.34s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.wrap {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ 顶栏 */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(7, 7, 11, 0.78), rgba(7, 7, 11, 0.34));
  backdrop-filter: blur(var(--blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
/*
  品牌区：一定要 nowrap + flex:none。
  之前手机端顶栏元素多，品牌块被挤到只剩一个字的宽度，
  flex-direction: column 就让「琉璃影视/聚合·秒搜·毛玻璃」**逐字竖排**糊在大封面上（用户截图就是这个）。
*/
.brand { display: flex; flex-direction: column; line-height: 1.15; margin-right: 4px; flex: none; white-space: nowrap; }
.brand b { font-size: 17px; letter-spacing: 0.4px; white-space: nowrap; }
.brand span { font-size: 10.5px; color: var(--text-3); letter-spacing: 1.6px; white-space: nowrap; }
.topbar .spacer { flex: 1; }

/* 搜索框 */
.searchbox {
  flex: 1;
  /*
    min-width: 0 是必须的：flex 项的"自动最小尺寸"等于它的 min-content，
    而输入框的 min-content 大约 20 个字符宽 —— 手机顶栏塞不下时它不肯缩，
    后面的按钮就被顶出屏幕（实测：412px 视口下刷新按钮跑到 411~447）。
  */
  min-width: 0;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  transition: border-color 0.2s, background 0.2s;
}
.searchbox:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.searchbox input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: 0;
  color: var(--text-1); font-size: 14px;
}
.searchbox input::placeholder { color: var(--text-4); }

/* 桌面导航 */
.navlinks { display: none; gap: 6px; }
.navlinks a {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  color: var(--text-2);
  transition: background 0.18s, color 0.18s;
}
.navlinks a:hover { background: rgba(255, 255, 255, 0.07); color: var(--text-1); }
.navlinks a.active { background: var(--accent); color: #fff; }

/* ------------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  background: var(--glass-fill-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  transition: transform 0.14s, background 0.18s, border-color 0.18s;
}
.btn:hover { background: rgba(255, 255, 255, 0.16); }
.btn:active { transform: scale(0.96); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 24px -10px var(--accent);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.sm { height: 32px; padding: 0 14px; font-size: 12.5px; }
.btn.ghost { background: rgba(255, 255, 255, 0.06); }

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  transition: transform 0.14s, background 0.18s;
  flex: none;
}
.iconbtn:hover { background: rgba(255, 255, 255, 0.16); }
.iconbtn:active { transform: scale(0.92); }
.iconbtn svg { width: 19px; height: 19px; }

/* ------------------------------------------------------------- 玻璃面板 */
.panel {
  border-radius: var(--r-lg);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.3);
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  white-space: nowrap;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  color: var(--text-2);
  transition: all 0.18s;
  cursor: pointer;
}
.chip:hover { color: var(--text-1); background: rgba(255, 255, 255, 0.14); }
.chip.active {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.chiprow {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
}
.chiprow::-webkit-scrollbar { display: none; }

/* 分类页顶部那三行分类胶囊：手机端就是这种大号胶囊，照它放大 */
.filterrow .chip {
  height: 40px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 500;
}
.filterrow .chip.active { box-shadow: 0 8px 22px -12px var(--accent); }
@media (max-width: 640px) {
  .filterrow .chip { height: 36px; padding: 0 15px; font-size: 14px; }

  /* ---- 手机端专项优化 ---- */

  /* 顶栏在手机上要塞「品牌 + 搜索 + 按钮」，空间不够就把副标题收掉，
     并保证品牌块不被压缩（压了就会逐字竖排） */
  .brand { margin-right: 0; }
  .brand b { font-size: 15px; letter-spacing: 0; }
  .brand span { display: none; }
  .topbar { gap: 8px; }
  .iconbtn { width: 36px; height: 36px; flex: none; }

  /* 输入框字号必须 ≥16px，否则安卓/iOS 一聚焦就会把整页放大 */
  .searchbox { height: 36px; padding: 0 12px; }
  .searchbox input { font-size: 16px; }
  input, textarea, select { font-size: 16px; }

  /* 海报墙：手机端三列，跟手机端 App 一致（轨道 118px 左右，标题用省略号收住） */
  .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .card .cname { font-size: 12px; margin-top: 6px; }
  .card .csub { font-size: 10px; }

  /* 大封面：手机上给滑动留出手势，文字块往下收一点避免压住海报主体 */
  .hero { margin-bottom: 18px; border-radius: var(--r-lg); }
  .hero-body { padding: 14px; }
  .hero-title { font-size: 21px; }
  .hero-meta { font-size: 12px; margin-bottom: 12px; }
}

/* ------------------------------------------------------------------ Hero */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 26px;
  box-shadow: 0 30px 70px -36px rgba(0, 0, 0, 0.9);
  /*
    可手动滑动的大封面：
    touch-action: pan-y 让「上下滚动页面」仍然交还给浏览器，只把横向手势留给滑动切换。
    这里不给 .hero 套一层 wrapper —— 桌面端 .hero 本身是两列栅格（海报 + 文案），
    套一层会把栅格布局破坏掉；所以滑动时分别平移 .hero-media 与 .hero-body 两层。
  */
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.hero.grabbing { cursor: grabbing; }
.hero-arrows {
  position: absolute;
  right: 16px; top: 16px;
  display: none;                 /* 手机端靠手势，不摆箭头；桌面端才显示 */
  gap: 8px;
  z-index: 4;
}
.hero-arrow {
  width: 34px; height: 34px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-1);
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.18s, transform 0.18s;
}
.hero-arrow:hover { background: rgba(255, 255, 255, 0.18); }
.hero-arrow:active { transform: scale(0.94); }
.hero-media {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--night-elevated);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7, 7, 11, 0.1) 0%, rgba(7, 7, 11, 0.35) 46%, rgba(7, 7, 11, 0.95) 100%);
}
.hero-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px;
}
.hero-tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 10px;
  color: var(--text-2);
}
.hero-title {
  font-size: 25px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 8px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}
.hero-meta { font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; }
.hero-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dots { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s;
  cursor: pointer;
  /* 手指点得到：视觉还是小圆点，但点击热区放大 */
  padding: 0;
  box-shadow: 0 0 0 6px transparent;
}
.dot.active { width: 18px; background: var(--accent); }

/* ------------------------------------------------------------------ 行 */
.section { margin-bottom: 30px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 18px; margin: 0; font-weight: 700; }
.section-head .from { font-size: 12px; color: var(--text-3); }
.section-head .more { margin-left: auto; font-size: 12.5px; color: var(--text-3); }
.rowscroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 31%;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.rowscroll::-webkit-scrollbar { display: none; }
.rowscroll > * { scroll-snap-align: start; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* ------------------------------------------------------------------ 卡片 */
/*
  min-width: 0 是必须的（踩了很久）：
  .card 是栅格项，默认 min-width: auto 等于它的 min-content；而标题 .cname 是
  white-space: nowrap，其 min-content 就是整行文字宽度 —— 于是卡片被撑到 214px，
  溢出只有 118.7px 的栅格轨道：手机端看起来"只有两列、像被放大了一样"，
  第三列直接被挤出屏幕（实测数据：栅格轨道 118.7px，卡片实际 214px）。
*/
.card { position: relative; cursor: pointer; min-width: 0; }
.card .cname,
.card .csub { min-width: 0; }
.card .poster {
  position: relative;
  width: 100%;
  aspect-ratio: var(--poster-ratio);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.22s;
}
.card:hover .poster { transform: translateY(-4px); box-shadow: 0 18px 34px -18px rgba(0, 0, 0, 0.9); }
.card .poster img { width: 100%; height: 100%; object-fit: cover; }
.card .poster .ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-4);
}
.card .poster .ph svg { width: 34px; height: 34px; }
.card .poster::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(0, 0, 0, 0.62) 100%);
}
.card .badge {
  position: absolute;
  left: 7px; bottom: 7px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  max-width: calc(100% - 14px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .score {
  position: absolute;
  right: 7px; top: 7px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  color: #2a1c00;
  background: linear-gradient(135deg, #ffd479, #ffb347);
}
.card .cname {
  margin: 8px 2px 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .csub {
  margin: 3px 2px 0;
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ 骨架 */
.sk {
  border-radius: var(--r-md);
  background: linear-gradient(100deg, rgba(255,255,255,0.05) 30%, rgba(255,255,255,0.13) 50%, rgba(255,255,255,0.05) 70%);
  background-size: 220% 100%;
  animation: shine 1.35s linear infinite;
}
@keyframes shine { from { background-position: 140% 0; } to { background-position: -40% 0; } }
.sk-poster { aspect-ratio: var(--poster-ratio); }
.sk-line { height: 12px; margin-top: 9px; border-radius: 6px; }

/* ------------------------------------------------------------------ 详情 */
.detail-hero {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 20px;
}
.detail-hero .bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 20%;
  filter: blur(30px) brightness(0.42);
  transform: scale(1.2);
}
.detail-hero .inner {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 18px;
}
.detail-hero .cover {
  width: 116px;
  flex: none;
  aspect-ratio: var(--poster-ratio);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 30px -16px rgba(0, 0, 0, 0.9);
}
.detail-hero .cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero h1 { font-size: 21px; margin: 2px 0 8px; line-height: 1.25; }
.metarow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tagpill {
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  color: var(--text-2);
}
.tagpill.score { color: #2a1c00; background: linear-gradient(135deg, #ffd479, #ffb347); border: 0; font-weight: 700; }
.actors { font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.plot {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.75;
  white-space: pre-wrap;
}
.plot.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.linkmore { color: var(--accent); font-size: 12.5px; margin-top: 6px; display: inline-block; }

.epgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 4px;
}
.ep {
  height: 38px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 12.5px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.16s;
}
.ep:hover { color: var(--text-1); background: rgba(255, 255, 255, 0.15); }
.ep.active { background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; }

/* ------------------------------------------------------------------ 播放 */
.player-page { padding-top: 0; padding-bottom: 0; }
.stage {
  position: relative;
  width: 100%;
  background: #000;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.stage video { width: 100%; height: 100%; display: block; background: #000; }
.stage-cover {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-align: center;
  padding: 20px;
  z-index: 5;
}
.stage-cover h3 { margin: 0; font-size: 15px; font-weight: 600; }
.stage-cover p { margin: 0; font-size: 12.5px; color: var(--text-3); max-width: 520px; line-height: 1.6; }
.spinner {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.playinfo { padding: 14px var(--gutter); }
.playinfo h2 { font-size: 16px; margin: 0 0 6px; }
.playinfo .sub { font-size: 12.5px; color: var(--text-3); }
.playtip {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--warning);
  background: rgba(255, 196, 107, 0.1);
  border: 1px solid rgba(255, 196, 107, 0.24);
}

/* 播放中/解析中的进度提示：带上秒数，用户就不会觉得卡死 */
.playprog { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.playprog .dotpulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }

/* 选集 / 线路面板：桌面塞进右侧栏，手机走底部抽屉，共用同一套样式 */
.picker { display: grid; gap: 14px; }
.picker-block > .pbt {
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.picker-block > .pbt b { color: var(--text-1); font-weight: 600; }
.picker .epgrid { max-height: 46vh; }

/* 播放器里的线路/剧集抽屉 */
.sheet-mask {
  position: fixed; inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%;
  max-width: 620px;
  max-height: 76vh;
  overflow-y: auto;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: linear-gradient(180deg, rgba(22, 22, 30, 0.94), rgba(12, 12, 18, 0.97));
  border: 1px solid var(--glass-border);
  border-bottom: 0;
  backdrop-filter: blur(26px) saturate(1.4);
  -webkit-backdrop-filter: blur(26px) saturate(1.4);
  padding: 18px var(--gutter) calc(18px + env(safe-area-inset-bottom));
  animation: sheetUp 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.sheet h3 { margin: 0 0 14px; font-size: 16px; }
.sheet .grab {
  width: 40px; height: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: -6px auto 12px;
}

/* ------------------------------------------------- 主页入口板块（分类 / 直播） */
.entryrow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 18px 0 26px;
}
.entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: var(--r-lg);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.3);
  text-align: left;
  transition: transform 0.18s, background 0.18s;
  position: relative;
  overflow: hidden;
}
.entry::before {
  content: "";
  position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}
.entry:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.14); }
.entry:active { transform: scale(0.985); }
.entry .eicon {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: var(--text-1);
}
.entry .eicon.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px -12px var(--accent);
}
.entry .eicon svg { width: 21px; height: 21px; }
.entry .etext { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.entry .etext b { font-size: 15px; }
.entry .etext span { font-size: 12px; color: var(--text-3); }
.entry .earrow { margin-left: auto; font-size: 20px; color: var(--text-4); }

/* ------------------------------------------------------------------ 直播 */
.livegrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.livecard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  text-align: left;
  transition: transform 0.16s, background 0.18s;
  min-width: 0;
}
.livecard:hover { background: rgba(255, 255, 255, 0.14); }
.livecard:active { transform: scale(0.97); }
.livecard img { width: 26px; height: 26px; object-fit: contain; flex: none; border-radius: 6px; }
.livecard .licon { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: var(--text-3); flex: none; }
.livecard .licon svg { width: 20px; height: 20px; }
.livecard .lname {
  font-size: 13.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; flex: 1;
}
.livecard .lnum { font-size: 10.5px; color: var(--text-4); flex: none; }

@media (min-width: 640px) {
  .entryrow { grid-template-columns: 1fr 1fr; }
  .livegrid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (min-width: 1000px) {
  .livegrid { grid-template-columns: repeat(5, 1fr); }
  .entry .eicon { width: 50px; height: 50px; border-radius: 16px; }
  .entry .etext b { font-size: 16.5px; }
}

/* 直播：每个源的状态（哪个成了、哪个败了、为什么）—— 不显示就只剩一片空白 */
.livebar { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.srcpill {
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.srcpill.bad { color: var(--warning); background: rgba(255, 196, 107, 0.1); border-color: rgba(255, 196, 107, 0.28); }

/* 分类页：三级筛选（大类 / 子类 / 站点）各带小标题，不然一屏全是 chip 分不清 */
.filterrow { margin-bottom: 10px; }
.filterrow > .flabel {
  font-size: 11.5px;
  color: var(--text-4);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.filterrow > .chiprow { margin: 0; }

/* ------------------------------------------------------------------ 底栏 */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-radius: var(--r-pill);
  background: rgba(16, 16, 22, 0.72);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.95);
  width: min(calc(100% - 24px), 460px);
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 4px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  color: var(--text-3);
  transition: all 0.2s;
}
.tabbar a svg { width: 20px; height: 20px; }
.tabbar a.active { color: #fff; background: var(--accent); }

/* ------------------------------------------------------ 空态 / 提示 / toast */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 52px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty svg { width: 44px; height: 44px; color: var(--text-4); }
.empty b { color: var(--text-1); font-size: 15px; }
.empty p { margin: 0; font-size: 13px; line-height: 1.7; max-width: 420px; }

.note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--warning);
  padding: 4px 2px 8px;
}
.note.err { color: var(--danger); }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + 34px);
  transform: translateX(-50%) translateY(12px);
  z-index: 90;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 13px;
  background: rgba(20, 20, 28, 0.94);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  max-width: 88vw;
  text-align: center;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.topnote {
  position: fixed;
  top: calc(var(--topbar) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 640px);
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  line-height: 1.5;
  background: rgba(20, 20, 28, 0.9);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.9);
  animation: pageIn 0.25s ease;
}
.topnote button { color: var(--accent); font-size: 12.5px; font-weight: 600; flex: none; }

/* --------------------------------------------------------- 下载页 / 关于 */
.dl-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 34px 20px;
}
.dl-icon {
  width: 76px; height: 76px;
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 18px 40px -18px var(--accent);
}
.dl-icon svg { width: 38px; height: 38px; color: #fff; }
.dl-hero h1 { margin: 0; font-size: 23px; }
.dl-hero p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.75; max-width: 560px; }
.dl-meta { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; color: var(--text-3); font-size: 12.5px; }
.dl-steps { display: grid; gap: 10px; text-align: left; max-width: 560px; width: 100%; }
.step { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.step i {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-style: normal; font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.qr {
  width: 132px; height: 132px;
  background: #fff;
  border-radius: 14px;
  padding: 7px;
}
.qr img, .qr canvas { width: 100%; height: 100%; image-rendering: pixelated; }

.footer {
  margin-top: 34px;
  padding: 20px 0 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-4);
  font-size: 11.5px;
  line-height: 1.8;
  text-align: center;
}
.footer a { color: var(--text-3); text-decoration: underline; }

/* ------------------------------------------------------------- 响应式 */
/* 平板 */
@media (min-width: 640px) {
  :root { --gutter: 22px; }
  .rowscroll { grid-auto-columns: 21%; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .hero-media { aspect-ratio: 16 / 10; }
  .hero-title { font-size: 32px; }
  .detail-hero .cover { width: 148px; }
  .detail-hero h1 { font-size: 25px; }
  .epgrid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

/* 桌面 */
@media (min-width: 1000px) {
  :root { --gutter: 30px; --topbar: 66px; }
  .navlinks { display: flex; }
  .tabbar { display: none; }
  .page { padding-bottom: 46px; }
  .rowscroll { grid-auto-columns: 15.4%; }
  .grid { grid-template-columns: repeat(6, 1fr); gap: 16px; }
  /* 桌面 Hero：海报在左、信息在右，铺满宽度 */
  .hero { display: grid; grid-template-columns: 240px 1fr; min-height: 300px; background: var(--night-soft); }
  .hero-arrows { display: flex; }        /* 桌面端给出左右箭头（鼠标也能拖，但箭头更直观） */
  .hero-media { aspect-ratio: auto; height: 100%; min-height: 300px; }
  .hero-media::after { background: linear-gradient(90deg, rgba(7,7,11,0.15), rgba(7,7,11,0.9) 92%); }
  .hero-body {
    position: relative;
    display: flex; flex-direction: column; justify-content: center;
    padding: 30px 34px;
  }
  .hero-title { font-size: 40px; max-width: 15em; }
  .hero-meta { font-size: 14px; margin-bottom: 20px; }
  .section-head h2 { font-size: 21px; }
  .card .cname { font-size: 14.5px; }
  .detail-hero .inner { padding: 26px; gap: 24px; }
  .detail-hero .cover { width: 190px; }
  .detail-hero h1 { font-size: 30px; }
  .player-page { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
  .stage { border-radius: var(--r-lg); margin-top: calc(var(--topbar) + 16px); }
  .side-panel {
    margin-top: calc(var(--topbar) + 16px);
    position: sticky;
    top: calc(var(--topbar) + 16px);
    max-height: calc(100vh - var(--topbar) - 34px);
    overflow-y: auto;
    padding-right: 2px;
  }
  /* 桌面端把选集/线路放在右侧栏里（原来要点开抽屉，白瞎了这块空间） */
  .side-panel .playinfo { padding: 16px; }
  .side-card { padding: 16px; margin-top: 14px; }
  .dl-hero { padding: 54px 20px; }
  #toast { bottom: 34px; }
  /* 分类页：桌面多列 */
  .cat-select { display: flex; flex-wrap: wrap; gap: 10px; }
}

@media (min-width: 1320px) {
  .rowscroll { grid-auto-columns: 13.2%; }
}

/* 竖屏时的安全区（刘海/灵动岛） */
@supports (padding: env(safe-area-inset-top)) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar) + env(safe-area-inset-top)); }
  .page { padding-top: calc(var(--topbar) + env(safe-area-inset-top) + 14px); }
  .hero-body { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}

/* 兜底：不支持 backdrop-filter 的浏览器（老 Firefox）也不能是一片糊 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel, .searchbox, .iconbtn, .chip, .tabbar, .topbar, .btn {
    background: rgba(20, 20, 28, 0.86);
  }
}
