/* ===== 配音板块（复刻 Doubao-音频生成-1.0）作用域变量 ===== */
.dubbing-page {
  --color-bg: #020a16;
  --color-bg-deep: #010611;
  --color-surface: #06101f;
  --color-surface-active: #0b1728;
  --color-brand: #8b5cf6;
  --color-brand-light: #a66bff;
  --color-text: #f7f4f2;
  --color-text-soft: #c6c0bd;
  --color-muted: #908b8b;
  --color-line: #1f2b3a;
  --color-line-soft: #142133;
  --color-hot: #ff5a1f;
  --color-warning: #f59e0b;
  --color-success: #16a34a;
  --color-danger: #ef4444;
  --color-teal: #14b8a6;
  --color-orange: #f97316;
  --color-text-primary: #f7f4f2;
  --color-text-secondary: #c6c0bd;
  --color-text-muted: #908b8b;
  --color-primary: #8b5cf6;
  --color-accent: #8b5cf6;
  --color-accent-light: #a78bfa;
  --color-surface-soft: #0b1728;
  --page-max: 1360px;
  --page-gutter: clamp(12px, 2vw, 28px);
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --transition: 160ms ease;
  color: var(--color-text);
  background: transparent;
  /* ── 原始布局（复刻参考站）── */
  display: flex;
  gap: 24px;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--page-gutter);
  min-height: calc(100vh - 300px);
  align-items: flex-start;
}



/* ── 左侧主区域 ── */
.dubbing-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

/* 模型选择栏 */
.dubbing-model-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
}

.dubbing-model-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-brand-light);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.dubbing-model-selector .ph-duotone { opacity: 0.9; }

.dubbing-model-actions {
  display: flex;
  gap: 6px;
}

.dubbing-format-btn {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--color-line-soft);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.dubbing-format-btn:hover { border-color: var(--color-brand); color: var(--color-brand-light); }
.dubbing-format-btn.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--color-brand);
  color: var(--color-brand-light);
}

/* ═════════════════════════════════════════
   AI 分析面板（DeepSeek 文案分析）
   ═════════════════════════════════════════ */

.dubbing-analyze-section {
  border-bottom: 1px solid var(--color-line-soft);
}

/* 折叠按钮 */
.dubbing-analyze-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.dubbing-analyze-toggle:hover {
  color: var(--color-accent-light, #a78bfa);
  background: rgba(124, 92, 252, 0.04);
}
.dubbing-analyze-toggle-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-muted);
  font-weight: 400;
}
.dubbing-analyze-arrow {
  transition: transform 0.2s ease;
  color: var(--color-muted);
}
.dubbing-analyze-arrow.open {
  transform: rotate(180deg);
}

/* 分析面板容器 */
.dubbing-analyze-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
  background: rgba(124, 92, 252, 0.03);
  border-top: 1px solid rgba(124, 92, 252, 0.1);
}

/* 字段 */
.dubbing-analyze-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dubbing-analyze-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dubbing-analyze-input {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.15s;
}
.dubbing-analyze-input:focus {
  border-color: var(--color-accent, #7c5cfc);
  box-shadow: 0 0 0 2px rgba(124, 92, 252, 0.1);
}
.dubbing-analyze-input::placeholder {
  color: var(--color-muted);
  opacity: 0.7;
}
.dubbing-analyze-meta {
  display: flex;
  justify-content: flex-end;
  font-size: 11px;
  color: var(--color-muted);
}
.dubbing-analyze-style-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}
.dubbing-analyze-style-input:focus {
  border-color: var(--color-accent, #7c5cfc);
}
.dubbing-analyze-style-input::placeholder {
  color: var(--color-muted);
  opacity: 0.7;
}

/* 分析按钮 */
.dubbing-analyze-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #7c5cfc, #6348d4);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.dubbing-analyze-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 4px 16px rgba(124, 92, 252, 0.3);
}
.dubbing-analyze-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dubbing-analyze-btn.analyzing {
  background: linear-gradient(135deg, #5b4bc4, #4838a8);
  animation: dubbing-analyze-pulse 1.5s ease infinite;
}
@keyframes dubbing-analyze-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* 分析结果 */
.dubbing-analyze-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-md);
}
.dubbing-analyze-result-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #22c55e;
}
.dubbing-analyze-fill-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #22c55e;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.12s;
}
.dubbing-analyze-fill-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.dubbing-analyze-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dubbing-analyze-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-accent-light, #a78bfa);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dubbing-analyze-content {
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-xs);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 编辑器区 */
.dubbing-editor {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-bottom: none;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dubbing-textarea {
  width: 100%;
  min-height: 140px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.75;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
  box-sizing: border-box;
}
.dubbing-textarea::placeholder {
  color: var(--color-muted);
  opacity: 0.6;
  line-height: 1.7;
}
.dubbing-textarea:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

/* 已选音色标签 */
.dubbing-selected-voice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  font-size: 12px;
  color: var(--color-brand-light);
  width: fit-content;
}
.dubbing-voice-tag {
  color: var(--color-muted);
  font-size: 11px;
}
.dubbing-remove-voice {
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  margin-left: 2px;
}
.dubbing-remove-voice:hover { color: var(--color-danger); }

/* 错误提示 */
.dubbing-error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 13px;
}

/* 生成结果面板 */
.dubbing-result-panel {
  padding: 16px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(20, 184, 166, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dubbing-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-brand-light);
}
.dubbing-result-header .ph-duotone { color: var(--color-teal); }

.dubbing-duration {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-muted);
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 10px;
  border-radius: 10px;
}

.dubbing-result-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dubbing-play-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--color-brand);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.dubbing-play-btn:hover {
  background: var(--color-brand-light);
  transform: scale(1.03);
}

.dubbing-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-line-soft);
  border-radius: 18px;
  color: var(--color-text-soft);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.dubbing-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-brand);
  color: var(--color-brand-light);
}

.dubbing-mock-hint {
  font-size: 12px;
  color: var(--color-warning);
  font-style: italic;
}

/* 计费信息 */
.dubbing-billing {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  width: fit-content;
}
.dubbing-billing.is-free {
  background: rgba(139, 92, 246, 0.12);
  color: #cbb3ff;
}
.dubbing-billing.is-charged {
  background: rgba(34, 197, 94, 0.12);
  color: #9bf0bf;
}

/* ── 底部控制栏 ── */
.dubbing-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px 16px;
  padding: 10px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.dubbing-toolbar-left,
.dubbing-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dubbing-toolbar-right { justify-self: end; }

.dubbing-toolbar-center {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

/* 命令按钮 + 帮助浮层 */
.dubbing-cmd-wrapper { position: relative; }
.dubbing-cmd-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--color-line-soft);
  border-radius: 8px;
  color: var(--color-text-soft);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.dubbing-cmd-btn:hover {
  border-color: var(--color-brand);
  color: var(--color-brand-light);
}

.dubbing-cmd-help {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  padding: 10px;
  background: var(--color-bg-deep);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
  min-width: 200px;
}
.dubbing-cmd-help-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-brand-light);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-line-soft);
}
.dubbing-cmd-help-item {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--color-text-soft);
  cursor: pointer;
  border-radius: 5px;
  white-space: nowrap;
}
.dubbing-cmd-help-item:hover {
  background: rgba(139, 92, 246, 0.12);
  color: var(--color-brand-light);
}

.dubbing-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--color-line-soft);
  border-radius: 8px;
  color: var(--color-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex: 0 0 auto;
}
.dubbing-tool-btn:hover {
  border-color: var(--color-brand);
  color: var(--color-brand-light);
}

/* 滑块组 */
.dubbing-slider-group {
  display: grid;
  grid-template-columns: max-content minmax(60px, 1fr) 28px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.dubbing-slider-group label {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--color-muted);
  white-space: nowrap;
  min-width: 52px;
}
.dubbing-slider-group input[type="range"] {
  width: 100%;
  min-width: 60px;
  height: 4px;
  accent-color: var(--color-brand);
  cursor: pointer;
}

.dub6-box-ref-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--color-line-soft);
  border-radius: 8px;
  color: var(--color-muted);
  background: var(--color-bg-deep);
  font-size: 12px;
}
.dub6-box-ref-status.is-selected {
  color: #22c55e;
  border-color: rgba(34,197,94,.4);
  background: rgba(34,197,94,.09);
}
.dubbing-slider-val {
  font-size: 11px;
  color: var(--color-text-soft);
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 字数统计 */
.dubbing-char-count {
  font-size: 12px;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

/* 清空按钮 */
.dubbing-clear-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--color-line-soft);
  border-radius: 8px;
  color: var(--color-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.dubbing-clear-btn:hover:not(:disabled) {
  border-color: var(--color-danger);
  color: var(--color-danger);
}
.dubbing-clear-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 生成按钮 */
.dubbing-generate-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.dubbing-generate-btn:hover:not(:disabled) {
  background: #252542;
  border-color: var(--color-brand);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.25);
}
.dubbing-generate-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── 右侧面板 ── */
.dubbing-sidebar {
  width: 340px;
  min-width: 300px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: fit-content;
  max-height: calc(100vh - 130px);
}

/* Tab 切换 */
.dubbing-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-line);
}
.dubbing-sidebar-tabs button {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.dubbing-sidebar-tabs button:hover { color: var(--color-text-soft); }
.dubbing-sidebar-tabs button.active {
  color: var(--color-brand-light);
  border-bottom-color: var(--color-brand);
}

/* 子 Tab —— 更紧凑 */
.dubbing-subtabs {
  display: flex;
  gap: 4px;
  padding: 8px 14px 0;
  overflow-x: auto;
}
.dubbing-subtabs button {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--color-line-soft);
  border-radius: 14px;
  color: var(--color-muted);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.dubbing-subtabs button:hover { border-color: var(--color-brand); color: var(--color-text-soft); }
.dubbing-subtabs button.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--color-brand);
  color: var(--color-brand-light);
}

/* 分类筛选 —— 更紧凑 */
.dubbing-category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--color-line-soft);
}
.dubbing-category-filter button {
  padding: 3px 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--color-muted);
  font-size: 10.5px;
  cursor: pointer;
  transition: all var(--transition);
}
.dubbing-category-filter button:hover { color: var(--color-text-soft); }
.dubbing-category-filter button.active {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.35);
  color: var(--color-brand-light);
}

/* 音色卡片网格 —— 更宽敞的布局 */
.dubbing-voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.dubbing-voice-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius-md);
  cursor: default;
  transition: all 0.2s ease;
}
.dubbing-voice-card:hover {
  background: rgba(124, 92, 252, 0.06);
  border-color: rgba(124, 92, 252, 0.25);
}
.dubbing-voice-card.selected {
  background: rgba(124, 92, 252, 0.1);
  border-color: var(--color-accent, #7c5cfc);
  box-shadow: 0 0 0 1px rgba(124, 92, 252, 0.2), 0 4px 16px rgba(124, 92, 252, 0.08);
}
.dubbing-voice-card.previewing {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.1);
}

/* ── 头像按钮（可点击试听）── */
.dubbing-voice-avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease;
  padding: 0;
}
.dubbing-voice-avatar-btn:hover {
  transform: scale(1.08);
}
.dubbing-voice-avatar-btn:active {
  transform: scale(0.95);
}

/* 音色头像（圆形渐变） */
.dubbing-voice-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

/* 试听中音波动画 */
.dubbing-voice-playing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
}
.dubbing-voice-bar {
  width: 3px;
  height: 14px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
  animation: dubbing-voice-bar-bounce 0.6s ease-in-out infinite alternate;
}
@keyframes dubbing-voice-bar-bounce {
  from { height: 6px; opacity: 0.5; }
  to   { height: 20px; opacity: 1; }
}

/* 信息区（点击选中） */
.dubbing-voice-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  padding: 2px 0;
}
.dubbing-voice-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.3;
}
.dubbing-voice-desc {
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 2px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 选中 ✓ 标记 */
.dubbing-voice-check {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  background: var(--color-accent, #7c5cfc);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  z-index: 2;
}

/* 试听中 ▶ 角标 */
.dubbing-voice-preview-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 18px;
  height: 18px;
  background: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9px;
  z-index: 2;
  animation: dubbing-preview-pulse 1s ease infinite;
}
@keyframes dubbing-preview-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

/* 历史记录列表 */
.dubbing-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}
.dubbing-history-list-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-soft);
}
.dubbing-history-hint {
  margin-left: auto;
  font-size: 10px;
  font-weight: 400;
  color: var(--color-muted);
  opacity: 0.8;
}
.dubbing-history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--color-muted);
}
.dubbing-history-empty p { font-size: 13px; }
.dubbing-history-empty-hint { font-size: 11px; opacity: 0.6; }

.dubbing-history-item {
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: all var(--transition);
  position: relative;
  cursor: pointer; /* 整条可点击复用 */
}
.dubbing-history-item:hover {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(0, 0, 0, 0.35);
}
.dubbing-history-text {
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.dubbing-history-text:hover {
  color: #c4b5fd;
}

/* 历史记录操作按钮行（播放 / 下载 / 删除） */
.dubbing-history-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

/* 历史记录音频播放器 */
.dubbing-history-audio {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.dubbing-history-play-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.dubbing-history-play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}
.dubbing-history-duration {
  font-size: 12px;
  color: var(--color-muted);
}
.dubbing-history-dl-btn {
  padding: 5px 9px;
  border: 1px solid var(--color-line-soft);
  border-radius: 6px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  transition: all 0.15s;
}
.dubbing-history-dl-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

/* 历史记录元信息标签 */
.dubbing-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--color-muted);
}
.dubbing-history-voice-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border-radius: 10px;
}
.dubbing-history-ref-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border-radius: 10px;
}
.dubbing-history-time {
  margin-left: auto;
  opacity: 0.6;
}

/* 历史记录删除按钮（位于操作行内） */
.dubbing-history-actions .dubbing-history-delete-btn {
  position: static;
  top: auto;
  right: auto;
  padding: 5px 9px;
  border: 1px solid var(--color-line-soft);
  border-radius: 6px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.dubbing-history-actions .dubbing-history-delete-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.4);
}

.dub6-batch-history-card {
  padding: 10px;
  margin-bottom: 9px;
  border: 1px solid var(--color-line-soft);
  border-radius: 10px;
  background: var(--color-bg-deep);
}
.dub6-batch-history-card.is-current-persona { border-color:rgba(34,197,94,.45);background:rgba(34,197,94,.055); }
.dub6-batch-history-head { display:flex;align-items:center;gap:7px; }
.dub6-batch-history-head b { flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px; }
.dub6-batch-history-audios { display:grid;gap:6px;margin:8px 0; }
.dub6-batch-history-audios > div { display:grid;grid-template-columns:48px minmax(0,1fr);align-items:center;gap:6px;font-size:11px;color:var(--color-muted); }
.dub6-batch-history-audios audio { width:100%;height:30px; }
.dub6-restore-batch-btn {
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:36px;
  padding:8px 12px;
  border:1px solid var(--color-brand);
  border-radius:9px;
  background:var(--color-brand);
  color:#fff;
  font-size:12px;
  font-weight:700;
  line-height:1.25;
  white-space:normal;
  cursor:pointer;
}
.dub6-restore-batch-btn:hover { filter:brightness(1.1);box-shadow:0 0 14px rgba(124,92,252,.24); }
.dub6-restore-batch-btn.is-secondary { margin-top:7px;background:transparent;color:var(--color-brand-light); }
.dub6-standalone-history { padding:9px;margin-bottom:8px;border:1px solid var(--color-line-soft);border-radius:9px;background:var(--color-bg-deep); }
.dub6-standalone-history-text { margin-bottom:7px;color:var(--color-text-soft);font-size:11px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden; }
.dub6-standalone-history audio { width:100%;height:30px; }
.dub6-flow-asset-note {
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(34,197,94,.28);
  border-radius: 8px;
  background: rgba(34,197,94,.07);
  color: var(--color-text-soft);
  font-size: 11px;
  line-height: 1.55;
}

/* ── 响应式 ── */
@media (max-width: 900px) {
  .dubbing-page {
    flex-direction: column;
  }
  .dubbing-sidebar {
    width: 100%;
    min-width: unset;
    max-height: 400px;
  }
  .dubbing-toolbar-center {
    grid-template-columns: 1fr;
  }
  .dubbing-slider-group input[type="range"] { width: 100%; }
}

/* ═════════════════════════════════════════
   参考音面板（上传 + 保存 + 复用）
   ═════════════════════════════════════════ */

/* Tab 徽章 */
.dubbing-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--color-accent, #7c5cfc);
  border-radius: 8px;
}

/* ── @提及参考音选择器（仿豆包官方）── */
.dubbing-at-mention {
  position: fixed;
  z-index: 1000;
  min-width: 240px;
  max-width: 300px;
  background: var(--color-surface);
  border: 1px solid var(--color-brand);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.15);
  overflow: hidden;
  animation: dubbing-at-fadein 0.15s ease-out;
}
@keyframes dubbing-at-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dubbing-at-mention-header {
  padding: 8px 12px 4px;
  font-size: 11px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--color-line-soft);
}

.dubbing-at-mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}
.dubbing-at-mention-item:hover {
  background: rgba(139, 92, 246, 0.1);
}
.dubbing-at-mention-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dubbing-at-mention-meta {
  font-size: 10px;
  color: var(--color-muted);
  white-space: nowrap;
}
.dubbing-at-mention-empty {
  padding: 16px 12px;
  font-size: 12px;
  color: var(--color-muted);
  text-align: center;
}

/* 分析结果：完整提示词文本 */
.dubbing-analyze-prompt-full {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 13px;
  padding: 14px 16px;
  background: rgba(139, 92, 246, 0.04);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
}

/* 参考音面板容器 */
.dubbing-reference-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  gap: 12px;
  padding: 14px;
}

/* ── 上传区域 ── */
.dubbing-ref-upload-area {
  flex-shrink: 0;
}

/* 拖拽/点击上传区 */
.dubbing-ref-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  border: 2px dashed rgba(124, 92, 252, 0.35);
  border-radius: var(--radius-md);
  background: rgba(124, 92, 252, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--color-muted);
}
.dubbing-ref-dropzone:hover {
  border-color: rgba(124, 92, 252, 0.6);
  background: rgba(124, 92, 252, 0.08);
}
.dubbing-ref-dropzone p {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}
.dubbing-ref-dropzone span {
  font-size: 11px;
  color: var(--color-muted);
}

/* 预览区（已选文件） */
.dubbing-ref-preview {
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius-md);
}
.dubbing-ref-waveform {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(124, 92, 252, 0.1);
  border-radius: var(--radius-sm);
  color: var(--color-accent-light, #a78bfa);
  font-size: 13px;
  font-weight: 500;
}
.dubbing-ref-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dubbing-ref-name-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}
.dubbing-ref-name-input:focus {
  border-color: var(--color-accent, #7c5cfc);
  box-shadow: 0 0 0 2px rgba(124, 92, 252, 0.15);
}
.dubbing-ref-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent, #7c5cfc);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.dubbing-ref-save-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}
.dubbing-ref-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.dubbing-ref-save-btn.loading {
  opacity: 0.7;
}
.dubbing-ref-cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--color-muted);
  background: transparent;
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.dubbing-ref-cancel-btn:hover {
  color: var(--color-danger, #f87171);
  border-color: var(--color-danger, #f87171);
}

/* ── 已保存列表 ── */
.dubbing-ref-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  gap: 6px;
}
.dubbing-ref-list-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}
.dubbing-ref-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 30px 16px;
  color: var(--color-muted);
}
.dubbing-ref-empty p { font-size: 13px; }
.dubbing-ref-empty span { font-size: 11px; }

/* 参考音条目 */
.dubbing-ref-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.dubbing-ref-item:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(124, 92, 252, 0.3);
}
.dubbing-ref-item.selected {
  background: rgba(124, 92, 252, 0.12);
  border-color: var(--color-accent, #7c5cfc);
  box-shadow: 0 0 0 1px rgba(124, 92, 252, 0.2);
}

/* 选择按钮 */
.dubbing-ref-select {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 2px solid var(--color-line-soft);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
}
.dubbing-ref-item.selected .dubbing-ref-select {
  border-color: var(--color-accent, #7c5cfc);
  background: rgba(124, 92, 252, 0.15);
}
.dubbing-ref-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: var(--color-muted);
  transition: color 0.15s;
}
.dubbing-ref-icon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.dubbing-ref-item.selected .dubbing-ref-icon {
  color: var(--color-accent, #7c5cfc);
}
.dubbing-ref-icon > :last-child {
  position: absolute;
  bottom: -2px;
  right: -2px;
  color: #fff;
  background: var(--color-accent, #7c5cfc);
  border-radius: 50%;
  padding: 1px;
}

/* 信息 */
.dubbing-ref-info {
  flex: 1;
  min-width: 0;
}
.dubbing-ref-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dubbing-ref-meta {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: var(--color-muted);
  margin-top: 2px;
}

/* 操作按钮组 */
.dubbing-ref-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.dubbing-ref-play-mini,
.dubbing-ref-insert-btn,
.dubbing-ref-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
  color: var(--color-muted);
}
.dubbing-ref-play-mini:hover { color: var(--color-accent, #7c5cfc); background: rgba(124, 92, 252, 0.1); }
.dubbing-ref-insert-btn {
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
  width: 26px;
}
.dubbing-ref-insert-btn:hover { color: #22c55e; background: rgba(34, 197, 94, 0.1); }
.dubbing-ref-delete-btn:hover { color: var(--color-danger, #f87171); background: rgba(248, 113, 113, 0.1); }

/* ── 当前选中提示栏 ── */
.dubbing-ref-selected-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #22c55e;
  flex-shrink: 0;
}
.dubbing-ref-selected-bar strong {
  color: var(--color-text-primary);
}
.dubbing-ref-selected-bar button {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--color-muted);
  background: transparent;
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.dubbing-ref-selected-bar button:hover {
  color: var(--color-danger, #f87171);
  border-color: var(--color-danger, #f87171);
}

/* ── 新增：多选参考音相关样式 ── */

/* 已选数量标签 */
.dubbing-ref-selected-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-accent, #7c5cfc);
  background: rgba(124, 92, 252, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
}

/* 参考音已达上限 */
.dubbing-ref-item.max-reached {
  opacity: 0.45;
  cursor: not-allowed;
}
.dubbing-ref-item.max-reached:hover {
  background: transparent;
  border-color: var(--color-line-soft);
}

/* 音频编号角标（选中时显示在图标上） */
.dubbing-ref-audio-num,
.dubbing-at-mention-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7c5cfc, #a78bfa);
  border-radius: 50%;
}

/* @提及弹窗增强 */
.dubbing-at-mention-hint {
  margin-left: auto;
  font-size: 10px;
  color: var(--color-accent, #7c5cfc);
  background: rgba(124, 92, 252, 0.12);
  padding: 1px 6px;
  border-radius: 8px;
}
.dubbing-at-mention-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dubbing-at-mention-item.is-selected {
  background: rgba(124, 92, 252, 0.1);
}
.dubbing-at-mention-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.dubbing-at-mention-item.disabled:hover {
  background: transparent;
}

/* 手动 @ 按钮（文本框旁） */
.dubbing-at-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-accent, #7c5cfc);
  background: rgba(124, 92, 252, 0.08);
  border: 1px solid rgba(124, 92, 252, 0.25);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.dubbing-at-btn:hover {
  background: rgba(124, 92, 252, 0.15);
  border-color: var(--color-accent, #7c5cfc);
}
.dubbing-at-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(135deg, #7c5cfc, #a78bfa);
  color: #fff;
  border-radius: 50%;
}
.dubbing-at-btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #4ade80);
  border-radius: 8px;
}

/* ════════════════════════════════════════
   音频标签编辑器（AudioTagEditor）
   替代 textarea，支持内联 @音频N 蓝色药片标签
   ════════════════════════════════════════ */

.audio-tag-editor-wrapper {
  position: relative;
  width: 100%;
}

.audio-tag-editor {
  min-height: 200px;
  max-height: 360px;
  overflow-y: auto;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.7;
  outline: none;
  transition: border-color 0.2s;
  word-break: break-word;
  caret-color: #e2e8f0; /* 光标颜色也强制浅色 */
}

/* 强制所有文字浅色：阻止从外部粘贴带来的黑色 span 混入（黑字看不见的根因） */
.audio-tag-editor * {
  color: inherit !important;
  background: transparent !important;
}

/* 蓝色药片标签除外：保持品牌蓝底白字（内部图标/按钮保持透明底） */
.audio-tag-editor .audio-tag-pill {
  color: #fff !important;
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
}
.audio-tag-editor .audio-tag-pill-icon,
.audio-tag-editor .audio-tag-pill-close,
.audio-tag-editor .audio-tag-pill-name {
  color: #fff !important;
  background: transparent !important;
}

.audio-tag-editor:empty::before {
  content: attr(data-placeholder);
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  position: absolute;
  top: 14px;
  left: 16px;
  font-size: 13px;
  line-height: 1.7;
}

.audio-tag-editor:focus {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* ── 蓝色音频药片标签（核心 UI）── */
.audio-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  margin: 0 2px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  vertical-align: middle;
  cursor: default;
  user-select: none;
  white-space: nowrap;
  line-height: 1.6;
  transition: transform 0.15s, box-shadow 0.15s;
}

.audio-tag-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.audio-tag-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.audio-tag-pill-name {
  /* 名称文字 */
}

.audio-tag-pill-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 2px;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, background 0.15s;
}

.audio-tag-pill-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.25);
}

/* ── @ 参考音下拉选择框 ── */
.audio-tag-dropdown {
  position: fixed;
  z-index: 1000;
  min-width: 240px;
  max-width: 300px;
  background: #1e1e2e;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  padding: 6px;
  animation: audioTagFadeIn 0.15s ease-out;
}

@keyframes audioTagFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.audio-tag-dropdown-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.audio-tag-dropdown-hint {
  margin-left: auto;
  font-size: 11px;
  color: #8b5cf6;
  font-weight: 700;
}

/* ── 语音库 / 参考库 双分组 Tab ── */
.audio-tag-dropdown-tabs {
  display: flex;
  gap: 4px;
  padding: 0 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.audio-tag-dropdown-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  justify-content: center;
}

.audio-tag-dropdown-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
}

.audio-tag-dropdown-tab.active {
  background: rgba(139, 92, 246, 0.16);
  color: #a78bfa;
}

.audio-tag-dropdown-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.25);
  font-size: 10px;
  font-weight: 700;
}

.audio-tag-dropdown-list {
  max-height: 220px;
  overflow-y: auto;
}

.audio-tag-dropdown-empty {
  padding: 16px 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.audio-tag-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.audio-tag-dropdown-item:hover {
  background: rgba(139, 92, 246, 0.12);
}

.audio-tag-dropdown-item.is-selected {
  background: rgba(59, 130, 246, 0.12);
}

.audio-tag-dropdown-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.audio-tag-dropdown-item.disabled:hover {
  background: transparent;
}

.audio-tag-dropdown-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  flex-shrink: 0;
}

.audio-tag-dropdown-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.audio-tag-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.audio-tag-dropdown-name {
  font-size: 13px;
  font-weight: 500;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-tag-dropdown-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.audio-tag-dropdown-item.is-selected svg {
  color: #3b82f6;
  flex-shrink: 0;
}

/* ── 编辑器底部字数统计 ── */
.audio-tag-editor-footer {
  display: flex;
  justify-content: flex-end;
  padding: 6px 4px 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}

/* ═══════════ 统一音频播放进度条（参考音 / 历史 / 生成结果） ═══════════ */
/* 参考音/历史记录：独立一行的进度条 */
.dubbing-ref-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

/* 生成结果区：进度条独立一行（controls 下方） */
.dubbing-result-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.dubbing-ref-progress-row input[type="range"],
.dubbing-result-progress input[type="range"] {
  flex: 1;
  min-width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #8b5cf6 var(--prog, 0%), rgba(255, 255, 255, 0.12) var(--prog, 0%));
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}
.dubbing-ref-progress-row input[type="range"]::-webkit-slider-thumb,
.dubbing-result-progress input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #a78bfa;
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.dubbing-mini-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* 播放中按钮高亮 */
.dubbing-ref-play-mini.playing,
.dubbing-history-play-btn.playing,
.dubbing-play-btn.playing {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
}
.audio-tag-editor-wrapper {
  position: relative;
  width: 100%;
}

.audio-tag-editor {
  min-height: 200px;
  max-height: 360px;
  overflow-y: auto;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.7;
  outline: none;
  transition: border-color 0.2s;
  word-break: break-word;
  caret-color: #e2e8f0; /* 光标颜色也强制浅色 */
}

/* 强制所有文字浅色：阻止从外部粘贴带来的黑色 span 混入（黑字看不见的根因） */
.audio-tag-editor * {
  color: inherit !important;
  background: transparent !important;
}

/* 蓝色药片标签除外：保持品牌蓝底白字（内部图标/按钮保持透明底） */
.audio-tag-editor .audio-tag-pill {
  color: #fff !important;
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
}
.audio-tag-editor .audio-tag-pill-icon,
.audio-tag-editor .audio-tag-pill-close,
.audio-tag-editor .audio-tag-pill-name {
  color: #fff !important;
  background: transparent !important;
}

.audio-tag-editor:empty::before {
  content: attr(data-placeholder);
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  position: absolute;
  top: 14px;
  left: 16px;
  font-size: 13px;
  line-height: 1.7;
}

.audio-tag-editor:focus {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* ── 蓝色音频药片标签（核心 UI）── */
.audio-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  margin: 0 2px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  vertical-align: middle;
  cursor: default;
  user-select: none;
  white-space: nowrap;
  line-height: 1.6;
  transition: transform 0.15s, box-shadow 0.15s;
}

.audio-tag-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.audio-tag-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.audio-tag-pill-name {
  /* 名称文字 */
}

.audio-tag-pill-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 2px;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, background 0.15s;
}

.audio-tag-pill-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.25);
}

/* ── @ 参考音下拉选择框 ── */
.audio-tag-dropdown {
  position: fixed;
  z-index: 1000;
  min-width: 240px;
  max-width: 300px;
  background: #1e1e2e;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  padding: 6px;
  animation: audioTagFadeIn 0.15s ease-out;
}

@keyframes audioTagFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.audio-tag-dropdown-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.audio-tag-dropdown-hint {
  margin-left: auto;
  font-size: 11px;
  color: #8b5cf6;
  font-weight: 700;
}

/* ── 语音库 / 参考库 双分组 Tab ── */
.audio-tag-dropdown-tabs {
  display: flex;
  gap: 4px;
  padding: 0 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.audio-tag-dropdown-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  justify-content: center;
}

.audio-tag-dropdown-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
}

.audio-tag-dropdown-tab.active {
  background: rgba(139, 92, 246, 0.16);
  color: #a78bfa;
}

.audio-tag-dropdown-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.25);
  font-size: 10px;
  font-weight: 700;
}

.audio-tag-dropdown-list {
  max-height: 220px;
  overflow-y: auto;
}

.audio-tag-dropdown-empty {
  padding: 16px 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.audio-tag-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.audio-tag-dropdown-item:hover {
  background: rgba(139, 92, 246, 0.12);
}

.audio-tag-dropdown-item.is-selected {
  background: rgba(59, 130, 246, 0.12);
}

.audio-tag-dropdown-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.audio-tag-dropdown-item.disabled:hover {
  background: transparent;
}

.audio-tag-dropdown-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  flex-shrink: 0;
}

.audio-tag-dropdown-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.audio-tag-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.audio-tag-dropdown-name {
  font-size: 13px;
  font-weight: 500;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-tag-dropdown-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.audio-tag-dropdown-item.is-selected svg {
  color: #3b82f6;
  flex-shrink: 0;
}

/* ── 编辑器底部字数统计 ── */
.audio-tag-editor-footer {
  display: flex;
  justify-content: flex-end;
  padding: 6px 4px 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}


/* ── 音色播放/暂停按钮 ── */
.dubbing-voice-play-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(124, 92, 252, 0.16);
  border: 1px solid rgba(124, 92, 252, 0.4);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 2px;
}
.dubbing-voice-play-btn:hover {
  background: rgba(124, 92, 252, 0.35);
  transform: scale(1.08);
}
.dubbing-voice-card.previewing .dubbing-voice-play-btn {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.55);
}

/* 历史批次「推送为当前批次」高亮按钮 */
.dub6-restore-batch-btn.is-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a1203;
  border: none;
  font-weight: 700;
}
.dub6-restore-batch-btn.is-primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}
