:root {
  --bg: #0b1020;
  --bg-soft: #121a33;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --text: #e9edf7;
  --muted: #8f9bb8;
  --brand: #4f8cff;
  --brand-2: #8b5cf6;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1000px 600px at 12% -10%, rgba(79, 140, 255, 0.22), transparent 60%),
    radial-gradient(900px 500px at 88% 0%, rgba(139, 92, 246, 0.18), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

/* 移动端：去掉点击高亮、去掉 300ms 延迟 */
a, button, input, select, .tab, .song, .line-btn, .subtab, .btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button, .btn, .tab, .line-btn, .subtab, .song { user-select: none; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11, 16, 32, 0.82);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  height: 62px; display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.brand .dot {
  width: 26px; height: 26px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; font-size: 14px;
}
.spacer { flex: 1; }
.chip {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  white-space: nowrap;
}
.chip.on { color: #b8f5cd; border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .12); }
.chip.off { color: #ffd7a8; border-color: rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .12); }

/* ---------------- 标签页 ---------------- */
.tabs { display: flex; gap: 8px; margin: 26px 0 22px; }
.tab {
  padding: 9px 20px; border-radius: 999px; cursor: pointer; font-size: 14px;
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  transition: all .18s ease;
}
.tab:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.tab.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 22px rgba(79, 140, 255, .35);
}

.panel { display: none; }
.panel.active { display: block; }

/* ---------------- 通用卡片 ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title .sub { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ---------------- 输入区 ---------------- */
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; }
input[type="text"], select {
  flex: 1; min-width: 220px; height: 46px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--border);
  background: rgba(0, 0, 0, .25); color: var(--text); font-size: 14px; outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input[type="text"]:focus, select:focus {
  border-color: rgba(79, 140, 255, .75);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .16);
}
input[type="text"]::placeholder { color: #6d7896; }
select { flex: 0 0 auto; min-width: 130px; cursor: pointer; }
select option { background: #131a2e; }

.btn {
  height: 46px; padding: 0 22px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(79,140,255,.32); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost {
  background: var(--panel-strong); color: var(--text);
  border: 1px solid var(--border); font-weight: 500;
}
.btn.ghost:hover { box-shadow: none; border-color: rgba(255,255,255,.25); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 9px; }

.hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.8; }
.hint code {
  background: rgba(0,0,0,.35); padding: 1px 6px; border-radius: 5px;
  font-size: 12px; color: #cbd6f5;
}

/* ---------------- 视频信息 ---------------- */
.vinfo { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 20px; }
.vinfo .cover {
  width: 240px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: #000; flex: 0 0 auto; border: 1px solid var(--border);
}
.vinfo .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vinfo .meta { flex: 1; min-width: 260px; }
.vinfo h3 { font-size: 17px; margin-bottom: 8px; line-height: 1.45; }
.vinfo .kv { font-size: 13px; color: var(--muted); }
.vinfo .kv b { color: #c8d3ee; font-weight: 500; }
.tagline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tag {
  font-size: 11.5px; padding: 3px 9px; border-radius: 7px;
  background: rgba(79,140,255,.14); color: #b9d1ff; border: 1px solid rgba(79,140,255,.25);
}

.actions-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.actions-bar .btn { display: inline-flex; align-items: center; text-decoration: none; }
.actions-bar .btn:hover { text-decoration: none; }

/* ---------------- 解析失败引导 ---------------- */
.alert {
  margin-top: 20px; padding: 18px 20px; border-radius: 12px;
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .3);
  border-left: 4px solid var(--err);
}
.alert-title { font-size: 15px; font-weight: 600; color: #ffc9c9; margin-bottom: 10px; }
.alert-msg {
  font-size: 13px; color: #ffd8d8; font-family: ui-monospace, Consolas, monospace;
  background: rgba(0, 0, 0, .3); padding: 10px 12px; border-radius: 8px;
  word-break: break-word; line-height: 1.7;
}
.alert-hint {
  margin-top: 12px; font-size: 13px; color: #ffe9c7; line-height: 1.8;
  background: rgba(245, 158, 11, .1); border-radius: 8px; padding: 10px 12px;
}
.alert-actions { margin-top: 16px; }
.alert-actions-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.alert-actions .btn + .btn { margin-left: 8px; }

/* ---------------- 格式表 ---------------- */
.table-scroll { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tbody tr:hover { background: rgba(255,255,255,.03); }
td.actions { text-align: right; white-space: nowrap; }

/* ---------------- 线路 ---------------- */
.lines { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.line-btn {
  font-size: 13px; padding: 7px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.line-btn:hover { color: var(--text); border-color: rgba(255,255,255,.25); }
.line-btn.active { color: #fff; background: rgba(79,140,255,.2); border-color: rgba(79,140,255,.5); }
.line-btn .status { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.line-btn .status.alive { background: var(--ok); }
.line-btn .status.dead { background: var(--err); }
.player-wrap { position: relative; }
.player-frame {
  width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: 12px;
  background: #000; overflow: hidden;
}
.player-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* 第三方线路的授权遮罩（手机端默认不自动加载外部站点） */
.frame-gate {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 20px; text-align: center;
  background: rgba(8, 12, 24, .94); border: 1px dashed var(--border); border-radius: 12px;
}
.frame-gate[hidden] { display: none; }
.frame-gate-title { font-size: 14px; font-weight: 600; color: #ffd9a0; }
.frame-gate-desc { font-size: 12.5px; color: var(--muted); line-height: 1.85; max-width: 520px; }
.frame-gate-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* 站内播放器 */
#inline-card video { width: 100%; max-height: 62vh; border-radius: 12px; background: #000; display: block; }

/* ---------------- 从官网找片 ---------------- */
.platforms {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px; margin: 14px 0 4px;
}
.platform {
  display: block; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--panel);
  text-decoration: none; transition: all .16s ease;
}
.platform:hover {
  text-decoration: none; transform: translateY(-2px);
  border-color: rgba(79, 140, 255, .5); background: rgba(79, 140, 255, .1);
}
.platform .p-name { font-size: 14px; font-weight: 600; color: var(--brand); }
.platform .p-note { font-size: 11.5px; color: var(--ok); margin-top: 2px; }
.platform .p-note.warn { color: var(--warn); }
.platform .p-target {
  font-size: 11px; color: var(--muted); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.bookmark-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.bookmark-row .btn { text-decoration: none; }
#bookmarklet-code {
  width: 100%; margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(0, 0, 0, .3); color: var(--muted);
  font-size: 11.5px; font-family: ui-monospace, Consolas, monospace; resize: vertical;
}

/* ---------------- 聚合搜索 ---------------- */
.vod-results { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; }
.vod-item {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel); cursor: pointer;
  transition: all .16s ease;
}
.vod-item:hover { border-color: rgba(79, 140, 255, .5); background: rgba(79, 140, 255, .1); }
.vod-item.active { border-color: rgba(79, 140, 255, .7); background: rgba(79, 140, 255, .16); }
.vod-item .v-name { font-size: 14px; font-weight: 500; }
.vod-item .v-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.vod-item .v-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 6px; flex: 0 0 auto;
  background: rgba(79, 140, 255, .16); color: #b9d1ff; border: 1px solid rgba(79, 140, 255, .3);
}
.vod-item .v-main { flex: 1; min-width: 0; }
.vod-item .v-name, .vod-item .v-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#vod-video { width: 100%; max-height: 62vh; border-radius: 12px; background: #000; display: block; }
#vod-info { font-size: 13px; color: var(--muted); line-height: 1.9; margin-top: 8px; }
#vod-info b { color: #c8d3ee; font-weight: 500; }

/* 热门海报墙 */
.vod-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px; margin-top: 12px; max-height: 460px; overflow-y: auto;
}
.vod-card { cursor: pointer; border-radius: 10px; overflow: hidden; transition: transform .16s ease; }
.vod-card:hover { transform: translateY(-3px); }
.vod-card .v-pic {
  width: 100%; aspect-ratio: 2 / 3; background: #131a2e center/cover no-repeat;
  border-radius: 10px; border: 1px solid var(--border); position: relative; overflow: hidden;
}
.vod-card .v-pic span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px;
  font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.85));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vod-card .v-title {
  font-size: 12.5px; margin-top: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vod-card .v-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.episodes {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px; margin-top: 6px; max-height: 320px; overflow-y: auto;
}
.episode {
  text-align: left; font-size: 13px; padding: 9px 12px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.episode:hover { border-color: rgba(79, 140, 255, .5); background: rgba(79, 140, 255, .1); }
.episode.active { border-color: rgba(79, 140, 255, .7); background: rgba(79, 140, 255, .18); }
.episode .ep-idx { color: var(--muted); font-size: 11.5px; margin-right: 6px; }

/* ---------------- 音乐 ---------------- */
.music-layout { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .music-layout { grid-template-columns: 1fr; } }

.songlist { max-height: 560px; overflow-y: auto; margin-top: 14px; }
.song {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px;
  border-radius: 10px; cursor: pointer; transition: background .15s ease;
}
.song:hover { background: rgba(255,255,255,.05); }
.song.active { background: rgba(79,140,255,.16); }
.song .idx { width: 22px; font-size: 12px; color: var(--muted); text-align: center; flex: 0 0 auto; }
.song .info { flex: 1; min-width: 0; }
.song .name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .artist { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .dur { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.song .mv {
  font-size: 11px; padding: 2px 7px; border-radius: 6px; flex: 0 0 auto;
  border: 1px solid rgba(239,68,68,.4); color: #ffb4b4; background: rgba(239,68,68,.12);
}
.song .mv.vip {
  border-color: rgba(245, 158, 11, .45); color: #ffd9a0; background: rgba(245, 158, 11, .13);
}

.player { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.player .disc {
  width: 68px; height: 68px; border-radius: 50%; overflow: hidden; flex: 0 0 auto;
  border: 2px solid var(--border); background: #000;
}
.player .disc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player .disc.spin img { animation: spin 12s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player .pmeta { flex: 1; min-width: 200px; }
.player .pmeta .t { font-size: 15px; font-weight: 600; }
.player .pmeta .a { font-size: 12.5px; color: var(--muted); }

.controls { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.controls .time { font-size: 12px; color: var(--muted); min-width: 40px; }
.controls input[type="range"] { flex: 1; min-width: 140px; accent-color: var(--brand); height: 4px; cursor: pointer; }

.player-status {
  margin-top: 10px; font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; gap: 8px; min-height: 18px;
}
.player-status.busy { color: #ffd9a0; }
.player-status.err { color: #ffb4b4; }
.player-status.ok { color: #a9e8bd; }
.player-status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto;
}
.player-status.busy .dot { animation: pulse-dot 1s ease-in-out infinite; }
@keyframes pulse-dot { 50% { opacity: .25; } }
.player-status button {
  margin-left: auto; background: var(--panel-strong); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 4px 12px;
  font-size: 12.5px; cursor: pointer;
}

.lyrics {
  margin-top: 16px; height: 260px; overflow-y: auto; padding: 8px 4px;
  font-size: 13.5px; color: var(--muted); text-align: center;
  scroll-behavior: smooth;
}
.lyrics .l { padding: 4px 0; transition: color .2s ease; }
.lyrics .l.on { color: #fff; font-weight: 600; transform: scale(1.03); }

.comments { max-height: 320px; overflow-y: auto; margin-top: 12px; }
.comment { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.comment img { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; background: #222; }
.comment .cname { font-size: 12px; color: var(--brand); }
.comment .ctext { font-size: 13px; color: #d5ddf0; }
.comment .clike { font-size: 11.5px; color: var(--muted); }

.subtabs { display: flex; gap: 6px; margin-bottom: 4px; }
.subtab {
  font-size: 13px; padding: 6px 14px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--muted);
}
.subtab.active { color: #fff; background: var(--panel-strong); border-color: var(--border); }

/* ---------------- 反馈 ---------------- */
.empty { text-align: center; padding: 42px 12px; color: var(--muted); font-size: 13.5px; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; display: inline-block;
  border: 2px solid rgba(255,255,255,.25); border-top-color: #fff;
  animation: rot .7s linear infinite; vertical-align: -2px;
}
@keyframes rot { to { transform: rotate(360deg); } }

#toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  background: rgba(18, 26, 51, .96); border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  padding: 11px 16px; border-radius: 10px; font-size: 13px; max-width: 340px;
  box-shadow: var(--shadow); animation: slidein .22s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed; inset: 0; background: rgba(3, 6, 15, .86); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal.open { display: flex; }
.modal-box {
  width: min(920px, 100%); background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.modal-box video { width: 100%; max-height: 68vh; border-radius: 10px; background: #000; display: block; }

.progress-line { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.progress-bar { height: 5px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 6px; }
.progress-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .15s ease; }

/* ================================================================
   移动端适配
   ================================================================ */

/* ---- 平板 / 窄屏 ---- */
@media (max-width: 900px) {
  .music-layout { grid-template-columns: 1fr; }
  .songlist { max-height: 40vh; }
  .lyrics { height: 34vh; min-height: 160px; }
  .comments { max-height: 40vh; }
}

/* ---- 手机 ---- */
@media (max-width: 768px) {
  /* 顶栏：两行布局，芯片自动收窄 */
  .topbar-inner {
    height: auto;
    min-height: 54px;
    padding: max(8px, env(safe-area-inset-top)) 14px 8px;
    flex-wrap: wrap;
    gap: 6px 8px;
  }
  .brand { font-size: 16px; }
  .brand .dot { width: 24px; height: 24px; font-size: 13px; }
  .spacer { flex: 1 1 auto; }
  .chip {
    font-size: 11px;
    padding: 3px 9px;
    max-width: 47vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .wrap { padding: 0 14px calc(56px + env(safe-area-inset-bottom)); }

  /* 标签页：占满整行，更好点 */
  .tabs { margin: 14px 0 12px; gap: 8px; }
  .tab { flex: 1; text-align: center; padding: 11px 8px; font-size: 15px; }

  .card { padding: 14px; border-radius: 12px; box-shadow: none; }
  .card + .card { margin-top: 12px; }
  .card-title { font-size: 14.5px; flex-wrap: wrap; gap: 6px; }
  .card-title .sub { font-size: 11.5px; }

  /* 输入类：16px 防止 iOS 聚焦自动放大 */
  .searchbar { gap: 8px; }
  input[type="text"], select {
    height: 48px;
    font-size: 16px;
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }
  .searchbar .btn { flex: 1 1 100%; height: 48px; font-size: 15px; }

  .btn { height: 46px; font-size: 15px; }
  .btn.sm { height: 38px; font-size: 13.5px; padding: 0 16px; }

  .hint { font-size: 12px; line-height: 1.9; }

  /* 视频信息：封面铺满 */
  .vinfo { gap: 12px; }
  .vinfo .cover { width: 100%; flex: 1 1 100%; }
  .vinfo .meta { min-width: 0; flex: 1 1 100%; }
  .vinfo h3 { font-size: 15.5px; }
  .vinfo .kv { font-size: 12.5px; word-break: break-all; }
  .tagline { gap: 6px; }

  /* 操作按钮整行 */
  .actions-bar { gap: 8px; }
  .actions-bar .btn { flex: 1 1 100%; justify-content: center; height: 46px; font-size: 14px; }

  /* 格式表 → 卡片式 */
  .table-scroll { overflow: visible; margin-top: 12px; }
  table { min-width: 0; font-size: 13.5px; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tbody tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, .025);
  }
  tbody tr:hover { background: rgba(255, 255, 255, .05); }
  td {
    border: none;
    padding: 4px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
  }
  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    flex: 0 0 auto;
    text-align: left;
  }
  td.actions {
    display: block;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px dashed var(--border);
    text-align: left;
  }
  td.actions::before { content: none; }
  td.actions .btn { display: flex; width: 100%; justify-content: center; align-items: center; }

  /* 线路按钮：两列网格 */
  .lines { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .line-btn { justify-content: center; padding: 10px 8px; font-size: 13px; }
  .player-frame { border-radius: 10px; }

  /* 音乐 */
  .song { padding: 11px 8px; min-height: 50px; border-radius: 10px; }
  .song .idx { width: 18px; font-size: 11px; }
  .song .name { font-size: 14px; }
  .song .artist { font-size: 11.5px; }
  .song .dur { font-size: 11.5px; }
  .songlist { margin-top: 10px; }

  .player { gap: 12px; }
  .player .disc { width: 56px; height: 56px; }
  .player .pmeta .t { font-size: 14.5px; }
  .player .pmeta .a { font-size: 12px; }
  #quality { flex: 0 0 auto; width: auto; height: 38px; font-size: 14px; padding: 0 10px; }

  .controls { flex-wrap: wrap; gap: 8px 10px; margin-top: 12px; }
  #seek { order: -1; flex: 1 1 100%; }
  .controls .time { font-size: 11.5px; min-width: 34px; }
  #btn-play { flex: 1 1 auto; min-width: 92px; height: 42px; }
  #volume { flex: 1 1 110px; max-width: none !important; }

  .subtabs { gap: 4px; }
  .subtab { flex: 1; text-align: center; padding: 9px 6px; font-size: 13.5px; }

  .lyrics { font-size: 14px; height: 36vh; min-height: 170px; }
  .comments { max-height: 36vh; }
  .comment img { width: 28px; height: 28px; }

  /* 提示条：底部整行 */
  #toasts {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .toast { max-width: none; font-size: 13px; }

  /* MV 弹窗：全屏 */
  .modal { padding: 0; }
  .modal-box {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px;
  }
  .modal-box video { max-height: 62vh; }

  /* 解析失败面板 */
  .alert { padding: 14px; }
  .alert-title { font-size: 14px; }
  .alert-msg { font-size: 12.5px; }
  .alert-hint { font-size: 12.5px; }
  .alert-actions .btn { display: flex; width: 100%; justify-content: center; height: 44px; }
  .alert-actions .btn + .btn { margin-left: 0; margin-top: 8px; }
}

/* ---- 小屏手机 ---- */
@media (max-width: 400px) {
  .wrap { padding-left: 11px; padding-right: 11px; }
  .card { padding: 12px; }
  .brand { font-size: 15px; }
  .chip { max-width: 44vw; font-size: 10.5px; }
  .lines { grid-template-columns: 1fr; }
  .tab { font-size: 14px; padding: 10px 6px; }
  .player .disc { width: 48px; height: 48px; }
}

/* ---- 横屏 / 矮屏：压缩纵向占用 ---- */
@media (max-height: 520px) and (orientation: landscape) {
  .lyrics { height: 60vh; }
  .player-frame { aspect-ratio: 21 / 9; }
  .modal-box video { max-height: 70vh; }
}

/* ---- 触摸设备：加大可点区域 ---- */
@media (hover: none) and (pointer: coarse) {
  .song:hover, tbody tr:hover { background: none; }
  .song:active { background: rgba(255, 255, 255, .07); }
  .btn:active { transform: scale(.98); }
  .tab:active, .line-btn:active, .subtab:active { opacity: .78; }
  input[type="range"] { height: 28px; }
}
