/* ============ 设计变量 ============ */
:root {
  --brand: #ff4d3a;
  --brand-2: #ff8a3d;
  --bg: #0b0d10;
  --bg-2: #11141a;
  --card: #151922;
  --card-2: #1b202b;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --fg: #eef1f5;
  --muted: #98a2b3;
  --ok: #33c27f;
  --warn: #ffb020;
  --shadow: 0 12px 32px rgba(0, 0, 0, .38);
  --radius: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --nav-h: 58px;
}

[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #f7f8fa;
  --line: rgba(15, 23, 42, .09);
  --line-2: rgba(15, 23, 42, .16);
  --fg: #12161c;
  --muted: #667085;
  --shadow: 0 10px 26px rgba(15, 23, 42, .10);
}

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

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

html.pl-open, html.pl-open body { overflow: hidden; height: 100%; }

body { min-height: 100vh; }

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

input { font: inherit; }

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

::-webkit-scrollbar { width: 0; height: 0; }

/* ============ 密码门禁 ============ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(20px + var(--safe-t)) 20px calc(20px + var(--safe-b));
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 77, 58, .20), transparent 60%),
    radial-gradient(90% 70% at 20% 100%, rgba(255, 138, 61, .12), transparent 60%),
    #07080b;
  transition: opacity .22s ease;
}

.gate.is-out { opacity: 0; pointer-events: none; }

.gate-box { width: 100%; max-width: 360px; text-align: center; }

.gate-logo {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 14px 30px rgba(255, 77, 58, .38);
}

.gate-logo svg { width: 28px; height: 28px; fill: #fff; margin-left: 3px; }

.gate h1 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: .5px;
}

.gate-tip { margin: 0 0 22px; color: var(--muted); font-size: 13px; }

.gate-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  height: 14px;
  margin-bottom: 26px;
}

.gate-dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .28);
  transition: all .15s ease;
}

.gate-dots i.on {
  background: var(--brand);
  border-color: var(--brand);
  transform: scale(1.08);
  box-shadow: 0 0 14px rgba(255, 77, 58, .6);
}

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

.gate-keypad button {
  height: 54px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  font-size: 20px;
  font-weight: 500;
  color: #f4f6fa;
  transition: transform .12s ease, background .15s ease;
}

.gate-keypad button:active { transform: scale(.96); background: rgba(255, 255, 255, .14); }
.gate-keypad button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.gate-keypad .k-fn { font-size: 15px; color: #c9d0da; }
.gate-keypad .k-ok {
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 16px;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(255, 77, 58, .32);
}

.gate-err { min-height: 18px; margin: 14px 0 0; color: #ff7a6b; font-size: 12.5px; }
.gate-note { margin: 6px 0 0; color: rgba(255, 255, 255, .32); font-size: 11.5px; }

.gate.is-shake .gate-box { animation: shake .34s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

/* ============ 应用框架 ============ */
.app {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; min-width: 0; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  flex: none;
}

.brand-mark svg { width: 15px; height: 15px; fill: #fff; margin-left: 2px; }

.brand-name { font-size: 16px; font-weight: 600; letter-spacing: .3px; white-space: nowrap; }

.top-btn {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  color: var(--fg);
  flex: none;
}

[data-theme="light"] .top-btn { background: #fff; }

.top-search {
  width: 48px;
  padding: 3px 4px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 9px;
  line-height: 1.1;
  white-space: nowrap;
}

.top-search svg { width: 16px; height: 16px; flex: none; }
.top-search span { display: block; }

.top-btn:active { transform: scale(.94); }

.rail {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--bg-2);
  background: color-mix(in srgb, var(--bg-2) 94%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

.rail-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10.5px;
  transition: color .16s ease;
}

.rail-item svg { width: 21px; height: 21px; }
.rail-item.is-on { color: var(--brand); }

.main {
  padding: 12px 16px 8px;
  max-width: 1320px;
  margin: 0 auto;
}

/* ============ 分类标签 ============ */
.cats {
  position: sticky;
  top: calc(58px + var(--safe-t));
  z-index: 20;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 10px;
  margin: -12px -16px 4px;
  padding-left: 16px;
  padding-right: 16px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cat {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 33px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  transition: all .16s ease;
}

[data-theme="light"] .cat { background: #fff; }

.cat em { font-style: normal; font-size: 10.5px; opacity: .6; }

.cat.is-on {
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(255, 77, 58, .3);
}

/* ============ 区块 ============ */
.sec { margin: 16px 0 4px; }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sec-head h2 { margin: 0; font-size: 16.5px; font-weight: 600; }
.sec-count { color: var(--muted); font-size: 12px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 12px;
}

/* ============ 继续观看 ============ */
.row-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.cont-card {
  position: relative;
  flex: none;
  width: 208px;
  padding: 12px 12px 14px;
  border-radius: 14px;
  text-align: left;
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  scroll-snap-align: start;
  overflow: hidden;
}

.cont-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 100% 0%, rgba(255, 77, 58, .16), transparent 70%);
  pointer-events: none;
}

.cont-name {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cont-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; }

.cont-bar {
  display: block;
  height: 3px;
  margin-top: 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.cont-bar b { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

.cont-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  opacity: 0;
  transition: opacity .16s;
}

.cont-play svg { width: 12px; height: 12px; margin-left: 1px; }
.cont-card:hover .cont-play, .cont-card:active .cont-play { opacity: 1; }

/* ============ 资源卡 ============ */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 13px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand);
  opacity: .85;
}

.card.t-web::before { background: #4b7bec; }
.card.t-vod::before { background: #ff4d3a; }
.card.t-live::before { background: #f7b731; }
.card.t-ali::before { background: #33c27f; }
.card.t-config::before { background: #8b5cf6; }

.card:active { transform: scale(.995); }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(140deg, rgba(255, 77, 58, .95), rgba(255, 138, 61, .95));
  letter-spacing: .2px;
}

.card h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 600; line-height: 1.35; }

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

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  margin-bottom: 12px;
}

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.dot.t-web { background: #4b7bec; }
.dot.t-vod { background: #ff4d3a; }
.dot.t-live { background: #f7b731; }
.dot.t-ali { background: #33c27f; }
.dot.t-config { background: #8b5cf6; }

.star {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 9px;
  color: var(--muted);
  flex: none;
}

.star.is-on { color: var(--warn); }
.star:active { transform: scale(.9); }

.card-acts {
  display: flex;
  gap: 7px;
  margin-top: auto;
  flex-wrap: wrap;
}

.card-acts button {
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12.5px;
  white-space: nowrap;
  transition: transform .12s ease, opacity .15s;
}

.card-acts button:active { transform: scale(.96); }

.btn-primary {
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 14px rgba(255, 77, 58, .26);
}

.btn-ghost {
  color: var(--fg);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
}

[data-theme="light"] .btn-ghost { background: #f2f3f6; }
.btn-ghost.danger { color: #ff5c4d; border-color: rgba(255, 92, 77, .35); }

/* ============ 页面标题 / 状态 ============ */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px 14px;
}

.page-head h1 { margin: 0; font-size: 20px; }
.page-head span { color: var(--muted); font-size: 12.5px; }

.head-actions { display: flex; align-items: center; gap: 9px; }

.page-search {
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  font-size: 12px;
  white-space: nowrap;
}

.page-search svg { width: 14px; height: 14px; }
.page-search:active { transform: scale(.96); }

.page-tip {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.state {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.state h3 { margin: 12px 0 8px; color: var(--fg); font-size: 16px; }

.state-ico {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 22px;
  color: var(--muted);
}

.state-sub { font-size: 11.5px; opacity: .75; word-break: break-all; }
.state .btn-primary { height: 36px; padding: 0 18px; border-radius: 10px; margin-top: 8px; font-size: 13px; }

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 搜索 ============ */
.search-wrap { padding: 4px 0 12px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
}

.search-box svg { width: 18px; height: 18px; color: var(--muted); flex: none; }

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--fg);
  font-size: 14px;
  outline: none;
}

.search-box input::-webkit-search-cancel-button { display: none; }

.search-clear {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, .08);
  font-size: 14px;
  line-height: 1;
  flex: none;
}

.search-submit {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  flex: none;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }

.chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 12.5px;
}

.group-title { margin: 18px 0 8px; font-size: 13px; color: var(--muted); font-weight: 500; }

/* 站内搜索列表 */
.site-list { display: flex; flex-direction: column; gap: 8px; }

.site-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 11px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
}

.site-row.is-target {
  border-color: rgba(255, 77, 58, .5);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 58, .18);
}

.site-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.site-info b { font-size: 13.5px; font-weight: 600; }
.site-info span {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-acts { display: flex; gap: 7px; flex: none; }
.site-acts button { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12px; }

/* ============ 历史 ============ */
.hist-list { display: flex; flex-direction: column; gap: 9px; }

.hist-item {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 12px 12px 12px 14px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
}

.hist-main { flex: 1; text-align: left; min-width: 0; }

.hist-main b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.hist-main span { display: block; color: var(--muted); font-size: 11.5px; }

.hist-bar {
  display: block;
  height: 3px;
  margin-top: 9px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}

.hist-bar b { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

.hist-del {
  width: 32px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 18px;
  flex: none;
}

.hist-del:active { background: rgba(255, 255, 255, .08); }

/* ============ 频道列表 ============ */
.ch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 9px; }

.ch-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 13px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  text-align: left;
}

.ch-item b { font-size: 13.5px; font-weight: 600; }
.ch-item span { color: var(--muted); font-size: 11px; }

/* ============ 设置 ============ */
.panel {
  margin-bottom: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}

.panel h3 { margin: 0 0 12px; font-size: 14.5px; font-weight: 600; }

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.panel-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.panel-note.ok { color: var(--ok); }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}

.list-row:last-of-type { border-bottom: 0; }
.list-row em { font-style: normal; color: var(--muted); font-size: 12px; text-align: right; }

.panel-acts { display: flex; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
.panel-acts button { height: 34px; padding: 0 14px; border-radius: 10px; font-size: 12.5px; }

.seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.seg button {
  height: 31px;
  min-width: 42px;
  padding: 0 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

[data-theme="light"] .seg button { background: #f2f3f6; }

.seg button.is-on {
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  border-color: transparent;
}

.seg.sm button { height: 28px; font-size: 12px; padding: 0 10px; }

.seg.seg-head {
  position: relative;
  z-index: 2;
  flex-wrap: nowrap;
  gap: 6px;
}

.seg-head button {
  height: 34px;
  min-width: 56px;
  padding: 0 8px;
  white-space: nowrap;
  pointer-events: auto;
  touch-action: manipulation;
}

.token-row { display: flex; gap: 8px; margin-top: 10px; }

.token-row input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 13px;
  outline: none;
}

.token-row button { height: 38px; padding: 0 16px; border-radius: 10px; font-size: 13px; flex: none; }

.link-btn { color: var(--brand); font-size: 12.5px; padding: 2px 4px; }

.foot-note {
  margin: 26px 0 10px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  opacity: .7;
}

/* ============ 全局提示 ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 24px);
  z-index: 500;
  transform: translate(-50%, 12px);
  max-width: min(86vw, 520px);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(20, 22, 28, .94);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
  border: 1px solid rgba(255, 255, 255, .1);
}

.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-warn { background: rgba(120, 40, 24, .96); border-color: rgba(255, 122, 107, .3); }

/* ============ 网页内嵌 ============ */
.embed {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-top: var(--safe-t);
}

.embed-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 50px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  flex: none;
}

.embed-bar b {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.embed-act {
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--fg);
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  flex: none;
}

.embed-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  flex: none;
}

.embed-search input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
}

.embed-search input:focus {
  outline: none;
  border-color: var(--brand);
}

.embed-search .embed-act { height: 32px; }

.embed-body { position: relative; flex: 1; min-height: 0; }
.embed-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }

.embed-tip {
  position: absolute;
  left: 50%;
  bottom: calc(16px + var(--safe-b));
  transform: translateX(-50%);
  width: max-content;
  max-width: 90%;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(15, 17, 22, .9);
  color: #e8ebf0;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  transition: opacity .3s ease;
  border: 1px solid rgba(255, 255, 255, .12);
}

.embed-tip.is-hide { opacity: 0; pointer-events: none; }

@media (max-width: 430px) {
  #embedReload { display: none; }
  .embed-act { padding: 0 9px; font-size: 11.5px; }
}

/* ============================================================
   播放器
   ============================================================ */
.pl {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #000;
  color: #fff;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.pl.pl-cssfs { z-index: 500; }

.pl-stage {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

.pl-stage:fullscreen,
.pl-stage:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  background: #000;
}

.pl[data-ui="hide"] { cursor: none; }

.pl-videobox {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pl-video {
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.ratio-fill .pl-video { object-fit: cover; }

.ratio-r169 .pl-video {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.ratio-r43 .pl-video {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.pl-shade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

/* 手势面 */
.pl-tap {
  position: absolute;
  inset: 0;
  z-index: 3;
  touch-action: none;
}

/* 中央状态 */
.pl-flash {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: 66px;
  height: 66px;
  padding: 18px;
  margin: -33px 0 0 -33px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .42);
  color: #fff;
  opacity: 0;
  transform: scale(.82);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.pl-flash.is-on { opacity: 1; transform: scale(1); }

.pl-pause-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 96px;
  height: 96px;
  padding: 26px;
  margin: -48px 0 0 -48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .36);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.pl-pause-overlay.is-on { opacity: 1; }

.pl-pause-overlay svg { width: 100%; height: 100%; fill: currentColor; }

.pl-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  margin: -17px 0 0 -17px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.pl-loading.is-on { opacity: 1; }

.pl-spinner {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .22);
  border-top-color: #fff;
  animation: spin .75s linear infinite;
}

.pl-hud {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(12, 14, 18, .68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  white-space: nowrap;
}

.pl-hud.is-on { opacity: 1; }
.pl-hud svg { width: 16px; height: 16px; }
.pl-hud-ico { width: 16px; height: 16px; display: inline-block; }
.pl-hud-label { color: rgba(255, 255, 255, .7); font-size: 12.5px; }

/* 顶部栏 */
.pl-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(8px + var(--safe-t)) 12px 26px calc(12px + var(--safe-l));
  background: linear-gradient(180deg, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
  transition: opacity .22s ease;
}

.pl[data-ui="hide"] .pl-top,
.pl[data-ui="hide"] .pl-bottom {
  opacity: 0;
  pointer-events: none;
}

.pl-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pl-titles b {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-titles span { font-size: 11.5px; color: rgba(255, 255, 255, .62); }

.pl-live-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 6px;
  background: rgba(255, 77, 58, .9);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  flex: none;
}

.pl-live-tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.4s infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* 底部控制 */
.pl-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  padding: 30px calc(14px + var(--safe-r)) calc(10px + var(--safe-b)) calc(14px + var(--safe-l));
  background: linear-gradient(0deg, rgba(0, 0, 0, .82), rgba(0, 0, 0, 0));
  transition: opacity .22s ease;
}

.pl-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.pl-time {
  font-size: 11.5px;
  color: rgba(255, 255, 255, .78);
  font-variant-numeric: tabular-nums;
  flex: none;
  min-width: 44px;
  text-align: center;
}

.pl-range {
  position: relative;
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
  touch-action: none;
  cursor: pointer;
}

.pl-range-track {
  position: relative;
  width: 100%;
  height: 3.5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .24);
  overflow: hidden;
  transition: height .14s ease;
}

.pl-range-buf {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(255, 255, 255, .34);
}

.pl-range-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.pl-range-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 77, 58, .28);
  transition: transform .12s ease;
  pointer-events: none;
}

.pl-range:active .pl-range-track { height: 5px; }

.pl-range:active .pl-range-thumb { transform: scale(1.3); }

.pl-bubble {
  position: absolute;
  bottom: 26px;
  left: 0;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(10, 12, 16, .9);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}

.pl-bubble.is-on { opacity: 1; }

.pl-ctrls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.pl-ctrls .pl-spacer { flex: 1; }

.pl-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 10px;
  color: #fff;
  transition: transform .12s ease, background .15s ease;
}

.pl-btn:active { transform: scale(.92); background: rgba(255, 255, 255, .1); }
.pl-btn svg { width: 100%; height: 100%; }

.pl-btn.pl-text {
  width: auto;
  min-width: 48px;
  padding: 0 8px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pl-back { margin-left: -6px; }

/* 设置 / 选集 面板 */
.pl-panel {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  background: rgba(0, 0, 0, .34);
}

.pl-sheet {
  width: 100%;
  max-height: 68%;
  display: flex;
  flex-direction: column;
  background: rgba(18, 20, 26, .97);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-bottom: calc(6px + var(--safe-b));
  animation: sheetUp .22s ease;
}

@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

.pl-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 8px 18px;
  font-size: 14.5px;
  font-weight: 600;
  flex: none;
}

.pl-sheet-head em { font-style: normal; margin-left: 6px; font-size: 11.5px; color: rgba(255, 255, 255, .5); font-weight: 400; }
.pl-sheet-head .pl-btn { width: 34px; height: 34px; padding: 8px; }

.pl-sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 16px 16px;
  overscroll-behavior: contain;
}

.pl-group { padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.pl-group:last-child { border-bottom: 0; }

.pl-group h4 {
  margin: 0 0 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, .62);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pl-group h4 em { font-style: normal; font-size: 11px; color: rgba(255, 255, 255, .38); }

.pl-seg { display: flex; gap: 7px; flex-wrap: wrap; }

.pl-seg button {
  height: 32px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .78);
  font-size: 12.5px;
}

.pl-seg button.is-on {
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
}

.pl-seg.is-block { flex-direction: column; align-items: stretch; }
.pl-seg.is-block button { text-align: left; }

.pl-subrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
  flex-wrap: wrap;
}

.pl-subrow .pl-seg button { height: 28px; min-width: 40px; font-size: 12px; }

.pl-ghost.sm {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, .2);
  color: rgba(255, 255, 255, .82);
}

.pl-eps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.pl-chsearch { margin: 4px 0 12px; }

.pl-chsearch input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 12.5px;
  outline: none;
}

.pl-chsearch input::-webkit-search-cancel-button { display: none; }
.pl-chsearch input::placeholder { color: rgba(255, 255, 255, .38); }

.pl-ep {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .8);
  font-size: 12px;
  text-align: center;
  overflow: hidden;
}

.pl-ep span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.pl-ep.is-cur { color: #fff; background: linear-gradient(140deg, var(--brand), var(--brand-2)); }

.pl-ep-bar {
  display: block;
  height: 2.5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, .35);
  overflow: hidden;
}

.pl-ep-bar b { display: block; height: 100%; background: rgba(255, 255, 255, .9); }
.pl-ep.is-cur .pl-ep-bar { display: none; }

.pl-empty { margin: 0; padding: 18px 0; color: rgba(255, 255, 255, .5); font-size: 12.5px; text-align: center; }

/* 错误层 */
.pl-error {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pl-error-box {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.pl-error-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 12px;
  padding: 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.pl-error h3 { margin: 0 0 6px; font-size: 16px; }
.pl-error p { margin: 0 0 16px; font-size: 12.5px; color: rgba(255, 255, 255, .65); line-height: 1.6; }

.pl-error-acts { display: flex; gap: 9px; justify-content: center; }

.pl-error-acts button,
.pl-error-lines button {
  height: 34px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 12.5px;
}

.pl-error .pl-primary { background: linear-gradient(140deg, var(--brand), var(--brand-2)); color: #fff; }
.pl-error .pl-ghost { border: 1px solid rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .82); }

.pl-error-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-top: 12px;
}

.pl-error-lines button {
  border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .7);
  height: 30px;
  font-size: 12px;
}

.pl-error-lines button.is-cur { border-color: var(--brand); color: var(--brand); }

/* 播放器内提示 */
.pl-toast {
  position: absolute;
  left: 50%;
  bottom: 92px;
  z-index: 10;
  transform: translate(-50%, 8px);
  max-width: 80%;
  padding: 8px 14px;
  border-radius: 9px;
  background: rgba(10, 12, 16, .82);
  font-size: 12.5px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.pl-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* 触摸涟漪 */
.pl-ripple {
  position: absolute;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  pointer-events: none;
  z-index: 4;
  animation: rippleOut .58s ease-out forwards;
}

@keyframes rippleOut {
  from { transform: scale(.4); opacity: .9; }
  to { transform: scale(2.4); opacity: 0; }
}

.pl-ripple-text {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(10, 12, 16, .72);
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  animation: floatUp .7s ease forwards;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -30%); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -120%); }
}

/* 字幕 */
.pl-sub {
  position: absolute;
  left: 6%;
  right: 6%;
  z-index: 4;
  text-align: center;
  white-space: pre-line;
  pointer-events: none;
  font-weight: 500;
  line-height: 1.4;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .9), 0 0 2px rgba(0, 0, 0, .9);
  color: #fff;
  transition: bottom .2s ease, font-size .2s ease;
}

.pl-sub.sub-s { font-size: clamp(12px, 2.1vw, 20px); }
.pl-sub.sub-m { font-size: clamp(15px, 2.7vw, 27px); }
.pl-sub.sub-l { font-size: clamp(18px, 3.4vw, 34px); }

.pl-sub.sub-low { bottom: 9%; }
.pl-sub.sub-mid { bottom: 19%; }
.pl-sub.sub-high { bottom: 30%; }

/* 手机竖屏：压缩控件尺寸，避免一行溢出 */
@media (max-width: 899px) {
  .pl-onlypc { display: none; }
  .pl-btn { width: 36px; height: 36px; padding: 8px; }
  .pl-btn.pl-text { min-width: 42px; padding: 0 6px; font-size: 12px; }
  .pl-ctrls { gap: 0; }
  .pl-time { min-width: 40px; }
}

/* 平板：更大的控件与右侧抽屉面板 */
@media (min-width: 900px) {
  .app { padding-left: 88px; padding-bottom: 24px; }

  .rail {
    position: fixed;
    top: 0;
    bottom: 0;
    right: auto;
    width: 88px;
    height: 100%;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    padding: calc(84px + var(--safe-t)) 8px 16px;
    border-top: 0;
    border-right: 1px solid var(--line);
  }

  .rail-item {
    flex: none;
    height: 66px;
    border-radius: 14px;
    gap: 5px;
    font-size: 11.5px;
  }

  .rail-item svg { width: 22px; height: 22px; }
  .rail-item.is-on { background: rgba(255, 77, 58, .12); }

  .topbar { padding-left: 20px; padding-right: 20px; }
  .brand-name { font-size: 17px; }
  .top-btn { width: 42px; height: 42px; padding: 10px; }

  .main { padding: 16px 24px 16px; }
  .cats { top: calc(64px + var(--safe-t)); margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

  .toast { bottom: 40px; }

  .pl-panel { align-items: stretch; }

  .pl-sheet {
    width: 396px;
    max-height: 100%;
    border-radius: 16px 0 0 16px;
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, .1);
    padding-bottom: var(--safe-b);
    animation: sheetIn .22s ease;
  }

  @keyframes sheetIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }

  .pl-btn { width: 44px; height: 44px; padding: 10px; }
  .pl-time { font-size: 12.5px; min-width: 54px; }
  .pl-titles b { font-size: 16px; }
  .pl-toast { bottom: 108px; font-size: 13.5px; }
}

/* 平板横屏：播放器控制更大 */
@media (orientation: landscape) and (min-width: 700px) {
  .pl-ctrls { gap: 6px; }
  .pl-btn { width: 46px; height: 46px; padding: 11px; }
  .pl-progress { gap: 14px; margin-bottom: 6px; }
  .pl-time { font-size: 13px; min-width: 58px; }
  .pl-bottom { padding-left: calc(22px + var(--safe-l)); padding-right: calc(22px + var(--safe-r)); padding-bottom: calc(14px + var(--safe-b)); }
  .pl-top { padding-left: calc(20px + var(--safe-l)); }
}

/* 超小屏微调 */
@media (max-width: 360px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .cats { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .card-acts button { padding: 0 10px; }
  .pl-time { min-width: 40px; font-size: 11px; }
}

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

/* ============================================================
   片库（采集源聚合）
   ============================================================ */
.lib-src {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.lib-src::-webkit-scrollbar { display: none; }

.lib-src button {
  flex: none;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.lib-src button.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.lib-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 2px 12px;
  scrollbar-width: none;
}
.lib-cats::-webkit-scrollbar { display: none; }

.lib-cats button {
  flex: none;
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.lib-cats button.is-on {
  color: var(--brand);
  border-color: var(--brand);
  background: rgba(255, 77, 58, .08);
}

.vgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
  gap: 12px;
}

.vcard {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  text-align: left;
}

.vposter {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-2);
  border: 1px solid var(--line);
}

.vposter img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vstar {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 2;
  display: block;
  width: 28px;
  height: 28px;
  padding: 5px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .5);
  color: rgba(255, 255, 255, .82);
}

.vstar svg { display: block; width: 100%; height: 100%; }
.vstar.is-on { color: var(--warn); }

.live-search { margin-bottom: 14px; }

.vfallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}

.vtag {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 2;
  max-width: calc(100% - 12px);
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 源站延迟角标：绿 <300ms，橙 300-800ms，红 >800ms */
.vlat {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .68);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vlat i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.vlat-fast { color: #34d399; }
.vlat-mid { color: #f59e0b; }
.vlat-slow { color: #ef4444; }

.vname {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7em;
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}

.vsub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vloading {
  padding: 26px 0 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.vloading .spinner { display: block; margin: 0 auto 10px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 0 6px;
}

.pager button {
  height: 34px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  font-size: 13px;
}

.pager button[disabled] { opacity: .35; }
.pager span { color: var(--muted); font-size: 12.5px; }

/* 聚合搜索结果 */
.agg-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 17px;
  vertical-align: 1px;
}

.cat-tag {
  display: inline-block;
  padding: 0 6px;
  border-radius: 5px;
  background: rgba(255, 77, 58, .1);
  color: var(--brand);
  font-size: 10.5px;
  line-height: 17px;
}

/* 详情面板 */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .62);
}

.sheet {
  position: relative;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(22px + var(--safe-b));
}

.sheet-top { display: flex; gap: 14px; }

.sheet-poster {
  flex: none;
  width: 102px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-2);
  border: 1px solid var(--line);
  position: relative;
}

.sheet-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sheet-info { flex: 1; min-width: 0; }
.sheet-info h3 { margin: 0 0 6px; font-size: 16.5px; line-height: 1.4; }
.sheet-meta { color: var(--muted); font-size: 12px; line-height: 1.7; word-break: break-word; }
.sheet-desc {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
  max-height: 5.2em;
  overflow: hidden;
}
.sheet-desc.is-full { max-height: none; }
.sheet-more {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
}
.sheet-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 8px;
  font-size: 13.5px;
  font-weight: 600;
}
.sheet-lines { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-lines button {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 12.5px;
}
.sheet-lines button.is-on { border-color: var(--brand); color: var(--brand); }

.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
}
.ep-grid button {
  height: 34px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-grid button:active { border-color: var(--brand); color: var(--brand); }

.sheet-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

@media (min-width: 900px) {
  .sheet-mask { align-items: center; }
  .sheet {
    width: min(720px, 92vw);
    max-height: 84vh;
    border: 1px solid var(--line);
    border-radius: 18px;
  }
  .sheet-poster { width: 128px; }
}

@media (max-width: 430px) {
  .vgrid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
}

/* ============ 阿里云盘 ============ */
.ali-qr-mask {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ali-qr-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 22px 20px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.ali-qr-card h3 { margin: 0 0 14px; font-size: 16px; }

.ali-qr-card img {
  width: 240px;
  height: 240px;
  max-width: 100%;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
}

.ali-qr-card #aliQrMsg { margin: 12px 0 6px; font-size: 13px; }
.ali-qr-tip { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }

.drive-list { display: flex; flex-direction: column; gap: 8px; }

.drive-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.drive-item b {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drive-item span { flex: none; color: var(--muted); font-size: 11.5px; }

.drive-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: rgba(255, 77, 58, .14);
  color: var(--brand);
  font-size: 11px;
  font-style: normal;
}
