:root {
  --accent: #7c6cff;
  --accent-soft: rgba(124, 108, 255, 0.35);
  --ink: #f2f2f5;
  --ink-dim: rgba(242, 242, 245, 0.55);
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(18, 18, 22, 0.62);
  --player-h: 108px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #08080b;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- background poster ---------- */
.bg {
  position: fixed;
  inset: -12%;
  background-size: cover;
  background-position: center;
  filter: blur(46px) saturate(1.5) brightness(0.42);
  transform: scale(1.1);
  transition: background-image 0.7s ease, opacity 0.7s ease;
  z-index: 0;
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, transparent 0%, rgba(6, 6, 9, 0.55) 55%, #08080b 100%);
}
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
}
.brand {
  font-size: 15px;
  letter-spacing: 0.14em;
  font-weight: 600;
  opacity: 0.8;
}
.brand span { color: var(--accent); }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background 0.2s, transform 0.12s, border-color 0.2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255,255,255,0.22); }
.icon-btn:active { transform: scale(0.93); }

/* ---------- stage ---------- */
.stage {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  padding-bottom: var(--player-h);
}

.disc-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.disc {
  position: relative;
  width: min(56vw, 340px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%,
      rgba(255,255,255,0.035) 0 1px,
      rgba(0,0,0,0) 1px 3px),
    radial-gradient(circle at 50% 50%, #16161a 0%, #0c0c0f 62%, #050506 100%);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.75),
    0 2px 0 rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  animation: spin 22s linear infinite;
  animation-play-state: paused;
  will-change: transform;
}
.disc.playing { animation-play-state: running; }

.disc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 210deg,
    rgba(255,255,255,0.14) 0deg,
    rgba(255,255,255,0) 42deg,
    rgba(255,255,255,0) 180deg,
    rgba(255,255,255,0.07) 232deg,
    rgba(255,255,255,0) 300deg
  );
  mix-blend-mode: screen;
  pointer-events: none;
}

.label {
  width: 39%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: #1b1b20;
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.55),
    0 0 26px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}

.hole {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #08080a;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1), inset 0 0 6px #000;
}

/* tonearm */
.arm {
  position: absolute;
  top: -6%;
  right: -4%;
  width: 54%;
  height: 2px;
  transform-origin: 100% 50%;
  transform: rotate(-24deg);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.arm i {
  position: absolute;
  left: 0; top: -1px;
  width: 74%;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,255,255,0.5), rgba(255,255,255,0.14));
  box-shadow: 0 4px 14px rgba(0,0,0,0.7);
}
.arm i::before {
  content: "";
  position: absolute;
  right: -7px; top: -5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8d8e2, #6a6a78);
  box-shadow: 0 3px 10px rgba(0,0,0,0.7);
}
.arm.playing { transform: rotate(-6deg); }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- now playing ---------- */
.now {
  text-align: center;
  max-width: min(78vw, 620px);
  padding: 0 12px;
}
.now h1 {
  margin: 0 0 8px;
  font-size: clamp(20px, 3.4vw, 30px);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}
.now p {
  margin: 0;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- spectrum ---------- */
#spectrum {
  position: fixed;
  left: 0; right: 0;
  bottom: var(--player-h);
  height: 130px;
  width: 100%;
  z-index: 5;
  opacity: 0.5;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* ---------- player ---------- */
.player {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  height: var(--player-h);
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(to top, rgba(8,8,11,0.95), rgba(8,8,11,0.55));
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}

.progress {
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.fill {
  position: relative;
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: visible;
}
.fill::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--p, 0%);
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), #fff);
  box-shadow: 0 0 14px var(--accent-soft);
}
.fill i {
  position: absolute;
  top: 50%;
  left: var(--p, 0%);
  width: 10px; height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%) scale(0);
  transition: transform 0.18s;
  box-shadow: 0 0 12px var(--accent);
}
.progress:hover .fill i { transform: translateY(-50%) scale(1); }

.row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.ctrl-group {
  display: flex;
  align-items: center;
  gap: 10px;
  order: 1;
}
.play-btn {
  width: 50px; height: 50px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(140deg, #fff, #cfcfd8);
  color: #0a0a0d;
  font-size: 17px;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.6) inset;
  transition: transform 0.12s, box-shadow 0.2s;
}
.play-btn:hover { transform: scale(1.05); box-shadow: 0 14px 34px rgba(0,0,0,0.65), 0 0 0 1px #fff inset; }
.play-btn:active { transform: scale(0.96); }

.time {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  order: 2;
}
.vol {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  order: 3;
}
.vol-ico { font-size: 12px; opacity: 0.5; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 96px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-soft);
}
input[type="range"]::-moz-range-thumb {
  width: 11px; height: 11px;
  border: none;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

/* ---------- drawer ---------- */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(86vw, 340px);
  z-index: 40;
  background: rgba(12, 12, 16, 0.9);
  backdrop-filter: blur(26px);
  border-left: 1px solid var(--line);
  transform: translateX(102%);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
}

#list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}
#list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s;
}
#list li:hover { background: rgba(255, 255, 255, 0.06); }
#list li.active { background: rgba(255, 255, 255, 0.1); }
#list li.active .t { color: #fff; }
#list .thumb {
  width: 40px; height: 40px;
  border-radius: 7px;
  background: #1b1b20 center/cover no-repeat;
  flex: 0 0 auto;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
#list .meta { min-width: 0; flex: 1; }
#list .t {
  font-size: 13.5px;
  color: rgba(255,255,255,0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#list .a {
  font-size: 11.5px;
  color: var(--ink-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#list .d {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  font-variant-numeric: tabular-nums;
}

.drawer-foot {
  padding: 12px 18px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.drawer-foot a { color: var(--ink-dim); text-decoration: none; }
.drawer-foot a:hover { color: #fff; }

.empty {
  text-align: center;
  padding: 40px 20px;
  font-size: 13px;
  color: var(--ink-dim);
}

@media (max-width: 560px) {
  :root { --player-h: 132px; }
  .stage { gap: 24px; padding-bottom: calc(var(--player-h) + 8px); }
  .disc { width: min(72vw, 300px); }
  .arm { display: none; }
  .row { flex-wrap: wrap; gap: 12px; }
  .vol { display: none; }
  #spectrum { height: 90px; opacity: 0.4; }
}
