* {
  box-sizing: border-box;
}

:root {
  --theme-rgb: 104, 124, 255;
  --theme-dark: 18, 20, 45;
  --theme-light: 180, 190, 255;
  --theme-soft: 150, 160, 255;
  --theme-contrast: 255, 255, 255;
  --accent: rgb(var(--theme-rgb));
  --text: rgba(255, 255, 255, 0.94);
  --muted: rgba(255, 255, 255, 0.62);
  --glass: rgba(255, 255, 255, 0.15);
  --glass-strong: rgba(255, 255, 255, 0.23);
  --stroke: rgba(255, 255, 255, 0.26);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 18%, rgba(var(--theme-light), 0.7), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(var(--theme-soft), 0.32), transparent 28%),
    radial-gradient(circle at 70% 90%, rgba(var(--theme-rgb), 0.8), transparent 36%),
    linear-gradient(135deg, rgb(var(--theme-dark)), rgb(var(--theme-rgb)));
  transition: background 800ms ease;
}

button,
input,
label {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.16), transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 45%);
  filter: blur(0.2px);
}

.wallpaper::before,
.wallpaper::after {
  content: "";
  position: absolute;
  width: 52vmax;
  height: 52vmax;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  filter: blur(40px);
  animation: floatBlob 12s ease-in-out infinite alternate;
}

.wallpaper::before {
  left: -16vmax;
  bottom: -18vmax;
}

.wallpaper::after {
  right: -12vmax;
  top: -18vmax;
  animation-delay: -4s;
}

@keyframes floatBlob {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(4vw, -3vh, 0) scale(1.08);
  }
}

.app {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0;
}

.glass {
  position: relative;
  border: 1px solid var(--stroke);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.23), rgba(255, 255, 255, 0.08)),
    var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(34px) saturate(1.45);
  -webkit-backdrop-filter: blur(34px) saturate(1.45);
}

.glass::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.26), transparent 38%);
  opacity: 0.85;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 30px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.top-bar h1,
.playlist-head h3 {
  margin: 0;
}

.top-bar h1 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.import-btn {
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.12));
  border-radius: 999px;
  padding: 12px 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 14px 30px rgba(0, 0, 0, 0.16);
  transition: transform 180ms ease, background 180ms ease;
}

.import-btn:hover {
  transform: translateY(-1px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.18));
}

.hidden-input {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.frameless {
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.frameless::before {
  display: none;
}

.player-card,
.playlist-card {
  border-radius: 42px;
  overflow: hidden;
}

.player-card {
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 26px;
}

.record-area {
  position: relative;
  display: grid;
  place-items: center;
  width: min(60vw, 340px);
  aspect-ratio: 1;
  margin-top: 4px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.24), transparent 55%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  box-shadow:
    inset 0 0 40px rgba(255, 255, 255, 0.13),
    0 34px 80px rgba(0, 0, 0, 0.28);
}

.disc {
  position: relative;
  width: 82%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.18), transparent 9%),
    repeating-radial-gradient(circle, #111 0 9px, #191919 10px 13px),
    radial-gradient(circle, #2a2a2a, #050505 68%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 0 70px rgba(255, 255, 255, 0.08),
    0 26px 80px rgba(0, 0, 0, 0.45);
  animation: spin 10s linear infinite;
  animation-play-state: paused;
}

.disc.playing {
  animation-play-state: running;
}

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

.vinyl-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.ring-1 {
  inset: 10%;
}

.ring-2 {
  inset: 21%;
}

.ring-3 {
  inset: 36%;
}

.cover {
  width: 55%;
  height: 55%;
  object-fit: cover;
  border-radius: 50%;
  box-shadow:
    0 0 0 9px rgba(255, 255, 255, 0.08),
    0 18px 38px rgba(0, 0, 0, 0.42);
  background: rgba(255, 255, 255, 0.12);
}

.center-dot {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle, white 0 16%, rgba(255, 255, 255, 0.84) 17% 42%, rgba(0, 0, 0, 0.3) 43% 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.32);
}

.song-info {
  width: min(100%, 620px);
  text-align: center;
  margin-top: 18px;
}

.folder-name,
#songDesc {
  margin: 0;
  color: var(--muted);
}

.folder-name {
  font-size: 13px;
}

.song-info h2 {
  margin: 8px 0 8px;
  font-size: clamp(24px, 3.8vw, 42px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.progress-panel {
  width: min(100%, 650px);
  margin-top: 16px;
}

.progress,
.volume {
  width: 100%;
  accent-color: white;
}

.progress {
  cursor: pointer;
}

.progress::-webkit-slider-runnable-track,
.volume::-webkit-slider-runnable-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.progress::-webkit-slider-thumb,
.volume::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}

.circle-btn,
.play-btn {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.36);
  color: white;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 18px 34px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease, background 160ms ease;
}

.circle-btn:hover,
.play-btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.circle-btn:active,
.play-btn:active {
  transform: scale(0.96);
}

.circle-btn {
  width: 52px;
  height: 52px;
}

.play-btn {
  width: 68px;
  height: 68px;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.46) 32%, rgba(255, 255, 255, 0.16) 70%),
    rgba(255, 255, 255, 0.2);
}

.circle-btn svg,
.play-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.play-btn svg {
  width: 30px;
  height: 30px;
}

.extra-control {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 420px);
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.playlist-card {
  padding: 18px;
  min-height: calc(100vh - 120px);
}

.playlist-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.playlist-head h3 {
  font-size: 24px;
  letter-spacing: -0.04em;
}

#songCount {
  color: var(--muted);
  font-size: 13px;
  padding-top: 6px;
}

.playlist {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding-right: 4px;
}

.playlist::-webkit-scrollbar {
  width: 8px;
}

.playlist::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.track {
  cursor: pointer;
  width: 100%;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 9px;
  color: white;
  background: rgba(255, 255, 255, 0.09);
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.track:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
}

.track.active {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.2);
}

.track img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.12);
}

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

.track strong {
  font-size: 14px;
}

.track span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 170px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.26);
  border-radius: 24px;
}

.empty p {
  margin: 0 0 8px;
  color: var(--text);
}

.empty span {
  font-size: 13px;
}

.tips {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.tips strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.tips pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(0, 0, 0, 0.17);
  line-height: 1.5;
}

.lyrics-box {
  width: min(100%, 650px);
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05)),
    rgba(0, 0, 0, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 18px 42px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
}

.lyrics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.lyrics-head h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.04em;
}

#lyricsMode {
  color: var(--muted);
  font-size: 13px;
  padding-top: 5px;
}

.lyrics-view {
  height: 112px;
  overflow: auto;
  scroll-behavior: smooth;
  padding: 2px 2px 4px;
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 82%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 18%, black 82%, transparent);
}

.lyrics-view::-webkit-scrollbar {
  width: 0;
}

.lyric-line {
  margin: 0;
  padding: 8px 8px;
  color: rgba(255, 255, 255, 0.48);
  text-align: center;
  font-size: 15px;
  line-height: 1.55;
  transition:
    color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease,
    text-shadow 180ms ease;
}

.lyric-line.active {
  color: white;
  opacity: 1;
  transform: scale(1.04);
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.34);
  font-weight: 700;
}

.lyric-line.empty {
  color: var(--muted);
  transform: none;
  font-weight: 400;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 10;
  transform: translate(-50%, 30px);
  opacity: 0;
  pointer-events: none;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: white;
  background: rgba(20, 20, 20, 0.42);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.playlist-card.frameless {
  padding: 6px 0;
}

.playlist-card.frameless .playlist-head,
.playlist-card.frameless .tips {
  padding-left: 8px;
  padding-right: 8px;
}

.player-card.frameless {
  padding-top: 18px;
}


/* Cover theme binding */
.import-btn {
  background:
    linear-gradient(135deg, rgba(var(--theme-light), 0.5), rgba(var(--theme-rgb), 0.2));
}

.import-btn:hover {
  background:
    linear-gradient(135deg, rgba(var(--theme-light), 0.62), rgba(var(--theme-rgb), 0.3));
}

.record-area {
  background:
    radial-gradient(circle, rgba(var(--theme-light), 0.34), transparent 55%),
    linear-gradient(135deg, rgba(var(--theme-rgb), 0.16), rgba(255, 255, 255, 0.04));
  box-shadow:
    inset 0 0 40px rgba(255, 255, 255, 0.13),
    0 34px 80px rgba(0, 0, 0, 0.28),
    0 0 68px rgba(var(--theme-rgb), 0.26);
}

.circle-btn {
  background:
    linear-gradient(135deg, rgba(var(--theme-light), 0.42), rgba(var(--theme-rgb), 0.18));
}

.play-btn {
  background:
    linear-gradient(135deg, rgba(var(--theme-light), 0.42), rgba(var(--theme-rgb), 0.18));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 18px 34px rgba(0, 0, 0, 0.22);
}

.progress,
.volume {
  background: transparent;
}

.progress::-webkit-slider-runnable-track,
.volume::-webkit-slider-runnable-track {
  background:
    linear-gradient(90deg, rgba(var(--theme-rgb), 0.9), rgba(var(--theme-light), 0.74)),
    rgba(255, 255, 255, 0.18);
}

.progress::-webkit-slider-thumb,
.volume::-webkit-slider-thumb {
  background: rgb(var(--theme-contrast));
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.3),
    0 0 22px rgba(var(--theme-rgb), 0.68);
}

.track.active {
  border-color: rgba(var(--theme-light), 0.75);
  background:
    linear-gradient(135deg, rgba(var(--theme-rgb), 0.42), rgba(var(--theme-light), 0.18));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 0 28px rgba(var(--theme-rgb), 0.32);
}

.lyric-line.active {
  color: rgb(var(--theme-contrast));
  text-shadow:
    0 0 14px rgba(var(--theme-light), 0.8),
    0 0 28px rgba(var(--theme-rgb), 0.52);
}

#lyricsMode {
  border: 1px solid rgba(var(--theme-light), 0.32);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(var(--theme-rgb), 0.16);
}

.folder-name {
  color: rgba(var(--theme-light), 0.92);
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .playlist-card,
  .player-card {
    min-height: auto;
  }

  .playlist {
    max-height: 320px;
  }
}

@media (max-width: 620px) {
  .app {
    width: min(100% - 20px, 1180px);
    padding: 12px 0;
  }

  .top-bar {
    align-items: stretch;
    flex-direction: column;
    border-radius: 28px;
  }

  .import-btn {
    text-align: center;
  }

  .player-card {
    padding: 22px 16px;
    border-radius: 32px;
  }

  .playlist-card {
    border-radius: 32px;
  }

  .record-area {
    width: min(84vw, 360px);
  }
}
