/* player.css - 中央圆形播放器控制（宽屏控制器） */

.player {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 900px;
}

/* 控制器容器 */
.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
}

/* 按钮行 */
.controls__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 80px; /* 按钮之间间距加大 */
}

/* === 中央播放按钮 === */
.btn-play {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow:
    0 0 40px var(--accent-glow),
    0 0 80px var(--accent-glow),
    inset 0 2px 20px rgba(255, 255, 255, 0.2);
  transition: all 0.4s var(--ease-smooth);
  overflow: visible;
}

/* 播放按钮外圈光晕 */
.btn-play::before {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.btn-play:hover {
  transform: scale(1.05);
  box-shadow:
    0 0 60px var(--accent-glow),
    0 0 120px var(--accent-glow),
    inset 0 2px 20px rgba(255, 255, 255, 0.3);
}

.btn-play:hover::before {
  opacity: 1;
}

.btn-play:active {
  transform: scale(0.98);
}

/* 图标 - 只显示一个 */
.btn-play svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
  transition: opacity 0.2s ease;
}

.btn-play .icon-play {
  margin-left: 3px;
}

/* 播放时隐藏播放图标，显示暂停图标 */
.btn-play .icon-play[hidden],
.btn-play .icon-pause[hidden] {
  display: none;
}

.btn-play[aria-label="Pause"] .icon-play {
  display: none;
}

.btn-play[aria-label="Play"] .icon-pause {
  display: none;
}

/* 播放时的脉冲动画 */
.btn-play[aria-label="Pause"]::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 0;
  }
}

/* === 重听按钮 === */
.btn-restart {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--btn-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--btn-border);
  backdrop-filter: blur(10px);
  transition: all 0.3s var(--ease-smooth);
}

.btn-restart:hover {
  background: var(--btn-bg-hover);
  color: var(--text-primary);
  border-color: var(--btn-border-hover);
  cursor: pointer;
}

/* === 音量按钮 === */
.btn-volume {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--btn-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--btn-border);
  backdrop-filter: blur(10px);
  transition: all 0.3s var(--ease-smooth);
}

.btn-volume:hover {
  background: var(--btn-bg-hover);
  color: var(--text-primary);
  border-color: var(--btn-border-hover);
  transform: scale(1.05);
}

.btn-volume:active {
  transform: scale(0.95);
}

.btn-volume svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* 音量图标切换 */
.btn-volume .icon-muted {
  display: none;
}

.btn-volume.is-muted .icon-volume {
  display: none;
}

.btn-volume.is-muted .icon-muted {
  display: block;
}

/* === 进度条（加宽） === */
.progress {
  position: relative;
  width: 100%;
  height: 8px;
  background: var(--progress-bg);
  border-radius: var(--radius-full);
  cursor: pointer;
  overflow: visible;
  transition: all 0.2s ease;
}

.progress:hover {
  height: 10px;
}

/* 拖动时加粗 */
.progress:active {
  height: 12px;
}

.progress__fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  border-radius: var(--radius-full);
  width: 0%;
  box-shadow: 0 0 20px var(--accent-glow);
  transition: width 0.1s linear;
  pointer-events: none;
}

/* During drag the fill must track the pointer exactly (no transition lag) */
.progress.is-dragging .progress__fill {
  transition: none;
}

.progress__thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  box-shadow:
    0 0 20px var(--accent-glow),
    0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s var(--ease-smooth);
  pointer-events: none;
}

.progress:hover .progress__thumb,
.progress:focus-visible .progress__thumb {
  transform: translate(-50%, -50%) scale(1);
}

.progress:active .progress__thumb {
  transform: translate(-50%, -50%) scale(1.3);
  box-shadow:
    0 0 32px var(--accent-glow),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

.progress:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* === 时间显示 === */
.time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 15px; /* 字号稍大 */
  font-weight: 500;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  padding: 0 12px; /* 左右留白 */
}

.time__sep {
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

#cur {
  color: var(--accent);
}

/* === Embed 播放器 === */
.embed {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
}

.embed iframe {
  width: 100%;
  height: 120px;
  border: none;
  display: block;
}

/* === 错误提示 === */
.error {
  padding: 16px 24px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  color: #fca5a5;
  font-size: 14px;
  text-align: center;
}

/* Audio 隐藏 */
#audio {
  display: none;
}

/* 响应式 */
@media (max-width: 968px) {
  .player {
    max-width: 700px; /* 平板缩小 */
  }

  .controls__row {
    gap: 60px;
  }
}

@media (max-width: 768px) {
  .player {
    gap: 24px;
    max-width: 500px;
  }

  .controls {
    gap: 24px;
  }

  .controls__row {
    gap: 40px;
  }

  .btn-play {
    width: 80px;
    height: 80px;
  }

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

  .btn-restart {
    width: 48px;
    height: 48px;
  }

  .btn-restart svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .player {
    max-width: 400px;
  }

  .controls__row {
    gap: 24px;
  }

  .btn-play {
    width: 72px;
    height: 72px;
  }

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

  .btn-restart {
    width: 44px;
    height: 44px;
  }

  .time {
    font-size: 12px;
    padding: 0 4px;
  }
}
