/* =========================================================
   剧盒 · 样式
   移动端优先 · 深色影院风
   ========================================================= */

:root {
  --bg: #0a0c11;
  --bg-soft: #0f1219;
  --elev: #141821;
  --card: #171c26;
  --card-2: #1d2230;
  --line: rgba(255, 255, 255, .075);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #eef1f7;
  --sub: #98a1b2;
  --muted: #6a7284;
  --brand: #2fe3c4;
  --brand-2: #3a9cff;
  --gold: #ffb83d;
  --danger: #ff5b6a;
  --radius: 14px;
  --tab-h: 56px;
  --top-h: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

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

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { min-height: 100vh; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

svg { width: 100%; height: 100%; display: block; }

img { display: block; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: var(--safe-t);
  /* 不透明底：WebView 里 sticky 元素带 backdrop-filter 会在滑动时反复重算模糊，
     低端机就是「一格一格」地卡（2.1.2 拿掉）。 */
  background: #0a0c11;
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.topbar.scrolled { border-bottom-color: var(--line); }

.topbar-inner {
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #04231f;
  padding: 4px;
}
.brand-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .5px;
}

.topbar-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  padding: 7px;
  color: var(--text);
  transition: background .15s;
}
.icon-btn:active { background: rgba(255,255,255,.08); }
#searchBtn { margin-left: auto; }

/* ---------------- 主容器 ---------------- */
.view {
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  min-height: calc(100vh - var(--top-h));
}

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: #0d1016;
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  transition: color .18s;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--brand); }

/* ---------------- 频道 / 筛选 ---------------- */
.channel-wrap {
  position: sticky;
  top: calc(var(--top-h) + var(--safe-t));
  z-index: 30;
  background: #0a0c11;
}

.channels {
  display: flex;
  gap: 20px;
  padding: 6px 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.channels::-webkit-scrollbar { display: none; }

.channel {
  position: relative;
  padding: 8px 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--sub);
  white-space: nowrap;
  transition: color .2s;
}
.channel.active { color: var(--text); }
.channel.active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 2px;
  transform: translateX(-50%);
  width: 18px; height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  padding: 0 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .055);
  color: var(--sub);
  font-size: 12.5px;
  white-space: nowrap;
  transition: all .16s;
}
.chip.on {
  background: linear-gradient(135deg, rgba(47, 227, 196, .18), rgba(58, 156, 255, .18));
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(47, 227, 196, .32);
}
.chip svg { width: 10px; height: 10px; opacity: .6; }
.chip:active { transform: scale(.96); }

/* ---------------- 海报网格 ---------------- */
.section { padding: 4px 16px 0; }

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

.poster-card { display: block; text-align: left; width: 100%; }

/* 首页两排：继续观看 / 最近更新 */
.rail { padding: 10px 0 2px; }
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 7px;
  color: #e8ebf2;
  font-size: 15px;
  font-weight: 700;
}
.rail-head .rail-hint { color: var(--muted); font-size: 11px; font-weight: 400; }
.rail-more { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 2px 0 2px 8px; }
.rail-scroll {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 12px 2px;
  scrollbar-width: none;
}
.rail-scroll::-webkit-scrollbar { display: none; }
.rail-card {
  flex: 0 0 116px;
  width: 116px;
  margin: 0 4px;
  border: 0;
  background: transparent;
  color: #e8ebf2;
  text-align: left;
  padding: 0;
}
.rail-card:active { transform: scale(.97); }
.rail-poster {
  position: relative;
  width: 116px;
  height: 158px;
  border-radius: 9px;
  overflow: hidden;
  background: linear-gradient(145deg, #1c2230, #121620);
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.rail-poster img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.rail-poster img.loaded { opacity: 1; }
.rail-ep, .rail-new {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 2;
  max-width: 104px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0,0,0,.66);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
}
.rail-new { left: auto; right: 6px; background: rgba(255,90,60,.92); }
.rail-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 2; background: rgba(255,255,255,.18); }
.rail-prog i { display: block; height: 100%; background: var(--brand); }
.rail-title { margin-top: 6px; font-size: 12.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-sub { margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.poster {
  position: relative;
  aspect-ratio: 3 / 4.2;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #1c2230, #121620);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.poster img {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s;
}
.poster img.loaded { opacity: 1; }

.poster-fallback {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, .72);
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(47, 227, 196, .16), transparent 60%),
    radial-gradient(120% 90% at 100% 100%, rgba(58, 156, 255, .18), transparent 60%),
    #151a24;
}

.badge {
  position: absolute;
  top: 6px; left: 6px;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, .62);
  letter-spacing: .2px;
}
.badge.rank { background: linear-gradient(135deg, #ff8a3d, #ff5b6a); }
.badge.top { background: linear-gradient(135deg, #ffd166, #ff8a3d); color: #2a1500; }

.poster-score {
  position: absolute;
  right: 6px; bottom: 6px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 1px 6px rgba(0,0,0,.9);
}

.poster-title {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.poster-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------------- 详情页 ---------------- */
.detail-hero {
  position: relative;
  height: 188px;
  overflow: hidden;
}
.detail-hero .bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-size: cover;
  background-position: center 20%;
  filter: blur(18px) saturate(1.3);
  transform: scale(1.25);
  opacity: .55;
}
.detail-hero .bg::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, rgba(10,12,17,.35) 0%, rgba(10,12,17,.86) 62%, var(--bg) 100%);
}

.detail-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 0 16px;
  margin-top: -72px;
}
.detail-hero .poster-big,
.poster-big {
  width: 98px;
  height: 138px;
  flex: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0,0,0,.55);
  background: var(--card);
  position: relative;
}
.poster-big img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }

.detail-head-info {
  min-width: 0;
  padding-bottom: 8px;
}
.detail-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 7px;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  color: var(--sub);
}
.detail-meta .dot { opacity: .35; }
.score-big { color: var(--gold); font-weight: 700; }

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px 0;
}
.tag {
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  color: var(--sub);
  background: rgba(255,255,255,.05);
}

.detail-actions {
  display: flex;
  gap: 10px;
  padding: 14px 16px 4px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: transform .12s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #21c8e8 55%, var(--brand-2));
  color: #032521;
  box-shadow: 0 6px 18px rgba(47, 227, 196, .22);
}
.btn-ghost {
  background: rgba(255,255,255,.07);
  color: var(--text);
}
.btn-ghost.on { color: var(--brand); background: rgba(47,227,196,.12); }
.btn-block { flex: 1; }

.overview {
  padding: 14px 16px 0;
  font-size: 13px;
  line-height: 1.72;
  color: #b9c1d0;
  position: relative;
}
.overview.clamp {
  max-height: calc(3 * 1.72em + 14px);
  overflow: hidden;
}
.overview-toggle {
  margin-top: 2px;
  padding: 4px 16px;
  font-size: 12px;
  color: var(--brand);
}

/* ---------------- 资源线路 ---------------- */
.block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 22px 16px 10px;
  font-size: 15px;
  font-weight: 700;
}
.block-title .hint {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

.lines { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }

.quality-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
}
.qr-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.qr-hint { font-size: 11px; line-height: 1.45; color: var(--muted); opacity: .8; width: 100%; }

.line-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid transparent;
  transition: all .16s;
  text-align: left;
  width: 100%;
}
.line-item.active {
  border-color: rgba(47, 227, 196, .45);
  background: linear-gradient(135deg, rgba(47,227,196,.09), rgba(58,156,255,.06));
}
.line-item:active { transform: scale(.995); }

.line-idx {
  width: 30px; height: 30px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sub);
  background: rgba(255,255,255,.06);
}
.line-item.active .line-idx {
  color: #04231f;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.line-main { flex: 1; min-width: 0; display: block; }
.line-name {
  display: block;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted);
}
.line-tags em {
  font-style: normal;
  color: var(--brand);
}
.line-state {
  flex: none;
  font-size: 12px;
  color: var(--brand);
  padding: 4px 8px;
  border-radius: 8px;
}
.line-state.busy { color: var(--muted); }
.line-state.err { color: var(--danger); }

/* ---------------- 选集 ---------------- */
.season-tabs {
  display: flex;
  gap: 8px;
  padding: 4px 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.season-tabs::-webkit-scrollbar { display: none; }

.ep-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px;
}
.ep-btn {
  position: relative;
  height: 42px;
  border-radius: 9px;
  background: var(--card);
  color: #c8cfdc;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition: all .14s;
  border: 1px solid transparent;
}
.ep-btn:active { transform: scale(.95); }
/* 压缩包集数：黄色描边，点播放会由夸克云解压 */
.ep-btn.archive { box-shadow: inset 0 0 0 1.5px rgba(245,185,66,.7); }
.ep-btn.archive.watched { box-shadow: inset 0 0 0 1.5px rgba(245,185,66,.7), inset 0 0 0 3px rgba(47,227,196,.35); }
.ep-btn.on {
  color: #04231f;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.ep-btn.q4k::after {
  content: "4K";
  position: absolute;
  top: 2px; right: 3px;
  font-size: 8px;
  color: var(--gold);
  opacity: .9;
}

/* ---------------- 搜索 ---------------- */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 16px 12px;
  padding: 0 12px;
  height: 42px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
}
.search-box.focus { border-color: rgba(47,227,196,.45); }
.search-box svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.search-box input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 14.5px;
}
.search-box input::placeholder { color: var(--muted); }
.search-clear { width: 20px; height: 20px; color: var(--muted); flex: none; }

.hot-words { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px; }
.hot-word {
  padding: 7px 13px;
  border-radius: 16px;
  background: var(--card);
  color: var(--sub);
  font-size: 12.5px;
}
.hot-word:active { background: var(--card-2); }

.result-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 16px; }

.result-item {
  display: flex;
  gap: 11px;
  padding: 10px;
  border-radius: 12px;
  background: var(--card);
  transition: background .15s;
  text-align: left;
  width: 100%;
}
.result-item:active { background: var(--card-2); }
.result-cover {
  width: 62px; height: 86px;
  border-radius: 8px;
  overflow: hidden;
  flex: none;
  position: relative;
  background: linear-gradient(145deg, #1c2230, #121620);
}
.result-cover img {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
}
.result-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.result-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.result-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.result-desc {
  margin-top: auto;
  font-size: 11px;
  color: var(--sub);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---------------- 我的 ---------------- */
.me-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px 8px;
}
.me-avatar {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(47,227,196,.9), rgba(58,156,255,.9));
  color: #04231f;
  font-weight: 800;
  font-size: 20px;
}
.me-name { font-size: 17px; font-weight: 700; }
.me-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.list-group {
  margin: 12px 16px 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}
.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row .val { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.list-row .arrow { width: 14px; height: 14px; color: var(--muted); }

.switch {
  margin-left: auto;
  width: 44px; height: 26px;
  border-radius: 13px;
  background: rgba(255,255,255,.14);
  position: relative;
  transition: background .2s;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}
.switch.on { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.switch.on::after { transform: translateX(18px); }

/* ---------------- 空状态 / 加载 ---------------- */
.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.empty-icon {
  width: 46px; height: 46px;
  margin: 0 auto 12px;
  opacity: .35;
}

.skeleton { padding: 6px 16px 0; }
.sk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 9px; }
.sk-item { border-radius: 10px; aspect-ratio: 3 / 4.2; }
.sk-line { height: 10px; border-radius: 5px; margin-top: 7px; }

.shimmer {
  background: linear-gradient(100deg, #171c26 20%, #202737 40%, #171c26 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer {
  from { background-position: 140% 0; }
  to { background-position: -40% 0; }
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.18);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 22px 16px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------------- 底部弹层 ---------------- */
.sheet-mask {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  animation: fade .18s ease;
}
.sheet-mask[hidden] { display: none; }

.sheet {
  width: 100%;
  background: #12161f;
  border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(16px + var(--safe-b));
  border-top: 1px solid var(--line);
  animation: slideUp .24s cubic-bezier(.2, .9, .3, 1);
  max-height: 80vh;
  overflow-y: auto;
}
.sheet-handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.18);
  margin: 4px auto 14px;
}
.sheet-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  word-break: break-all;
}
.sheet-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
  word-break: break-all;
  line-height: 1.6;
}
.sheet-actions { display: flex; flex-direction: column; gap: 9px; }

/* 分享给朋友：二维码 + 链接 */
.share-qr {
  width: 190px;
  height: 190px;
  margin: 2px auto 10px;
  padding: 8px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.share-qr svg { width: 100%; height: 100%; }
.share-url {
  margin: 0 auto 14px;
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  color: var(--sub);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  word-break: break-all;
}

.opt-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.opt {
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: var(--sub);
  font-size: 13px;
}
.opt.on {
  color: var(--brand);
  background: rgba(47,227,196,.13);
  box-shadow: inset 0 0 0 1px rgba(47,227,196,.3);
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 24px);
  transform: translateX(-50%) translateY(6px);
  z-index: 120;
  max-width: 78vw;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(28, 33, 44, .96);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: none; }

/* ---------------- 横滑推荐 ---------------- */
.hscroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 16px 4px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.hscroll::-webkit-scrollbar { display: none; }
.hcard {
  flex: none;
  width: 104px;
  scroll-snap-align: start;
}
.hcard .poster { aspect-ratio: 3 / 4.15; }

/* ---------------- 杂项 ---------------- */
.divider { height: 1px; background: var(--line); margin: 18px 16px 0; }
.note {
  padding: 10px 16px 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
}
.center { text-align: center; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }

/* =========================================================
   兼容层：Chrome 83 及更早的 WebView 不支持 flex 的 gap，
   这里统一关掉 gap，改用 margin 控制间距（新老内核表现一致）
   ========================================================= */
.topbar-inner, .brand, .channels, .filter-row, .detail-head,
.detail-actions, .block-title, .line-item, .line-tags, .season-tabs,
.search-box, .me-head, .list-row, .btn, .chip, .tab { gap: 0; }

.topbar-inner > * + * { margin-left: 10px; }
.brand > * + * { margin-left: 8px; }
.channels > * + * { margin-left: 20px; }
.filter-row > * + * { margin-left: 8px; }
.detail-head > * + * { margin-left: 14px; }
.detail-actions > * + * { margin-left: 10px; }
.block-title > * + * { margin-left: 8px; }
.season-tabs > * + * { margin-left: 8px; }
.me-head > * + * { margin-left: 14px; }
.chip svg { margin-left: 3px; }
.btn svg { margin-right: 6px; }
.tab span { margin-top: 3px; }

.line-item > .line-idx { margin-right: 10px; }
.line-item > .line-state { margin-left: 8px; }
.line-tags > * + * { margin-left: 6px; }

.lines > * + * { margin-top: 8px; }
.result-list > * + * { margin-top: 10px; }
.sheet-actions > * + * { margin-top: 9px; }

.detail-meta, .detail-tags, .hot-words, .result-meta, .opt-list { gap: 0; }
.detail-meta > *, .detail-tags > *, .hot-words > *,
.result-meta > *, .opt-list > * { margin: 0 6px 6px 0; }

.search-box > * + * { margin-left: 8px; }
.list-row > * + * { margin-left: 10px; }
.list-row > .val { margin-left: auto; }

/* =========================================================
   兼容层 2：Chrome 83 不支持 aspect-ratio（88+ 才有），
   用 padding-top 百分比撑出同样的比例
   ========================================================= */
@supports not (aspect-ratio: 1 / 1) {
  .poster { height: 0; padding-top: 140%; }
  .hcard .poster { padding-top: 138.3%; }
  .sk-item { height: 0; padding-top: 140%; }
  .poster > img {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%; height: 100%;
  }
}
/* 补充：结果卡片 / 横滑卡片 / 加载行 的 flex gap（Chrome 83 无效） */
.result-item { gap: 0; }
.result-item > * + * { margin-left: 11px; }
.hscroll { gap: 0; }
.hscroll > * + * { margin-left: 10px; }
.loading-row { gap: 0; }
.loading-row > * + * { margin-left: 9px; }
.list-row > .switch { margin-left: auto; }
/* 手机上点击后别留一圈焦点框（Chrome 83 没有 :focus-visible） */
button:focus, a:focus, [tabindex]:focus { outline: none; }
/* ---------------- 继续观看 ---------------- */
.continue-bar {
  margin: 12px 16px 0;
  width: calc(100% - 32px);
  display: flex;
  align-items: center;
  text-align: left;
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(47,227,196,.16), rgba(58,156,255,.12));
  border: 1px solid rgba(47,227,196,.32);
  color: #dff7f2;
  font-size: 13.5px;
}
.cb-play {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #06231e;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  flex: none;
}
.cb-text { flex: 1; margin-left: 10px; }
.cb-arrow { color: var(--brand); font-size: 18px; margin-left: 8px; }
.ep-btn.watched { box-shadow: inset 0 0 0 1.5px rgba(47,227,196,.65); color: var(--brand); }
.ep-btn.saved::before {
  content: "";
  position: absolute;
  left: 5px; top: 5px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brand);
  opacity: .75;
}
/* 夸克已保存资源卡片：明确告诉用户「不用再全网搜」 */
.lib-card {
  margin: 0 16px 12px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(47,227,196,.10), rgba(255,255,255,.02));
  border: 1px solid rgba(47,227,196,.25);
}
.lib-main { display: flex; flex-direction: column; gap: 3px; }
.lib-main b { color: var(--brand); font-size: 14px; }
.lib-main span { color: var(--muted); font-size: 12px; }
.lib-tips { color: #8b95a5; font-size: 12px; line-height: 1.6; margin: 9px 0 10px; }
/* 选中集：缺资源灰掉 / 合集标记 */
.ep-btn.off {
  opacity: .28;
  color: #8b93a3;
  background: rgba(255,255,255,.03);
}
.ep-btn.merged::after {
  content: "合集";
  position: absolute;
  top: 2px; right: 3px;
  font-size: 8px;
  color: var(--brand);
  opacity: .9;
}

/* ---------------- 一键解析按钮 ---------------- */
.mini-btn {
  flex: none;
  height: 26px;
  padding: 0 11px;
  border-radius: 13px;
  font-size: 11.5px;
  font-weight: 700;
  color: #04231f;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none;
  white-space: nowrap;
}
.mini-btn:active { transform: scale(.95); }
.mini-btn.busy {
  color: var(--muted);
  background: rgba(255,255,255,.07);
}

/* ---------------- 首页上滑加载 ---------------- */
.load-more {
  padding: 18px 16px 26px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.load-more .spinner {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 6px;
}
.load-more.end { color: #59606f; padding-bottom: 30px; }

/* 缺集时用户自己点的「补齐缺集」入口 */
.ep-more {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 2px;
}
.ep-more-tip { color: #8b95a5; font-size: 11.5px; line-height: 1.5; }

/* 缺集：不再是死按钮，点一下全网找这一集 */
.ep-btn.find {
  opacity: .55;
  color: #b6bfcf;
  background: rgba(255,255,255,.04);
  border: 1px dashed rgba(255,255,255,.16);
}
.ep-btn.find::after {
  content: "找";
  position: absolute;
  top: 1px; right: 3px;
  font-size: 8px;
  color: var(--brand);
}
.ep-gap-find {
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #04231f;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

/* 缺集太多时压成一条提示（占满一整行） */
.ep-gap {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 9px;
  background: rgba(255,255,255,.03);
  border: 1px dashed rgba(255,255,255,.09);
  color: #5d6472;
  font-size: 11.5px;
}

/* ---------------- 内嵌播放器 ---------------- */
.player {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 上下滑亮度/音量时别让 WebView 再把手势当页面滚动/下拉刷新 */
  touch-action: none;
  overscroll-behavior: contain;
}
.player video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  background: #000;
  object-fit: contain;
}
/* 画面比例「铺满」：转码档和原片比例不一样时，用裁边把画面顶满屏幕 */
.player.vid-fill video { object-fit: cover; }
.player-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: linear-gradient(rgba(0,0,0,.72), rgba(0,0,0,0));
  z-index: 3;
}
.player-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff;
  padding: 0;
}
.player-btn svg { width: 21px; height: 21px; }
#playerBack { background: rgba(0,0,0,.55); }
.player-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 10px;
  color: #fff;
  font-size: 13.5px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-nav { display: flex; flex: 0 0 auto; }
.player-nav .pbtn { margin-left: 8px; }

.pbtn {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12.5px;
  line-height: 1;
}
.pbtn-sm { padding: 6px 10px; font-size: 12px; }
.pbtn-primary { background: var(--brand, #ff5a3c); border-color: transparent; color: #fff; }
.pbtn:disabled { opacity: .4; }

/* 播放中途的缓冲提示统一用 sub.js 的 #jbBufChip（贴顶栏那一颗），
   这里不再有居中的第二颗——两颗一起弹就是 2026-10-31 用户截图报的那个。 */

.player-loading {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.82);
  z-index: 2;
  text-align: center;
  padding: 0 24px;
}
.player-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.18);
  border-top-color: #fff;
  animation: pspin .8s linear infinite;
  margin-bottom: 14px;
}
@keyframes pspin { to { transform: rotate(360deg); } }
.player-msg { color: #dfe3ea; font-size: 13.5px; line-height: 1.6; }
.player-actions { margin-top: 18px; display: flex; }
.player-actions .pbtn { margin: 0 5px; padding: 10px 16px; font-size: 13.5px; }

/* ---------------- 登录表单 ---------------- */
.login-form { padding: 2px 0 4px; }
.login-form .field { margin-bottom: 10px; }
.login-form label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}
.login-form input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: var(--fg, #e8ebf2);
  font-size: 15px;
  padding: 11px 12px;
  outline: none;
}
.login-form input:focus { border-color: rgba(255,90,60,.6); }
.login-form .err {
  color: #ff7a6b;
  font-size: 12.5px;
  min-height: 18px;
  margin: 4px 0 8px;
}
.login-form .btn-block { width: 100%; }
.login-form .tip {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 10px;
}

/* ===== 播放器控制层（腾讯视频式） ===== */
/* WebView 是 Chrome 83：不能用 flex gap / inset，改用 margin 和四边属性 */

.player-bigplay {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  color: #fff;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.player-bigplay svg { width: 32px; height: 32px; margin-left: 4px; }
.player-bigplay[hidden] { display: none; }

/* 播放时只自动隐藏底部控制条；左上角关闭按钮永远留着，避免找不到退出 */
.player.ctl-hidden .player-top { background: transparent; }
.player.ctl-hidden .player-top .player-title,
.player.ctl-hidden .player-top #playerEpsBtn { opacity: 0; pointer-events: none; }
.player.ctl-hidden .player-ctl { opacity: 0; pointer-events: none; }
.player.ctl-hidden .player-bigplay { opacity: 0; pointer-events: none; }
.player-top, .player-ctl, .player-bigplay {
  transition: opacity .18s ease;
}

.player-ctl {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px 14px;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.82));
  z-index: 4;
  color: #fff;
}

.pc-time {
  display: flex;
  align-items: center;
  font-size: 11.5px;
  color: #dfe3ea;
  font-variant-numeric: tabular-nums;
  margin-bottom: 7px;
}
.pc-sep { margin: 0 5px; color: #7b8394; }

/* 进度条：容器给足可点区域，视觉轨道在中间 */
.pc-bar {
  position: relative;
  height: 26px;
  display: flex;
  align-items: center;
}
.pc-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.24);
  overflow: hidden;
}
.pc-buf, .pc-played {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
}
.pc-buf { background: rgba(255,255,255,.36); }
.pc-played { background: var(--brand, #ff5a3c); }
.pc-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
  pointer-events: none;
}

.pc-row {
  display: flex;
  align-items: center;
  margin-top: 4px;
}
.pc-spacer { flex: 1 1 auto; }
.pc-btn {
  min-width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 14px;
}
.pc-btn svg { width: 22px; height: 22px; }
/* WebView 里 SVG 的 hidden 属性不可靠，双保险 */
.pc-btn svg[hidden] { display: none; }
.pc-btn:active { background: rgba(255,255,255,.12); }
.pc-text {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 14px;
  min-width: 42px;
}
.pc-btn[hidden] { display: none; }

/* 选集浮层 */
.player-eps,
.player-quality {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 62%;
  background: rgba(14,17,23,.97);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  padding-bottom: 78px;
}
.player-eps[hidden], .player-quality[hidden] { display: none; }
.pq-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 12px 14px;
  display: flex;
  flex-direction: column;
}
.pq-group {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 4px 4px;
  color: #d8dee9;
  font-size: 12.5px;
}
.pq-group span { color: #7d8798; font-size: 11px; }
.pq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 4px 8px;
}
.pq-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  margin: 5px 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: #1b2029;
  color: #c8d0dd;
  font-size: 13.5px;
  text-align: left;
}
.pq-item .pq-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 画质档位：第一行档位名，第二行分辨率和一集流量 */
.pq-item .pq-name em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 11px;
  color: #8b95a5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pq-item.on .pq-name em { color: rgba(255,255,255,.78); }
.pq-item .pq-tag { font-size: 12px; color: #7d8798; margin-left: 8px; white-space: nowrap; }
.pq-item.on { background: var(--brand, #ff5a3c); color: #fff; }
.pq-item.on .pq-tag { color: rgba(255,255,255,.8); }
.pq-item:disabled { opacity: .38; }
/* 语言面板：全网找国语版（粤语/原声的片子去别的分享里找配音版） */
.pq-item.find {
  background: transparent;
  color: #cfd6e2;
  box-shadow: inset 0 0 0 1px rgba(47,227,196,.5);
}
.pq-item.find .pq-tag { color: var(--brand, #2fe3c4); }
.pq-item.find.busy { opacity: .8; }
.pq-item.find em { color: #8b95a5; }
.pq-note {
  margin: 2px 4px 10px;
  color: #8b95a5;
  font-size: 12px;
  line-height: 1.55;
}
.pe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
}
.pe-meta { color: #7d8798; font-size: 12px; font-weight: 400; }
.pe-grid {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 12px 12px;
  display: flex;
  flex-wrap: wrap;
}
.pe-item {
  width: 50px;
  height: 44px;
  margin: 5px;
  border: 0;
  border-radius: 9px;
  background: #1b2029;
  color: #c8d0dd;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.pe-item.on {
  background: var(--brand, #ff5a3c);
  color: #fff;
  font-weight: 700;
}
.pe-item:disabled { opacity: .32; }
.pe-item.archive { box-shadow: inset 0 0 0 1.5px rgba(245,185,66,.7); }
/* 缺集：不再是点不动的灰块，右上角带个「找」，点了去别的分享里找这一集 */
.pe-item.find {
  position: relative;
  background: transparent;
  color: #7f8998;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.pe-item.find i {
  position: absolute;
  right: 3px;
  top: 1px;
  font-style: normal;
  font-size: 9px;
  line-height: 1;
  color: var(--brand, #2fe3c4);
}
.pe-item.find.busy { color: #cfd6e2; box-shadow: inset 0 0 0 1px rgba(47,227,196,.55); }

.player:fullscreen video,
.player:-webkit-full-screen video { height: 100%; }

/* 手机横屏（矮屏）：画质/线路/选集/倍速/设置这些底部弹层统一改成右侧整高抽屉，
   画面留在左边整屏可看；抽屉从顶到底一整块，里面自己滚，不会再出现「横屏只剩一条」 */
@media (orientation: landscape) and (max-height: 560px) {
  .player-eps,
  .player-quality {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(46vw, 420px);
    max-height: none;
    border-top-left-radius: 14px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    padding-top: env(safe-area-inset-top);
  }
  .pq-list,
  .pe-grid { padding-bottom: 12px; }
  .pe-head { padding-top: 12px; }
}

/* ---------------- 手势 HUD / 倍速 / 设置（2.1） ---------------- */

/* 横屏全屏：控制条隐藏时，连关闭和设置按钮一起淡出，画面只剩视频 */
.player.fs.ctl-hidden .player-top .player-btn { opacity: 0; pointer-events: none; }
.player-top .player-btn { transition: opacity .18s ease; }

.player-hud {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.66);
  color: #fff;
  z-index: 7;
  min-width: 58px;
  pointer-events: none;
}
.player-hud[hidden] { display: none; }
.player-hud.left { left: 34px; }
.player-hud.right { right: 34px; }
.hud-ico { font-size: 17px; line-height: 1; color: #ffd479; }
.player-hud.right .hud-ico { color: #8fd0ff; }
.hud-track {
  width: 6px;
  height: 148px;
  border-radius: 3px;
  background: rgba(255,255,255,.22);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.hud-fill { width: 100%; height: 100%; background: #fff; border-radius: 3px; transform-origin: 50% 100%; transform: scaleY(0.5); }
.hud-num { font-size: 12px; color: #e6ecf6; font-variant-numeric: tabular-nums; }

/* 长按加速提示 */
.player-boost-tip {
  position: absolute;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0,0,0,.66);
  color: #fff;
  font-size: 13px;
  z-index: 7;
  pointer-events: none;
}
.player-boost-tip[hidden] { display: none; }

/* 倍速微调：0.5~3.0，每按一次 ±0.1（2.4.53） */
.rate-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 2px 16px 4px;
}
.rate-step-btn {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: #1b2029;
  color: #c8d0dd;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rate-step-btn:active { background: #262d3a; }
/* 到 0.5 / 3.0 边界后置灰（仍可点，但不响应） */
.rate-step-btn.off { color: #5a6373; background: #151a22; }
.rate-cur {
  min-width: 88px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.rate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px 14px 18px;
}
.rate-item {
  padding: 12px 0;
  border: 0;
  border-radius: 10px;
  background: #1b2029;
  color: #c8d0dd;
  font-size: 14px;
}
.rate-item.on { background: var(--brand, #ff5a3c); color: #fff; }

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
}
.set-label { color: #c8d0dd; font-size: 14px; }
.seg { display: flex; background: #1b2029; border-radius: 10px; padding: 3px; gap: 3px; }
.seg button {
  border: 0;
  background: transparent;
  color: #aab3c2;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13.5px;
}
.seg button.on { background: var(--brand, #ff5a3c); color: #fff; }
.set-tip { padding: 8px 16px 20px; color: #8b95a5; font-size: 12px; line-height: 1.6; }

/* 双击步长：竖排 + 滑块 */
.set-row-col {
  flex-direction: column;
  align-items: stretch;
}
.set-row-col .set-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.set-row-col .set-label b {
  color: var(--brand, #ff5a3c);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.set-range {
  width: 100%;
  height: 26px;
  margin: 0;
  background: transparent;
}

/* 横滑调进度时的 HUD：居中横条 */
.player-hud.seek {
  left: 50%;
  right: auto;
  top: 46%;
  transform: translate(-50%, -50%);
  flex-direction: row;
  padding: 12px 20px;
  border-radius: 14px;
  min-width: 92px;
}
.player-hud.seek .hud-track { display: none; }
.player-hud.seek .hud-ico { color: #fff; font-size: 18px; }
.player-hud.seek .hud-num { font-size: 15px; font-weight: 600; }

/* ---------------- 双击快进/后退反馈（腾讯视频式，2.1.2） ---------------- */
.player-seek-tip {
  position: absolute;
  top: 50%;
  width: 132px;
  height: 132px;
  margin-top: -66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .38);
  color: #fff;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transform: scale(.82);
  transition: opacity .16s ease, transform .16s ease;
}
.player-seek-tip.left { left: 7%; }
.player-seek-tip.right { right: 7%; }
.player-seek-tip.show { opacity: 1; transform: scale(1); }
.player-seek-tip .st-arrows { display: flex; align-items: center; }
.player-seek-tip .st-arrows svg { width: 22px; height: 22px; margin: 0 -4px; opacity: .95; }
.player-seek-tip.left .st-arrows { transform: scaleX(-1); }
.player-seek-tip .st-num { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.player-seek-tip.show .st-arrows svg:nth-child(1) { animation: stPulse .7s ease .0s; }
.player-seek-tip.show .st-arrows svg:nth-child(2) { animation: stPulse .7s ease .08s; }
.player-seek-tip.show .st-arrows svg:nth-child(3) { animation: stPulse .7s ease .16s; }
@keyframes stPulse {
  0% { opacity: .25; transform: translateX(-4px); }
  45% { opacity: 1; transform: translateX(0); }
  100% { opacity: .85; transform: translateX(0); }
}

/* 上一集 / 下一集 */
.pc-navbtn svg { width: 21px; height: 21px; }
.pc-btn[disabled] { opacity: .3; }


/* =========================================================
   观看记录 / 收藏（首页同款海报墙）
   ========================================================= */
.shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 4px;
  font-size: 14px;
  font-weight: 600;
}
.shelf-head .hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.shelf-card { position: relative; }
.shelf-badge {
  position: absolute;
  left: 6px;
  bottom: 8px;
  z-index: 2;
  max-width: calc(100% - 12px);
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .66);
  color: #fff;
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shelf-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  height: 3px;
  background: rgba(255, 255, 255, .16);
}
.shelf-progress i {
  display: block;
  height: 100%;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.shelf-more {
  position: absolute;
  top: 6px; right: 6px;
  z-index: 4;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .56);
  color: rgba(255, 255, 255, .9);
  font-size: 10px;
}

/* =========================================================
   离线缓存
   ========================================================= */
.dl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 16px 0;
  padding: 14px;
  border-radius: 14px;
  background: var(--card);
}
.dl-top-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dl-top-num { font-size: 27px; font-weight: 800; color: var(--brand); line-height: 1; }
.dl-top-txt { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.dl-top-txt b { font-size: 13px; color: var(--text); font-weight: 600; }
.dl-top-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.dl-top-actions button {
  font-size: 11px;
  color: var(--brand);
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(47, 227, 196, .1);
  white-space: nowrap;
}
#dlRows { padding: 6px 16px 16px; }
.dl-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.dl-row:last-child { border-bottom: 0; }
.dl-cover {
  position: relative;
  width: 56px;
  height: 76px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-2);
}
.dl-cover img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.dl-cover .poster-fallback { font-size: 10px; padding: 4px; }
.dl-info { flex: 1; min-width: 0; }
.dl-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dl-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dl-status { margin-top: 5px; font-size: 11px; color: var(--sub); line-height: 1.4; }
.dl-status.ok { color: var(--brand); }
.dl-status.run { color: var(--gold); }
.dl-status.err { color: var(--danger); }
.dl-bar {
  height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.dl-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.dl-ops { display: flex; flex-direction: column; gap: 6px; flex: none; }
.dl-op {
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  white-space: nowrap;
}
.dl-op.primary { background: rgba(47, 227, 196, .16); color: var(--brand); }

/* 缓存弹层 */
.dl-space {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 12px;
  font-size: 12px;
  color: var(--muted);
}
.dl-space b { color: var(--text); }

/* 存储空间：分类占用 */
.st-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 0 2px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(47, 227, 196, .08);
  color: var(--muted);
  font-size: 12.5px;
}
.st-total b { color: var(--brand); font-size: 19px; letter-spacing: .3px; }
.st-warn {
  margin: 8px 0 2px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 90, 60, .12);
  color: #ffb3a3;
  font-size: 12px;
  line-height: 1.5;
}
.st-suggest {
  margin: 10px 0 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(47, 227, 196, .07);
}
.st-suggest b { display: block; color: #bfe9df; font-size: 12px; margin-bottom: 4px; }
.st-suggest button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.06);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
}
.st-suggest button:first-of-type { border-top: 0; }
.st-suggest button span { flex: 1; min-width: 0; padding-right: 8px; color: #c8d0dd; line-height: 1.4; }
.st-suggest button em { flex: 0 0 auto; font-style: normal; color: var(--brand); font-size: 11.5px; }
.st-list { margin-top: 4px; }
.st-row {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.st-row:last-child { border-bottom: 0; }
.st-name { flex: 1; min-width: 0; font-size: 13.5px; }
.st-name small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.st-size { margin-left: 10px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.st-clr {
  margin-left: 10px;
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: var(--brand);
  font-size: 11.5px;
}
.dl-range { display: flex; gap: 8px; margin-bottom: 10px; }
.dl-q-list { display: flex; flex-direction: column; gap: 8px; }
.dl-q {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid transparent;
  text-align: left;
}
.dl-q.on {
  border-color: rgba(47, 227, 196, .55);
  background: rgba(47, 227, 196, .09);
}
.dl-q-name { font-size: 13.5px; font-weight: 600; }
.dl-q-size { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.dl-q-check { margin-left: 6px; color: var(--brand); font-weight: 700; }
.dl-sum { margin: 12px 0 8px; font-size: 12px; color: var(--sub); }
.dl-warn {
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 91, 106, .25);
  background: rgba(255, 91, 106, .08);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.6;
}
.dl-warn-link { margin-left: 4px; color: var(--danger); text-decoration: underline; font-size: 12px; }
.dl-start.disabled, .dl-start[disabled] { opacity: .45; }

/* 播放器上多了一个「缓存」，窄屏也别把按钮挤出去 */
.pc-row .pc-text { min-width: 40px; padding: 0 4px; font-size: 12.5px; }
/* 播放器打开时，「缓存」这类弹层要压在播放器上面 */
.sheet-mask { z-index: 10000; }
/* 播放器里的提示也要看得见 */
.toast { z-index: 10001; }

/* =========================================================
   批量管理 / 点击反馈 / 播放缓存
   ========================================================= */
.shelf-head { align-items: center; }
.shelf-head-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.shelf-head-actions button {
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  color: var(--brand);
  background: rgba(47, 227, 196, .1);
}
.shelf-tip {
  padding: 0 16px 6px;
  font-size: 11px;
  color: var(--muted);
}
.shelf-card.picking { cursor: pointer; }
.shelf-card.selected .poster {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
.shelf-card.selected .poster-fallback,
.shelf-card.selected .poster img { opacity: .82; }
.shelf-check {
  position: absolute;
  top: 6px; left: 6px;
  z-index: 6;
  width: 23px; height: 23px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: transparent;
  background: rgba(0, 0, 0, .55);
  border: 1.5px solid rgba(255, 255, 255, .65);
  backdrop-filter: blur(4px);
}
.shelf-check svg { width: 14px; height: 14px; }
.shelf-check.on { color: #04231f; background: var(--brand); border-color: var(--brand); }

.dl-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 0;
}
.dl-chips {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.dl-chips::-webkit-scrollbar { display: none; }
.dl-chips .chip { flex: none; }
.dl-chips .chip b { font-weight: 600; opacity: .75; margin-left: 1px; }
.dl-cache-btn {
  flex: none;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
}
.dl-check {
  width: 22px; height: 22px;
  flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  color: transparent;
  border: 1.5px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .03);
}
.dl-check svg { width: 13px; height: 13px; }
.dl-check.on { color: #04231f; background: var(--brand); border-color: var(--brand); }
.dl-row.selected {
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 10px;
  background: rgba(47, 227, 196, .07);
}
.dl-seen {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--brand);
  background: rgba(47, 227, 196, .13);
  vertical-align: 1px;
}

.bulk-bar {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(var(--safe-b) + 12px);
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(24, 29, 39, .96);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  backdrop-filter: blur(14px);
}
.bulk-info { font-size: 12px; color: var(--sub); }
.bulk-info b { font-size: 16px; color: var(--brand); margin: 0 2px; }
.bulk-bar > button {
  margin-left: auto;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--text);
  background: rgba(255, 255, 255, .09);
}
.bulk-bar > button + button { margin-left: 0; }
.bulk-bar .bulk-del { color: #fff; background: var(--danger); }
.bulk-bar .bulk-del[disabled] { opacity: .35; }
.view.has-bulk { padding-bottom: calc(var(--safe-b) + 104px); }

.tab, .list-row, .poster-card, .dl-row, .chip, .btn, .icon-btn, .dl-op,
.shelf-head-actions button, .dl-cache-btn, .bulk-bar button {
  transition: transform .12s ease, opacity .12s ease, background .15s ease;
}
.tap-fx { transform: scale(.965); opacity: .84; }
.poster-card.tap-fx { transform: scale(.975); }
.dl-start { width: 100%; margin-top: 4px; }

/* 我的 → 错误日志 */
.log-wrap {
  margin: 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  overflow: auto;
  max-height: 220px;
}
.log-pre {
  margin: 0;
  padding: 10px 12px;
  font: 11px/1.55 ui-monospace, Consolas, monospace;
  color: var(--sub);
  white-space: pre-wrap;
  word-break: break-all;
}

/* 原生播放模式：只留控件，画面来自垫底 SurfaceView */
body.native-video, body.native-video .player { background: transparent !important; }
body.native-video #playerVideo { visibility: hidden !important; }
body.native-video #app { visibility: hidden !important; }
body.native-video #player { visibility: visible !important; }
