﻿:root {
  --design-width: 720;
  --design-height: 1280;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.page {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #dde6d2;
}

.player-card {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: url("./images/bg.jpg") center / 100% 100% no-repeat;
}

.ui-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100vw, calc(100vh * 9 / 16));
  height: min(100vh, calc(100vw * 16 / 9));
  transform: translate(-50%, -50%);
}

.record-area {
  position: absolute;
  left: calc(130 / var(--design-width) * 100%);
  top: calc(194 / var(--design-height) * 100%);
  width: calc(514 / var(--design-width) * 100%);
  height: calc(545 / var(--design-height) * 100%);
}

.record {
  position: absolute;
  inset: 0 auto auto 0;
  width: calc(514 / 514 * 100%);
  height: auto;
  animation: spin 8s linear infinite;
  transform-origin: center;
}

.record.paused {
  animation-play-state: paused;
}

.arm {
  position: absolute;
  width: calc(240 / 514 * 100%);
  right: calc(-20 / 514 * 100%);
  top: calc(-18 / 545 * 100%);
  pointer-events: none;
}

.title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(760 / var(--design-height) * 100%);
  width: calc(413 / var(--design-width) * 100%);
  height: auto;
}

.progress-block {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(930 / var(--design-height) * 100%);
  width: calc(580 / var(--design-width) * 100%);
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: clamp(14px, 2.3vw, 32px);
  color: #111;
  margin-bottom: clamp(8px, 1.6vw, 20px);
}

.progress-track {
  position: relative;
  width: 100%;
  height: clamp(6px, 0.9vw, 16px);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.95);
}

.progress-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: clamp(24px, 6.5vw, 50px);
  height: clamp(24px, 6.5vw, 50px);
  transform: translate(-50%, -50%);
  border: 0;
  padding: 0;
  background: transparent;
}

.progress-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.controls {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(1040 / var(--design-height) * 100%);
  width: calc(610 / var(--design-width) * 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255, 255, 255, 0.88);
}

.icon-btn,
.play-btn {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  line-height: 1;
}

.icon-btn {
  font-size: clamp(34px, 5.3vw, 70px);
}

.play-btn {
  width: calc(100 / var(--design-width) * 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #748468;
  display: grid;
  place-items: center;
  font-size: clamp(38px, 5.6vw, 76px);
}

#playIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
}

#playIcon.ri-play-line {
  transform: translateX(0.06em);
}

.playlist-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.playlist-modal.show {
  pointer-events: auto;
}

.playlist-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.25s ease;
}

.playlist-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: min(100vw, calc(100vh * 9 / 16));
  max-height: 55vh;
  background: linear-gradient(180deg, rgba(236, 243, 227, 0.98), rgba(224, 235, 211, 0.98));
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.playlist-modal.show .playlist-mask {
  background: rgba(0, 0, 0, 0.35);
}

.playlist-modal.show .playlist-panel {
  transform: translate(-50%, 0);
}

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(120, 135, 110, 0.2);
}

.playlist-header h3 {
  margin: 0;
  font-size: 18px;
  color: #2f3a2a;
  font-weight: 600;
}

.playlist-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #516248;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.playlist-items {
  margin: 0;
  padding: 8px 10px 14px;
  list-style: none;
  max-height: calc(55vh - 62px);
  overflow-y: auto;
}

.playlist-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #3c4934;
  font-size: 15px;
}

.playlist-item + .playlist-item {
  margin-top: 4px;
}

.playlist-item.active {
  background: rgba(255, 255, 255, 0.66);
  color: #2d3a26;
  font-weight: 600;
}

.playlist-item .index {
  opacity: 0.72;
  margin-right: 8px;
}

.playlist-item .name {
  flex: 1;
  text-align: left;
}

.playlist-item .playing {
  font-size: 16px;
  color: #6b7d5f;
}

@media (max-width: 420px) {
  .icon-btn {
    font-size: clamp(28px, 8vw, 40px);
  }

  .play-btn {
    font-size: clamp(32px, 9vw, 44px);
  }

  .time-row {
    font-size: clamp(12px, 3.8vw, 16px);
  }
}

@media (min-width: 1024px) {
  body {
    overflow: auto;
  }

  .page {
    min-height: 100vh;
    padding: 24px;
  }

  .player-card {
    width: min(460px, 92vw);
    height: min(818px, 92vh);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
    background-size: cover;
  }

  .ui-stage {
    width: 100%;
    height: 100%;
  }

  .time-row {
    font-size: clamp(16px, 1.6vw, 24px);
  }

  .controls {
    width: calc(560 / var(--design-width) * 100%);
  }

  .icon-btn {
    font-size: 42px;
  }

  .play-btn {
    width: 72px;
    font-size: 46px;
  }

  .icon-btn,
  .play-btn,
  .progress-thumb,
  .playlist-close,
  .playlist-item {
    cursor: pointer;
  }

  .playlist-panel {
    width: min(460px, 92vw);
    border-radius: 18px 18px 0 0;
  }
}

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