/**
 * 音乐栏目 - PC前端样式（网格卡片 + 时长角标 + 播放页）
 */

/* =========================
   列表页：网格卡片
   ========================= */
.music-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1400px) {
  .music-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .music-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .music-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

.music-card {
  background: var(--card-bg);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.music-card:hover {
  transform: translateY(-1px);
  border-color: rgba(88, 166, 255, .45);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.music-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-tertiary);
}

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

.music-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.music-thumb-placeholder i {
  font-size: 48px;
}

.music-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  background: rgba(13, 17, 23, .85);
  border: 1px solid rgba(255,255,255,.18);
  color: #e6edf3;
  backdrop-filter: blur(8px);
}

.music-title {
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}

/* =========================
   播放页
   ========================= */
.music-detail-wrap {
  max-width: 1100px;
  margin: 18px auto 48px;
}

.music-player {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-primary);
  background: var(--card-bg);
  padding: 12px;
}

/* =========================
   音乐详情页播放器
   ========================= */
.music-detail-player {
  width: 100%;
  padding: 32px;
  border-radius: 20px;
  border: 1px solid var(--border-primary);
  background: linear-gradient(135deg, rgba(22, 27, 34, 0.95) 0%, rgba(13, 17, 23, 0.98) 100%);
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(88, 166, 255, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.music-detail-player::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(88, 166, 255, 0.5) 50%, 
    transparent 100%);
  opacity: 0.6;
}

/* 碟盘容器 */
.music-disc-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.music-disc {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: 
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, #0d1117 0%, #161b22 25%, #21262d 50%, #161b22 75%, #0d1117 100%);
  border: 12px solid;
  border-image: linear-gradient(135deg, 
    rgba(88, 166, 255, 0.3) 0%, 
    rgba(88, 166, 255, 0.1) 25%,
    rgba(88, 166, 255, 0.05) 50%,
    rgba(88, 166, 255, 0.1) 75%,
    rgba(88, 166, 255, 0.3) 100%) 1;
  box-shadow: 
    0 0 0 2px rgba(88, 166, 255, 0.2),
    0 12px 48px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(88, 166, 255, 0.1),
    inset 0 0 30px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.music-disc:hover {
  box-shadow: 
    0 0 0 2px rgba(88, 166, 255, 0.4),
    0 16px 64px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(88, 166, 255, 0.2),
    inset 0 0 30px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.music-disc.rotating {
  animation: rotateDisc 10s linear infinite;
}

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

.disc-cover {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid rgba(0, 0, 0, 0.3);
  box-shadow: 
    0 0 0 2px rgba(88, 166, 255, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.6),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 1;
}

.music-disc:hover .disc-cover {
  box-shadow: 
    0 0 0 2px rgba(88, 166, 255, 0.4),
    0 12px 32px rgba(0, 0, 0, 0.7),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.disc-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.disc-placeholder i {
  font-size: 64px;
}

/* 波形图容器 */
.music-waveform-container {
  width: 100%;
  height: 140px;
  margin-bottom: 24px;
  border-radius: 12px;
  background: 
    linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%),
    radial-gradient(ellipse at center, rgba(88, 166, 255, 0.1) 0%, transparent 70%);
  border: 1px solid rgba(88, 166, 255, 0.2);
  overflow: hidden;
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(88, 166, 255, 0.1);
  position: relative;
}

.music-waveform-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(88, 166, 255, 0.05) 2px,
      rgba(88, 166, 255, 0.05) 4px
    );
  pointer-events: none;
  opacity: 0.5;
}

#waveformCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 播放控制区域 */
.music-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.music-control-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.music-control-btn:hover {
  background: var(--bg-tertiary);
  border-color: rgba(88, 166, 255, 0.5);
  transform: scale(1.05);
}

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

.music-control-btn i {
  font-size: 20px;
}

.music-play-btn {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.3) 0%, rgba(88, 166, 255, 0.2) 100%);
  border: 2px solid rgba(88, 166, 255, 0.5);
  box-shadow: 
    0 4px 16px rgba(88, 166, 255, 0.3),
    0 0 20px rgba(88, 166, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
}

.music-play-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(88, 166, 255, 0.3);
  transition: width 0.3s ease, height 0.3s ease;
}

.music-play-btn:hover {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.4) 0%, rgba(88, 166, 255, 0.3) 100%);
  border-color: rgba(88, 166, 255, 0.7);
  box-shadow: 
    0 6px 24px rgba(88, 166, 255, 0.4),
    0 0 30px rgba(88, 166, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

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

.music-play-btn.playing {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.4) 0%, rgba(88, 166, 255, 0.3) 100%);
  box-shadow: 
    0 4px 16px rgba(88, 166, 255, 0.4),
    0 0 25px rgba(88, 166, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 
      0 4px 16px rgba(88, 166, 255, 0.4),
      0 0 25px rgba(88, 166, 255, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 
      0 4px 20px rgba(88, 166, 255, 0.6),
      0 0 35px rgba(88, 166, 255, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

.music-play-btn i {
  font-size: 24px;
}

/* 进度条 */
.music-progress-wrapper {
  flex: 1;
  min-width: 200px;
}

.music-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  margin-bottom: 10px;
  border: 1px solid rgba(88, 166, 255, 0.1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.music-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, 
    #58a6ff 0%, 
    #79c0ff 50%,
    #a5d6ff 100%);
  border-radius: 4px;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 
    0 0 10px rgba(88, 166, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
}

.music-progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #58a6ff;
  box-shadow: 
    0 0 8px rgba(88, 166, 255, 0.8),
    0 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.music-progress-bar:hover .music-progress-fill {
  background: linear-gradient(90deg, 
    #79c0ff 0%, 
    #a5d6ff 50%,
    #c9e5ff 100%);
  box-shadow: 
    0 0 15px rgba(88, 166, 255, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.music-progress-bar:hover .music-progress-fill::after {
  opacity: 1;
}

.music-progress-bar:hover {
  height: 10px;
}

.music-time-display {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 音量控制 */
.music-volume-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.music-volume-slider {
  flex: 1;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.music-volume-fill {
  height: 100%;
  background: linear-gradient(90deg, #58a6ff 0%, #79c0ff 100%);
  border-radius: 2px;
  width: 100%;
  transition: width 0.1s linear;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .music-detail-player {
    padding: 16px;
  }
  
  .music-disc {
    width: 200px;
    height: 200px;
  }
  
  .disc-cover {
    width: 140px;
    height: 140px;
  }
  
  .disc-placeholder {
    width: 140px;
    height: 140px;
  }
  
  .disc-placeholder i {
    font-size: 48px;
  }
  
  .music-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .music-progress-wrapper {
    width: 100%;
  }
  
  .music-volume-wrapper {
    width: 100%;
  }
}

.music-cover {
  text-align: center;
}

.music-cover img {
  max-width: 400px;
  max-height: 400px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.music-meta {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  background: var(--card-bg);
}

.music-meta h1 {
  font-size: 18px;
  margin: 0 0 8px;
}

.music-meta .music-desc {
  color: var(--text-secondary);
  margin: 0 0 10px;
  white-space: pre-wrap;
}

.music-tags .badge {
  margin-right: 6px;
  margin-bottom: 6px;
}


