/* 语音配音页面 — 遵循项目样式规范 */

.voice-dubbing {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 左右分栏 */
.dubbing-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  flex: 1;
  min-height: 0;
}

/* ========== 左侧 ========== */

.voice-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  min-height: 0;
  overflow: hidden;
}

.voice-sidebar > .voice-section:first-child {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.voice-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.voice-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.voice-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.voice-section-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.link-btn {
  font-size: var(--font-sm);
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

/* Tab — 遵循项目选项卡风格 */
.voice-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
}

.voice-tab {
  padding: 6px 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.voice-tab:hover {
  color: var(--primary);
}

.voice-tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* 试听条 */
.voice-preview-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--primary-light);
  border-radius: var(--radius-md);
}

.voice-preview-audio {
  flex: 1;
  height: 28px;
}

/* 音色列表 — 遵循 .option-card 规范 */
.voice-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.voice-row {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.voice-row:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.voice-row.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.voice-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.voice-row-info {
  flex: 1;
  min-width: 0;
}

.voice-row-name {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.voice-row-desc {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

.voice-row-desc-inline {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-left: 8px;
  font-weight: 400;
}

/* 标签 — 遵循全局 .tag 风格，不覆盖 */
.voice-row-name .tag {
  font-size: var(--font-xs);
  padding: 1px 5px;
}

/* 试听按钮 — 图标按钮风格 */
.preview-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1;
  font-variant-emoji: text;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.preview-icon:hover {
  background: var(--primary);
  color: var(--text-inverse);
}

.preview-icon:disabled {
  opacity: 0.5;
  cursor: default;
}

/* 空状态 */
.voice-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xl);
  text-align: center;
  margin: auto;
}

.voice-empty-title {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.voice-empty-desc {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
}

.voice-empty-action {
  margin-top: 4px;
  font-size: var(--font-sm);
}

/* 语速 */
.speed-value {
  font-size: var(--font-sm);
  color: var(--primary);
  font-weight: 600;
}

.speed-value small {
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 4px;
}

.speed-slider-wrap {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  width: 100%;
}

.speed-slider-wrap span {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 36px;
  text-align: center;
}

.speed-slider-wrap .slider-input {
  flex: 1;
}

/* 底部生成按钮 — 复用全局 .btn-primary，只做宽度调整 */
.voice-generate-wrap {
  margin-top: auto;
  padding-top: var(--spacing-md);
}

.voice-generate-wrap .btn {
  width: 100%;
}

.voice-generate-btns {
  display: flex;
  gap: var(--spacing-sm);
}

.voice-generate-btns .btn {
  flex: 1;
}

/* ========== 右侧 ========== */

.script-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.script-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.script-content-meta {
  font-size: var(--font-xs);
  font-weight: 400;
  color: var(--text-secondary);
}

/* textarea 撑满剩余空间 */
.script-content textarea {
  flex: 1;
  min-height: 0;
  line-height: 1.8;
}

/* 试听播放器（当前由右侧图标按钮直接控制，无需展开区域） */
.voice-preview-inline {
  display: none;
}
