:root {
  --glass-bg: rgba(18, 20, 30, 0.62);
  --glass-bg-strong: rgba(18, 20, 30, 0.82);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-highlight: rgba(255, 255, 255, 0.16);
  --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);

  --bg-base: #0a0c14;

  --text: #eef1f8;
  --text-dim: rgba(238, 241, 248, 0.58);
  --text-soft: rgba(238, 241, 248, 0.35);

  --accent: #7aa2ff;
  --accent-2: #a78bfa;
  --danger: #ff6b81;

  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  /* 歌词颜色体系 */
  --lyric-idle:   rgba(190, 200, 215, 0.40);
  --lyric-near:   rgba(215, 224, 238, 0.62);
  --lyric-far:    rgba(190, 200, 215, 0.20);
  --lyric-active: #ffffff;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  overflow: hidden;
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

input, textarea, [contenteditable="true"] { user-select: text; -webkit-user-select: text; }

img {
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}

button {
  font: inherit; color: inherit; cursor: pointer;
  border: none; background: none; outline: none;
}
button:focus, button:focus-visible, button:active { outline: none; box-shadow: none; }

input {
  font: inherit; color: inherit;
  border: none; outline: none; background: none;
}

/* ============ 背景光斑 ============ */
.bg-layer { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg-base); }
.blob { position: absolute; border-radius: 50%; filter: none; opacity: 0.5; will-change: transform; }
.b1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle at center, #4361ee 0%, transparent 68%);
  top: -160px; left: -140px;
  animation: float1 20s ease-in-out infinite;
}
.b2 {
  width: 620px; height: 620px;
  background: radial-gradient(circle at center, #8a5cf6 0%, transparent 68%);
  bottom: -220px; right: -200px;
  animation: float2 24s ease-in-out infinite;
}
.b3 {
  width: 460px; height: 460px;
  background: radial-gradient(circle at center, #06b6d4 0%, transparent 68%);
  top: 35%; left: 50%;
  animation: float3 22s ease-in-out infinite;
}
@keyframes float1 { 50% { transform: translate(60px, 80px); } }
@keyframes float2 { 50% { transform: translate(-80px, -60px); } }
@keyframes float3 { 50% { transform: translate(-100px, 60px); } }

/* ============ 毛玻璃 ============ */
.glass {
  position: relative;
  background:
    linear-gradient(135deg,
      rgba(255,255,255,0.09) 0%,
      rgba(255,255,255,0.02) 28%,
      rgba(255,255,255,0.00) 50%,
      rgba(255,255,255,0.02) 72%,
      rgba(255,255,255,0.06) 100%),
    var(--glass-bg);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

@supports not (backdrop-filter: blur(18px)) {
  .glass { background: rgba(18, 20, 30, 0.94); }
}

/* ============ 布局 ============ */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 14px;
  position: relative;
}

/* ============ 主面板（搜索 + 结果合并） ============ */
.results-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
}

/* ============ 搜索栏 ============ */
.topbar {
  padding: 14px 16px 10px;
  flex-shrink: 0;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  height: 48px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.search-wrap:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(122, 162, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.12);
}

.platform-picker {
  position: relative;
  height: 100%;
  flex-shrink: 0;
}

.platform-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 100%;
  border-radius: 999px;
  background: rgba(122, 162, 255, 0.16);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  transition: background 0.15s;
  white-space: nowrap;
}
.platform-btn:hover { background: rgba(122, 162, 255, 0.28); }

.platform-btn .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px currentColor;
  flex-shrink: 0;
}
.platform-btn .chev { font-size: 9px; opacity: 0.7; }

.platform-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 150px;
  border-radius: var(--radius-md);
  padding: 6px;
  z-index: 999;
  display: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 50%, rgba(255,255,255,0.04) 100%),
    rgba(20, 22, 32, 0.96);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 16px 44px rgba(0, 0, 0, 0.65),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.platform-menu.open { display: block; animation: menuIn 0.18s ease; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } }

.platform-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
}
.platform-item:hover { background: rgba(255, 255, 255, 0.08); }
.platform-item.active { background: rgba(122, 162, 255, 0.18); }

.platform-item .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.search-input {
  flex: 1;
  height: 100%;
  padding: 0 14px;
  background: transparent;
  border: none;
  font-size: 13px;
  color: var(--text);
  min-width: 0;
}
.search-input::placeholder { color: var(--text-soft); }

.search-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
  transition: transform 0.15s;
  box-shadow:
    0 4px 14px rgba(122, 162, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.search-btn:hover { transform: scale(1.05); }
.search-btn:active { transform: scale(0.95); }

.panel-head {
  padding: 4px 22px 10px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-shrink: 0;
}
.panel-head h2 { font-size: 16px; font-weight: 600; letter-spacing: 0.3px; }
.panel-sub { font-size: 12px; color: var(--text-dim); }

.result-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 100px;
  min-height: 0;
}
.result-list::-webkit-scrollbar { width: 6px; }
.result-list::-webkit-scrollbar-track { background: transparent; }
.result-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.result-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 90px 20px;
  color: var(--text-dim);
  gap: 16px;
}
.empty-state i.empty-icon { font-size: 38px; opacity: 0.35; }
.empty-state p { font-size: 13px; }

/* ============ 歌曲卡片 ============ */
.song-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: background 0.15s;
  cursor: pointer;
  margin-bottom: 2px;
  outline: none;
}
.song-card:hover { background: rgba(255, 255, 255, 0.05); }
.song-card.playing { background: rgba(122, 162, 255, 0.1); }

.song-cover {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(122,162,255,0.18), rgba(167,139,250,0.18));
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 22px;
  flex-shrink: 0;
}
.song-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.song-info { min-width: 0; }
.song-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.song-card.playing .song-name { color: #b9ceff; }
.song-meta {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.song-meta .album::before {
  content: '·';
  margin: 0 4px;
  opacity: 0.5;
}
.song-meta .album { color: var(--text-soft); }

.song-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(122, 162, 255, 0.18);
  color: #b9ceff;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.song-actions { display: flex; align-items: center; gap: 6px; }

.song-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  transition: all 0.15s;
  color: var(--text-dim);
  font-size: 14px;
}
.song-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  transform: translateY(-1px);
}
.song-btn.dl-btn:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

/* ============ 悬浮播放器 ============ */
.player {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  z-index: 50;
  cursor: pointer;
  background: rgba(18, 20, 30, 0.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.2s;
}
.player:hover { transform: translateX(-50%) translateY(-2px); }

.player-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  padding: 4px;
  border-radius: 999px;
}

.cover {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(122,162,255,0.28), rgba(167,139,250,0.28));
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background-size: cover;
  background-position: center;
  color: rgba(255,255,255,0.5);
  font-size: 17px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }

.meta { min-width: 0; }
.meta .title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}
.meta .artist {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}

.player-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ctrl-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text);
  transition: all 0.15s;
  font-size: 14px;
}
.ctrl-btn:hover { background: rgba(255, 255, 255, 0.1); }
.ctrl-btn.play {
  width: 48px;
  height: 48px;
  background: #f0f2f8;
  color: #16181f;
  font-size: 15px;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.ctrl-btn.play:hover { transform: scale(1.06); }

/* ============ 全屏播放器 ============ */
.nowplaying-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
  overflow: hidden;
  color: #fff;
}
.nowplaying-overlay.open { opacity: 1; visibility: visible; }

.np-bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(140%) brightness(0.5);
  z-index: -2;
  transform: scale(1.2);
}
.np-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,12,20,0.45) 0%, rgba(10,12,20,0.7) 55%, rgba(10,12,20,0.92) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: -1;
}

.np-handle {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  z-index: 5;
}

.np-close {
  position: absolute;
  top: 18px;
  left: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  font-size: 15px;
  z-index: 10;
  transition: background 0.15s;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.2);
}
.np-close:hover { background: rgba(255, 255, 255, 0.22); }

.np-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 26px 22px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  min-height: 0;
}

.np-cover {
  width: 100%;
  max-width: min(340px, 46vh, 62vw);
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(122,162,255,0.25), rgba(167,139,250,0.25));
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 56px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 6px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.np-cover img { width: 100%; height: 100%; object-fit: cover; }

.np-info {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.np-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.3px;
  word-break: break-word;
}
.np-artist {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 6px;
  word-break: break-word;
}

.np-progress-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  position: relative;
  cursor: pointer;
}
.np-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: #fff;
  position: relative;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}
.np-progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  opacity: 0;
  transition: opacity 0.15s;
}
.np-progress-bar:hover .np-progress-handle { opacity: 1; }

.np-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.np-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.np-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  transition: transform 0.15s, background 0.15s;
}
.np-btn:hover { background: rgba(255, 255, 255, 0.08); }
.np-btn.np-play {
  width: 64px;
  height: 64px;
  background: #fff;
  color: #16181f;
  font-size: 24px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.np-btn.np-play:hover { transform: scale(1.05); }

.np-volume {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
  color: rgba(255, 255, 255, 0.6);
}
.np-volume i { font-size: 14px; }
.np-volume input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
}
.np-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.np-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}
.np-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.15s, transform 0.15s;
  font-size: 20px;
}
.np-action:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }
.np-action-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.4px;
}

.np-quality-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(122, 162, 255, 0.25);
  color: #dbe5ff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ============ 歌词全屏 ============ */
.lyrics-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  overflow: hidden;
}
.lyrics-overlay.open { opacity: 1; visibility: visible; }

.lyrics-bg {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(120%) brightness(0.4);
  z-index: -2;
  transform: scale(1.15);
}
.lyrics-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(10,12,20,0.5), rgba(10,12,20,0.96));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: -1;
}

/* ★ 顶部固定标题栏（左侧小封面用伪元素 + CSS 变量实现） */
.lyrics-head {
  padding: 26px 40px 6px;
  text-align: left;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}
/* ★ 小封面：background-image 优先取 --lcover 变量（由 JS 注入），否则回退到默认渐变 */
.lyrics-head::before {
  content: '';
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-image: var(--lcover, linear-gradient(135deg, rgba(122,162,255,0.45), rgba(167,139,250,0.45)));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.l-title { font-size: 18px; font-weight: 600; margin-bottom: 2px; }
.l-artist { font-size: 12px; color: var(--text-dim); }

/* ★ 容器：顶部预留一点空间，底部留白让末尾行也能滚到"顶部位置" */
.lyrics-container {
  flex: 1;
  overflow-y: auto;
  padding: 40px 0 55vh;
  scrollbar-width: none;
  /* ★ 去掉 scroll-behavior: smooth，避免与 JS 滚动冲突 */
  -webkit-overflow-scrolling: touch;
}
.lyrics-container::-webkit-scrollbar { display: none; }

.lyrics-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 0 56px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ============ 逐行歌词（平滑过渡） ============ */
.lyric-line {
  font-size: 32px;
  line-height: 1.38;
  color: var(--lyric-idle);
  cursor: pointer;
  padding: 4px 0;
  text-align: left;
  font-weight: 700;
  letter-spacing: 0.3px;
  transform: scale(0.96);
  transform-origin: left center;
  text-shadow: 0 0 0 rgba(122, 162, 255, 0);
  will-change: transform, color;
  backface-visibility: hidden;
  /* ★ 只过渡 GPU 友好属性 + 颜色，不再动 font-size / filter / blur */
  transition:
    color 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    text-shadow 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.lyric-line.near {
  color: var(--lyric-near);
  transform: scale(0.98);
}

.lyric-line.active {
  color: var(--lyric-active);
  transform: scale(1.08);
  letter-spacing: 0.5px;
  text-shadow:
    0 0 28px rgba(122, 162, 255, 0.4),
    0 0 60px rgba(122, 162, 255, 0.18);
}

.lyric-line.far {
  color: var(--lyric-far);
  transform: scale(0.94);
}

.lyric-line:hover { color: #fff; }

.lyric-main { display: inline-block; }
.lyric-line .trans {
  display: block;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.42);
  font-weight: 400;
  margin-top: 8px;
}

.lyrics-empty {
  text-align: center;
  color: var(--text-soft);
  font-size: 15px;
  padding: 60px 0;
}

/* 用户手动滚动时：全部平铺，取消景深 */
.lyrics-container.user-scrolling .lyric-line {
  transform: none !important;
  text-shadow: 0 0 0 rgba(122, 162, 255, 0) !important;
  transition: color 0.2s ease !important;
}
.lyrics-container.user-scrolling .lyric-line.active { color: #fff; }

/* ============ 弹窗 ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } }

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  padding: 22px 22px 14px;
  animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 50%, rgba(255,255,255,0.04) 100%),
    rgba(20, 22, 32, 0.94);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.65),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
@keyframes popIn { from { transform: scale(0.92); opacity: 0; } }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}
.modal-head h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.modal-sub {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.15s;
  font-size: 14px;
  color: var(--text-dim);
  display: grid;
  place-items: center;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }

.quality-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}
.quality-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.15s;
  border: 1px solid transparent;
}
.quality-item:hover {
  background: rgba(122, 162, 255, 0.12);
  border-color: rgba(122, 162, 255, 0.28);
}
.quality-item.current {
  background: rgba(122, 162, 255, 0.16);
  border-color: rgba(122, 162, 255, 0.42);
}
.q-left { display: flex; align-items: center; gap: 10px; }
.q-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(122, 162, 255, 0.16);
  color: #b9ceff;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 600;
}
.q-tag.hi { background: rgba(167, 139, 250, 0.18); color: #c4b5fd; }
.q-name { font-size: 14px; }
.q-current {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  margin-left: 8px;
}
.q-arrow { color: var(--text-soft); transition: transform 0.15s; font-size: 12px; }
.quality-item:hover .q-arrow { color: var(--accent); transform: translateX(3px); }

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.01) 50%, rgba(255,255,255,0.04) 100%),
    rgba(20, 22, 32, 0.94);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 300;
  max-width: 80vw;
  text-align: center;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(255, 107, 129, 0.35); color: #ffc5cc; }
.toast.success { border-color: rgba(110, 255, 180, 0.35); }

.loader {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 歌词模式切换按钮 ============ */
.toggle-lyrics-mode {
  position: absolute;
  top: 22px;
  right: 26px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.15s;
  z-index: 10;
  font-size: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.2);
}
.toggle-lyrics-mode:hover { background: rgba(255, 255, 255, 0.16); }

/* ============ 逐字歌词 ============ */
.lyric-line.word-line .lyric-main { display: block; }

/* 每个字的过渡时长由 JS 按「该字剩余时长」动态写入 transition-duration */
.lyric-word {
  display: inline;
  color: var(--lyric-idle);
  text-shadow: 0 0 0 rgba(122, 162, 255, 0);
  transition-property: color, text-shadow;
  transition-timing-function: linear;
  transition-duration: 150ms;
}

/* ★ 已唱过的字 = 与逐行 active 完全一致的白色高亮 */
.lyric-line.word-line.active .lyric-word.sung {
  color: #fff;
  text-shadow:
    0 0 22px rgba(122, 162, 255, 0.45),
    0 0 48px rgba(122, 162, 255, 0.2);
}

/* ============ 响应式 ============ */
@media (max-width: 720px) {
  .np-content { padding: 44px 22px 20px; }
  .np-cover { max-width: min(300px, 40vh, 58vw); font-size: 48px; }
  .np-title { font-size: 21px; }
  .np-artist { font-size: 13px; }
  .np-btn { width: 44px; height: 44px; font-size: 18px; }
  .np-btn.np-play { width: 58px; height: 58px; font-size: 22px; }
  .np-controls { gap: 26px; }

  .lyrics-head { padding: 20px 22px 6px; }
  .lyrics-head::before { width: 36px; height: 36px; }
  .l-title { font-size: 16px; }
  .lyrics-list { padding: 0 22px; gap: 18px; }
  .lyrics-container { padding: 24px 0 50vh; }
  .lyric-line { font-size: 24px; }
  .lyric-line .trans { font-size: 14px; }
}

@media (max-width: 600px) {
  .app { padding: 8px; }
  .topbar { padding: 10px 12px 8px; }
  .search-wrap { height: 44px; padding: 3px; }
  .platform-btn { padding: 0 12px; font-size: 11px; }
  .search-btn { width: 36px; height: 36px; font-size: 13px; }
  .panel-head { padding: 4px 18px 8px; }
  .result-list { padding: 4px 8px 90px; }
  .song-card { grid-template-columns: 48px 1fr auto; gap: 10px; padding: 8px 10px; }
  .song-cover { width: 48px; height: 48px; border-radius: 10px; font-size: 18px; }

  .player {
    width: calc(100% - 16px);
    bottom: 12px;
    padding: 6px 10px;
    gap: 10px;
  }
  .cover { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }
  .ctrl-btn { width: 36px; height: 36px; font-size: 13px; }
  .ctrl-btn.play { width: 42px; height: 42px; font-size: 14px; }
  .meta .title { font-size: 13px; }
  .meta .artist { font-size: 11px; }
}