/*
 * VoiceSelector — 音色选择器样式
 *
 * 固定在页面左下角（小艺头像在右下角，左右分工互不遮挡）。
 * 品牌色：主色 #F18D24，蓝点缀 #2D8CF0。
 */

#voice-selector {
  position: fixed;
  left: 16px;
  bottom: calc(var(--footer-height, 64px) + 16px);
  z-index: 9990;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

#voice-selector .vs-wrapper {
  position: relative;
  display: inline-block;
}

/* ── 药丸按钮 ── */
#voice-selector .vs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(241, 141, 36, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #5a3a12;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(241, 141, 36, 0.18);
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  user-select: none;
}

#voice-selector .vs-btn:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 6px 18px rgba(241, 141, 36, 0.28);
}

#voice-selector .vs-btn:active {
  transform: translateY(0);
}

#voice-selector .vs-btn__icon {
  display: inline-flex;
  color: #F18D24;
}

#voice-selector .vs-btn__label {
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#voice-selector .vs-btn__arrow {
  font-size: 10px;
  color: #b07a3a;
  transition: transform 0.15s ease;
}

#voice-selector .vs-btn[aria-expanded="true"] .vs-btn__arrow {
  transform: rotate(180deg);
}

/* ── 下拉列表 ── */
#voice-selector .vs-dropdown {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 168px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  z-index: 9991;
}

#voice-selector .vs-dropdown[hidden] {
  display: none;
}

#voice-selector .vs-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: background 0.12s ease;
}

#voice-selector .vs-option:hover {
  background: #fff4e8;
}

#voice-selector .vs-option--active {
  background: #fff1e0;
  color: #F18D24;
  font-weight: 600;
}

#voice-selector .vs-option__check {
  display: inline-flex;
  width: 14px;
  color: #F18D24;
  flex: 0 0 14px;
}

#voice-selector .vs-option__label {
  flex: 1 1 auto;
  white-space: nowrap;
}

/* ── 静音开关：紧贴「选择声音」按钮旁的图标按钮（无文字，紧凑圆形） ── */
#voice-selector .vs-mute-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(241, 141, 36, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #2D8CF0;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(241, 141, 36, 0.18);
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

#voice-selector .vs-mute-btn:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 6px 18px rgba(241, 141, 36, 0.28);
}

#voice-selector .vs-mute-btn__icon {
  display: inline-flex;
  color: #2D8CF0; /* 开启=蓝点缀 */
}

#voice-selector .vs-mute-btn__label {
  flex: 1 1 auto;
  text-align: left;
  white-space: nowrap;
}

#voice-selector .vs-mute-btn--on {
  background: #fff0f0;
  border-color: rgba(229, 71, 71, 0.35);
  color: #e54747; /* 关闭=红色警示 */
}

#voice-selector .vs-mute-btn--on .vs-mute-btn__icon {
  color: #e54747; /* 关闭=红 */
}

#voice-selector .vs-mute-btn--on:hover {
  background: #ffe6e6;
}

/* ── 小屏适配 ── */
@media (max-width: 480px) {
  #voice-selector {
    left: 10px;
    bottom: calc(var(--footer-height, 64px) + 10px);
  }
  #voice-selector .vs-btn__label {
    max-width: 84px;
  }
}
