/* ============================================================
   Music Downloader · Apple Music 风格
   ============================================================ */
:root {
  --bg-a: #e8e9ee;
  --bg-b: #d7dbe8;
  --bg-c: #f2edea;
  --ink: #1d1d1f;
  --ink-2: #86868b;
  --ink-3: #b0b0b6;
  --card: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.65);
  --glass: rgba(255, 255, 255, 0.62);
  --line: rgba(0, 0, 0, 0.08);
  --accent: #fa2d48;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  --radius: 20px;
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #f5f5f7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  animation: pageIn 0.55s ease both;
}
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- 背景渐变（随封面变化） ---- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 90% at 12% 0%, var(--bg-a), transparent 60%),
    radial-gradient(110% 90% at 100% 15%, var(--bg-b), transparent 65%),
    radial-gradient(120% 110% at 50% 110%, var(--bg-c), transparent 70%);
  transition: background 1.2s ease;
}
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 18px 120px;
}

/* ---- 头部 ---- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 20px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #fa6b57, #f0324b 45%, #a032c8);
  box-shadow: 0 4px 14px rgba(240, 50, 75, 0.35);
}
.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.header-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.header-status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  transition: background 0.3s;
}
.header-status.live { color: var(--ink); }
.header-status.live .dot { background: #30b254; box-shadow: 0 0 0 3px rgba(48, 178, 84, 0.18); animation: dotPulse 2.2s ease-in-out infinite; }
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(48, 178, 84, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(48, 178, 84, 0); }
}

/* ---- Hero ---- */
.hero { padding: 26px 4px 30px; }
.hero-title {
  font-size: 42px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -1.2px;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}
.hero-sub {
  margin-top: 10px;
  font-size: 15px;
  color: var(--ink-2);
  letter-spacing: 0.2px;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}
.source-switch {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--card);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}
.search-box {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow);
  color: var(--ink-2);
  transition: box-shadow 0.25s;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.search-box:focus-within {
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(0, 0, 0, 0.04);
}

/* ---- 下载账号切换条 ---- */
.account-bar {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}
.account-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}
.account-chip:hover { background: rgba(0, 0, 0, 0.045); }
.account-chip:active { transform: scale(0.97); }
.account-chip.active-vip {
  border-color: rgba(201, 161, 92, 0.55);
  background: rgba(201, 161, 92, 0.09);
  color: var(--ink);
}
.account-chip.active-novip {
  border-color: var(--line);
  background: rgba(0, 0, 0, 0.045);
  color: var(--ink);
}
.account-chip .acc-name { font-weight: 600; }
.account-chip .acc-qq { font-variant-numeric: tabular-nums; opacity: 0.62; font-size: 12px; }
.account-chip .acc-vip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #c9a15c;
  border: 1px solid rgba(201, 161, 92, 0.45);
  border-radius: 5px;
  padding: 1px 6px;
  transform: translateY(-1px);
  line-height: 1.4;
}
.account-chip .acc-novip {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  transform: translateY(-1px);
  line-height: 1.4;
}
.account-chip .acc-err {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #d0021b;
  border: 1px solid rgba(208, 2, 27, 0.25);
  border-radius: 5px;
  padding: 1px 6px;
  transform: translateY(-1px);
  line-height: 1.4;
}
.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  height: 40px;
  line-height: 40px;
  padding: 0;
  margin: 0;
  caret-color: var(--ink);
}
.search-box input::placeholder { color: var(--ink-3); }
.search-box button {
  border: none;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 20px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.search-box button:active { transform: scale(0.97); }
.search-box button:disabled { opacity: 0.5; }

/* ---- 状态与元信息 ---- */
.status {
  padding: 14px 6px;
  color: var(--ink-2);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
}
.status:empty {
  padding: 0;
  min-height: 0;
}
.status .spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.result-meta {
  padding: 0 6px 16px;
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: 0.3px;
}
.result-meta b { color: var(--ink); font-weight: 700; }

/* ---- 歌曲列表 ---- */
.song-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.song {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--card);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 0.2s, box-shadow 0.2s;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.song:hover { transform: translateY(-2px); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.1); }
.song.playing-card {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.14), 0 14px 44px rgba(0, 0, 0, 0.1);
}
.song.playing-card .song-disc { animation: discGlow 2.6s ease-in-out infinite; }
@keyframes discGlow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 0 0 0 rgba(0, 0, 0, 0.12); }
  50% { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 0 0 6px rgba(0, 0, 0, 0.05); }
}

.song-disc {
  width: 52px; height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
  background: #e9e9ee center/cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  position: relative;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
}
.song-disc.loaded { animation: coverIn 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes coverIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
.song:hover .song-disc { transform: scale(1.06) rotate(-2deg); }
.song-disc::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}
.song-body { flex: 1; min-width: 0; }
.song-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
}
.song-meta .sep { color: var(--ink-3); flex-shrink: 0; }
.song-meta span { overflow: hidden; text-overflow: ellipsis; }
.song-meta .singer { flex-shrink: 1; }
.song-meta .album { flex-shrink: 2; }

.song-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.song-play {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s;
}
.song-play svg { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.song-play:hover { background: var(--ink); color: #fff; transform: scale(1.08); }
.song-play:active { transform: scale(0.9); }
.song-play.playing { background: var(--ink); color: #fff; }
.song-play.playing svg { animation: iconBreathe 1.4s ease-in-out infinite; }
@keyframes iconBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.82); }
}

.dl-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.22s;
  font-variant-numeric: tabular-nums;
  position: relative;
  overflow: hidden;
}
.dl-open::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.5s;
}
.dl-open:hover::after { transform: translateX(120%); }
.dl-open:hover { background: var(--ink); color: #fff; }
.dl-open:active { transform: scale(0.95); }
.dl-open.busy { background: rgba(0, 0, 0, 0.08); }
.dl-open.done { background: rgba(48, 178, 84, 0.14); color: #1f8a45; }
.dl-open.error { background: rgba(240, 50, 75, 0.12); color: #d51f3d; }

/* 列表内进度条 */
.progress-bar {
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 3px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: width 0.2s;
}
.song { position: relative; }
.error-msg {
  position: absolute;
  left: 14px; right: 14px; bottom: 10px;
  font-size: 11px;
  color: #d51f3d;
}

/* ---- 页脚 ---- */
.footer {
  margin-top: 48px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* ============================================================
   底部迷你播放条
   ============================================================ */
.player {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  z-index: 60;
  width: min(720px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px 20px;
  background: rgba(250, 250, 252, 0.75);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
  animation: playerUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes playerUp {
  from { opacity: 0; transform: translate(-50%, 24px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.player.hidden { display: none; }

.player-cover {
  width: 48px; height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  background: #e9e9ee center/cover no-repeat;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  position: relative;
}
.player-cover .disc-hole {
  position: absolute;
  left: 50%; top: 50%;
  width: 9px; height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.player-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.player-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 6px;
}
.player-singer {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-progress {
  position: absolute;
  left: 14px; right: 14px; bottom: 9px;
  height: 2.5px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.player-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  width: 0%;
}

.player-play {
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.player-play svg { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.player-play:hover { background: rgba(0, 0, 0, 0.06); }
.player-play:active svg { transform: scale(0.82); }

/* ============================================================
   正在播放全屏页
   ============================================================ */
.now-playing {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(130% 70% at 50% -10%, rgba(255, 255, 255, 0.22), transparent 60%),
    linear-gradient(165deg, var(--np-a, #3a3a44), var(--np-b, #17171c) 55%, var(--np-c, #101014));
  color: #fff;
  padding: 14px 24px calc(26px + env(safe-area-inset-bottom));
  overflow-y: auto;
  animation: npUp 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}
@keyframes npUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}
.now-playing.hidden { display: none; }
.now-playing.closing { animation: npClose 0.32s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; }
.now-playing.dragging { transition: none !important; }
@keyframes npClose {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

.np-handle {
  width: 72px;
  height: 24px;
  margin: 0 auto 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
  border-radius: 12px;
  transition: background 0.2s;
  touch-action: none;
}
.np-handle:active { cursor: grabbing; }
.np-handle::before {
  content: "";
  width: 40px; height: 4.5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
  transition: background 0.2s, transform 0.2s;
}
.np-handle:hover::before { background: rgba(255, 255, 255, 0.6); }
.np-handle:active::before { transform: scale(0.9); }
.np-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.np-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.85);
}

.np-cover-wrap {
  display: flex;
  justify-content: center;
  padding: 26px 0 20px;
  flex-shrink: 0;
  animation: npPop 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
@keyframes npPop {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.np-cover {
  width: min(62vw, 300px);
  height: min(62vw, 300px);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08) center/cover no-repeat;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.12);
  position: relative;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.np-cover-wrap:hover .np-cover { transform: scale(1.03) rotate(-1deg); }

.np-info { text-align: center; flex-shrink: 0; animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both; }
.np-name {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-singer {
  margin-top: 6px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-progress { margin-top: 26px; flex-shrink: 0; animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both; }
.np-track {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  position: relative;
}
.np-track:hover .np-fill { filter: brightness(1.2); }
.np-fill {
  height: 100%;
  border-radius: 3px;
  background: #fff;
  width: 0%;
  transition: width 0.2s linear, filter 0.2s;
}
.np-time {
  margin-top: 9px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.7);
}

.np-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  flex-shrink: 0;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.36s both;
}
.np-play {
  width: 64px; height: 64px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.np-play svg { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.np-play:hover { background: rgba(255, 255, 255, 0.24); transform: scale(1.05); }
.np-play:active { transform: scale(0.92); }
.np-play:active svg { transform: scale(0.85); }

/* ---- 滚动歌词（Apple Music 式） ---- */
.np-lyrics-wrap {
  flex: 1;
  min-height: 180px;
  margin-top: 26px;
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
  animation: fadeInUp 0.8s ease 0.42s both;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.np-lyrics {
  position: absolute;
  top: 0; left: 0; right: 0;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.lyric-line {
  padding: 9px 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  color: rgba(255, 255, 255, 0.32);
  transition: color 0.5s, font-size 0.5s, font-weight 0.5s;
  letter-spacing: 0.4px;
}
.lyric-line.active {
  color: #fff;
  font-size: 19px;
  font-weight: 700;
}
.lyric-line.near { color: rgba(255, 255, 255, 0.55); }
.lyric-line.time { font-size: 12px; color: rgba(255, 255, 255, 0.28); font-variant-numeric: tabular-nums; }
.np-lyrics-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.4);
}

/* ---- 歌词：超长自动换行 ---- */
.lyric-line {
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

/* ---- 横屏 / 宽屏：左封面右歌词（Apple Music 分栏） ---- */
@media (orientation: landscape) {
  .now-playing {
    display: grid;
    grid-template-columns: minmax(300px, 42%) 1fr;
    grid-template-rows: auto auto auto auto auto;
    align-content: center;
    padding: 18px 36px 24px;
  }
  .np-handle {
    display: flex;
    grid-column: 1; grid-row: 1;
    margin: 0;
    align-self: start;
    justify-self: start;
  }
  .np-header { grid-column: 2; grid-row: 1; align-self: center; }
  .np-cover-wrap {
    grid-column: 1; grid-row: 2;
    padding: 20px 0 14px;
    align-self: end;
  }
  .np-cover {
    width: min(38vh, 330px);
    height: min(38vh, 330px);
  }
  .np-info { grid-column: 1; grid-row: 3; align-self: start; }
  .np-progress { grid-column: 1; grid-row: 4; margin-top: 18px; }
  .np-controls { grid-column: 1; grid-row: 5; margin-top: 12px; }
  .np-lyrics-wrap {
    grid-column: 2; grid-row: 2 / 6;
    margin-top: 0;
    align-self: center;
    min-height: 0;
    height: 100%;
  }
  .lyric-line { font-size: 18px; padding: 11px 0; }
  .lyric-line.active { font-size: 22px; }
  .np-time { font-size: 12.5px; }
}

/* 手机横屏（矮视口）：压缩封面与间距 */
@media (orientation: landscape) and (max-height: 480px) {
  .now-playing { padding: 12px 20px 16px; grid-template-columns: minmax(240px, 44%) 1fr; }
  .np-cover-wrap { padding: 10px 0 8px; }
  .np-cover { width: min(30vh, 190px); height: min(30vh, 190px); border-radius: 14px; }
  .np-name { font-size: 17px; }
  .np-singer { font-size: 13px; margin-top: 3px; }
  .np-progress { margin-top: 12px; }
  .np-controls { margin-top: 8px; }
  .np-play { width: 52px; height: 52px; }
  .np-lyrics-wrap { margin-top: 0; }
  .lyric-line { font-size: 14px; padding: 6px 0; }
  .lyric-line.active { font-size: 16.5px; }
}

/* 平板/桌面横屏（高视口）：更大封面 */
@media (orientation: landscape) and (min-height: 560px) {
  .np-cover { width: min(44vh, 380px); height: min(44vh, 380px); }
  .lyric-line { font-size: 19px; padding: 12px 0; }
  .lyric-line.active { font-size: 23px; }
}

/* 超宽屏 */
@media (orientation: landscape) and (min-width: 1600px) {
  .now-playing { grid-template-columns: minmax(420px, 38%) 1fr; padding: 26px 60px 34px; }
  .np-cover { width: min(46vh, 460px); height: min(46vh, 460px); }
  .lyric-line { font-size: 21px; padding: 14px 0; }
  .lyric-line.active { font-size: 26px; }
}

/* 竖屏平板：封面放大 */
@media (orientation: portrait) and (min-width: 561px) {
  .np-cover { width: min(54vw, 380px); height: min(54vw, 380px); }
  .np-name { font-size: 26px; }
  .lyric-line { font-size: 17px; padding: 11px 0; }
  .lyric-line.active { font-size: 21px; }
}

/* ============================================================
   音质选择面板
   ============================================================ */
.dl-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.dl-modal.hidden { display: none; }
.dl-modal.closing .dl-mask { animation: fadeOut 0.26s ease forwards; }
.dl-modal.closing .dl-panel { animation: panelClose 0.28s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes panelClose {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}
.dl-mask {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 16, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.dl-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: rgba(250, 250, 252, 0.92);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 22px 22px 28px;
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.32s cubic-bezier(0.215, 0.61, 0.355, 1);
}
@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.dl-head { display: flex; align-items: center; gap: 14px; }
.dl-cover {
  width: 56px; height: 56px;
  border-radius: 14px;
  flex-shrink: 0;
  background: #e9e9ee center/cover no-repeat;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.dl-info { flex: 1; min-width: 0; }
.dl-name {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dl-singer {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl-listen {
  width: 100%;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--ink);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 12px 0;
  cursor: pointer;
  transition: opacity 0.2s;
}
.dl-listen:hover { opacity: 0.88; }
.dl-listen.listening { opacity: 0.75; }

.dl-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.dl-acc {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.2px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  line-height: 1.5;
}
.dl-acc.vip {
  color: #a8853f;
  border-color: rgba(201, 161, 92, 0.45);
  background: rgba(201, 161, 92, 0.06);
}
.dl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 13px 16px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--ink);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  animation: rowIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.dl-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.6) 50%, transparent 65%);
  transform: translateX(-130%);
  transition: transform 0.5s;
}
.dl-row:hover::after { transform: translateX(130%); }
.dl-row:hover:not(:disabled) { background: rgba(0, 0, 0, 0.06); }
.dl-row:active:not(:disabled) { transform: scale(0.985); }
.dl-row:disabled { cursor: default; }
.dl-row .dl-q {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}
.song-name .vip-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #c9a15c;
  border: 1px solid rgba(201, 161, 92, 0.45);
  border-radius: 5px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: 2px;
  transform: translateY(-1px);
}
.song-name .vip-tag.need {
  color: #c9a15c;
  border-color: rgba(201, 161, 92, 0.45);
}
.dl-row .dl-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.dl-row .dl-size {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.dl-row .dl-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  flex-shrink: 0;
  min-width: 46px;
  justify-content: flex-end;
}
.dl-row.downloading { border-color: rgba(0, 0, 0, 0.2); }
.dl-row.downloading .dl-status { color: var(--ink); }
.dl-row.done { border-color: rgba(48, 178, 84, 0.4); }
.dl-row.done .dl-status { color: #1f8a45; }
.dl-row.done .dl-q { color: #1f8a45; }
.dl-row.error { border-color: rgba(240, 50, 75, 0.4); }
.dl-row.error .dl-status { color: #d51f3d; }
.dl-row.need-vip { opacity: 0.55; }
.dl-row.need-vip .dl-status {
  color: #c9a15c;
  border: 1px solid rgba(201, 161, 92, 0.45);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.dl-row.unavailable { opacity: 0.4; }
.dl-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: rgba(0, 0, 0, 0.07);
  pointer-events: none;
  transition: width 0.2s;
}

@media (min-width: 561px) {
  .dl-modal { align-items: center; }
  .dl-panel { border-radius: 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.9); }
}

/* ---- 移动端窄屏 ---- */
@media (max-width: 480px) {
  .hero-title { font-size: 34px; }
  .app { padding: 14px 14px 120px; }
  .np-cover { width: min(64vw, 280px); height: min(64vw, 280px); }
  .lyric-line { font-size: 15px; }
  .lyric-line.active { font-size: 18px; }
}

/* ---- 分页 ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 26px 0 10px;
  padding: 10px 0 4px;
}
.pagination.hidden { display: none; }
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 96px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.22s ease;
}
.page-btn svg { width: 13px; height: 13px; }
.page-btn:not(:disabled):hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.page-btn:not(:disabled):active { transform: scale(0.96); }
.page-btn:disabled { opacity: 0.32; cursor: not-allowed; }
.page-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 44px;
  font-size: 14px;
  color: var(--ink-dim, #9aa4b2);
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.page-info b { color: var(--ink); font-weight: 700; }


/* ---- 封面/歌词独立下载（下载面板内） ---- */
.asset-row {
  border-top: 1px dashed rgba(0, 0, 0, 0.12) !important;
  margin-top: 2px;
}
.asset-row .dl-q {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.asset-row .dl-q svg { width: 14px; height: 14px; }

/* ---- 轻提示 ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translate(-50%, 16px);
  background: rgba(20, 24, 32, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  max-width: 82vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.gold {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  color: var(--ink);
  border: 1px solid rgba(201, 161, 92, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.toast.gray {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  color: var(--ink-2);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* 页面版本角标 */
.ver-tag {
  font-size: 10px;
  color: var(--ink-3);
  opacity: 0.75;
}

/* 音质实测中 */
.dl-row.checking {
  cursor: default;
}
.dl-row.checking .dl-status {
  color: var(--ink-3);
}
.dl-row.checking::after {
  opacity: 0;
}
