:root {
  --bg-a: #15161d;
  --bg-b: #24332f;
  --bg-c: #7f4c38;
  --accent: #36e5b4;
  --accent-2: #f8c75f;
  --text: #f7f4ec;
  --muted: #b7b4aa;
  --panel: rgba(20, 22, 28, 0.72);
  --panel-strong: rgba(247, 244, 236, 0.1);
  --line: rgba(255, 255, 255, 0.14);
  --energy: 0;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at calc(20% + var(--energy) * 18%) 15%, rgba(54, 229, 180, 0.28), transparent 30%),
    radial-gradient(circle at 82% calc(18% + var(--energy) * 16%), rgba(248, 199, 95, 0.24), transparent 28%),
    linear-gradient(132deg, var(--bg-a), var(--bg-b) 48%, var(--bg-c));
  color: var(--text);
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

#wavefield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  pointer-events: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.player-panel {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(22px);
}

.visual-column,
.side-column {
  min-width: 0;
}

.visual-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 10px;
}

.side-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
}

.top-bar,
.track-meta,
.section-head,
.controls,
.progress-wrap,
.playlist-item {
  display: flex;
  align-items: center;
}

.top-bar,
.track-meta,
.section-head {
  justify-content: space-between;
  gap: 16px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 4.8rem);
  line-height: 0.98;
  max-width: 620px;
}

.brand-title {
  width: fit-content;
  max-width: 100%;
  padding-bottom: 6px;
  background: linear-gradient(92deg, #fff8df 0%, var(--accent-2) 34%, var(--accent) 66%, #ffffff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-family: "STXingkai", "FZShuTi", "KaiTi", "Microsoft JhengHei UI", "Microsoft YaHei", serif;
  font-size: clamp(2.55rem, 5.2vw, 5.7rem);
  font-weight: 700;
  line-height: 1.06;
  text-shadow:
    0 0 18px color-mix(in srgb, var(--accent) 42%, transparent),
    0 8px 34px rgba(0, 0, 0, 0.38);
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.28));
}

.section-head h2,
.track-meta h2 {
  font-size: 1.08rem;
}

.section-head span,
.track-meta p,
.bpm-pill,
.progress-wrap span {
  color: var(--muted);
  font-size: 0.88rem;
}

.cover-stage {
  position: relative;
  flex: 1;
  min-height: 330px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
}

.cover-glow {
  position: absolute;
  width: min(520px, 72vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from calc(var(--energy) * 160deg), var(--accent), var(--accent-2), #ff6f91, var(--accent));
  filter: blur(34px);
  opacity: calc(0.16 + var(--energy) * 0.4);
  transform: scale(calc(0.86 + var(--energy) * 0.22));
}

.album-cover {
  position: relative;
  width: min(310px, 58vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.18)),
    var(--cover-image),
    #17191f;
  background-position: center;
  background-size: cover;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  transform: translateY(calc(var(--energy) * -8px)) scale(calc(1 + var(--energy) * 0.035));
  transition: background 250ms ease, transform 180ms ease;
}

.cover-shine {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.34), transparent 28%),
    radial-gradient(circle at 70% 18%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 28%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.38), transparent 48%);
  opacity: calc(0.42 + var(--energy) * 0.22);
  pointer-events: none;
}

#spectrum {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 42%;
}

.bpm-pill,
.icon-button,
.play-button,
.volume-control,
.file-button {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.bpm-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
}

.progress-wrap {
  gap: 12px;
}

.progress-wrap span {
  width: 42px;
  text-align: center;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.controls {
  justify-content: center;
  gap: 12px;
}

.icon-button,
.play-button {
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button {
  width: 44px;
  height: 44px;
  font-size: 1.8rem;
}

.play-button {
  width: 68px;
  height: 68px;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.55rem;
}

.icon-button:hover,
.play-button:hover,
.playlist-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.34);
}

.volume-control {
  width: min(210px, 38vw);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 999px;
}

.file-button {
  position: relative;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0 16px;
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.source-status {
  min-height: 24px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.lyrics-card,
.playlist-card {
  min-height: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.lyrics-window {
  height: min(420px, 48vh);
  margin-top: 18px;
  overflow: hidden;
  mask-image: linear-gradient(transparent, black 16%, black 84%, transparent);
}

.lyrics-track {
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 420ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.lyric-line {
  min-height: 36px;
  color: rgba(247, 244, 236, 0.42);
  font-size: 1.05rem;
  line-height: 1.45;
  transition: color 220ms ease, transform 220ms ease, font-size 220ms ease;
}

.lyric-line.active {
  color: var(--text);
  font-size: 1.34rem;
  font-weight: 800;
  transform: translateX(8px);
}

.playlist-card {
  align-self: end;
}

.playlist {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.playlist-item {
  width: 100%;
  gap: 12px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.playlist-item.active {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

.playlist-art {
  width: 48px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.18)),
    var(--item-cover),
    linear-gradient(135deg, var(--item-a), var(--item-b));
  background-position: center;
  background-size: cover;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.playlist-copy {
  min-width: 0;
  flex: 1;
}

.playlist-copy strong,
.playlist-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.playlist-time {
  color: var(--muted);
  font-size: 0.84rem;
}

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

@media (max-width: 860px) {
  .app-shell {
    padding: 14px;
    place-items: start center;
  }

  .player-panel {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 12px;
  }

  .cover-stage {
    min-height: 300px;
  }

  .side-column {
    grid-template-rows: auto auto;
  }

  .lyrics-window {
    height: 260px;
  }

  .controls {
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .visual-column,
  .lyrics-card,
  .playlist-card {
    padding: 12px;
  }

  h1 {
    font-size: 2rem;
  }

  .brand-title {
    font-size: 2.55rem;
    line-height: 1.12;
  }

  .cover-stage {
    min-height: 260px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .play-button {
    width: 60px;
    height: 60px;
  }

  .volume-control {
    width: 100%;
  }

  .file-button {
    width: 100%;
  }
}
