/* ============ 极视直播 · 深色影院主题 ============ */

:root {
  color-scheme: dark;
  --bg: #0a0c10;
  --bg2: #0e1117;
  --panel: #131722;
  --panel2: #1a2030;
  --panel-soft: rgba(19, 23, 34, .55);
  --border: #232b3d;
  --border2: #2e3950;
  --text: #e9edf5;
  --text2: #97a1b5;
  --text3: #5d6778;
  --accent: #ff5449;
  --accent-deep: #e62e2e;
  --accent-soft: rgba(255, 84, 73, .12);
  --grad: linear-gradient(135deg, #ff6a4d 0%, #e62e2e 100%);
  --ok: #34d399;
  --radius: 14px;
  --topbar-h: 60px;
  --side-w: 224px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --topbar-bg: rgba(12, 15, 21, .82);
  --sidebar-bg: rgba(14, 17, 23, .5);
  --drawer-bg: rgba(12, 15, 21, .98);
  --scrim: rgba(0, 0, 0, .55);
  --toast-bg: rgba(20, 24, 34, .95);
  --scroll-thumb: #2a3247;
  --scroll-thumb-hover: #38425c;
  --skel-a: #1a2030;
  --skel-b: #232c40;
  --fb-grad: linear-gradient(135deg, #2a3348, #1a2030);
  --glow-1: rgba(230, 46, 46, .09);
  --glow-2: rgba(56, 97, 251, .07);
  --glow-3: rgba(230, 46, 46, .05);
}

/* 浅色主题(JS 根据设置/系统偏好设置 data-theme) */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6fa;
  --bg2: #eef0f6;
  --panel: #ffffff;
  --panel2: #f1f3f9;
  --panel-soft: rgba(255, 255, 255, .6);
  --border: #e3e7f0;
  --border2: #d3dae7;
  --text: #1c2333;
  --text2: #5b6475;
  --text3: #9aa3b5;
  --accent: #e63946;
  --accent-deep: #c1121f;
  --accent-soft: rgba(230, 57, 70, .1);
  --grad: linear-gradient(135deg, #ff6a4d 0%, #d92c2c 100%);
  --shadow: 0 10px 30px rgba(23, 32, 64, .12);
  --topbar-bg: rgba(255, 255, 255, .85);
  --sidebar-bg: rgba(245, 246, 250, .6);
  --drawer-bg: rgba(255, 255, 255, .98);
  --scrim: rgba(20, 26, 40, .35);
  --toast-bg: rgba(255, 255, 255, .96);
  --scroll-thumb: #c9d0de;
  --scroll-thumb-hover: #b2bcd0;
  --skel-a: #eef0f6;
  --skel-b: #e2e6ef;
  --fb-grad: linear-gradient(135deg, #dde3f0, #ccd5e6);
  --glow-1: rgba(230, 57, 70, .06);
  --glow-2: rgba(56, 97, 251, .05);
  --glow-3: rgba(230, 57, 70, .04);
}

@media (min-width: 1920px) { :root { font-size: 18px; } }

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

html { }

body {
  font-family: -apple-system, BlinkMacSystemFont, "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 420px at 18% -8%, var(--glow-1), transparent 60%),
    radial-gradient(1000px 500px at 105% -12%, var(--glow-2), transparent 60%),
    radial-gradient(800px 600px at 50% 115%, var(--glow-3), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

::selection { background: rgba(255, 84, 73, .35); }

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

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 焦点态(电视/键盘) ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}
.focusable:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(255, 84, 73, .18), var(--shadow);
  z-index: 5;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--grad);
  box-shadow: 0 4px 16px rgba(230, 46, 46, .35);
}
.brand-mark svg { width: 20px; height: 20px; color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 17px; letter-spacing: .5px; }
.brand-text small { font-size: 11px; color: var(--text2); letter-spacing: 1px; }

.searchbox {
  flex: 1; max-width: 420px; height: 40px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color .2s, box-shadow .2s;
}
.searchbox:focus-within {
  border-color: rgba(255, 84, 73, .55);
  box-shadow: 0 0 0 4px rgba(255, 84, 73, .12);
}
.searchbox svg { width: 17px; height: 17px; color: var(--text2); flex-shrink: 0; }
.searchbox input {
  flex: 1; min-width: 0; background: none; border: 0; color: var(--text);
  font-size: 14px;
}
.searchbox input::-webkit-search-cancel-button { display: none; }
.search-clear {
  display: none; padding: 4px; border-radius: 50%;
  color: var(--text2);
}
.search-clear:hover { color: var(--text); }
.searchbox.has-value .search-clear { display: flex; }
.search-clear svg { width: 14px; height: 14px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.clock {
  font-variant-numeric: tabular-nums;
  font-size: 14px; color: var(--text2);
  text-align: right; line-height: 1.25; white-space: nowrap;
}
.clock b { color: var(--text); font-size: 15px; font-weight: 600; }
.clock small { display: block; font-size: 11px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--text2);
  border: 1px solid transparent;
  transition: all .18s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover, .icon-btn:focus-visible {
  color: var(--text);
  background: var(--panel2);
  border-color: var(--border);
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 主题切换按钮:三态图标 */
#themeBtn svg { display: none; }
#themeBtn[data-mode="auto"] .i-auto { display: block; }
#themeBtn[data-mode="light"] .i-light { display: block; }
#themeBtn[data-mode="dark"] .i-dark { display: block; }

.only-mobile { display: none; }

/* ---------- 布局 ---------- */
.layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h));
}

/* ---------- 侧栏 ---------- */
.sidebar {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
  padding: 14px 10px 10px;
}
.sidebar-head {
  font-size: 11px; letter-spacing: 3px; color: var(--text3, #5d6778);
  padding: 4px 10px 10px; text-transform: uppercase;
}
.cat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; }

.cat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text2);
  font-size: 14px;
  text-align: left;
  border: 1px solid transparent;
  transition: all .15s;
  width: 100%;
}
.cat-item .ci-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item .ci-count {
  font-size: 11px; color: var(--text2);
  background: var(--panel2);
  padding: 1px 7px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.cat-item:hover { color: var(--text); background: var(--panel); }
.cat-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 84, 73, .18), rgba(230, 46, 46, .08));
  border-color: rgba(255, 84, 73, .35);
}
.cat-item.active .ci-count { background: rgba(255, 84, 73, .2); color: #ffb4ae; }

.sidebar-foot {
  padding: 12px 10px 4px;
  border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text2);
  line-height: 1.8;
}
.sidebar-foot b { color: var(--text); font-weight: 600; }

.scrim { display: none; }

/* ---------- 主区 ---------- */
.main { padding: 18px 22px 30px; min-width: 0; }

/* ---------- 播放区 ---------- */
.player-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.player-shell {
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255, 95, 73, .55), rgba(255, 255, 255, .07) 32%, rgba(255, 255, 255, .04) 70%, rgba(255, 95, 73, .25));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5), 0 0 60px rgba(230, 46, 46, .07);
}

.video-frame {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
.video-frame video { width: 100%; height: 100%; display: block; background: #000; }

.video-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(rgba(0, 0, 0, .65), transparent);
  opacity: 1; transition: opacity .25s;
  pointer-events: none;
  z-index: 3;
}
.video-frame.hide-ui .video-top { opacity: 0; }

.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: 2px;
  color: #fff;
  background: rgba(230, 46, 46, .9);
  padding: 3px 10px 3px 8px; border-radius: 6px;
  flex-shrink: 0;
}
.live-badge i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #fff;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.playing-title {
  font-size: 14px; font-weight: 500;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.unmute-pill {
  position: absolute; left: 14px; bottom: 64px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  font-size: 13px; font-weight: 500;
  color: #fff;
  background: rgba(20, 24, 34, .92);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  z-index: 4;
  animation: fadeUp .3s ease;
}
.unmute-pill[hidden] { display: none; } /* 作者 display 规则会压过 UA 的 [hidden],必须显式覆盖 */
.unmute-pill svg { width: 16px; height: 16px; color: var(--accent); }
.unmute-pill:hover { border-color: var(--accent); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.video-mask {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  z-index: 2;
  background: rgba(5, 7, 10, .45);
  opacity: 0; visibility: hidden;
  transition: opacity .25s;
}
.video-mask.show { opacity: 1; visibility: visible; }

.spinner {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .18);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}

.mask-error { text-align: center; padding: 20px; color: var(--text2); }
.mask-error svg { width: 46px; height: 46px; margin: 0 auto 12px; color: var(--text2); }
.mask-error p { font-size: 14px; margin-bottom: 16px; color: var(--text); }
.mask-error-btns { display: flex; gap: 10px; justify-content: center; }

.btn {
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  background: var(--panel2);
  border: 1px solid var(--border2);
  color: var(--text);
  transition: all .18s;
}
.btn:hover { border-color: var(--text2); }
.btn:active { transform: scale(.96); }
.btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(230, 46, 46, .35);
}
.btn-primary:hover { filter: brightness(1.1); border-color: transparent; }

/* 播放器控制条 */
.controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, rgba(0, 0, 0, .72));
  opacity: 1; transition: opacity .25s;
  z-index: 3;
}
.video-frame.hide-ui .controls { opacity: 0; pointer-events: none; }
.video-frame.hide-ui { cursor: none; }

.ctl-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  transition: background .15s, transform .12s;
}
.ctl-btn svg { width: 20px; height: 20px; }
.ctl-btn:hover { background: rgba(255, 255, 255, .14); }
.ctl-btn:active { transform: scale(.9); }

#playBtn .i-pause { display: none; }
#playBtn.playing .i-play { display: none; }
#playBtn.playing .i-pause { display: block; }
#muteBtn .i-mute { display: none; }
#muteBtn.muted .i-vol { display: none; }
#muteBtn.muted .i-mute { display: block; }
#fsBtn .i-fs-exit { display: none; }
#fsBtn.fs .i-fs { display: none; }
#fsBtn.fs .i-fs-exit { display: block; }

.vol-group { display: flex; align-items: center; gap: 2px; }
#volSlider {
  width: 0; opacity: 0; transition: width .2s, opacity .2s;
  accent-color: var(--accent);
  height: 4px; cursor: pointer;
}
.vol-group:hover #volSlider, #volSlider:focus-visible { width: 76px; opacity: 1; }

.src-group {
  display: flex; align-items: center; gap: 2px;
  background: rgba(255, 255, 255, .08);
  border-radius: 10px;
  margin-left: 6px;
  padding: 0 4px;
}
.src-label {
  font-size: 12.5px; font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .9);
  padding: 0 4px; white-space: nowrap;
}
.ctl-flex { flex: 1; }

/* ---------- 正在播放面板 ---------- */
.now-playing {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky; top: calc(var(--topbar-h) + 18px);
}
.np-head { display: flex; align-items: center; gap: 12px; }
.np-logo-wrap {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: 14px;
  background: var(--panel2);
  border: 1px solid var(--border2);
  display: grid; place-items: center;
  overflow: hidden;
}
.np-logo-wrap img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.np-fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 24px; font-weight: 700;
  background: var(--grad);
  color: #fff;
}
.np-meta { flex: 1; min-width: 0; }
.np-meta h2 { font-size: 19px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-badges { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.badge {
  font-size: 11px; padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel2);
  border: 1px solid var(--border2);
  color: var(--text2);
  white-space: nowrap;
}
.badge-line { color: #ffb4ae; border-color: rgba(255, 84, 73, .3); background: var(--accent-soft); }

.np-fav { margin-left: auto; }
.np-fav.on { color: #ffcf4d; }
.np-fav.on svg { fill: #ffcf4d; }

.np-sec { margin-top: 16px; }
.np-sec-title {
  font-size: 12px; color: var(--text2);
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.np-sec-title span { letter-spacing: 0; font-size: 11px; }

.src-list { display: flex; flex-wrap: wrap; gap: 6px; }
.src-item {
  min-width: 52px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12.5px; font-variant-numeric: tabular-nums;
  background: var(--panel2);
  border: 1px solid var(--border2);
  color: var(--text2);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.src-item:hover { color: var(--text); border-color: var(--text3, #4a5670); }
.src-item i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text3);
}
.src-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 84, 73, .25), rgba(230, 46, 46, .12));
  border-color: rgba(255, 84, 73, .5);
}
.src-item.active i { background: var(--accent); animation: pulse 1.6s infinite; }
.src-item.dead { opacity: .4; text-decoration: line-through; }
.src-item.dead i { background: #666; }
.src-item.ok i { background: var(--ok); }

.np-updated {
  border-top: 1px dashed var(--border);
  padding-top: 10px; margin-top: 16px;
  font-size: 12px; color: var(--text2);
}

/* ---------- 分类 chips(移动端) ---------- */
.chips { display: none; }

/* ---------- 频道网格 ---------- */
.grid-sec { margin-top: 22px; }
.grid-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 14px;
}
.grid-head h3 { font-size: 18px; font-weight: 700; }
.grid-count { font-size: 12.5px; color: var(--text2); }

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

.chan {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 16px 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: transform .16s, border-color .16s, box-shadow .16s;
  text-align: center;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  content-visibility: auto;            /* 屏外卡片跳过布局/绘制 */
  contain-intrinsic-size: auto 118px;  /* 预估尺寸,避免滚动条跳动 */
}
.chan::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120px 60px at 50% 0%, rgba(255, 84, 73, .1), transparent);
  opacity: 0; transition: opacity .2s;
  pointer-events: none; /* 装饰层不拦截点击,否则会盖住收藏按钮 */
}
.chan:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 84, 73, .45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}
.chan:hover::after { opacity: 1; }
.chan:active { transform: translateY(-1px) scale(.98); }

.chan.playing {
  border-color: rgba(255, 84, 73, .65);
  background: linear-gradient(180deg, rgba(255, 84, 73, .1), var(--panel) 55%);
}
.chan.playing .chan-playing-tag { display: inline-flex; }

.chan-logo {
  width: 58px; height: 58px;
  object-fit: contain;
}
.chan-fallback {
  width: 58px; height: 58px; border-radius: 14px;
  display: grid; place-items: center;
  font-size: 19px; font-weight: 700; color: var(--text);
  background: var(--fb-grad);
  border: 1px solid var(--border2);
}
.chan-name {
  font-size: 13.5px; font-weight: 500;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chan-sub {
  font-size: 11px; color: var(--text2);
  font-variant-numeric: tabular-nums;
}
.chan-playing-tag {
  display: none;
  position: absolute; top: 8px; right: 8px;
  align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600;
  color: #fff;
  background: rgba(230, 46, 46, .92);
  padding: 2px 7px; border-radius: 999px;
}
.chan-playing-tag i { width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }

.chan-fav-btn {
  position: absolute; top: 7px; left: 7px;
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text2);
  opacity: 0;
  transition: opacity .15s, color .15s;
  background: rgba(10, 12, 16, .55);
}
.chan-fav-btn svg { width: 15px; height: 15px; }
.chan:hover .chan-fav-btn, .chan-fav-btn.on { opacity: 1; }
.chan-fav-btn.on { color: #ffcf4d; }
.chan-fav-btn.on svg { fill: #ffcf4d; }
.chan-fav-btn:hover { color: #ffcf4d; }

@media (hover: none) {
  .chan-fav-btn { opacity: 1; background: rgba(10, 12, 16, .4); }
  .vol-group #volSlider { display: none; }
}

/* 骨架屏 */
.chan.skeleton .chan-logo, .chan.skeleton .chan-fallback { display: none; }
.chan.skeleton { padding: 20px 10px; }
.skel {
  border-radius: 8px;
  background: linear-gradient(100deg, var(--skel-a) 40%, var(--skel-b) 50%, var(--skel-a) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skel-logo { width: 58px; height: 58px; border-radius: 14px; }
.skel-name { width: 70%; height: 13px; margin-top: 10px; }
.skel-sub { width: 45%; height: 10px; margin-top: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty-tip {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text2);
  padding: 60px 0;
  font-size: 14px;
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  margin-top: 28px; padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  left: 50%; bottom: 30px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--toast-bg);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  color: var(--text);
  animation: toastIn .25s ease;
  max-width: 82vw;
  text-align: center;
}
.toast.warn { border-color: rgba(255, 176, 80, .4); }
.toast.error { border-color: rgba(255, 84, 73, .5); }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- 全屏 ---------- */
.video-frame:fullscreen,
.video-frame:-webkit-full-screen {
  border-radius: 0;
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
}
.video-frame:fullscreen video,
.video-frame:-webkit-full-screen video { object-fit: contain; }

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .player-zone { grid-template-columns: 1fr; }
  .now-playing { position: static; }
  .src-list { max-height: 130px; overflow-y: auto; }
}

@media (max-width: 900px) {
  .only-mobile { display: grid; }
  .clock small { display: none; }
  .brand-text small { display: none; }
  .searchbox { max-width: none; }

  .layout { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: min(78vw, 300px);
    height: 100vh;
    z-index: 90;
    background: var(--drawer-bg);
    transform: translateX(-102%);
    transition: transform .25s ease;
    padding-top: 70px;
    box-shadow: none;
  }
  .sidebar.open {
    transform: none;
    box-shadow: 20px 0 60px rgba(0, 0, 0, .5);
  }
  .scrim {
    display: block;
    position: fixed; inset: 0;
    background: var(--scrim);
    z-index: 80;
    opacity: 0; visibility: hidden;
    transition: opacity .25s;
  }
  .scrim.show { opacity: 1; visibility: visible; }

  .main { padding: 12px 14px 24px; }

  .chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 12px;
    margin-top: 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--text2);
    background: var(--panel);
    border: 1px solid var(--border);
    white-space: nowrap;
    transition: all .15s;
  }
  .chip.active {
    color: #fff;
    background: var(--grad);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(230, 46, 46, .3);
  }

  .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 9px; }
  .grid-sec { margin-top: 4px; }
  .foot-kbd { display: none; }

  .unmute-pill { bottom: 60px; font-size: 12px; }
  .src-label { font-size: 11.5px; }
  .ctl-btn { width: 34px; height: 34px; }
}

@media (max-width: 480px) {
  .clock { display: none; }
  .brand-text b { font-size: 15px; }
  .np-meta h2 { font-size: 17px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}

/* 电视大屏优化 */
@media (min-width: 1600px) {
  :root { --side-w: 250px; }
  .main { padding: 22px 28px 36px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
