:root {
  --bg: #1a1a2e;
  --card: #16213e;
  --accent: #0f3460;
  --highlight: #e94560;
  --text: #eaeaea;
  --muted: #9ba4b5;
}

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

body {
  font-family: "WenQuanYi Micro Hei", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #1a1a2e 0%, #0f3460 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.app {
  display: grid;
  grid-template-columns: 360px 360px;
  gap: 24px;
  max-width: 820px;
  width: 100%;
}

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

/* 播放器卡片 */
.player-card, .playlist-card {
  background: var(--card);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.cover-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
}

.cover {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  box-shadow: 0 8px 24px rgba(233, 69, 96, 0.3);
  transition: transform 0.3s;
}

.cover.spin {
  animation: spin 8s linear infinite;
}

.cover.spin.paused {
  animation-play-state: paused;
}

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

.info {
  text-align: center;
  margin-bottom: 20px;
}

.info h2 {
  font-size: 18px;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info p {
  font-size: 13px;
  color: var(--muted);
}

/* 进度条 */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--muted);
}

#progress {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #2a3a5c;
  outline: none;
}

#progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--highlight);
  cursor: pointer;
}

/* 控制按钮 */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.controls button {
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  transition: all 0.2s;
}

.controls button:hover {
  background: var(--accent);
}

#playBtn {
  font-size: 24px;
  background: var(--highlight);
  width: 56px;
  height: 56px;
}

#playBtn:hover {
  transform: scale(1.08);
}

/* 音量 */
.volume-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

#volume {
  flex: 1;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 3px;
  background: #2a3a5c;
  outline: none;
}

#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--highlight);
  cursor: pointer;
}

/* 倍速 */
.speed-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
}

#speed {
  background: var(--accent);
  color: var(--text);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
}

/* 播放列表 */
.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.playlist-header h3 {
  font-size: 16px;
}

.playlist-header span {
  font-size: 12px;
  color: var(--muted);
}

#playlist {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

#playlist::-webkit-scrollbar {
  width: 6px;
}

#playlist::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.playlist-group {
  margin-bottom: 14px;
}

.playlist-group h4 {
  font-size: 13px;
  color: var(--highlight);
  margin-bottom: 8px;
  padding-left: 4px;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
}

.song-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.song-item.active {
  background: var(--accent);
  color: #fff;
}

.song-item .idx {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.song-item.active .idx {
  background: var(--highlight);
}

.song-item .title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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