* {
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(to bottom, #2c2c2c 0%, #1a1a1a 100%);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: #fff;
}

.player {
  background: #242424;
  width: 95%;
  max-width: 1200px;
  height: 90vh;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: grid;
  grid-template-columns: 1fr 350px;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  position: relative;
}

/* 左侧区域 - 唱片 */
.left-section {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #3a3a3a 0%, #242424 100%);
  padding: 40px;
}

.vinyl-container {
  position: relative;
  width: 400px;
  height: 400px;
}

/* 唱片臂 */
.vinyl-arm {
  position: absolute;
  top: -80px;
  right: 40px;
  width: 120px;
  height: 200px;
  background: linear-gradient(to bottom, #666 0%, #444 50%, #333 100%);
  border-radius: 10px 10px 50% 50%;
  transform-origin: top right;
  transform: rotate(-30deg);
  z-index: 10;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.8s ease;
}

.vinyl-arm::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  background: #888;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* 唱片 */
.vinyl-disc {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #1a1a1a 0%, #0a0a0a 35%, #000 60%, #1a1a1a 100%);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(255, 255, 255, 0.1);
  animation: rotate 20s linear infinite paused;
}

/* 唱片纹理 */
.vinyl-disc::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center,
    transparent 0px,
    transparent 2px,
    rgba(255, 255, 255, 0.03) 2px,
    rgba(255, 255, 255, 0.03) 4px
  );
}

.cover-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 250px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(236, 65, 65, 0.5);
}

#cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* 播放时旋转 */
.playing .vinyl-disc {
  animation-play-state: running;
}

.playing .vinyl-arm {
  transform: rotate(-5deg);
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 右侧区域 - 播放列表 */
.right-section {
  grid-column: 2;
  grid-row: 1 / 3;
  background: #1c1c1c;
  border-left: 1px solid #333;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.playlist-header {
  padding: 20px;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  background: #252525;
  border-bottom: 1px solid #333;
}

#playlist {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

#playlist::-webkit-scrollbar {
  width: 8px;
}

#playlist::-webkit-scrollbar-track {
  background: #1c1c1c;
}

#playlist::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

#playlist::-webkit-scrollbar-thumb:hover {
  background: #555;
}

#playlist li {
  padding: 15px 20px;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 1px solid #2a2a2a;
  font-size: 14px;
  color: #999;
}

#playlist li:hover {
  background: #2a2a2a;
  color: #fff;
}

#playlist li.active {
  background: #ec4141;
  color: #fff;
  font-weight: bold;
}

/* 底部控制栏 */
.bottom-bar {
  grid-column: 1;
  grid-row: 2;
  background: #1c1c1c;
  border-top: 1px solid #333;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.song-info h2#title {
  margin: 0;
  font-size: 18px;
  color: #fff;
  font-weight: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.player-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.controls button {
  background: #2a2a2a !important;
  border: none !important;
  color: #999 !important;
  width: 48px !important;
  height: 48px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  font-size: 16px !important;
  cursor: pointer;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  position: relative;
  overflow: hidden;
}

.controls button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(236, 65, 65, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.controls button:hover::before {
  opacity: 1;
}

.controls button:hover {
  color: #ec4141 !important;
  transform: scale(1.08) !important;
  box-shadow: 0 4px 15px rgba(236, 65, 65, 0.4) !important;
}

.controls button:active {
  transform: scale(0.95) !important;
}

.controls #play {
  background: linear-gradient(135deg, #ec4141 0%, #d83030 100%) !important;
  color: #fff !important;
  width: 64px !important;
  height: 64px !important;
  font-size: 24px !important;
  box-shadow: 0 4px 20px rgba(236, 65, 65, 0.5) !important;
}

.controls #play::before {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
}

.controls #play:hover {
  background: linear-gradient(135deg, #ff4d4d 0%, #ec4141 100%) !important;
  color: #fff !important;
  transform: scale(1.1) !important;
  box-shadow: 0 6px 25px rgba(236, 65, 65, 0.6) !important;
}

.controls #play:active {
  transform: scale(0.98) !important;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

#current-time,
#duration {
  font-size: 12px;
  color: #666;
  min-width: 40px;
  text-align: center;
}

#progress {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #444;
  appearance: none;
  cursor: pointer;
  position: relative;
}

#progress::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: #ec4141;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(236, 65, 65, 0.5);
  transition: all 0.3s;
}

#progress::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(236, 65, 65, 0.8);
}

#progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #ec4141;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.extra-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.speed-control,
.timer-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.speed-control label,
.timer-control label {
  color: #999;
  font-size: 12px;
}

.speed-control select,
.timer-control select {
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  border: 1px solid #444;
  background: #2a2a2a;
  color: #999;
  cursor: pointer;
  outline: none;
  transition: all 0.3s;
}

.speed-control select:hover,
.timer-control select:hover {
  border-color: #ec4141;
  color: #ec4141;
}

/* 响应式设计 */
@media (max-width: 900px) {
  .player {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    height: auto;
    min-height: 100vh;
  }

  .left-section {
    grid-column: 1;
    grid-row: 1;
    padding: 30px;
  }

  .vinyl-container {
    width: 300px;
    height: 300px;
  }

  .vinyl-disc {
    width: 300px;
    height: 300px;
  }

  .cover-container {
    width: 180px;
    height: 180px;
  }

  .right-section {
    grid-column: 1;
    grid-row: 2;
    border-left: none;
    border-top: 1px solid #333;
    max-height: 300px;
  }

  .bottom-bar {
    grid-column: 1;
    grid-row: 3;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  .song-info h2#title {
    max-width: 100%;
    text-align: center;
  }

  .extra-controls {
    flex-direction: row;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .vinyl-container {
    width: 250px;
    height: 250px;
  }

  .vinyl-disc {
    width: 250px;
    height: 250px;
  }

  .cover-container {
    width: 150px;
    height: 150px;
  }

  .vinyl-arm {
    width: 100px;
    height: 160px;
    top: -60px;
    right: 20px;
  }

  .controls button {
    width: 44px !important;
    height: 44px !important;
    font-size: 14px !important;
    background: #2a2a2a !important;
  }

  .controls #play {
    width: 56px !important;
    height: 56px !important;
    font-size: 20px !important;
    background: linear-gradient(135deg, #ec4141 0%, #d83030 100%) !important;
  }
}
