@charset "utf-8";
/* ======================================================
 文件名: audio.js
 描述: 该文件实现了音乐播放主要功能。
 作者: 子夜歌
 演示地址：https://ziyege.com/muc
   ======================================================== */

/* ============================================================================
   CSS变量定义 - 定义全局颜色、尺寸、断点等变量
   ============================================================================ */
:root {
  /* ---------- 颜色变量 ---------- */
  --primary-color: #4caf50;          /* 主色调 - 绿色 */
  --primary-dark: #006633;           /* 深绿色 */
  --primary-light: #66cc66;          /* 浅绿色 */
  --accent-color: #f03;              /* 强调色 - 红色 */
  --text-primary: #333;              /* 主要文本颜色 */
  --text-secondary: #666;            /* 次要文本颜色 */
  --bg-light: #e0e0e0;               /* 浅背景色 */
  --bg-lighter: #f5f5f5;             /* 更浅背景色 */
  --border-color: #ddd;              /* 边框颜色 */

  /* 新增链接颜色变量 */
  --link-color: #1a73e8;             /* 链接默认颜色 */
  --link-hover-color: #0d47a1;       /* 链接悬停颜色 */
  --link-active-color: #f03;         /* 链接激活颜色 */
  --link-visited-color: #6a1b9a;     /* 访问后链接颜色 */

  /* ---------- 尺寸变量 ---------- */
  --border-radius: 10px;              /* 统一圆角半径 */
  --transition-speed: 0.3s;           /* 统一过渡速度 */
  --container-padding: clamp(8px, 2vw, 12px);  /* 响应式容器内边距 */
  --control-size: clamp(32px, 7vw, 36px);      /* 控制按钮尺寸 */
  --control-size-large: clamp(40px, 9vw, 44px);/* 大型控制按钮尺寸 */
  --icon-size: clamp(16px, 4vw, 20px);         /* 图标尺寸 */
  --icon-size-large: clamp(20px, 5vw, 24px);   /* 大型图标尺寸 */

  /* ---------- 响应式断点 ---------- */
  --mobile-breakpoint: 768px;        /* 移动端断点 */
}

/* ============================================================================
   重置与基础样式
   ============================================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Arial, 'Microsoft YaHei', sans-serif;
  font-size: clamp(14px, 1.5vw, 16px); /* 响应式字体大小 */
  line-height: 1.5;
  color: var(--text-secondary);
  background-color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================================
   可访问性增强
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  /* 减少动画 - 适用于对动画敏感的用户 */
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  /* 高对比度模式 */
  :root {
    --primary-color: #008000;
    --primary-dark: #004400;
    --text-primary: #000;
    --text-secondary: #222;
    --link-color: #0000ee;
    --link-hover-color: #000080;
  }
}

/* 屏幕阅读器专用类 - 视觉隐藏但可访问 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================================
   通用链接样式
   ============================================================================ */
a {
  color: var(--link-color);
  text-decoration: none;
  transition: all var(--transition-speed) ease;
  position: relative;
}

a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

a:active {
  color: var(--link-active-color);
}

a:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================================
   布局样式
   ============================================================================ */
.container {
  display: flex;
  flex: 1;
  height: calc(100vh - 80px);
  overflow: hidden;
  position: relative;
}

/* 左侧列 - 音乐列表区域 */
.left-column {
  flex: 0 0 60%;
  max-width: 60%;
  padding: var(--container-padding);
  border-right: 2px solid var(--primary-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.left-column > div:first-child {
  color: var(--primary-dark);
  font-weight: bold;
  text-align: center;
  padding: clamp(8px, 1.5vw, 12px) 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

/* 右侧列 - 播放器和歌词区域 */
.right-column {
  flex: 1;
  padding: var(--container-padding);
  color: var(--primary-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* ============================================================================
   音乐列表样式
   ============================================================================ */
.music-list-container {
  flex: 1;
  overflow-y: auto;
  margin-top: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}

.music-list-container::-webkit-scrollbar {
  width: 6px;
}

.music-list-container::-webkit-scrollbar-track {
  background: transparent;
}

.music-list-container::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: var(--border-radius);
}

.music-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 8px;
  padding: 0 5px;
}

.music-item {
  padding: clamp(10px, 2vw, 12px) clamp(12px, 2.5vw, 15px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  background-color: var(--bg-lighter);
}

.music-item:hover {
  background-color: rgba(76, 175, 80, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.music-item.playing {
  background-color: rgba(240, 51, 51, 0.1);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* ============================================================================
   歌曲链接样式
   ============================================================================ */
.music-item a {
  display: block;
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 0;
  transition: all var(--transition-speed) ease;
  border-radius: 4px;
  font-size: clamp(0.9rem, 1.5vw, 1rem);
}

/* 正常状态的歌曲链接 */
.music-item a {
  color: #2c3e50; /* 深蓝色，更加清晰 */
  font-weight: 600;
}

/* 悬停状态 */
.music-item a:hover {
  color: var(--primary-color);
  text-decoration: none;
  padding-left: 5px;
  background-color: rgba(76, 175, 80, 0.05);
}

/* 播放中的歌曲链接 */
.music-item.playing a {
  color: var(--accent-color);
  font-weight: 700;
}

.music-item.playing a:hover {
  color: #ff4444; /* 更深的红色 */
  background-color: rgba(255, 68, 68, 0.05);
}

/* 添加小图标效果 */
.music-item a::before {
  content: '♪ ';
  color: var(--primary-light);
  font-weight: normal;
  opacity: 0.6;
  transition: all var(--transition-speed) ease;
}

.music-item:hover a::before {
  color: var(--primary-color);
  opacity: 1;
}

.music-item.playing a::before {
  content: '▶ ';
  color: var(--accent-color);
  opacity: 1;
}

/* 链接焦点状态 */
.music-item a:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ============================================================================
   播放器控制区域
   ============================================================================ */
.player-info {
  width: 100%;
  text-align: center;
  margin-bottom: clamp(15px, 3vw, 20px);
}

#now-playing {
  font-size: clamp(1rem, 2vw, 1.1rem);
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 10px;
}

.player-artist {
  color: var(--text-secondary);
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
}

/* 播放器中的链接样式（如歌手链接等） */
.player-info a {
  color: var(--primary-color);
  font-weight: 500;
}

.player-info a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ============================================================================
   进度条样式
   ============================================================================ */
.progress-container {
  width: 100%;
  margin: clamp(15px, 3vw, 20px) 0;
  padding: 0 10px;
}

.progress-time {
  display: flex;
  justify-content: space-between;
  font-size: clamp(0.75rem, 1.5vw, 0.85rem);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

progress {
  width: 100%;
  height: clamp(6px, 1.5vw, 8px);
  -webkit-appearance: none;
  appearance: none;
  border: none;
  border-radius: var(--border-radius);
  background: linear-gradient(90deg, var(--bg-light) 0%, var(--bg-light) 100%);
  overflow: hidden;
  cursor: pointer;
}

/* Webkit浏览器样式 */
progress::-webkit-progress-bar {
  background: linear-gradient(90deg, 
    var(--bg-light) 0%, 
    var(--bg-light) 100%);
  border-radius: var(--border-radius);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

progress::-webkit-progress-value {
  background: linear-gradient(
    90deg,
    var(--primary-light) 0%,
    var(--primary-color) 50%,
    var(--primary-dark) 100%
  );
  border-radius: var(--border-radius);
  position: relative;
  box-shadow: 
    0 0 10px rgba(102, 204, 102, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  transition: width 0.1s linear;
  position: relative;
  z-index: 1;
}

/* 创建进度条头部的高光效果 */
progress::-webkit-progress-value::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(12px, 3vw, 16px);
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3) 20%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent
  );
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* Firefox样式 */
progress::-moz-progress-bar {
  background: linear-gradient(
    90deg,
    var(--primary-light) 0%,
    var(--primary-color) 50%,
    var(--primary-dark) 100%
  );
  border-radius: var(--border-radius);
  box-shadow: 
    0 0 10px rgba(102, 204, 102, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   控制按钮样式 - 关键修改部分
   ============================================================================ */
.control-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 20px); /* 增加间距确保图标清晰 */
  margin: clamp(15px, 3vw, 20px) 0;
  width: 100%;
  padding: 0 10px;
}

.control-btn {
  width: var(--control-size);
  height: var(--control-size);
  min-width: 32px; /* 增大最小尺寸确保图标清晰 */
  min-height: 32px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 6px; /* 增加内边距，图标周围有更多空间 */
  transition: all var(--transition-speed) ease;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.control-btn:hover {
  transform: scale(1.1);
  background-color: rgba(76, 175, 80, 0.15);
}

.control-btn:active {
  transform: scale(1.05);
}

.control-btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.control-btn.play-pause {
  width: var(--control-size-large);
  height: var(--control-size-large);
  min-width: 40px;
  min-height: 40px;
  padding: 8px;
  background-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.control-btn.play-pause:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(0, 102, 51, 0.4);
}

/* 图标样式优化 */
.control-btn img {
  width: var(--icon-size);
  height: var(--icon-size);
  min-width: 16px;
  min-height: 16px;
  display: block;
  object-fit: contain;
  transition: all var(--transition-speed) ease;
}

/* 播放/暂停按钮图标更大 */
.control-btn.play-pause img {
  width: var(--icon-size-large);
  height: var(--icon-size-large);
  min-width: 20px;
  min-height: 20px;
  filter: brightness(0) invert(1); /* 将图标变为白色 */
}

/* 特定按钮图标调整 */
.control-btn.prev img,
.control-btn.next img {
  width: calc(var(--icon-size) * 0.9);
  height: calc(var(--icon-size) * 0.9);
}

.control-btn.random img,
.control-btn.repeat img {
  width: calc(var(--icon-size) * 0.85);
  height: calc(var(--icon-size) * 0.85);
}

/* ============================================================================
   音量控制样式
   ============================================================================ */
.volume-control {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.5vw, 12px);
  margin: clamp(12px, 2.5vw, 15px) 0;
  width: 100%;
  max-width: min(200px, 90vw);
  padding: 0 15px;
}

.volume-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  min-width: 20px;
  min-height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.volume-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#volumeControl {
  flex: 1;
  height: clamp(4px, 1vw, 5px);
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-light);
  border-radius: var(--border-radius);
  outline: none;
  min-width: 80px; /* 增大最小宽度 */
}

#volumeControl::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: clamp(16px, 4vw, 18px);
  height: clamp(16px, 4vw, 18px);
  min-width: 16px;
  min-height: 16px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-speed) ease;
}

#volumeControl::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(76, 175, 80, 0.3);
}

#volumeControl::-moz-range-thumb {
  width: clamp(16px, 4vw, 18px);
  height: clamp(16px, 4vw, 18px);
  min-width: 16px;
  min-height: 16px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   歌词显示样式
   ============================================================================ */
.lyrics-container {
  flex: 1;
  width: 100%;
  max-height: min(350px, 40vh);
  overflow-y: auto;
  margin-top: clamp(15px, 3vw, 20px);
  padding: clamp(10px, 2vw, 15px);
  border-radius: var(--border-radius);
  background-color: var(--bg-lighter);
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
}

#lyrics-display {
  font-size: clamp(0.9rem, 1.8vw, 1rem);
  line-height: 1.7;
  text-align: center;
  color: var(--primary-dark);
}

.lyric-line {
  padding: clamp(6px, 1.5vw, 8px) clamp(10px, 2vw, 12px);
  margin: clamp(3px, 1vw, 4px) 0;
  border-radius: var(--border-radius);
  transition: all var(--transition-speed) ease;
  min-height: clamp(28px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lyric-line.current {
  color: var(--accent-color);
  background-color: rgba(240, 51, 51, 0.1);
  font-weight: 600;
  transform: scale(1.02);
}

.lyric-time {
  display: none; /* 隐藏时间戳，需要时再显示 */
}

/* 歌词中的链接样式 */
#lyrics-display a {
  color: var(--primary-color);
  border-bottom: 1px dotted var(--primary-light);
}

#lyrics-display a:hover {
  color: var(--primary-dark);
  border-bottom: 1px solid var(--primary-color);
}

/* ============================================================================
   页头页脚样式
   ============================================================================ */
header {
  text-align: center;
  padding: clamp(15px, 3vw, 20px);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
}

header h1 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin: 0;
  font-weight: 300;
}

/* 页头中的链接 */
header a {
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

header a:hover {
  color: white;
  border-bottom: 1px solid white;
}

footer {
  text-align: center;
  padding: clamp(12px, 2.5vw, 15px);
  background-color: var(--bg-lighter);
  color: var(--text-secondary);
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);

  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* 页脚中的链接 */
footer a {
  color: var(--primary-color);
}

footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ============================================================================
   响应式设计 - 重点优化移动端
   ============================================================================ */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 100px);
  }
  
  .left-column,
  .right-column {
    flex: none;
    max-width: 100%;
    width: 100%;
    min-height: 40vh;
  }
  
  .left-column {
    border-right: none;
    border-bottom: 2px solid var(--primary-color);
    flex: 0 0 auto;
    max-height: 50vh;
  }
  
  .right-column {
    flex: 1;
    min-height: 50vh;
    padding-top: 5px;
  }
  
  .music-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .lyrics-container {
    max-height: min(200px, 30vh);
    margin-top: 10px;
  }
  
  /* 移动端控制按钮优化 */
  .control-buttons {
    gap: 10px;
    margin: 15px 0;
  }
  
  .control-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 5px;
  }
  
  .control-btn img {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
  }
  
  .control-btn.play-pause {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 7px;
  }
  
  .control-btn.play-pause img {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
  }
  
  .control-btn.prev img,
  .control-btn.next img {
    width: 16px;
    height: 16px;
  }
  
  .control-btn.random img,
  .control-btn.repeat img {
    width: 15px;
    height: 15px;
  }
  
  /* 移动端音量控制 */
  .volume-control {
    max-width: 85vw;
    margin: 12px 0;
    gap: 8px;
  }
  
  .volume-icon {
    width: 22px;
    height: 22px;
  }
  
  #volumeControl {
    height: 6px;
  }
  
  #volumeControl::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border-width: 2px;
  }
  
  /* 移动端进度条优化 */
  progress {
    height: 8px;
  }
  
  progress::-webkit-progress-value::after {
    width: 18px;
  }
  
  /* 移动端链接优化 */
  .music-item a {
    padding: 5px 0;
  }
  
  .music-item a:hover {
    padding-left: 6px;
  }
  
  header h1 {
    font-size: 1.3rem;
  }
  
  /* 移动端隐藏不必要的内容 */
  .music-item a::before {
    font-size: 0.9em;
  }
}

/* 小屏幕手机优化 */
@media (max-width: 480px) {
  :root {
    --control-size: 36px;
    --control-size-large: 44px;
    --icon-size: 18px;
    --icon-size-large: 22px;
  }
  
  .container {
    min-height: calc(100vh - 90px);
  }
  
  .music-item {
    padding: 8px 10px;
  }
  
  #lyrics-display {
    font-size: 0.9rem;
  }
  
  .lyrics-container {
    padding: 8px;
  }
  
  .music-item a::before {
    margin-right: 4px;
    font-size: 0.85em;
  }
  
  /* 超小屏幕控制按钮优化 */
  .control-buttons {
    gap: 8px;
    margin: 12px 0;
  }
  
  .control-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 4px;
  }
  
  .control-btn img {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
  }
  
  .control-btn.play-pause {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 6px;
  }
  
  .control-btn.play-pause img {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
  }
  
  .control-btn.prev img,
  .control-btn.next img {
    width: 14px;
    height: 14px;
  }
  
  .control-btn.random img,
  .control-btn.repeat img {
    width: 13px;
    height: 13px;
  }
  
  /* 超小屏幕音量控制 */
  .volume-control {
    max-width: 80vw;
    margin: 10px 0;
  }
  
  .volume-icon {
    width: 20px;
    height: 20px;
  }
  
  #volumeControl {
    height: 5px;
    min-width: 60px;
  }
  
  #volumeControl::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
  }
  
  .progress-time {
    font-size: 0.7rem;
  }
}

/* ============================================================================
   加载状态
   ============================================================================ */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  border: 2px solid var(--bg-light);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================================================
   主题切换支持
   ============================================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #e0e0e0;
    --text-secondary: #aaa;
    --bg-light: #2a2a2a;
    --bg-lighter: #1a1a1a;
    --border-color: #444;
    --primary-dark: #4caf50;
    --link-color: #4fc3f7;
    --link-hover-color: #29b6f6;
    --link-visited-color: #ba68c8;
  }
  
  body {
    background-color: #121212;
    color: var(--text-secondary);
  }
  
  .music-item {
    background-color: var(--bg-lighter);
  }
  
  .music-item a {
    color: #e0e0e0;
  }
  
  .music-item a:hover {
    color: var(--primary-light);
  }
  
  .music-item.playing a {
    color: #ff6b6b;
  }
  
  .lyrics-container {
    background-color: var(--bg-lighter);
  }
  
  footer {
    background-color: #1a1a1a;
  }
  
  /* 暗色模式控制按钮 */
  .control-btn.play-pause {
    background-color: var(--primary-dark);
  }
  
  .control-btn.play-pause:hover {
    background-color: var(--primary-color);
  }
  
  /* 暗色模式进度条优化 */
  progress::-webkit-progress-bar {
    background: color-mix(in srgb, var(--bg-light) 90%, #fff 10%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  }
  
  progress::-webkit-progress-value {
    background: linear-gradient(
      90deg,
      color-mix(in srgb, var(--primary-light) 80%, #fff 20%) 0%,
      var(--primary-color) 50%,
      color-mix(in srgb, var(--primary-dark) 80%, #000 20%) 100%
    );
  }
  
  progress {
    background: color-mix(in srgb, var(--bg-light) 90%, #fff 10%);
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .music-item a {
    color: #0000ee;
    text-decoration: underline;
  }
  
  .music-item a:hover {
    color: #000080;
    text-decoration: underline;
  }
  
  .music-item.playing a {
    color: #cc0000;
    font-weight: bold;
  }
  
  .control-btn.play-pause {
    background-color: #008000;
    border: 2px solid #000;
  }
  
  progress::-webkit-progress-value {
    background: linear-gradient(
      90deg,
      #00cc00 0%,
      #009900 50%,
      #006600 100%
    );
    box-shadow: none;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .control-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }
  
  .control-btn img {
    min-width: 22px;
    min-height: 22px;
  }
  
  .control-btn.play-pause {
    min-width: 52px;
    min-height: 52px;
    padding: 12px;
  }
  
  .control-btn.play-pause img {
    min-width: 26px;
    min-height: 26px;
  }
  
  .volume-icon {
    min-width: 44px;
    min-height: 44px;
  }
  
  .music-item {
    min-height: 44px;
  }
  
  #volumeControl {
    height: 10px;
  }
  
  #volumeControl::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
  }
}

/* 图标平滑过渡 */
@media (prefers-reduced-motion: no-preference) {
  .control-btn img,
  .volume-icon img {
    transition: transform 0.2s ease;
  }
  
  .control-btn:active img {
    transform: scale(0.95);
  }
}

/* ============================================================================
   额外样式
   ============================================================================ */
.current-song {
  background-color: rgba(0, 123, 255, 0.1);
  font-weight: bold;
}

.current-song a {
  color: #007bff !important;
}

.lyric-line {
  padding: 8px 0;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.lyric-line.current-lyric {
  font-size: 1.2em;
  font-weight: bold;
  color: #007bff;
  opacity: 1;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}