/* ===== 智能口播工具 - 浅色主题双栏布局 ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --transition: all .2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== 顶部导航 ===== */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topnav-logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
}
.topnav-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
}
.topnav-title .accent { color: var(--primary); }
.topnav-auth {
  align-items: center;
  gap: 10px;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}
.btn-auth-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #fecaca;
  background: #fff7f7;
  color: #ef4444;
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-auth-logout:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.auth-locked {
  overflow: hidden;
}
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(16,185,129,.16), transparent 26%),
    radial-gradient(circle at 82% 12%, rgba(99,102,241,.18), transparent 28%),
    rgba(15, 23, 42, .62);
  backdrop-filter: blur(18px);
}
.auth-gate.is-hidden {
  display: none;
}
.auth-panel {
  width: min(440px, 100%);
  border: 1px solid rgba(255,255,255,.72);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.94));
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 28px 80px rgba(15,23,42,.22);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.auth-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  background: linear-gradient(135deg, #10b981, #6366f1);
  box-shadow: 0 14px 28px rgba(99,102,241,.28);
}
.auth-kicker {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
}
.auth-panel h1 {
  margin-top: 2px;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}
.auth-copy {
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 20px;
}
.auth-form {
  display: grid;
  gap: 14px;
}
.auth-form label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-weight: 700;
}
.auth-form input {
  height: 44px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  padding: 0 13px;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: var(--transition);
}
.auth-form input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99,102,241,.13);
}
.auth-submit {
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #6366f1);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(16,185,129,.18);
  transition: var(--transition);
}
.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(99,102,241,.24);
}
.auth-submit:disabled {
  opacity: .72;
  cursor: wait;
  transform: none;
}
.auth-message {
  min-height: 20px;
  color: #ef4444;
  font-size: 13px;
  font-weight: 700;
}
.auth-message.info {
  color: #0f9f6e;
}
.btn-settings {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}
.btn-settings:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ===== 主体布局 ===== */
.app-main {
  display: flex;
  gap: 16px;
  padding: 72px 20px 20px;
  min-height: 100vh;
  align-items: flex-start;
  background:
    radial-gradient(circle at 82% 10%, rgba(20,184,166,.12), transparent 28%),
    radial-gradient(circle at 50% 0%, rgba(99,102,241,.1), transparent 34%),
    var(--bg);
}
.left-col {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 72px;
  height: calc(100vh - 92px);
  max-height: calc(100vh - 82px);
  overflow: hidden;
}
.right-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.history-col {
  width: 292px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 92px);
}
.history-panel {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 16px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(248,250,252,.82)),
    radial-gradient(circle at 20% 0%, rgba(99,102,241,.16), transparent 38%),
    radial-gradient(circle at 100% 20%, rgba(16,185,129,.18), transparent 34%);
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: 0 18px 48px rgba(15,23,42,.1), inset 0 1px 0 rgba(255,255,255,.82);
  backdrop-filter: blur(16px);
}
.history-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(99,102,241,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.05) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 58%);
}
.history-panel-hero,
.history-section {
  position: relative;
  z-index: 1;
}
.history-panel-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.history-kicker {
  display: inline-flex;
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: #64748b;
}
.history-panel-hero h3 {
  font-size: 18px;
  line-height: 1.1;
  color: #0f172a;
  letter-spacing: -.5px;
}
.history-orb {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #4f46e5 48%, #14b8a6);
  box-shadow: 0 14px 28px rgba(79,70,229,.25);
}
.history-hero-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.history-clear-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(239,68,68,.18);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff, #fff1f2);
  color: #ef4444;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(239,68,68,.08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.history-clear-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(239,68,68,.42);
  box-shadow: 0 14px 24px rgba(239,68,68,.14);
}
.history-panel-copy {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
  padding: 10px 11px;
  border-radius: 14px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(226,232,240,.78);
}
.history-section {
  padding: 12px;
  border-radius: 17px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(226,232,240,.78);
  box-shadow: 0 10px 24px rgba(15,23,42,.045);
}
.history-section + .history-section {
  margin-top: 12px;
}
.history-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.history-section-head span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 900;
  color: #172554;
}
.history-section-head i {
  color: var(--primary);
}
.history-section-head small {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ===== 卡片 ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-icon { font-size: 14px; }
.card-icon.blue { color: #3b82f6; }
.card-icon.purple { color: #8b5cf6; }
.card-icon.green { color: #10b981; }
.card-icon.orange { color: #f59e0b; }
.card-body { padding: 14px 16px; }

.polish-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.polish-card .card-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.polish-card #polish-input,
.polish-card #polished-text {
  flex: 1;
  min-height: 128px;
  resize: none;
}
.polish-card #polished-text {
  min-height: 116px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 7px; }
.btn-clone {
  background: #f3f4f6;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-clone:hover { border-color: var(--primary); color: var(--primary); }
.btn.loading { opacity: .6; pointer-events: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== URL 输入栏 ===== */
.url-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  margin-bottom: 10px;
  transition: var(--transition);
}
.url-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.url-icon { color: var(--text-light); font-size: 13px; }
.url-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 0;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.url-bar input::placeholder { color: var(--text-light); }

/* ===== 平台标签 ===== */
.platform-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.ptag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ===== 标签行 ===== */
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.result-label { color: var(--success); }
.field-actions { display: flex; align-items: center; gap: 6px; }
.word-count { font-size: 11px; color: var(--text-light); }
.btn-icon-sm {
  width: 24px; height: 24px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-light);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-icon-sm:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 文本域 ===== */
.textarea-auto, .textarea-sm {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  background: #fafafa;
  resize: none;
  transition: var(--transition);
  line-height: 1.6;
}
.textarea-auto:focus, .textarea-sm:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
  background: #fff;
}
.textarea-auto::placeholder, .textarea-sm::placeholder { color: var(--text-light); }
.textarea-auto { min-height: 100px; max-height: 200px; overflow-y: auto; }
.textarea-sm { height: 90px; }

/* ===== 箭头分隔符 ===== */
.arrow-divider {
  text-align: center;
  color: var(--text-light);
  font-size: 16px;
  margin: 8px 0;
}

/* ===== 润色控制区 ===== */
.polish-controls { margin-top: 10px; }
.style-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.chip {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.chip.active, .chip:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.intensity-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.intensity-wrap { flex: 1; }
.intensity-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}
.intensity-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ===== TTS Tabs ===== */
.tts-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 12px;
}
.tts-tab-btn {
  flex: 1;
  padding: 6px 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tts-tab-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.tts-tab-panel { display: none; }
.tts-tab-panel.active { display: block; }

/* ===== 音色列表 ===== */
.voice-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
  color: var(--text-light);
  font-size: 12px;
  text-align: center;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  margin-bottom: 8px;
}
.voice-placeholder i { font-size: 22px; color: #cbd5e1; }
.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.voice-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.voice-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(99,102,241,.1); }
.voice-card.selected { border-color: var(--primary); background: rgba(99,102,241,.06); }
.voice-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  margin: 0 auto 6px;
}
.voice-name { font-size: 12px; font-weight: 600; color: var(--text); }
.voice-desc { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ===== TTS 参数网格 ===== */
.tts-params-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.setting-item {}
.setting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.setting-header label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.setting-val { font-size: 11.5px; font-weight: 700; color: var(--primary); }
.range-stepper {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 9px;
}
.range-step-btn {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(99,102,241,.18);
  border-radius: 10px;
  background: linear-gradient(135deg, #fff, #eef2ff);
  color: var(--primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
  box-shadow: 0 8px 16px rgba(99,102,241,.08);
}
.range-step-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(99,102,241,.42);
  background: linear-gradient(135deg, #eef2ff, #f0fdfa);
  box-shadow: 0 12px 20px rgba(99,102,241,.14);
}
.range-step-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(99,102,241,.1);
}
.range-step-btn i {
  font-size: 11px;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  height: 4px;
}
.form-select, .form-select-sm {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12px;
  color: var(--text);
  background: #fff;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.form-select:focus, .form-select-sm:focus { border-color: var(--primary); }

/* ===== 配音结果 ===== */
.tts-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f7fffb 52%, #eff6ff 100%);
  border: 1px solid rgba(16,185,129,.24);
  border-radius: 16px;
  margin-top: 12px;
  box-shadow: 0 10px 28px rgba(15,23,42,.06), inset 0 1px 0 rgba(255,255,255,.86);
}
.tts-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.result-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 5px;
}
.result-badge.success { color: var(--success); }
.audio-download-btn {
  border: none;
  min-width: 132px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #10b981 0%, #14b8a6 48%, #3b82f6 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(16,185,129,.24);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.audio-download-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 14px 26px rgba(16,185,129,.3);
}
.audio-download-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(16,185,129,.22);
}
.audio-download-btn i {
  font-size: 13px;
}
.full-audio { width: 100%; height: 38px; border-radius: 999px; }
.history-strip {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 1px;
}
.history-strip.has-items {
  display: flex;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 252px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 4px 1px 0;
  scroll-behavior: smooth;
}
.history-list.has-items {
  display: flex;
}
.history-list:not(.has-items)::before {
  content: '暂无记录，生成后会出现在这里';
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(148,163,184,.55);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  background: rgba(248,250,252,.76);
}
.history-pill {
  width: 100%;
  border: 1px solid rgba(99,102,241,.16);
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.9));
  color: #334155;
  border-radius: 15px;
  padding: 10px 11px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 18px rgba(15,23,42,.04);
  text-align: left;
  position: relative;
}
.history-pill:hover,
.history-pill.active {
  border-color: var(--primary);
  color: var(--primary);
  background: linear-gradient(135deg, #eef2ff, #f0fdfa);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(99,102,241,.13);
}
.history-pill i {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  box-shadow: 0 8px 14px rgba(99,102,241,.18);
}
.history-card-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.history-card-main strong {
  color: inherit;
  font-size: 13px;
  line-height: 1.25;
}
.history-card-main em {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #94a3b8;
  font-style: normal;
  font-size: 11.2px;
  font-weight: 800;
}
.history-card-date {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .01em;
}
.history-card-meta {
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 800;
}
.history-card-actions {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}
.history-rename-btn,
.history-delete-btn {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid rgba(148,163,184,.26);
  border-radius: 9px;
  background: rgba(255,255,255,.78);
  color: #94a3b8;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
}
.history-rename-btn:hover {
  color: var(--primary);
  border-color: rgba(99,102,241,.34);
  background: #eef2ff;
}
.history-delete-btn {
  color: #f87171;
  border-color: rgba(248,113,113,.22);
  background: rgba(255,255,255,.82);
}
.history-delete-btn:hover {
  color: #dc2626;
  border-color: rgba(220,38,38,.34);
  background: #fff1f2;
}
.history-rename-btn i,
.history-delete-btn i {
  width: auto;
  height: auto;
  display: inline;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: currentColor;
  font-size: 11px;
}
.history-rename-popover {
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}
.history-rename-popover.show {
  opacity: 1;
  visibility: visible;
}
.history-rename-panel {
  pointer-events: auto;
  width: min(320px, calc(100vw - 32px));
  padding: 14px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,250,252,.95)),
    radial-gradient(circle at 100% 0%, rgba(99,102,241,.14), transparent 38%);
  border: 1px solid rgba(226,232,240,.95);
  box-shadow: 0 22px 52px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  transform-origin: top left;
  animation: historyRenameIn .18s ease both;
}
.history-rename-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.history-rename-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #14b8a6);
  box-shadow: 0 10px 18px rgba(79,70,229,.22);
}
.history-rename-top strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  color: #0f172a;
}
.history-rename-top small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
}
.history-rename-input {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(148,163,184,.34);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-weight: 800;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.history-rename-input:focus {
  border-color: rgba(99,102,241,.62);
  box-shadow: 0 0 0 4px rgba(99,102,241,.1);
}
.history-rename-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.history-rename-cancel,
.history-rename-save {
  height: 34px;
  border-radius: 11px;
  padding: 0 13px;
  border: 1px solid rgba(148,163,184,.25);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.history-rename-cancel {
  background: #fff;
  color: #64748b;
}
.history-rename-save {
  border-color: transparent;
  background: linear-gradient(135deg, #4f46e5, #14b8a6);
  color: #fff;
  box-shadow: 0 10px 18px rgba(79,70,229,.2);
}
.history-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15,23,42,.28);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}
.history-confirm-modal.show {
  opacity: 1;
  visibility: visible;
}
.history-confirm-box {
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,250,252,.95)),
    radial-gradient(circle at 100% 0%, rgba(239,68,68,.12), transparent 38%);
  border: 1px solid rgba(226,232,240,.95);
  box-shadow: 0 24px 60px rgba(15,23,42,.22), inset 0 1px 0 rgba(255,255,255,.9);
  animation: historyConfirmIn .18s ease both;
}
.history-confirm-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #ef4444;
  background: #fff1f2;
  border: 1px solid rgba(239,68,68,.18);
  box-shadow: 0 12px 20px rgba(239,68,68,.12);
}
.history-confirm-title {
  display: block;
  font-size: 16px;
  line-height: 1.3;
  color: #0f172a;
}
.history-confirm-text {
  margin-top: 7px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}
.history-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.history-confirm-cancel,
.history-confirm-ok {
  height: 36px;
  border-radius: 11px;
  padding: 0 14px;
  border: 1px solid rgba(148,163,184,.25);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.history-confirm-cancel {
  background: #fff;
  color: #64748b;
}
.history-confirm-ok {
  border-color: transparent;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  box-shadow: 0 12px 20px rgba(239,68,68,.22);
}
@keyframes historyConfirmIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes historyRenameIn {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.history-pill:hover .history-card-main em,
.history-pill.active .history-card-main em {
  color: #64748b;
}

/* ===== 克隆上传区 ===== */
.clone-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: #fafafa;
}
.clone-upload-zone:hover, .clone-upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(99,102,241,.04);
}
.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  pointer-events: auto;
}
.upload-content i { font-size: 26px; color: var(--text-light); }
.upload-title { font-size: 13px; font-weight: 600; }
.upload-hint { font-size: 11.5px; color: var(--text-light); }

.clone-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.clone-file {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
  flex-shrink: 0;
}
.clone-name-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  outline: none;
  transition: var(--transition);
  min-width: 100px;
}
.clone-name-input:focus { border-color: var(--primary); }

.clone-list { display: flex; flex-direction: column; gap: 6px; }
.clone-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.clone-item:hover, .clone-item.selected {
  border-color: var(--primary);
  background: rgba(99,102,241,.05);
}
.clone-avatar { font-size: 22px; }
.clone-info {}
.clone-name { font-size: 13px; font-weight: 600; color: var(--text); }
.clone-date { font-size: 11px; color: var(--text-light); }
.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--text-light);
}
.empty-state i { font-size: 28px; margin-bottom: 8px; display: block; }
.empty-state p { font-size: 13px; }

/* ===== 视频上传区 ===== */
.video-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: #fafafa;
  min-height: 220px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.video-upload-zone:hover, .video-upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(99,102,241,.04);
}
.video-upload-zone .upload-content {
  width: 100%;
  min-height: 188px;
  justify-content: center;
}
.video-picker-row {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  overflow-x: auto;
  padding: 0 2px 8px;
}
.video-thumb-card,
.video-add-card {
  width: 104px;
  flex: 0 0 104px;
}
.video-thumb-card {
  position: relative;
  cursor: default;
}
.video-thumb-card.selected .video-thumb-media {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,.14);
}
.video-thumb-media {
  position: relative;
  width: 104px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 7px;
  border: 2px solid #e2e8f0;
  background: #0f172a;
}
.video-thumb-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-owner-badge {
  position: absolute;
  left: 7px;
  top: 7px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  color: #7c3aed;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.video-card-close,
.video-card-play {
  position: absolute;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.video-card-close {
  right: 6px;
  top: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #64748b;
  background: rgba(255,255,255,.92);
  font-size: 11px;
}
.video-card-close:hover {
  color: #ef4444;
}
.video-card-play {
  right: 7px;
  bottom: 7px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: rgba(15,23,42,.62);
  border: 1px solid rgba(255,255,255,.65);
  font-size: 11px;
}
.video-card-play:hover {
  background: rgba(249,115,22,.92);
}
.video-thumb-name {
  margin-top: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-add-card {
  aspect-ratio: 3 / 4;
  border: 1.5px dashed #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.video-add-card i {
  font-size: 22px;
  color: #64748b;
}
.video-add-card span {
  font-size: 12px;
  color: #64748b;
}
.video-add-card:hover {
  border-color: #f97316;
  color: #f97316;
  background: #fff7ed;
}
.video-add-card:hover i,
.video-add-card:hover span {
  color: #f97316;
}
.video-preview {
  width: 100%;
  max-height: 220px;
  border-radius: var(--radius-sm);
  background: #000;
}
.video-file-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--success);
  margin-top: 6px;
  font-weight: 500;
}

/* ===== 提示条 ===== */
.alert-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #3b82f6;
  margin-bottom: 10px;
}

/* ===== 音频上传 mini 区 ===== */
.mini-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12.5px;
  background: #fafafa;
  transition: var(--transition);
  margin-bottom: 10px;
}
.mini-upload:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 对口型选项 ===== */
.lipsync-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.option-info {}
.option-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 5px;
}
.option-desc { font-size: 11px; color: var(--text-light); margin-top: 1px; }

/* ===== Toggle 开关 ===== */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 11px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ===== 进度条 ===== */
.lipsync-progress {
  margin-bottom: 12px;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.progress-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  transition: width .5s ease;
}

/* ===== 对口型结果 ===== */
.lipsync-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.result-actions { display: flex; gap: 8px; }

/* ===== 生成按钮 ===== */
.btn-generate {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: .5px;
}
.btn-generate:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.3); }
.btn-generate:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-generate.loading { opacity: .7; pointer-events: none; }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(520px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  min-width: 200px;
  max-width: 100%;
  box-shadow: var(--shadow-md);
  transform: translateY(-16px);
  transition: transform .3s ease;
  opacity: 1;
  pointer-events: auto;
}
.toast.show { transform: translateY(0); }
.toast-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.toast-error { background: #fff1f2; border: 1px solid #fecdd3; color: #dc2626; }
.toast-warning { background: #fffbeb; border: 1px solid #fde68a; color: #d97706; }

/* ===== 响应式 ===== */
@media (max-width: 1180px) {
  .app-main {
    flex-wrap: wrap;
  }
  .history-col {
    width: 100%;
    position: static;
    max-height: none;
  }
  .history-panel {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) 1fr 1fr;
    gap: 12px;
    align-items: stretch;
  }
  .history-panel-copy {
    margin-bottom: 0;
  }
  .history-section + .history-section {
    margin-top: 0;
  }
}

@media (max-width: 900px) {
  .app-main { flex-direction: column; }
  .left-col { width: 100%; position: static; height: auto; max-height: none; overflow: visible; }
  .right-col { width: 100%; }
  .history-col { width: 100%; }
  .history-panel {
    display: block;
  }
  .history-section + .history-section {
    margin-top: 12px;
  }
  .history-panel-copy {
    margin-bottom: 14px;
  }
  .polish-card { flex: none; }
}

/* ===== 克隆声音 Modal ===== */
.clone-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.clone-modal-box {
  background: #fff;
  border-radius: 18px;
  width: 500px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
}
.clone-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.clone-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.clone-modal-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #fb923c, #f97316);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}
.clone-modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  line-height: 1;
}
.clone-modal-close:hover { background: #e2e8f0; color: var(--text); }
.clone-modal-body {
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.clone-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.clone-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.clone-dropzone:hover, .clone-dropzone.dragover {
  border-color: #f97316;
  background: #fff7ed;
}
.clone-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.clone-drop-icon {
  width: 40px;
  height: 40px;
  background: #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 16px;
  margin-bottom: 4px;
}
.clone-drop-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.clone-drop-hint {
  font-size: 12px;
  color: var(--text-light);
}
.clone-file-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  justify-content: center;
}
.clone-file-clear {
  border: none;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}
.clone-file-clear:hover { color: var(--danger); background: #fff1f2; }
.clone-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
  outline: none;
  transition: var(--transition);
}
.clone-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.clone-hint-text {
  font-size: 11.5px;
  color: var(--text-light);
  margin: 6px 0 10px;
  line-height: 1.5;
}
.btn-preview-clone {
  background: #ede9fe;
  color: #7c3aed;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-preview-clone:hover { background: #ddd6fe; }
.btn-preview-clone:disabled { opacity: .6; cursor: not-allowed; }
.clone-name-field {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}
.clone-name-field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.clone-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 18px;
  border-top: 1px solid var(--border);
}
.btn-modal-cancel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-modal-cancel:hover { background: #f1f5f9; color: var(--text); }
.btn-modal-save {
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-modal-save:hover { filter: brightness(1.06); box-shadow: 0 4px 12px rgba(249,115,22,.3); }
.btn-modal-save:disabled { opacity: .6; cursor: not-allowed; filter: none; }

/* ===== 声音选择头部 ===== */
.voice-select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.voice-select-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.voice-select-title i { color: var(--primary); }
.btn-clone-fancy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid #fed7aa;
  background: #fff;
  color: #f97316;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-clone-fancy:hover { background: #fff7ed; border-color: #f97316; }

/* 修复克隆弹窗"+"图标居中 */
.clone-drop-icon {
  width: 40px;
  height: 40px;
  background: #e2e8f0;
  border-radius: 50%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #94a3b8;
  font-size: 16px;
  margin: 0 auto 4px;
  line-height: 1;
}

/* ====== 任务状态栏 ====== */
.task-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 12px;
  gap: 16px;
}
.task-info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.task-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #334155;
}
.task-info-label {
  color: #64748b;
  white-space: nowrap;
}
.task-info-value {
  font-weight: 500;
  color: #0f172a;
}
.task-info-value.accent {
  color: #4f46e5;
}
.btn-generate-compact {
  flex-shrink: 0;
  padding: 12px 28px;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
  transition: background .2s, box-shadow .2s, opacity .2s;
  white-space: nowrap;
}
.btn-generate-compact:hover {
  background: #4338ca;
  box-shadow: 0 4px 12px rgba(79,70,229,.35);
}
.btn-generate-compact:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.btn-generate-compact.loading {
  opacity: .7;
  cursor: not-allowed;
}

/* ====== 底部操作栏（单行横向）====== */
.bottom-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  border-radius: 14px;
  padding: 14px 20px;
  margin-top: 16px;
}
.bottom-status-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
}
/* 覆盖旧的竖向 task-info-list */
.task-info-list {
  flex-direction: row !important;
  align-items: center !important;
  gap: 24px !important;
}

/* ====== 底部操作栏视觉打磨 ====== */
.bottom-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  padding: 16px 24px;
  margin-top: 16px;
}
.bottom-status-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 32px;
}
.task-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.task-info-label {
  color: #94a3b8;
  white-space: nowrap;
}
.task-info-value {
  color: #1e293b;
  font-weight: 500;
  white-space: nowrap;
}
.task-info-value.accent {
  color: #4f46e5;
  font-weight: 500;
}

/* ====== 音色卡片网格 ====== */
.voice-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 0;
}
.voice-card-item {
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: #fff;
}
.voice-card-item:hover { background: #f8fafc; }
.voice-card-item.selected { border-color: #f97316; background: #fff7ed; }
.voice-card-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: #f97316;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.2s;
}
.voice-card-item.selected .voice-card-check { opacity: 1; }
.voice-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.voice-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}
.voice-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.voice-play-btn {
  position: absolute;
  bottom: -3px;
  left: -3px;
  width: 20px;
  height: 20px;
  background: #f97316;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.15s;
}
.voice-play-btn:hover { transform: scale(1.15); }
.voice-play-btn svg { width: 10px; height: 10px; fill: #fff; }
.voice-card-info {
  display: flex;
  flex-direction: column;
  margin-left: 10px;
  min-width: 0;
}
.voice-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}
.voice-badge-my {
  font-size: 10px;
  background: #f97316;
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}
.voice-card-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
