:root {
  --bg: #262626;
  --card: #f5f5f5;
  --card-head: #ffffff;
  --line: #ececec;
  --text: #2f2f2f;
  --muted: #8f8f8f;
  --brand: #1acc8b;
  --brand-dark: #15a36f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: radial-gradient(circle at 20% 0%, #3b3b3b, var(--bg));
  color: var(--text);
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.tips {
  position: absolute;
  top: 20px;
  text-align: center;
  color: #b8b8b8;
  font-size: 12px;
  line-height: 1.6;
  max-width: 460px;
}

.player {
  width: 360px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  background: var(--card);
}

.control-area {
  background: var(--card-head);
  min-height: 126px;
  padding: 10px 14px 10px;
  position: relative;
  border-bottom: 1px solid var(--line);
}

.cover-wrapper {
  position: absolute;
  left: 14px;
  top: 10px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid #fff;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-wrapper.empty {
  filter: grayscale(1);
  opacity: 0.55;
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-image.rotating {
  animation: spin 10s linear infinite;
  animation-play-state: paused;
}

.cover-image.playing {
  animation-play-state: running;
}

.cover-fallback {
  color: #c3c3c3;
  font-size: 30px;
}

.actions-top {
  position: absolute;
  right: 8px;
  top: 6px;
  display: flex;
  gap: 6px;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: #929292;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
  width: 30px;
  height: 30px;
}

.icon-btn:hover {
  color: var(--brand);
  background: #edfdf7;
}

.meta-block {
  margin-left: 84px;
  margin-top: 10px;
  margin-right: 66px;
}

.album-title,
.now-playing {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-title {
  font-size: 12px;
  font-weight: 700;
}

.now-playing {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.play-controls {
  margin-left: 84px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.control-btn,
.play-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.control-btn {
  color: #1e1e1e;
  font-size: 19px;
}

.play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  box-shadow: 0 8px 20px rgba(26, 204, 139, 0.35);
}

.play-btn:hover {
  background: var(--brand-dark);
}

.control-btn:disabled,
.play-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.volume-row {
  margin-left: 84px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-icon {
  font-size: 12px;
}

#volume-slider {
  width: 118px;
  accent-color: var(--brand);
}

.volume-text {
  color: var(--muted);
  font-size: 11px;
}

.playlist-panel {
  background: var(--card);
}

.playlist-header {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.playlist-title {
  margin: 0;
  font-size: 12px;
  color: #777;
  font-weight: 700;
}

.playlist-actions {
  display: flex;
  gap: 4px;
}

.playlist {
  height: 228px;
  overflow-y: auto;
  background: var(--card);
  padding: 8px 0;
}

.playlist.collapsed {
  height: 0;
  padding: 0;
  overflow: hidden;
}

.album-row {
  padding: 8px 18px 6px;
  font-size: 11px;
  color: #8a8a8a;
  font-weight: 700;
  border-top: 1px dashed #e9e9e9;
}

.track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 18px;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s;
}

.track:hover {
  background: #fff;
}

.track.active {
  background: #fff;
  border-left-color: var(--brand);
}

.track-left {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.track-index {
  width: 16px;
  font-size: 12px;
  color: #9f9f9f;
  text-align: center;
}

.track-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 600;
}

.track.active .track-title {
  color: var(--brand);
}

.track-right {
  font-size: 12px;
  color: #999;
  margin-left: 10px;
}

.equalizer {
  display: none;
  align-items: flex-end;
  gap: 2px;
  margin-left: 6px;
  height: 13px;
}

.equalizer i {
  width: 2px;
  background: var(--brand);
  border-radius: 4px;
}

.equalizer i:nth-child(1) {
  height: 9px;
  animation: bounce 1s infinite;
}

.equalizer i:nth-child(2) {
  height: 12px;
  animation: bounce 1.2s infinite;
}

.equalizer i:nth-child(3) {
  height: 6px;
  animation: bounce 0.8s infinite;
}

.track.active.playing .equalizer {
  display: inline-flex;
}

.empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #adadad;
  gap: 10px;
  text-align: center;
}

.empty-state .note {
  max-width: 260px;
  font-size: 12px;
  color: #b5b5b5;
  line-height: 1.5;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.modal-title {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 14px;
}

.modal-form input {
  width: 100%;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  padding: 10px;
  outline: none;
}

.modal-form input:focus {
  border-color: #b7e8d3;
}

.modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-muted,
.btn-primary {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
}

.btn-muted {
  background: #f2f2f2;
  color: #666;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.loader {
  width: 14px;
  height: 14px;
  border: 2px solid #bfeeda;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-top: 10px;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: scaleY(0.4);
  }

  50% {
    transform: scaleY(1);
  }
}

@media (max-width: 430px) {
  .page {
    padding: 12px;
  }

  .player {
    width: 100%;
    max-width: 360px;
  }

  .tips {
    top: 10px;
    font-size: 11px;
    padding: 0 10px;
  }
}
