/**
 * 音乐搜索器 - 现代化样式（零外部依赖）
 * 双主题由 :root / [data-theme=dark] 的 CSS 变量驱动，主题记忆在 localStorage。
 */

:root {
  --brand: #6366f1;
  --brand-2: #a855f7;
  --accent: #ec4899;
  --brand-soft: rgba(99, 102, 241, .12);
  --brand-soft-2: rgba(168, 85, 247, .14);

  --bg: #f4f6fb;
  --bg-grad-1: rgba(99, 102, 241, .16);
  --bg-grad-2: rgba(236, 72, 153, .12);
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --surface-2: #f7f8fc;
  --surface-hover: rgba(99, 102, 241, .07);
  --border: rgba(20, 24, 60, .09);
  --border-strong: rgba(20, 24, 60, .16);

  --text: #1c2138;
  --text-2: #5b6480;
  --text-3: #8b94ad;
  --shadow-sm: 0 2px 10px rgba(24, 30, 70, .06);
  --shadow: 0 12px 36px rgba(24, 30, 70, .12);
  --shadow-lg: 0 24px 70px rgba(24, 30, 70, .2);
  --radius: 18px;
  --radius-sm: 11px;
  --pb-height: 84px;
}

[data-theme="dark"] {
  --bg: #0e1120;
  --bg-grad-1: rgba(99, 102, 241, .26);
  --bg-grad-2: rgba(168, 85, 247, .18);
  --surface: rgba(26, 30, 50, .78);
  --surface-solid: #1a1e32;
  --surface-2: #222741;
  --surface-hover: rgba(140, 150, 255, .1);
  --border: rgba(255, 255, 255, .1);
  --border-strong: rgba(255, 255, 255, .2);
  --text: #eef0fb;
  --text-2: #a9b1cc;
  --text-3: #737d9e;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .24);
  --shadow: 0 12px 36px rgba(0, 0, 0, .4);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .55);
  --brand-soft: rgba(129, 140, 248, .18);
  --brand-soft-2: rgba(168, 85, 247, .2);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: calc(var(--pb-height) + 32px);
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei',
    'Hiragino Sans GB', 'Noto Sans CJK SC', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background .3s, color .3s;
}
body.has-player { padding-bottom: calc(var(--pb-height) + 46px); }
button, input { font: inherit; }
button { cursor: pointer; border: 0; background: none; color: inherit; }
a { color: var(--brand); text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
::selection { background: var(--brand-soft-2); }

/* ---------- 背景装饰 ---------- */
.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; display: block; border-radius: 50%; filter: blur(90px); opacity: .85; }
.orb-1 { width: 460px; height: 460px; top: -180px; left: -120px; background: var(--bg-grad-1); }
.orb-2 { width: 400px; height: 400px; top: 80px; right: -140px; background: var(--bg-grad-2); }
.orb-3 { width: 380px; height: 380px; bottom: -160px; left: 42%; background: var(--bg-grad-1); opacity: .5; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 960px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: 0 6px 18px rgba(99, 102, 241, .35);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; letter-spacing: .2px; }
.brand-text small { font-size: 11px; color: var(--text-3); }
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--text-2); border: 1px solid var(--border); background: var(--surface-solid);
  transition: color .2s, border-color .2s, transform .2s, background .2s;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- 布局 ---------- */
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.hero { padding: 46px 0 26px; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(28px, 5vw, 40px); font-weight: 800; letter-spacing: -.8px; }
.hero-dot { background: linear-gradient(135deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 8px 0 0; color: var(--text-2); font-size: 14px; }

/* ---------- 搜索面板 ---------- */
.search-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.mode-tabs { display: flex; gap: 6px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 18px; }
.mode-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 8px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: background .2s, color .2s, box-shadow .2s; white-space: nowrap;
}
.mode-tab svg { width: 15px; height: 15px; }
.mode-tab:hover { color: var(--brand); }
.mode-tab.is-active { background: var(--surface-solid); color: var(--brand); box-shadow: var(--shadow-sm); }

.search-box {
  display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 16px;
  background: var(--surface-solid); border: 1.5px solid var(--border-strong);
  border-radius: 14px; transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search-box-icon { color: var(--text-3); width: 19px; height: 19px; }
#j-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; padding: 8px 0; }
#j-input::placeholder { color: var(--text-3); }
.clear-btn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); }
.clear-btn:hover { background: var(--surface-2); color: var(--text); }
.clear-btn svg { width: 14px; height: 14px; }
.search-btn {
  min-width: 96px; padding: 11px 20px; border-radius: 10px; font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 18px rgba(99, 102, 241, .32);
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.search-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(99, 102, 241, .42); }
.search-btn:active { transform: translateY(0); }
.search-btn:disabled { opacity: .72; cursor: progress; transform: none; }
.btn-spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.field-hint { margin: 9px 2px 0; font-size: 12px; color: var(--text-3); min-height: 18px; }

.source-row, .quick-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; }
.row-label { flex: none; width: 66px; padding-top: 6px; font-size: 12px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.mini-icon { width: 13px; height: 13px; }
.source-chips, .quick-chips { display: flex; flex-wrap: wrap; gap: 7px; flex: 1; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 12.5px;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
  transition: all .2s; user-select: none;
}
.chip:hover span { color: var(--brand); border-color: var(--brand); }
.chip input:checked + span {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
}
.chip input:focus-visible + span { outline: 3px solid var(--brand-soft); outline-offset: 2px; }
.quick-chip { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; color: var(--text-2); background: transparent; border: 1px dashed var(--border-strong); transition: all .2s; }
.quick-chip:hover { color: var(--brand); border-color: var(--brand); border-style: solid; background: var(--brand-soft); }
.quick-chip .qc-del { margin-left: 5px; opacity: .45; font-size: 14px; line-height: 1; vertical-align: -1px; }
.quick-chip .qc-del:hover { opacity: 1; color: var(--accent); }

.alert { margin-top: 16px; padding: 11px 14px; border-radius: 11px; font-size: 13px; background: rgba(239, 68, 68, .1); color: #dc2626; border: 1px solid rgba(239, 68, 68, .22); }
[data-theme="dark"] .alert { color: #fca5a5; }

/* ---------- 结果区 ---------- */
.result-section { margin-top: 30px; }
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.result-head h2 { margin: 0; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.count-pill { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; color: var(--brand); background: var(--brand-soft); }
.result-meta { margin: 3px 0 0; font-size: 12px; color: var(--text-3); }
.text-btn { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 12.5px; padding: 6px 10px; border-radius: 8px; }
.text-btn svg { width: 14px; height: 14px; }
.text-btn:hover { color: var(--brand); background: var(--brand-soft); }

.song-list { display: flex; flex-direction: column; gap: 8px; }
.song-item {
  display: grid; grid-template-columns: 30px 48px minmax(0, 1fr) auto; align-items: center; gap: 13px;
  padding: 10px 14px 10px 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; box-shadow: var(--shadow-sm); transition: transform .18s, border-color .18s, background .18s;
  animation: itemIn .32s both;
}
@keyframes itemIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.song-item:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-hover); }
.song-item.is-current { border-color: var(--brand); background: var(--brand-soft); }
.song-index { text-align: center; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.song-item.is-current .song-index { color: var(--brand); font-weight: 700; }
.song-cover {
  position: relative; width: 48px; height: 48px; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); cursor: pointer; flex: none;
}
.song-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.song-cover-mask {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  background: rgba(20, 22, 50, .5); opacity: 0; transition: opacity .2s;
}
.song-cover:hover .song-cover-mask, .song-item.is-current .song-cover-mask { opacity: 1; }
.song-cover-mask svg { width: 20px; height: 20px; }
.song-info { min-width: 0; }
.song-title { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-item.is-current .song-title { color: var(--brand); }
.song-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.song-actions { display: flex; align-items: center; gap: 3px; }
.mini-btn { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--text-3); transition: color .2s, background .2s; }
.mini-btn svg { width: 16px; height: 16px; }
.mini-btn:hover { color: var(--brand); background: var(--brand-soft); }
.mini-btn.is-play svg { width: 17px; height: 17px; }
.source-badge { font-size: 10.5px; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; margin-right: 4px; white-space: nowrap; }
.badge-warn { font-size: 10.5px; color: #b45309; background: rgba(245, 158, 11, .14); border: 1px solid rgba(245, 158, 11, .3); padding: 2px 7px; border-radius: 6px; margin-right: 4px; white-space: nowrap; }
[data-theme="dark"] .badge-warn { color: #fbbf24; }
.help-note { padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--text-2) !important; }
.help-note strong { color: var(--brand); }
.wave { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; }
.wave i { width: 2px; background: var(--brand); border-radius: 2px; animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(1) { height: 5px; animation-delay: 0s; }
.wave i:nth-child(2) { height: 11px; animation-delay: .2s; }
.wave i:nth-child(3) { height: 7px; animation-delay: .4s; }
.wave.is-paused i { animation-play-state: paused; }
@keyframes wave { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }

.skeleton-wrap { display: flex; flex-direction: column; gap: 8px; }
.skeleton {
  height: 70px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface);
  position: relative; overflow: hidden;
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--surface-hover), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.empty-state { text-align: center; padding: 46px 20px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; color: var(--text-3); background: var(--surface-2); }
.empty-icon svg { width: 27px; height: 27px; }
.empty-state h3 { margin: 0 0 6px; font-size: 16px; }
.empty-state p { margin: 0 0 16px; font-size: 13px; color: var(--text-3); }
.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  color: var(--brand); background: var(--brand-soft); border: 1px solid transparent;
  transition: background .2s, transform .2s;
}
.ghost-btn:hover { background: var(--brand-soft-2); transform: translateY(-1px); }
.ghost-btn svg { width: 15px; height: 15px; }
.more-btn { display: block; width: 100%; margin-top: 14px; padding: 12px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border-strong); }
.more-btn:hover { color: var(--brand); border-color: var(--brand); }
.more-btn:disabled { opacity: .6; cursor: default; }

/* ---------- 帮助 / 页脚 ---------- */
.help-card { margin-top: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.help-card summary { display: flex; align-items: center; gap: 8px; padding: 15px 20px; cursor: pointer; font-size: 14px; font-weight: 650; list-style: none; }
.help-card summary::-webkit-details-marker { display: none; }
.help-card summary svg { width: 15px; height: 15px; color: var(--text-3); transition: transform .2s; }
.help-card details[open] summary svg { transform: rotate(90deg); }
.help-card summary:hover { color: var(--brand); }
.help-body { padding: 0 20px 20px; font-size: 13px; color: var(--text-2); border-top: 1px solid var(--border); padding-top: 16px; }
.help-body p { margin: 0 0 12px; }
.help-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 7px; }
.help-list li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.help-list span { min-width: 68px; color: var(--text-3); font-size: 12px; }
.help-list code { font-family: Menlo, Consolas, 'Courier New', monospace; font-size: 11.5px; background: var(--surface-2); padding: 3px 8px; border-radius: 6px; word-break: break-all; }
.help-list code b { color: var(--accent); font-weight: 700; }
.help-tip kbd { font-family: inherit; font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border-strong); }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 26px 2px 34px; font-size: 11.5px; color: var(--text-3); }
.link-btn { color: var(--text-3); text-decoration: underline; font-size: 11.5px; }
.link-btn:hover { color: var(--brand); }

/* ---------- 播放条 ---------- */
.player-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface); backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--border); box-shadow: 0 -8px 30px rgba(24, 30, 70, .09);
}
.pb-progress { position: relative; height: 5px; background: var(--surface-2); cursor: pointer; }
.pb-progress:hover { height: 7px; }
.pb-progress-buffer { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--border-strong); }
.pb-progress-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.pb-thumb { position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); transform: translateY(-50%) scale(0); transition: transform .15s; box-shadow: var(--shadow-sm); }
.pb-progress:hover .pb-thumb { transform: translateY(-50%) scale(1); }
.pb-inner { max-width: 1080px; margin: 0 auto; height: var(--pb-height); padding: 0 20px; display: flex; align-items: center; gap: 16px; }
.pb-cover { position: relative; width: 54px; height: 54px; border-radius: 11px; overflow: hidden; flex: none; background: var(--surface-2); padding: 0; }
.pb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-cover-mask { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(20, 22, 50, .55); opacity: 0; transition: opacity .2s; }
.pb-cover:hover .pb-cover-mask { opacity: 1; }
.pb-cover-mask svg { width: 20px; height: 20px; }
.pb-meta { min-width: 0; width: 170px; flex: none; }
.pb-title { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-author { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-controls { display: flex; align-items: center; gap: 6px; flex: none; }
.ctrl-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); transition: color .2s, background .2s, transform .2s; }
.ctrl-btn svg { width: 17px; height: 17px; }
.ctrl-btn:hover { color: var(--brand); background: var(--brand-soft); }
.ctrl-main { width: 42px; height: 42px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 5px 16px rgba(99, 102, 241, .35); }
.ctrl-main svg { width: 19px; height: 19px; }
.ctrl-main:hover { color: #fff; transform: scale(1.06); }
.pb-time { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.pb-time-sep { margin: 0 4px; opacity: .6; }
.pb-extra { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.volume-wrap { display: flex; align-items: center; gap: 4px; }
.volume-range { width: 78px; height: 4px; border-radius: 4px; appearance: none; -webkit-appearance: none; background: var(--border-strong); outline: none; cursor: pointer; }
.volume-range::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: var(--brand); }
.volume-range::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--brand); }
.ctrl-btn.is-active { color: var(--brand); background: var(--brand-soft); }

/* ---------- 歌词抽屉 ---------- */
.lyric-drawer {
  position: fixed; right: 0; top: 0; bottom: var(--pb-height); z-index: 35; width: 380px; max-width: 100%;
  display: flex; flex-direction: column; background: var(--surface);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: slideIn .28s ease both;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px; border-bottom: 1px solid var(--border); }
.drawer-head img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; }
.drawer-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.drawer-meta strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-meta span { font-size: 12px; color: var(--text-3); }
.lyric-lines { position: relative; flex: 1; overflow-y: auto; padding: 26px 22px 40px; scrollbar-width: thin; text-align: center; }
.lyric-lines p { margin: 0 0 15px; font-size: 13.5px; line-height: 1.7; color: var(--text-3); transition: color .25s, transform .25s, font-size .25s; }
.lyric-lines p.is-active { color: var(--brand); font-weight: 700; font-size: 15px; transform: scale(1.02); }
.lyric-placeholder { color: var(--text-3) !important; font-size: 13px !important; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12, 15, 32, .5); backdrop-filter: blur(4px); animation: fadeIn .2s both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  position: relative; width: 100%; max-width: 520px; max-height: 86vh; overflow: auto;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); animation: popIn .24s both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-sm { max-width: 430px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; font-size: 13.5px; color: var(--text-2); }
.modal-body p { margin: 0 0 12px; }
.modal-body p:last-child { margin-bottom: 0; }
.muted { color: var(--text-3); font-size: 12.5px; }
.modal-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 20px; }
.detail-song { display: flex; gap: 14px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.detail-song img { width: 62px; height: 62px; border-radius: 12px; object-fit: cover; }
.detail-song > div { display: flex; flex-direction: column; min-width: 0; }
.detail-song strong { font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-song span { font-size: 12.5px; color: var(--text-3); }
.detail-source { color: var(--brand) !important; }
.detail-rows { display: grid; gap: 2px; }
.detail-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: 0; }
.detail-row > label { flex: none; width: 72px; font-size: 12px; color: var(--text-3); }
.detail-row > span { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-family: Menlo, Consolas, monospace; }
.detail-row > button { flex: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--pb-height) + 24px); transform: translate(-50%, 14px);
  z-index: 80; padding: 10px 18px; border-radius: 11px; font-size: 13px; font-weight: 600;
  color: #fff; background: rgba(28, 32, 58, .94); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; white-space: nowrap; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
[data-theme="dark"] .toast { background: rgba(58, 64, 96, .96); }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  :root { --pb-height: 72px; }
  .wrap { padding: 0 14px; }
  .hero { padding: 30px 0 20px; }
  .search-panel { padding: 16px; }
  .mode-tab { font-size: 12px; gap: 5px; }
  .mode-tab svg { display: none; }
  .search-box { padding-left: 12px; }
  #j-input { font-size: 15px; }
  .search-btn { min-width: 74px; padding: 10px 13px; }
  .source-row, .quick-row { flex-direction: column; gap: 7px; }
  .row-label { width: auto; padding-top: 0; }
  .song-item { grid-template-columns: 22px 44px minmax(0, 1fr) auto; gap: 9px; padding: 9px 9px 9px 7px; }
  .song-cover { width: 44px; height: 44px; }
  .source-badge { display: none; }
  .mini-btn.opt-hide-sm { display: none; }
  .pb-inner { padding: 0 12px; gap: 10px; }
  .pb-cover { width: 46px; height: 46px; }
  .pb-meta { width: auto; flex: 1; }
  .pb-time, .volume-wrap { display: none; }
  .pb-extra { gap: 0; }
  .ctrl-btn { width: 31px; height: 31px; }
  .ctrl-main { width: 38px; height: 38px; }
  .lyric-drawer { width: 100%; }
  .footer { justify-content: center; text-align: center; }
  .modal-foot .ghost-btn { flex: 1; }
}
@media (max-width: 380px) {
  .pb-lyric-hide { display: none; }
  .search-btn .btn-label { display: none; }
  .search-btn { min-width: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
