﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿/* WaveSurfer Audio Player - 典雅复古风格 */

/* 基础容器样式 - 使用主题色系统 */
.ws-audio {
  /* 主题色变量改为继承 :root 的 ws-*，不在组件内重定义，避免空值导致透明 */
  
  /* 基于主题色的配色方案 */
  --ws-bg: rgba(var(--ws-primary-rgb), 0.05); /* 极淡的主题色背景 */
  --ws-bg-dark: rgba(0, 0, 0, 0.85); /* 深色背景（暗色模式） */
  --ws-fg: rgba(0, 0, 0, 0.87); /* 主要文字 */
  --ws-fg-light: rgba(255, 255, 255, 0.95); /* 浅色文字（暗色模式） */
  --ws-muted: rgba(0, 0, 0, 0.6); /* 次要文字 */
  --ws-muted-light: rgba(255, 255, 255, 0.7); /* 次要文字（暗色模式） */
  --ws-border: rgba(var(--ws-primary-rgb), 0.25); /* 边框 */
  --ws-border-light: rgba(255, 255, 255, 0.2); /* 边框（暗色模式） */
  --ws-shadow: rgba(var(--ws-primary-rgb), 0.2); /* 阴影 */
  --ws-wave-bg: rgba(var(--ws-primary-rgb), 0.1); /* 波形背景 */
  --ws-wave-progress: rgba(var(--ws-primary-rgb), 0.85); /* 波形进度色 */
  --ws-wave-base: rgba(var(--ws-primary-rgb), 0.35); /* 波形基础色 */
  
  background: var(--ws-bg);
  color: var(--ws-fg);
  border: 1px solid var(--ws-border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 32px var(--ws-shadow);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: 0.01em;
  margin: 0 auto;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .ws-audio {
    --ws-bg: var(--ws-bg-dark);
    --ws-fg: var(--ws-fg-light);
    --ws-muted: var(--ws-muted-light);
    --ws-border: var(--ws-border-light);
    --ws-shadow: rgba(0, 0, 0, 0.4);
  }
}

/* 主题变体 - 基于主题色的不同风格 */
.ws-theme-light {
  --ws-bg: rgba(var(--ws-primary-rgb), 0.03);
  --ws-fg: rgba(0, 0, 0, 0.87);
  --ws-muted: rgba(0, 0, 0, 0.6);
  --ws-border: rgba(var(--ws-primary-rgb), 0.15);
  --ws-shadow: rgba(var(--ws-primary-rgb), 0.1);
}

.ws-theme-dark {
  --ws-bg: rgba(0, 0, 0, 0.85);
  --ws-fg: rgba(255, 255, 255, 0.95);
  --ws-muted: rgba(255, 255, 255, 0.7);
  --ws-border: rgba(255, 255, 255, 0.15);
  --ws-shadow: rgba(0, 0, 0, 0.5);
}

.ws-theme-glass {
  --ws-bg: rgba(var(--ws-primary-rgb), 0.08);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(var(--ws-primary-rgb), 0.2);
}

/* 标题样式 - 居左、空间更小 */
.ws-audio-header {
  margin-bottom: 12px;
  font-weight: normal;
  letter-spacing: 0.5px;
  text-align: left;
  padding-bottom: 8px;
  position: relative;
}

.ws-audio-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ws-fg);
  text-shadow: none;
}

/* 播放器主体 */
.ws-audio-player {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 波形区域 */
.ws-audio-wave {
  height: 96px; /* 外边框高度保持不变 */
  background: var(--ws-wave-bg);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ws-border);
  box-shadow: inset 0 2px 8px rgba(var(--ws-primary-rgb), 0.1);
  padding: 10px 0; /* 上下各 10px 留白 */
  box-sizing: border-box; /* 确保 padding 不增加总高度 */
  transition: all 0.3s ease;
}

.ws-audio-wave:hover {
  box-shadow: inset 0 2px 12px rgba(var(--ws-primary-rgb), 0.15);
  border-color: rgba(var(--ws-primary-rgb), 0.3);
}

.ws-audio-wave canvas { 
  display: block; 
  width: 100%;
  height: 100%;
}

/* 确保波形渲染器正确显示 */
.ws-audio-wave > div {
  height: 100%;
}

.ws-audio-wave .wrapper {
  height: 100% !important;
}

/* 加载动画 */
.ws-audio.ws-loading .ws-audio-wave::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, 
    rgba(var(--ws-primary-rgb), 0), 
    rgba(var(--ws-primary-rgb), 0.15), 
    rgba(var(--ws-primary-rgb), 0)
  );
  animation: ws-shimmer 1.8s infinite ease-in-out;
  pointer-events: none; /* 避免覆盖层拦截点击 */
}

@keyframes ws-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* 控件区 */
.ws-audio-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* 按钮样式 - 基于主题色 */
.ws-btn {
  appearance: none;
  border: 1px solid rgba(var(--ws-primary-rgb), 0.3);
  background: rgba(var(--ws-primary-rgb), 0.12);
  color: var(--ws-fg);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(var(--ws-primary-rgb), 0.15);
  backdrop-filter: blur(10px);
}

.ws-btn:hover {
  border-color: var(--ws-primary);
  background: rgba(var(--ws-primary-rgb), 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--ws-primary-rgb), 0.3);
}

.ws-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--ws-primary-rgb), 0.3);
}

.ws-btn:active {
  transform: translateY(0);
}

/* 播放按钮特殊样式 */
.ws-btn-play {
  background: var(--ws-primary);
  color: white;
  border-color: var(--ws-primary);
  padding: 10px 20px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(var(--ws-primary-rgb), 0.4);
}
/* 统一图标样式 */
.ws-btn .ws-icon,
.ws-hero-play .ws-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: middle;
}
.ws-btn-play .icon-pause,
.ws-hero-play .icon-pause {
  display: none;
}
.ws-btn-play.is-playing .icon-play,
.ws-hero-play.is-playing .icon-play {
  display: none;
}
.ws-btn-play.is-playing .icon-pause,
.ws-hero-play.is-playing .icon-pause {
  display: inline-block;
}

.ws-btn-play:hover {
  background: var(--ws-accent);
  border-color: var(--ws-accent);
  box-shadow: 0 6px 20px rgba(var(--ws-primary-rgb), 0.4);
}

/* 功能按钮 */
.ws-btn-fullscreen,
.ws-btn-volume {
  min-width: 36px;
  text-align: center;
  font-size: 16px;
}

/* 时间显示 */
.ws-time {
  min-width: 96px;
  text-align: center;
  color: var(--ws-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  background: rgba(var(--ws-primary-rgb), 0.05);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.ws-time:hover {
  background: rgba(var(--ws-primary-rgb), 0.1);
}

/* 进度条样式 */
.ws-seek {
  flex: 1;
  min-width: 0;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(var(--ws-primary-rgb), 0.2);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: visible;
}

.ws-seek:hover {
  background: rgba(var(--ws-primary-rgb), 0.25);
}

/* 进度条轨道样式 */
.ws-seek::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  background: rgba(var(--ws-primary-rgb), 0.2);
  border-radius: 4px;
}

.ws-seek::-moz-range-track {
  width: 100%;
  height: 8px;
  background: rgba(var(--ws-primary-rgb), 0.2);
  border-radius: 4px;
  border: none;
}

/* 进度条已播放部分 */
.ws-seek::-webkit-slider-progress {
  background: var(--ws-primary);
  height: 8px;
  border-radius: 4px;
}

.ws-seek::-moz-range-progress {
  background: var(--ws-primary);
  height: 8px;
  border-radius: 4px;
}

.ws-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ws-primary);
  border: 2px solid white;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(var(--ws-primary-rgb), 0.3);
  transition: all 0.2s ease;
  position: relative;
  z-index: 2;
}

.ws-seek::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(var(--ws-primary-rgb), 0.4);
  background: var(--ws-accent);
}

.ws-seek::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ws-primary);
  border: 2px solid white;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(var(--ws-primary-rgb), 0.3);
  transition: all 0.2s ease;
}

.ws-seek::-moz-range-thumb:hover {
  transform: scale(1.1);
  background: var(--ws-accent);
}

.ws-seek::-ms-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ws-primary);
  border: 4px solid white;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(var(--ws-primary-rgb), 0.4);
}

/* 音量控制 */
.ws-volume {
  width: 100px;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(var(--ws-primary-rgb), 0.15);
  border-radius: 4px;
  outline: none;
  transition: all 0.2s ease;
}

.ws-volume:hover {
  background: rgba(var(--ws-primary-rgb), 0.2);
}

.ws-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ws-primary);
  border: 2px solid white;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(var(--ws-primary-rgb), 0.3);
  transition: all 0.2s ease;
}

.ws-volume::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.ws-volume::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ws-primary);
  border: 2px solid white;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(var(--ws-primary-rgb), 0.3);
}

/* 下载按钮 */
.ws-download {
  margin-left: auto;
  color: var(--ws-primary);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.ws-download:hover {
  color: var(--ws-accent);
  background: rgba(var(--ws-primary-rgb), 0.1);
  text-decoration: none;
  transform: translateY(-1px);
}

/* 播放列表样式 */
.ws-playlist {
  margin: 16px 0 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
  list-style-type: none;
  border: 1px solid var(--ws-border);
  border-radius: 8px;
  background: rgba(var(--ws-primary-rgb), 0.08);
}

.ws-track {
  padding: 10px 15px;
  cursor: pointer;
  color: var(--ws-fg);
  outline: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.ws-track:not(:last-child) {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.ws-track:hover,
.ws-track:focus {
  background: rgba(var(--ws-primary-rgb), 0.1);
  color: var(--ws-primary);
}

.ws-track-active {
  color: var(--ws-primary);
  font-weight: 600;
  background: rgba(var(--ws-primary-rgb), 0.15);
  border-left: 3px solid var(--ws-primary);
  padding-left: 12px;
}

.ws-track-index {
  margin-right: 10px;
  color: var(--ws-muted);
}

.ws-track-title {
  flex: 1;
}

/* 警告信息 */
.ws-audio-warning {
  padding: 16px;
  border: 1px dashed rgba(var(--ws-primary-rgb), 0.5);
  background: rgba(var(--ws-primary-rgb), 0.08);
  color: var(--ws-primary);
  border-radius: 12px;
  font-weight: 500;
}

/* 回退样式：仅显示原生 audio，隐藏自定义控件与大按钮 */
.ws-fallback .ws-audio-controls {
  display: none !important;
}

.ws-fallback .ws-audio-wave audio {
  display: block;
  width: 100%;
  border-radius: 8px;
}

.ws-fallback .ws-hero-play {
  display: none !important;
}

/* 大气布局：左侧大号播放键 + 右侧波形 */
.ws-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 大播放按钮 - 基于主题色 */
.ws-hero-play {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--ws-primary), var(--ws-accent));
  color: white;
  font-size: 32px; /* 影响 SVG 尺寸（1em） */
  line-height: 1;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(var(--ws-primary-rgb), 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ws-hero-play::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.2), transparent);
  border-radius: 50% 50% 0 0;
  pointer-events: none; /* 装饰层不拦截按钮点击 */
}

.ws-hero-play:hover {
  background: linear-gradient(135deg, var(--ws-accent), var(--ws-primary));
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(var(--ws-primary-rgb), 0.4);
}

.ws-hero-play:active {
  transform: scale(0.95);
}

.ws-hero-play:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(var(--ws-primary-rgb), 0.3);
}

/* 让波形紧邻大按钮并填满剩余空间 */
.ws-hero .ws-audio-wave {
  flex: 1;
  height: 96px; /* 恢复外边框高度 */
}

/* 响应式：桌面端显示大按钮并隐藏小按钮；移动端相反 */
@media (min-width: 768px) {
  .ws-hero-play {
    display: flex;
  }
  .ws-btn-play {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .ws-hero-play {
    display: none;
  }
  .ws-btn-play {
    display: inline-flex;
  }
}

/* 全屏态：充满视口，扩大波形区域与交互密度 */
.ws-audio.ws-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: var(--ws-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 30px;
  padding-bottom: calc(30px + env(safe-area-inset-bottom));
  max-width: none;
}

.ws-audio.ws-fullscreen .ws-audio-header {
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.ws-audio.ws-fullscreen .ws-audio-title {
  font-size: 20px;
}

.ws-audio.ws-fullscreen .ws-audio-player {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ws-audio.ws-fullscreen .ws-hero {
  flex: 1;
  align-items: stretch;
}

.ws-audio.ws-fullscreen .ws-hero .ws-audio-wave {
  flex: 1;
  height: auto !important;
  min-height: 200px !important;
  background: rgba(var(--ws-primary-rgb), 0.12);
}

/* 确保全屏模式下波形渲染器正确显示 */
.ws-audio.ws-fullscreen .ws-hero .ws-audio-wave > div,
.ws-audio.ws-fullscreen .ws-hero .ws-audio-wave .wrapper,
.ws-audio.ws-fullscreen .ws-hero .ws-audio-wave .scroll {
  height: 100% !important;
}

.ws-audio.ws-fullscreen .ws-audio-controls {
  margin-top: auto;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: rgba(var(--ws-primary-rgb), 0.15);
  position: sticky;
  bottom: env(safe-area-inset-bottom);
  overflow: visible; /* 允许音量弹层溢出显示 */
}

.ws-audio.ws-fullscreen .ws-hero-play {
  transform: scale(1.2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  width: 120px;
  font-size: 40px;
}

/* 全屏模式下显示进度条 */
.ws-audio.ws-fullscreen .ws-seek {
  display: block !important;
  min-width: 0;
  height: 8px;
}

/* 停靠模式：整个播放器固定在页面底部 */
.ws-audio.ws-docked {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  width: 100vw;
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--ws-border);
  border-bottom: none;
  box-shadow: 0 -6px 20px var(--ws-shadow);
  background: var(--ws-bg);
  padding: 20px 20px calc(16px + env(safe-area-inset-bottom));
  max-width: none;
}

.ws-audio.ws-docked .ws-audio-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
}

.ws-audio.ws-docked .ws-hero .ws-audio-wave {
  height: 96px; /* 恢复外边框高度 */
}

/* 确保停靠模式下波形渲染器正确显示 */
.ws-audio.ws-docked .ws-hero .ws-audio-wave > div,
.ws-audio.ws-docked .ws-hero .ws-audio-wave .wrapper,
.ws-audio.ws-docked .ws-hero .ws-audio-wave .scroll {
  height: 100% !important;
}

.ws-audio.ws-docked .ws-audio-controls {
  margin-top: 12px;
  padding-top: 12px;
  background: rgba(var(--ws-primary-rgb), 0.12);
  overflow: visible; /* 允许音量弹层溢出显示 */
}

/* 停靠模式下显示进度条 */
.ws-audio.ws-docked .ws-seek {
  display: block !important;
}

/* 进度条视觉优化（现代浏览器） */
.ws-seek {
  accent-color: var(--ws-primary);
}



/* 移动端隐藏底部进度条（仅隐藏 range，不影响波形） */
@media (max-width: 767.98px) {
  .ws-seek {
    display: none;
  }
}

/* 音量按钮与弹出滑块（纵向调节） */
.ws-volume-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* 音量按钮样式 - 现代 SVG 图标 */
.ws-btn.ws-btn-volume {
  min-width: 36px;
  text-align: center;
  background: transparent;
  color: var(--ws-fg);
  border: 1px solid var(--ws-border);
  position: relative;
  overflow: hidden;
}
.ws-btn.ws-btn-volume:hover {
  background: rgba(var(--ws-primary-rgb), 0.2);
  border-color: var(--ws-primary);
}

/* 弹层位置：出现在按钮上方，水平居中（原生纵向，不旋转） */
.ws-volume-group .ws-volume {
  position: absolute;
bottom: calc(100% + 56px);
    left: 65%;
  display: none;
  z-index: 1002;
  background: transparent;
  border: 0;
  transform: translate(-50%, 0); /* 居中放置 */
}

/* 音量弹出层样式 */
.ws-volume-group.ws-open::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 36px; /* 竖向窄背景（更小） */
  height: 96px; /* 背景高度（更小，留内边距） */
  background: var(--ws-bg);
  border: 1px solid var(--ws-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--ws-shadow);
  z-index: 1001;
  pointer-events: none; /* 背景框不拦截其它控件点击 */
}

.ws-volume-group.ws-open .ws-volume {
  display: block;
  z-index: 1002; /* 高于背景框，确保滑块可见 */
}





/* 让旋转后的音量滑块轨道/拇指在深色背景上清晰可见 */
.ws-volume-group .ws-volume:focus {
  outline: none;
}

/* WebKit (Chrome/Safari/Edge Chromium) */
.ws-volume-group .ws-volume::-webkit-slider-runnable-track {
  height: 3px; /* 更细更简洁 */
  background: rgba(var(--ws-primary-rgb), 0.3);
  border-radius: 2px;
}

.ws-volume-group .ws-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ws-primary);
  border: 1px solid rgba(var(--ws-primary-rgb), 0.5);
  margin-top: -3px;
}

/* Firefox */
.ws-volume-group .ws-volume::-moz-range-track {
  height: 3px;
  background: rgba(var(--ws-primary-rgb), 0.3);
  border-radius: 2px;
}

.ws-volume-group .ws-volume::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ws-primary);
  border: 1px solid rgba(var(--ws-primary-rgb), 0.5);
}

/* 旧版 Edge/IE 回退 */
.ws-volume-group .ws-volume::-ms-track {
  height: 4px;
  background: transparent;
  border-color: transparent;
  color: transparent;
}

.ws-volume-group .ws-volume::-ms-fill-lower,
.ws-volume-group .ws-volume::-ms-fill-upper {
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
}

.ws-volume-group .ws-volume::-ms-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ws-color);
  border: 2px solid #2C3E50;
}

/* 竖向滑块（兼容方案）：横向样式旋转为竖直，细白风格可控 */
.ws-volume-group .ws-volume {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 72px !important;   /* 横向长度（旋转后为竖向高度） */
  height: 12px !important;  /* 横向厚度（旋转后为竖向粗细） */
  margin: 0;
  accent-color: #ffffff;
  transform: translate(-50%, 0) rotate(-90deg) !important; /* 居中后旋转为竖向 */
  transform-origin: 50% 100% !important;
  pointer-events: auto;
}

/* 强制隐藏旧的倍速下拉（兼容遗留标记） */
.ws-speed {
  display: none !important;
}

/* 错误信息样式 */
.ws-error {
  padding: 16px;
  background: rgba(var(--ws-primary-rgb), 0.08);
  border: 1px solid rgba(var(--ws-primary-rgb), 0.2);
  color: var(--ws-fg);
  border-radius: 12px;
  text-align: center;
  margin-top: 12px;
  font-weight: 500;
}

/* 小屏优化：控制条更紧凑，避免全屏按钮换行 */
@media (max-width: 420px) {
  .ws-audio-controls {
    flex-wrap: nowrap !important;
    gap: 6px;
  }
  .ws-audio-controls .ws-btn {
    padding: 8px;
    font-size: 14px;
    line-height: 1;
    flex: 0 0 auto;
  }
  .ws-time {
    font-size: 12px;
    line-height: 1;
    padding: 0 6px;
    min-width: 78px; /* 适配 00:00 / 80:00 */
    white-space: nowrap;
    flex: 0 1 auto;
  }
  .ws-btn-fullscreen,
  .ws-btn-volume,
  .ws-btn-prev,
  .ws-btn-next,
  .ws-btn-play {
    min-width: 32px;
    min-height: 32px;
  }
}

/* 极窄屏进一步收紧 */
@media (max-width: 360px) {
  .ws-audio-controls {
    gap: 4px;
  }
  .ws-audio-controls .ws-btn {
    padding: 4px 6px;
    font-size: 12px;
  }
  .ws-time {
    font-size: 11px;
    min-width: 72px;
    padding: 0 4px;
  }
}

/* 背景图：播放器与全屏 */
.ws-audio {
  padding: 20px;
  background: url('../beijing.jpg') center / cover no-repeat;
}

.ws-audio.ws-fullscreen {
  background: url('../beijing.jpg') center / cover no-repeat;
}

/* 提升可读性：在背景图上叠加暗色遮罩并确保内容位于其上 */
.ws-audio {
  position: relative;
}
.ws-audio::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.38); /* 默认遮罩强度 */
  pointer-events: none;
}
.ws-audio.ws-fullscreen::before {
  background: rgba(0,0,0,0.45); /* 全屏略深，对比度更好 */
}
/* 让主要内容层级在遮罩之上 */
.ws-audio .ws-audio-header,
.ws-audio .ws-audio-player,
.ws-audio .ws-hero,
.ws-audio .ws-audio-controls {
  position: relative;
  z-index: 1;
}

/* 控制条在背景上增加半透明底与轻微模糊，提升按钮与时间显示对比 */
.ws-audio .ws-audio-controls {
  background: rgba(var(--ws-primary-rgb), 0.1);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(var(--ws-primary-rgb), 0.2);
}

/* 波形容器加深底色，避免被背景图干扰 */
.ws-audio .ws-audio-wave {
  background: rgba(var(--ws-primary-rgb), 0.08);
  border-color: rgba(var(--ws-primary-rgb), 0.3);
}

/* 文本轻微阴影，提升在亮背景上的可读性 */
.ws-audio-title,
.ws-time {
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* 进度条轨道对比度提升 - 极强对比 */
.ws-seek {
  background: rgba(0, 0, 0, 0.6) !important; /* 未播放部分：深黑色 */
  accent-color: rgba(var(--ws-primary-rgb), 1) !important; /* 已播放部分：主色调亮色调 */
  border: 1px solid rgba(0, 0, 0, 0.3); /* 添加边框增强轮廓 */
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3); /* 内阴影增强立体感 */
}

/* 为不支持现代特性的浏览器提供极强对比渐变背景 */
.ws-seek {
  background: linear-gradient(to right, 
    rgba(var(--ws-primary-rgb), 1) 0%, 
    rgba(var(--ws-primary-rgb), 1) var(--progress, 0%), 
    rgba(0, 0, 0, 0.6) var(--progress, 0%), 
    rgba(0, 0, 0, 0.6) 100%
  ) !important;
}

/* 进度条悬停时增强效果 */
.ws-seek:hover {
  background: rgba(0, 0, 0, 0.7) !important;
  border-color: rgba(var(--ws-primary-rgb), 1);
}

/* 非交互状态彻底隐藏拇指，避免覆盖轨道（WebKit/Firefox/旧 Edge）*/
.ws-seek:not(:hover):not(:focus):not(:active)::-webkit-slider-thumb {
  width: 0 !important; height: 0 !important; opacity: 0 !important;
  border: 0 !important; box-shadow: none !important; background: transparent !important;
}
.ws-seek:not(:hover):not(:focus):not(:active)::-moz-range-thumb {
  width: 0 !important; height: 0 !important; opacity: 0 !important;
  border: 0 !important; box-shadow: none !important; background: transparent !important;
}
.ws-seek:not(:hover):not(:focus):not(:active)::-ms-thumb {
  width: 0 !important; height: 0 !important; opacity: 0 !important;
  border: 0 !important; box-shadow: none !important; background: transparent !important;
}

/* 交互时显示小拇指（12px），主题色填充+白描边 */
.ws-seek:active::-webkit-slider-thumb {
  width: 12px !important; height: 12px !important; opacity: 1 !important;
  background: rgba(var(--ws-primary-rgb), 1) !important; border: 2px solid #fff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
}
.ws-seek:active::-moz-range-thumb {
  width: 12px !important; height: 12px !important; opacity: 1 !important;
  background: rgba(var(--ws-primary-rgb), 1) !important; border: 2px solid #fff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
}
.ws-seek:active::-ms-thumb {
  width: 12px !important; height: 12px !important; opacity: 1 !important;
  background: rgba(var(--ws-primary-rgb), 1) !important; border: 2px solid #fff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
}

/* 进度条拇指：默认隐藏，仅在交互时显示（覆盖前面的拇指大小） */
.ws-seek::-webkit-slider-thumb,
.ws-seek::-moz-range-thumb,
.ws-seek::-ms-thumb {
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transition: all .15s ease;
}

/* 悬停/聚焦/拖动时显示小拇指（12px），主题色填充 + 白色描边 */
.ws-seek:active::-webkit-slider-thumb {
  width: 12px !important;
  height: 12px !important;
  opacity: 1 !important;
  background: rgba(var(--ws-primary-rgb), 1) !important;
  border: 2px solid #fff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
}

.ws-seek:active::-moz-range-thumb {
  width: 12px !important;
  height: 12px !important;
  opacity: 1 !important;
  background: rgba(var(--ws-primary-rgb), 1) !important;
  border: 2px solid #fff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
}

.ws-seek:active::-ms-thumb {
  width: 12px !important;
  height: 12px !important;
  opacity: 1 !important;
  background: rgba(var(--ws-primary-rgb), 1) !important;
  border: 2px solid #fff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
}

/* ==== 拇指引导增强（优先级更高，放在文件末尾覆盖） ==== */
.ws-seek:active::-webkit-slider-thumb,
.ws-seek:active::-moz-range-thumb,
.ws-seek:active::-ms-thumb {
  width: 16px !important;
  height: 16px !important;
  opacity: 1 !important;
  background: rgba(var(--ws-primary-rgb), 1) !important;
  border: 2px solid #fff !important; /* 清晰白描边 */
  box-shadow:
    0 0 0 6px rgba(var(--ws-primary-rgb), .25) !important, /* 半透明主题色外环（导引） */
    0 4px 14px rgba(var(--ws-primary-rgb), .45) !important; /* 柔和光晕 */
  cursor: grabbing !important;
  z-index: 3 !important;
}

/* ==== 进度拖动时间提示气泡 ==== */
.ws-seek-tip {
  position: absolute;
  bottom: 16px;            /* 位于轨道上方 */
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  will-change: transform, opacity;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.ws-seek-tip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0,0,0,0.8);
}
.ws-seek-tip.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* 父容器为定位上下文，保证气泡定位准确 */
.ws-audio .ws-seek { position: relative; }

/* 进度圆点微调：与轨道中线精准对齐且不被遮盖 */
.ws-seek::-webkit-slider-thumb {
  /* 拇指总高14px，轨道8px，(14-8)/2 = 3px，上移 -2px 更贴合你的视觉预期 */
  margin-top: -2px !important;
  z-index: 10 !important;
}
.ws-seek::-moz-range-thumb {
  /* Firefox 默认已居中，移除上移，保持较高层级 */
  z-index: 10 !important;
}
.ws-seek::-ms-thumb {
  /* 旧版 Edge/IE 使用 margin-top 调整到中线 */
  margin-top: -2px !important;
  z-index: 10 !important;
}

/* 常态拇指常显（覆盖隐藏规则，确保圆点一直可见） */
.ws-seek:not(:hover):not(:focus):not(:active)::-webkit-slider-thumb,
.ws-seek::-webkit-slider-thumb {
  width: 10px !important;
  height: 10px !important;
  opacity: 1 !important;
  background: rgba(var(--ws-primary-rgb), 1) !important;
  border: 2px solid #fff !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.25) !important;
  cursor: pointer !important;
}
.ws-seek:not(:hover):not(:focus):not(:active)::-moz-range-thumb,
.ws-seek::-moz-range-thumb {
  width: 10px !important;
  height: 10px !important;
  opacity: 1 !important;
  background: rgba(var(--ws-primary-rgb), 1) !important;
  border: 2px solid #fff !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.25) !important;
  cursor: pointer !important;
}
.ws-seek:not(:hover):not(:focus):not(:active)::-ms-thumb,
.ws-seek::-ms-thumb {
  width: 12px !important; /* 旧版 Edge/IE 拇指稍大以保证显示 */
  height: 12px !important;
  opacity: 1 !important;
  background: rgba(var(--ws-primary-rgb), 1) !important;
  border: 2px solid #fff !important;
  box-shadow: 0 2px 6px rgba(var(--ws-primary-rgb), .35) !important;
  cursor: pointer !important;
}

/* 拖动时增强（保持已添加的16px外环与光晕效果） */

/* ===== 强制兜底主色：避免任何变量缺失导致透明 ===== */
:root {
  --ws-primary: #4CAF50 !important;
  --ws-primary-rgb: 76, 175, 80 !important;
  --ws-accent: #3D8C40 !important;
}