:root {
  --bg: #0f1116;
  --panel: #171a22;
  --panel2: #1e222c;
  --line: #282d39;
  --text: #e8eaf0;
  --muted: #98a0ae;
  --accent: #7c6cff;
  --accent2: #22d3ee;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1100px 600px at 12% -8%, #1c2133 0%, var(--bg) 58%) fixed;
  padding-bottom: calc(132px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(15, 17, 22, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: 0.02em; }
.tools {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex: 1 1 340px;
  justify-content: flex-end;
}
#search {
  flex: 1 1 180px;
  min-width: 120px;
  max-width: 320px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  outline: none;
  transition: border-color 0.15s;
}
#search:focus { border-color: var(--accent); }
select, button {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
select:hover, button:hover { border-color: #3a4152; }
#refresh { padding: 8px 11px; }

/* ---------- 列表 ---------- */
main { padding: 8px 10px 0; }
.hint { color: var(--muted); text-align: center; padding: 48px 16px; margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.row:hover { background: var(--panel); }
.row.active { background: var(--panel2); }
.row .info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row .title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .artist {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eq {
  display: none;
  gap: 2px;
  align-items: flex-end;
  height: 14px;
  width: 14px;
  flex: 0 0 auto;
}
.row.active .eq { display: flex; }
.eq i {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: eq 0.9s ease-in-out infinite;
}
.eq i:nth-child(1) { height: 6px; }
.eq i:nth-child(2) { height: 12px; animation-delay: 0.2s; }
.eq i:nth-child(3) { height: 8px; animation-delay: 0.4s; }
.list.paused .eq i { animation-play-state: paused; }
@keyframes eq { 50% { transform: scaleY(0.35); } }

/* ---------- 播放器 ---------- */
.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(23, 26, 34, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.now { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 55%; }
.now img {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--panel2);
  flex: 0 0 auto;
}
.now .meta { min-width: 0; }
.now-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-artist {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.controls { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.controls button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}
.controls .play {
  width: 46px;
  height: 46px;
  border: none;
  font-size: 17px;
  color: #0b0d12;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.controls .play:active { transform: scale(0.96); }
#vol { width: 84px; accent-color: var(--accent); }

.progress {
  flex: 1 1 100%;
  order: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.progress span { width: 34px; text-align: center; flex: 0 0 auto; }
#seek { flex: 1; accent-color: var(--accent); height: 4px; }

@media (max-width: 560px) {
  #vol { display: none; }
  .topbar { padding: 12px; }
  .topbar h1 { font-size: 16px; }
  .player { padding-left: 12px; padding-right: 12px; }
  .now { flex: 1 1 auto; }
}
