/* 文声视频 — 极简唯美，中老年友好；配色匹配深海蓝金属 logo */
:root {
  --bg: #eef2f8;
  --surface: #ffffff;
  --ink: #0d1f3a;
  --ink-soft: #4a5a78;
  --ink-faint: #8a96a8;
  --line: #dbe3ee;
  --accent: #2b3a67;
  --accent-soft: #e3eaf5;
  --accent-strong: #1a2a4a;
  --accent-glow: #4a6098;
  --warn: #c45843;
  --ok: #4a8a5a;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 6px 24px rgba(26, 42, 74, 0.08);
  --shadow-lg: 0 16px 48px rgba(26, 42, 74, 0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─────────── Topbar ─────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  max-width: 960px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 46px; height: 46px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(26, 42, 74, 0.22);
  object-fit: cover;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo {
  font-size: 22px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--accent);
}
.tag { color: var(--ink-faint); font-size: 13px; margin-top: 2px; }
.user-area { font-size: 15px; }

/* ─────────── Container ─────────── */
.container { max-width: 960px; margin: 0 auto; padding: 8px 24px 60px; }

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.card h1 {
  margin: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: 0.3px;
}
.card h2 {
  margin: 0 0 22px; font-size: 22px; font-weight: 600;
}
.subtitle { color: var(--ink-soft); margin: 0 0 22px; font-size: 15px; }

/* ─────────── Textarea ─────────── */
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  background: #f4f7fb;
  outline: none;
  transition: border-color 0.2s;
}
textarea:focus { border-color: var(--accent); }
.meta-row { text-align: right; color: var(--ink-faint); font-size: 13px; margin-top: 8px; }

/* ─────────── Config grid ─────────── */
.config-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px;
  margin-top: 22px;
}
.config-block {
  background: #f4f7fb;
  border-radius: var(--radius);
  padding: 16px 18px;
}
.config-block:nth-child(3) { grid-column: 1 / span 2; }
.config-label { font-size: 14px; color: var(--ink-soft); margin-bottom: 10px; }

.voice-list, .bg-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.option-chip {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  background: var(--surface);
  display: flex; align-items: center; gap: 8px;
  transition: all 0.15s;
  user-select: none;
}
.option-chip:hover { border-color: var(--accent); }
.option-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 500;
}
.option-chip .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-color, var(--ink-faint));
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.option-chip.active .dot { box-shadow: 0 0 0 1px var(--accent); }
.option-chip .badge {
  margin-left: auto; font-size: 11px; color: var(--accent); background: var(--accent-soft);
  padding: 1px 6px; border-radius: 4px;
}

.upload-btn {
  display: inline-flex; align-items: center;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}
.upload-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─────────── Slider ─────────── */
.slider { width: 100%; accent-color: var(--accent); }

/* ─────────── Action row ─────────── */
.action-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.quota-tip { color: var(--ink-faint); font-size: 14px; }

/* ─────────── Buttons ─────────── */
.btn-primary {
  background: linear-gradient(135deg, #1a2a4a, #2b3a67 60%, #3d5a7f);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 16px; font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(26, 42, 74, 0.28);
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(26, 42, 74, 0.36); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { background: #b8c0ce; cursor: not-allowed; box-shadow: none; }
.btn-primary.block { width: 100%; margin-top: 12px; }

.btn-text {
  background: none; border: none;
  color: var(--accent); cursor: pointer;
  font-size: 15px; padding: 8px 12px;
}
.btn-text:hover { color: var(--accent-strong); }
.btn-text:disabled { color: var(--ink-faint); cursor: not-allowed; }

.btn-ghost {
  background: var(--surface); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 10px;
  font-size: 14px; color: var(--ink-soft); cursor: pointer;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ─────────── Library ─────────── */
.library-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.empty-state {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-faint);
  background: #f4f7fb;
  border-radius: var(--radius);
}
.video-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface);
  transition: box-shadow 0.15s;
}
.video-card:hover { box-shadow: var(--shadow); }
.video-card video { width: 100%; border-radius: 8px; background: #000; max-height: 200px; }
.video-card .vc-title { font-size: 15px; font-weight: 500; line-height: 1.4; }
.video-card .vc-meta { color: var(--ink-faint); font-size: 12px; }
.video-card .vc-status {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 12px; background: #f4f7fb; color: var(--ink-soft);
}
.video-card .vc-status.done { background: #e2efe6; color: var(--ok); }
.video-card .vc-status.generating { background: #e3eaf5; color: var(--accent-strong); }
.video-card .vc-status.failed { background: #fde7e3; color: var(--warn); }
.video-card .vc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.video-card .vc-error { color: var(--warn); font-size: 12px; }

/* ─────────── Modal ─────────── */
.modal-mask {
  position: fixed; inset: 0; background: rgba(13, 31, 58, 0.48);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px; width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal h3 { margin: 0 0 20px; font-size: 20px; }
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 26px;
  color: var(--ink-faint); cursor: pointer;
  line-height: 1;
}
.tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: none;
  padding: 10px 16px;
  font-size: 15px; cursor: pointer;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.tab-panel input[type=tel], .tab-panel input[type=text] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
}
.tab-panel input:focus { border-color: var(--accent); }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row input { flex: 1; }
.hint { color: var(--ink-faint); font-size: 14px; margin: 0 0 16px; }

/* ─────────── Toast ─────────── */
.toast {
  position: fixed; left: 50%; bottom: 40px;
  transform: translateX(-50%);
  background: rgba(20, 16, 40, 0.92); color: white;
  padding: 12px 22px; border-radius: 24px;
  font-size: 14px; z-index: 200;
  box-shadow: var(--shadow-lg);
}
.toast[hidden] { display: none; }

/* ─────────── Mobile ─────────── */
@media (max-width: 720px) {
  .topbar { padding: 14px 18px; }
  .container { padding: 4px 14px 40px; }
  .card { padding: 22px 18px; }
  .config-grid { grid-template-columns: 1fr; }
  .config-block:nth-child(3) { grid-column: 1; }
  .action-row { flex-direction: column; gap: 12px; align-items: stretch; }
  .btn-primary { width: 100%; }
}