/* ==========================================================================
   CookieTune 🎛️ 专业音效控制台、极光开关、EQ均衡器与 A-B 诗词循环 (audio-fx.css)
   设计语言：唯美玻璃拟态 (Glassmorphism)、微光渐变 (Aurora Glow)、高级圆角与高对比度交互
   ========================================================================== */

/* 全局模态遮罩层 */
#audio-fx-modal.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(8, 6, 14, 0.78) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10000 !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

#audio-fx-modal.modal-backdrop.active {
  display: flex !important;
  animation: fxModalFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes fxModalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 弹窗主卡片 */
.audio-fx-modal-card {
  width: 100% !important;
  max-width: 520px !important;
  max-height: 88vh !important;
  background: linear-gradient(145deg, rgba(28, 16, 42, 0.94), rgba(14, 10, 24, 0.96)) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 24px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(255, 117, 140, 0.22) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  color: #ffffff !important;
  box-sizing: border-box !important;
}

/* 弹窗头部 */
.audio-fx-modal-card .modal-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 18px 22px 14px 22px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

.modal-title-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.modal-title-wrap .modal-title-icon {
  font-size: 20px !important;
  filter: drop-shadow(0 0 8px rgba(255, 117, 140, 0.6)) !important;
}

.modal-title-wrap h3 {
  margin: 0 !important;
  font-size: 16.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  color: #ffffff !important;
  font-family: var(--font-sans, "Plus Jakarta Sans", sans-serif) !important;
}

.audio-fx-modal-card .close-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: rgba(255, 255, 255, 0.75) !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.audio-fx-modal-card .close-btn:hover {
  background: rgba(255, 117, 140, 0.25) !important;
  border-color: rgba(255, 117, 140, 0.5) !important;
  color: #ffffff !important;
  transform: rotate(90deg) !important;
}

/* 弹窗内容滚动区 */
.fx-modal-body {
  padding: 18px 20px 24px 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: calc(88vh - 65px) !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent !important;
}

.fx-modal-body::-webkit-scrollbar {
  width: 5px !important;
}

.fx-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 10px !important;
}

/* 功能卡片区块 */
.fx-section {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 16px !important;
  padding: 14px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  transition: border-color 0.25s ease, background 0.25s ease !important;
}

.fx-section:hover {
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.fx-master-section {
  background: linear-gradient(135deg, rgba(255, 117, 140, 0.12), rgba(254, 107, 139, 0.06)) !important;
  border-color: rgba(255, 117, 140, 0.3) !important;
  box-shadow: 0 4px 20px rgba(255, 117, 140, 0.08) !important;
}

.fx-switch-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  width: 100% !important;
}

.fx-switch-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.fx-switch-info h4 {
  margin: 0 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  letter-spacing: 0.2px !important;
}

.fx-section-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-bottom: 2px !important;
}

.fx-section-title-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.fx-section-title-wrap h4,
.fx-section h4 {
  margin: 0 !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  letter-spacing: 0.2px !important;
}

.fx-section .section-desc {
  margin: 0 !important;
  font-size: 11.5px !important;
  color: rgba(255, 255, 255, 0.6) !important;
  line-height: 1.4 !important;
}

/* 🌟 高颜值极光滑动开关 (Aurora Toggle Switch) */
.toggle-switch {
  position: relative !important;
  display: inline-block !important;
  width: 48px !important;
  height: 26px !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.toggle-switch input {
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
}

.toggle-slider {
  position: absolute !important;
  cursor: pointer !important;
  inset: 0 !important;
  background: rgba(255, 255, 255, 0.16) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  border-radius: 30px !important;
}

.toggle-slider:before {
  position: absolute !important;
  content: "" !important;
  height: 18px !important;
  width: 18px !important;
  left: 3px !important;
  bottom: 3px !important;
  background-color: #ffffff !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary-gradient, linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%)) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 0 14px rgba(255, 117, 140, 0.6) !important;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px) !important;
  background-color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

/* 控制体容器 */
.fx-controls-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  transition: opacity 0.3s ease, filter 0.3s ease !important;
}

.fx-controls-body.fx-disabled {
  opacity: 0.4 !important;
  pointer-events: none !important;
  filter: grayscale(0.6) !important;
}

/* 🌟 5 大意境音效预设网格 (Atmospheric Presets) */
.fx-presets-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)) !important;
  gap: 8px !important;
  margin-top: 4px !important;
}

.fx-preset-card {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  padding: 10px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  cursor: pointer !important;
  transition: all 0.24s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  outline: none !important;
  text-decoration: none !important;
}

.fx-preset-card .preset-icon {
  font-size: 18px !important;
  line-height: 1 !important;
}

.fx-preset-card .preset-name {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

.fx-preset-card:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  transform: translateY(-2px) !important;
}

.fx-preset-card.active {
  background: var(--primary-gradient, linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%)) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(255, 117, 140, 0.45) !important;
  transform: scale(1.02) !important;
}

/* 🌟 滑块行与自定义 Range 样式 (EQ & Crossfade) */
.fx-slider-row, .fx-eq-item {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
}

.fx-slider-label {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 12px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 600 !important;
}

.fx-val-badge {
  font-family: monospace !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #ff859d !important;
  background: rgba(255, 117, 140, 0.15) !important;
  border: 1px solid rgba(255, 117, 140, 0.25) !important;
  padding: 1px 7px !important;
  border-radius: 8px !important;
}

.fx-eq-sliders-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  margin-top: 4px !important;
}

/* 自定义高端 Range Slider */
input[type="range"].fx-range-slider {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 100% !important;
  height: 6px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.16) !important;
  outline: none !important;
  border: none !important;
  margin: 6px 0 !important;
  cursor: pointer !important;
  transition: background 0.2s ease !important;
}

input[type="range"].fx-range-slider:hover {
  background: rgba(255, 255, 255, 0.24) !important;
}

input[type="range"].fx-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  border: 2.5px solid #ff758c !important;
  box-shadow: 0 0 10px rgba(255, 117, 140, 0.9), 0 2px 6px rgba(0, 0, 0, 0.4) !important;
  cursor: pointer !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

input[type="range"].fx-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.22) !important;
  box-shadow: 0 0 15px rgba(255, 117, 140, 1), 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

input[type="range"].fx-range-slider::-moz-range-thumb {
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  border: 2.5px solid #ff758c !important;
  box-shadow: 0 0 10px rgba(255, 117, 140, 0.9) !important;
  cursor: pointer !important;
}

input[type="range"].fx-range-slider::-moz-range-track {
  background: rgba(255, 255, 255, 0.16) !important;
  height: 6px !important;
  border-radius: 10px !important;
  border: none !important;
}

/* ==========================================================================
   🔁 A-B 段落单句循环控制面板 (A-B Verse Loop Panel)
   ========================================================================== */
.fx-ab-section {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(255, 117, 140, 0.08)) !important;
  border-color: rgba(139, 92, 246, 0.25) !important;
}

.ab-status-badge {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #a78bfa !important;
  background: rgba(139, 92, 246, 0.15) !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
  padding: 2px 8px !important;
  border-radius: 10px !important;
}

.ab-status-badge.active {
  color: #55efc4 !important;
  background: rgba(85, 239, 196, 0.15) !important;
  border-color: rgba(85, 239, 196, 0.4) !important;
  box-shadow: 0 0 10px rgba(85, 239, 196, 0.3) !important;
}

.ab-control-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  margin-top: 6px !important;
}

.ab-point-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 8px 12px !important;
  gap: 10px !important;
}

.ab-point-meta {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.ab-point-tag {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  color: #ffffff !important;
}

.ab-point-tag.point-a {
  background: linear-gradient(135deg, #ff758c, #ff7eb3) !important;
  box-shadow: 0 0 8px rgba(255, 117, 140, 0.5) !important;
}

.ab-point-tag.point-b {
  background: linear-gradient(135deg, #4facfe, #00f2fe) !important;
  box-shadow: 0 0 8px rgba(79, 172, 254, 0.5) !important;
}

.ab-time-display {
  font-family: monospace !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  min-width: 46px !important;
}

.ab-point-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.ab-adjust-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  padding: 4px 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.ab-adjust-btn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

.ab-set-btn {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: var(--radius-full, 20px) !important;
  color: #ffffff !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  padding: 5px 12px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.ab-set-btn.point-a-btn:hover {
  background: rgba(255, 117, 140, 0.3) !important;
  border-color: rgba(255, 117, 140, 0.6) !important;
}

.ab-set-btn.point-b-btn:hover {
  background: rgba(79, 172, 254, 0.3) !important;
  border-color: rgba(79, 172, 254, 0.6) !important;
}

.ab-main-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 4px !important;
}

.ab-toggle-loop-btn {
  flex: 1 !important;
  background: var(--primary-gradient, linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%)) !important;
  border: none !important;
  border-radius: var(--radius-full, 20px) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  padding: 9px 16px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-shadow: 0 4px 15px rgba(255, 117, 140, 0.35) !important;
  transition: all 0.25s ease !important;
}

.ab-toggle-loop-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(255, 117, 140, 0.5) !important;
}

.ab-toggle-loop-btn.looping {
  background: linear-gradient(135deg, #00b894, #00cec9) !important;
  box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4) !important;
}

.ab-clear-loop-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: var(--radius-full, 20px) !important;
  color: rgba(255, 255, 255, 0.75) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 8px 16px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.ab-clear-loop-btn:hover {
  background: rgba(255, 71, 87, 0.25) !important;
  border-color: rgba(255, 71, 87, 0.5) !important;
  color: #ffffff !important;
}

/* ==========================================================================
   🎵 播放器控制栏按钮深度统一 (Player Toolbar AB & FX Buttons)
   ========================================================================== */
.ab-repeat-btn,
.audio-fx-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: var(--radius-full, 20px) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.ab-repeat-btn {
  min-width: 42px !important;
  height: 32px !important;
  padding: 0 10px !important;
  letter-spacing: 0.5px !important;
}

.ab-repeat-btn:hover,
.audio-fx-btn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

.ab-repeat-btn.setting {
  background: rgba(255, 180, 0, 0.22) !important;
  border-color: #ffb400 !important;
  color: #ffd54f !important;
  animation: pulseAmberGlow 1.2s infinite alternate !important;
}

.ab-repeat-btn.active {
  background: var(--primary-gradient, linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%)) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(255, 117, 140, 0.6) !important;
}

@keyframes pulseAmberGlow {
  from {
    box-shadow: 0 0 4px rgba(255, 180, 0, 0.4);
  }
  to {
    box-shadow: 0 0 14px rgba(255, 180, 0, 0.85);
  }
}

.audio-fx-btn {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
}

.audio-fx-btn.active {
  background: rgba(255, 117, 140, 0.25) !important;
  border-color: rgba(255, 117, 140, 0.6) !important;
  color: #ff758c !important;
  box-shadow: 0 0 12px rgba(255, 117, 140, 0.4) !important;
}

/* 进度条 A-B 区间选区与图钉 */
.ab-loop-highlight {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(90deg, rgba(255, 117, 140, 0.45), rgba(79, 172, 254, 0.45)) !important;
  border-radius: 4px !important;
  pointer-events: none !important;
  z-index: 2 !important;
  box-shadow: 0 0 10px rgba(255, 117, 140, 0.6) !important;
  border-left: 2px solid #ffffff !important;
  border-right: 2px solid #ffffff !important;
}

.ab-loop-pin {
  position: absolute !important;
  top: -7px !important;
  transform: translateX(-50%) !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 5 !important;
  color: #ffffff !important;
  border: 1.5px solid #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
  pointer-events: none !important;
  user-select: none !important;
}

#ab-pin-a.ab-loop-pin {
  background: linear-gradient(135deg, #ff758c, #ff7eb3) !important;
}

#ab-pin-b.ab-loop-pin {
  background: linear-gradient(135deg, #4facfe, #00f2fe) !important;
}
