/* 口播工坊 · 深色玻璃质感 */
:root {
  --bg: #0a0c12;
  --card: rgba(36, 40, 54, 0.55);
  --card-solid: rgba(30, 34, 46, 0.62);
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.055);
  --text: #f3f4f6;
  --muted: #9aa3b5;
  --dim: #7a8499;
  --chip: rgba(255, 255, 255, 0.06);
  --chip-on: rgba(255, 255, 255, 0.14);
  --white: #f4f5f8;
  --ink: #12141a;
  --accent: #7dffd0;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --shadow-card:
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    /* 左上翠绿光晕 —— 参考图主氛围 */
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(28, 120, 95, 0.55), transparent 58%),
    /* 右上褐灰光晕 */
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(95, 75, 55, 0.32), transparent 52%),
    /* 右侧冷蓝 */
    radial-gradient(ellipse 45% 40% at 92% 42%, rgba(55, 70, 120, 0.22), transparent 55%),
    /* 底部压暗 */
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(8, 10, 18, 0.9), transparent 55%),
    linear-gradient(165deg, #141820 0%, #0a0c12 42%, #08090e 100%);
}
.aurora::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 35% at 18% 18%, rgba(60, 180, 140, 0.12), transparent 70%),
    radial-gradient(ellipse 40% 30% at 82% 12%, rgba(140, 110, 70, 0.1), transparent 70%);
  filter: blur(40px);
}
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.topbar, .stepper, .workspace, .stage {
  position: relative;
  z-index: 1;
}
.workspace[hidden] { display: none !important; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px 0;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.linkish {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linkish:hover {
  color: #c8e6dc;
}
.auth-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(240px, 42vw);
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 255, 208, 0.22);
  background: rgba(125, 255, 208, 0.08);
  color: #e8f5f0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.auth-chip:hover {
  background: rgba(125, 255, 208, 0.14);
  border-color: rgba(125, 255, 208, 0.38);
}
.auth-chip-name {
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 12em;
}
.auth-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(125, 255, 208, 0.35);
  background: linear-gradient(135deg, rgba(125, 255, 208, 0.18), rgba(125, 255, 208, 0.08));
  color: #e8faf3;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.auth-entry:hover {
  border-color: rgba(125, 255, 208, 0.55);
  background: linear-gradient(135deg, rgba(125, 255, 208, 0.26), rgba(125, 255, 208, 0.12));
  box-shadow: 0 6px 18px rgba(125, 255, 208, 0.12);
}
.btn-xs {
  width: auto !important;
  margin-top: 0 !important;
  padding: 6px 14px !important;
  font-size: 12px !important;
  min-height: 32px !important;
  white-space: nowrap;
  flex-shrink: 0;
}
.seg-2 {
  grid-template-columns: 1fr 1fr;
}
.seg-2 .seg-item {
  padding: 9px 8px;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

/* 朗读方式：四卡片 */
.tts-pick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.tts-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 12px 12px 11px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s, color 0.14s;
}
.tts-card:hover {
  border-color: rgba(125, 255, 208, 0.22);
  background: rgba(0, 0, 0, 0.38);
}
.tts-card.on {
  border-color: rgba(125, 255, 208, 0.45);
  background: linear-gradient(160deg, rgba(125, 255, 208, 0.12), rgba(0, 0, 0, 0.32));
  color: #eefaf5;
  box-shadow:
    0 0 0 1px rgba(125, 255, 208, 0.12),
    0 8px 20px rgba(0, 0, 0, 0.28);
}
.tts-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.tts-card-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: inherit;
  white-space: nowrap;
}
.tts-card.on .tts-card-title {
  color: #fff;
}
.tts-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.tts-badge.free {
  background: rgba(125, 255, 208, 0.16);
  color: #7dffd0;
}
.tts-badge.paid {
  background: rgba(255, 196, 120, 0.16);
  color: #ffc478;
}
.tts-card.on .tts-badge.free {
  background: rgba(125, 255, 208, 0.22);
}
.tts-card.on .tts-badge.paid {
  background: rgba(255, 196, 120, 0.22);
}
.tts-card-desc {
  font-size: 11px;
  line-height: 1.45;
  color: var(--dim);
  white-space: normal;
}
.tts-card.on .tts-card-desc {
  color: rgba(232, 245, 240, 0.78);
}
.tts-hint {
  margin-top: 8px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.hidden {
  display: none !important;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 12, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}
.modal[hidden] {
  display: none !important;
}
.auth-card {
  position: relative;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 28px 24px 24px;
  border-radius: 20px;
  border: 1px solid rgba(125, 255, 208, 0.22);
  background:
    linear-gradient(180deg, rgba(28, 42, 46, 0.98) 0%, rgba(16, 24, 28, 0.98) 100%);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
#auth-panel-guest,
#auth-panel-user {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
#auth-panel-guest[hidden],
#auth-panel-user[hidden] {
  display: none !important;
}
.auth-card-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.auth-card-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.auth-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-right: 32px;
}
.auth-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid rgba(125, 255, 208, 0.28);
  background: rgba(125, 255, 208, 0.1);
  color: var(--accent);
}
.auth-card-icon--ok {
  border-color: rgba(125, 255, 208, 0.4);
  background: rgba(125, 255, 208, 0.16);
}
.auth-card-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.auth-card-title {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  color: #f4faf7;
}
.auth-card-user {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 750;
  color: #f4faf7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-bonus-line {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
  color: rgba(125, 255, 208, 0.85);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
}
.auth-tabs[hidden] {
  display: none !important;
}
.auth-tab {
  min-height: 40px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tab.on {
  background: rgba(125, 255, 208, 0.14);
  color: #e8faf3;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-field[hidden] {
  display: none !important;
}
.auth-field input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.32);
  color: #e8f5f0;
  font-size: 14px;
}
.auth-field input::placeholder {
  color: var(--dim);
}
.auth-field input:focus {
  outline: none;
  border-color: rgba(125, 255, 208, 0.45);
  box-shadow: 0 0 0 3px rgba(125, 255, 208, 0.12);
}
.auth-error {
  min-height: 1.2em;
  margin: 0;
  color: #ff8f8f;
  font-size: 13px;
}
.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 4px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #3d9f84 0%, #2a7a66 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(61, 159, 132, 0.28);
}
.auth-submit:hover {
  filter: brightness(1.06);
}
.auth-forgot-link {
  display: inline-flex;
  align-self: center;
  margin: -4px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(125, 255, 208, 0.85);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-forgot-link[hidden] {
  display: none !important;
}
.auth-forgot-link:hover {
  color: #7dffd0;
}
.auth-footnote {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--dim);
  text-align: center;
}
.auth-quota-block {
  padding: 16px 16px 15px;
  border-radius: 14px;
  border: 1px solid rgba(125, 255, 208, 0.22);
  background: rgba(125, 255, 208, 0.08);
}
.auth-quota-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(125, 255, 208, 0.8);
}
.auth-quota-value {
  margin: 10px 0 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  color: #f4faf7;
}
.auth-quota-meta {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
.auth-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 2px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.billing-card {
  width: min(440px, 100%);
  gap: 0;
}
.billing-card .auth-card-head {
  margin-bottom: 6px;
}
.billing-card .auth-card-title {
  margin: 0;
}
.billing-balance {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 650;
  color: rgba(125, 255, 208, 0.9);
}
.billing-lead {
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--dim);
}
.billing-section-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: none;
}
.billing-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.billing-paytypes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
}
.billing-paytype {
  padding: 10px 12px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.billing-paytype:hover {
  color: #e8faf3;
}
.billing-paytype.on {
  color: #e8faf3;
  background: rgba(125, 255, 208, 0.16);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}
.billing-orders-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.billing-orders-block[hidden] {
  display: none !important;
}
.billing-orders {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 132px;
  overflow: auto;
}
.billing-order-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 12px;
  color: #cfe8df;
}
.billing-order-row .st-fulfilled { color: var(--accent); font-weight: 700; }
.billing-order-row .st-pending { color: #f0c674; font-weight: 700; }
.billing-order-row .st-paid { color: #9ecbff; font-weight: 700; }
.billing-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 14px 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  color: #e8f5f0;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.billing-product:hover {
  border-color: rgba(125, 255, 208, 0.45);
  background: rgba(125, 255, 208, 0.1);
  transform: translateY(-1px);
}
.billing-product:active {
  transform: translateY(0);
}
.billing-product:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.billing-product-chars {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.billing-product-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--dim);
}
.billing-product-aside {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.billing-product-price {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #f4faf7;
}
.billing-product-cta {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}
.billing-product:hover .billing-product-cta {
  color: #9dffdf;
}
.billing-product:disabled .billing-product-cta {
  color: var(--dim);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.min-w-0 { min-width: 0; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.brand-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  display: inline-flex;
}
.brand-mark svg {
  width: 38px;
  height: 38px;
  display: block;
}
.logo {
  font-family: "Songti SC", "Noto Serif SC", "STSong", "Songti TC", serif;
  font-weight: 700;
  font-size: 23px;
  letter-spacing: 0.14em;
  line-height: 1.05;
  color: #f4f1ea;
}
.brand-tag {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: lowercase;
  color: rgba(244, 241, 234, 0.48);
  white-space: nowrap;
}
.hub-link {
  margin-left: 2px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(244, 241, 234, 0.42);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.12s;
}
.hub-link:hover {
  color: rgba(244, 241, 234, 0.82);
}
.hub-link:focus-visible {
  outline: 2px solid rgba(244, 241, 234, 0.35);
  outline-offset: 3px;
  border-radius: 4px;
}
.linkish {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}
.linkish:hover { color: #fff; }
.muted { color: var(--muted); font-size: 13px; }

/* —— 步骤条（无胶囊底，横向散开） —— */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  max-width: 1320px;
  margin: 8px auto 20px;
  padding: 10px 48px 16px;
  flex-wrap: nowrap;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
  min-width: 0;
  padding: 0;
  flex: 0 0 auto;
  transition: opacity 0.15s;
}
.step.active {
  opacity: 1;
}
.step.has-result {
  opacity: 0.85;
  cursor: pointer;
}
.step.has-result:hover {
  opacity: 1;
}
.step.has-result .step-num {
  border-color: rgba(125, 255, 208, 0.55);
  color: #7dffd0;
}
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  background: transparent;
}
.step.active .step-num {
  background: #fff;
  border-color: #fff;
  color: #111;
  box-shadow: none;
}
.step-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.step-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.2;
}
.step.active .step-title { color: #fff; }
.step-desc {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.3;
  white-space: nowrap;
}
.step.active .step-desc {
  color: rgba(255, 255, 255, 0.6);
}
.step-arrow {
  flex: 1 1 72px;
  min-width: 56px;
  max-width: 140px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 2px;
  user-select: none;
  padding: 0 12px;
  color: transparent;
  background: linear-gradient(90deg, rgba(255,255,255,0.4), rgba(255,255,255,0.06));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* —— 主工作区 —— */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.85fr);
  gap: 12px;
  padding: 0 20px 16px;
  max-width: 1320px;
  margin: 0 auto;
}

.card {
  position: relative;
  background: var(--card);
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
/* 顶部高光边 —— 玻璃质感关键 */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.22) 20%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0.22) 80%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

.editor {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.title-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 2px 0;
}
.counter {
  color: var(--dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.editor-hint {
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.script {
  flex: 1;
  width: 100%;
  resize: vertical;
  min-height: 280px;
  max-height: 520px;
  background: rgba(8, 10, 16, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  outline: none;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.script::placeholder { color: rgba(154, 163, 181, 0.65); }
.script:focus {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.45),
    0 0 0 3px rgba(255, 255, 255, 0.04);
}
.upload {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.upload:hover { color: #fff; border-color: rgba(255, 255, 255, 0.4); }

/* —— 右侧 —— */
.side {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card-solid);
}
.field-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.field-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: border-color 0.15s;
}
.field-input:focus {
  border-color: rgba(125, 255, 208, 0.25);
}
.field-note {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 9px;
  overflow: hidden;
  padding: 3px;
  border: 1px solid var(--line-soft);
}
.seg-5 {
  grid-template-columns: repeat(5, 1fr);
}
.seg-6 {
  grid-template-columns: repeat(6, 1fr);
}
.seg-item {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 4px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 7px;
  transition: background 0.12s, color 0.12s;
}
.seg-item.on {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ratios {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.ratio {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  padding: 8px 4px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.ratio.on {
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06), 0 4px 14px rgba(0, 0, 0, 0.3);
}
.ratio-frame {
  border: 1.5px solid currentColor;
  border-radius: 2px;
  opacity: 0.9;
}
.r-916 { width: 12px; height: 22px; }
.r-45 { width: 14px; height: 18px; }
.r-34 { width: 15px; height: 20px; }
.r-23 { width: 14px; height: 21px; }
.r-11 { width: 18px; height: 18px; }
.r-43 { width: 20px; height: 15px; }
.r-169 { width: 24px; height: 14px; }
.r-219 { width: 26px; height: 11px; }
@media (max-width: 520px) {
  .ratios { grid-template-columns: repeat(3, 1fr); }
}

/* 精简时间轴：固定刻度 */
.timeline {
  margin-top: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.confirm-left .timeline {
  margin-top: 10px;
}
.timeline-dock.timeline {
  margin-top: 8px;
}
.tl-lane {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 6px;
}
.tl-lane-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  writing-mode: horizontal-tb;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.timeline-track {
  position: relative;
  height: 64px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}
.timeline-audio-track {
  position: relative;
  height: 36px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}
.tl-audio-clip {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, #3a5a8a 0%, #2a4068 55%, #243656 100%);
  border: 1px solid rgba(140, 180, 255, 0.4);
  color: #e8f0ff;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}
.tl-lane-audio[hidden] {
  display: none !important;
}
.timeline-ruler {
  position: relative;
  height: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 4px;
  margin-left: 48px;
}
.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  z-index: 5;
  pointer-events: auto;
  cursor: ew-resize;
}
.timeline-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 2px 2px 6px 6px;
  background: #fff;
}
.timeline-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.timeline-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #e8eef2);
}
.timeline-clock {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #7dffd0;
}
.timeline-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.tl-add-btn {
  margin-left: 4px;
  height: 24px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(125, 255, 208, 0.35);
  background: rgba(125, 255, 208, 0.1);
  color: #c8fff0;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.tl-add-btn:hover {
  background: rgba(125, 255, 208, 0.22);
  border-color: rgba(125, 255, 208, 0.55);
}
.timeline-zoom {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.tl-zoom-btn {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #e8eef2;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.tl-zoom-btn:hover {
  background: rgba(125, 255, 208, 0.18);
  border-color: rgba(125, 255, 208, 0.45);
}
.tl-zoom-range {
  width: 88px;
  accent-color: #7dffd0;
  cursor: pointer;
}
.timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 255, 208, 0.45) rgba(255, 255, 255, 0.06);
}
.timeline-scroll::-webkit-scrollbar {
  height: 8px;
}
.timeline-scroll::-webkit-scrollbar-track {
  margin: 0 2px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.timeline-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(125, 255, 208, 0.35), rgba(125, 255, 208, 0.55));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  min-width: 40px;
}
.timeline-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(125, 255, 208, 0.55), rgba(125, 255, 208, 0.8));
  background-clip: padding-box;
  border: 2px solid transparent;
}
.timeline-scroll::-webkit-scrollbar-corner {
  background: transparent;
}
.timeline-canvas {
  position: relative;
  min-height: 72px;
}
.tl-mark {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
}
.tl-clip {
  position: absolute;
  top: 4px;
  bottom: 4px;
  display: flex;
  align-items: stretch;
  border-radius: 8px;
  background: #12201e;
  border: 1px solid rgba(125, 255, 208, 0.35);
  color: #e8fff6;
  cursor: grab;
  user-select: none;
  touch-action: none;
  overflow: hidden;
  box-sizing: border-box;
}
.tl-clip.on {
  border-color: #7dffd0;
  box-shadow: 0 0 0 2px rgba(125, 255, 208, 0.25);
  z-index: 2;
}
.tl-film {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 0;
  pointer-events: none;
  background: #0d1614;
}
.tl-film img {
  flex: 1 0 0;
  min-width: 0;
  height: 100%;
  object-fit: cover;
  border-right: 1px solid rgba(0, 0, 0, 0.35);
}
.tl-film img:last-child {
  border-right: 0;
}
.tl-loop-gap {
  position: absolute;
  top: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  pointer-events: none;
}
.tl-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  background: linear-gradient(
    180deg,
    rgba(8, 16, 14, 0.72) 0%,
    rgba(8, 16, 14, 0.2) 55%,
    rgba(8, 16, 14, 0.05) 100%
  );
  pointer-events: auto;
}
.tl-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
.tl-dur {
  font-size: 10px;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
.tl-handle {
  position: relative;
  z-index: 2;
  width: 10px;
  flex: 0 0 10px;
  padding: 0;
  border: 0;
  background: rgba(125, 255, 208, 0.28);
  cursor: ew-resize;
}
.tl-del {
  position: absolute;
  top: 3px;
  right: 12px;
  z-index: 3;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.tl-clip:hover .tl-del,
.tl-clip.on .tl-del {
  opacity: 1;
}
.tl-del:hover {
  background: rgba(220, 70, 70, 0.9);
}
.tl-empty {
  position: absolute;
  inset: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px dashed rgba(125, 255, 208, 0.35);
  color: rgba(200, 255, 240, 0.7);
  font-size: 12px;
  pointer-events: none;
}
.timeline-scroll.tl-drop-hover {
  outline: 1px dashed rgba(125, 255, 208, 0.55);
  outline-offset: 2px;
  background: rgba(125, 255, 208, 0.06);
}
.tl-handle:hover,
.tl-handle:focus-visible {
  background: rgba(125, 255, 208, 0.55);
}
.tl-l { border-right: 1px solid rgba(0, 0, 0, 0.25); }
.tl-r { border-left: 1px solid rgba(0, 0, 0, 0.25); }

.styles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.styles-4 {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.style {
  position: relative;
  aspect-ratio: 16 / 11;
  max-height: 88px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: #111;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.style:hover:not(:disabled) { transform: translateY(-1px); }
.style.on {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 6px 16px rgba(0, 0, 0, 0.35);
}
.style:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.25);
}
.style-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.style-bg {
  position: absolute;
  inset: 0;
}
.style-name {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 4px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.55) 100%);
  border-radius: 0;
}
.style-soon {
  position: absolute;
  top: 4px; right: 4px;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.85);
  z-index: 1;
}
.s-broll { background: linear-gradient(160deg, #245a52, #0e1c24 55%, #1c3a32); }
.s-illus { background: linear-gradient(160deg, #6a3a5a, #2a1428 55%, #4a2840), radial-gradient(circle at 30% 30%, #ffb6c8, transparent 45%); }
.s-mecha { background: linear-gradient(160deg, #3a5070, #101820 55%, #2a3848); }
.s-dream { background: linear-gradient(160deg, #4050a0, #181828 55%, #503868); }
.s-classic { background: linear-gradient(160deg, #8a6a40, #2a2010 55%, #5a4830); }
.s-city { background: linear-gradient(160deg, #406080, #101820 55%, #304858); }

.source-panel { display: none; margin-bottom: 4px; }
.source-panel.on { display: block; }

.dropzone {
  display: block;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.dropzone:hover, .dropzone.drag {
  border-color: rgba(125, 255, 208, 0.45);
  background: rgba(125, 255, 208, 0.05);
  box-shadow: inset 0 0 0 1px rgba(125, 255, 208, 0.08);
}
.dropzone-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  word-break: break-all;
}
.dropzone-sub { color: var(--dim); font-size: 12px; line-height: 1.5; }

.btn-next {
  margin-left: auto;
  background: var(--white);
  color: var(--ink);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 500;
}
.check.block { display: flex; padding-bottom: 0; }
.field-note.center { text-align: center; }
.editor.dim { opacity: 0.72; }
.side.focus {
  box-shadow:
    var(--shadow-card),
    0 0 0 1px rgba(125, 255, 208, 0.12);
}

.row2 {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}
.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 10px;
  white-space: nowrap;
}

.btn-primary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin-top: 0;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #e6e9f0 55%, #d8dce8 100%);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  padding: 0 18px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 2px 0 rgba(255, 255, 255, 0.6) inset,
    0 -1px 0 rgba(0, 0, 0, 0.08) inset;
  transition: transform 0.12s, filter 0.12s, box-shadow 0.12s;
}
.btn-primary:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}
.side > .btn-primary,
#btn-next-confirm {
  display: flex;
  width: 100%;
  margin-top: 6px;
}
#btn-view-result {
  display: flex;
  width: 100%;
  margin-top: 8px;
}

/* —— 步骤 3：进度 / 预览舞台 —— */
.stage {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto 28px;
  padding: 28px 24px 32px;
  min-height: 420px;
}
.stage[hidden] { display: none !important; }
.stage-confirm {
  max-width: 1320px;
  padding-left: 28px;
  padding-right: 28px;
}

.confirm-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.confirm-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.confirm-head .muted {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--dim);
}
.confirm-split {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(440px, 1.28fr);
  gap: 22px;
  align-items: start;
}
.confirm-left {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.confirm-left .reel-frame {
  max-height: min(48vh, 420px);
}
.confirm-left .reel-meta[hidden] {
  display: none !important;
}
.confirm-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 0;
}
.confirm-voice {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.confirm-voice .field {
  margin: 0;
}
.confirm-voice .field-label {
  margin-bottom: 10px;
}
/* 确认页：朗读方式横向 4 档，卡片略高 */
.confirm-right .tts-pick {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.confirm-right .tts-card {
  min-height: 72px;
  padding: 14px 12px;
  gap: 8px;
  justify-content: center;
}
.confirm-right .tts-card-top {
  flex-wrap: wrap;
  gap: 5px 8px;
}
.confirm-right .tts-card-title {
  font-size: 13px;
}
.confirm-right .tts-badge {
  font-size: 10px;
  padding: 2px 6px;
}
.confirm-right .tts-card-desc {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  color: var(--dim);
}
.confirm-right .tts-card.on .tts-card-desc {
  color: rgba(232, 250, 245, 0.72);
}
.confirm-right .tts-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.timeline-dock {
  margin-top: 0;
  width: 100%;
}
.voice-rate-row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.voice-rate-row .field-label {
  margin-bottom: 10px;
}
.voice-rate-row .seg-6 {
  max-width: none;
  gap: 4px;
}
.voice-slot-static {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 13px;
}
.voice-rate-tier .tier-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.voice-pick.hidden,
.field-note.hidden,
#voice-browser-slot.hidden,
.voice-slot-static.hidden {
  display: none !important;
}
.confirm-stats {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px 16px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.confirm-align-bar {
  order: 0;
}
.confirm-stats[hidden] {
  display: none !important;
}
.confirm-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.confirm-stat .confirm-k {
  font-size: 11px;
  color: var(--muted);
}
.confirm-stat .confirm-v {
  font-size: 15px;
  font-weight: 750;
  color: #e8eef2;
  font-variant-numeric: tabular-nums;
}
.confirm-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #f0c674;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.confirm-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.confirm-audio-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.confirm-audio-inline {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}
.confirm-actions .confirm-result {
  margin-top: 4px;
  padding: 10px 12px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}
.confirm-actions .confirm-audio-inline {
  margin-top: 0;
}
.timeline-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}
.timeline-foot > .field-note {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.timeline-foot-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.timeline-foot-opts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
}
.compose-subs {
  margin: 0;
  padding: 0;
  white-space: nowrap;
  color: #e8f5f0;
  font-size: 13px;
  font-weight: 650;
}
.compose-subs-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--dim);
  text-align: right;
  max-width: 220px;
}
.compose-subs-hint[hidden] {
  display: none !important;
}
.timeline-foot .btn-primary {
  flex: 0 0 auto;
  min-width: 140px;
  margin: 0;
}
.timeline-foot .btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.confirm-result {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.confirm-result[hidden] {
  display: none !important;
}
.confirm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 2px;
}
.confirm-status {
  margin: 0;
  text-align: left;
  min-height: 1.4em;
  line-height: 1.45;
}
.sample-script {
  margin: -4px 0 0;
  opacity: 0.85;
  font-size: 12px;
  line-height: 1.45;
}
.reel-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0a0b0f;
  border: 1px solid var(--line-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  aspect-ratio: 9 / 16;
  max-height: min(72vh, 620px);
  margin: 0 auto;
  width: 100%;
}
.reel-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
.reel-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.reel-frame.has-media .reel-empty { display: none; }
.reel-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
}
.reel-meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}
.reel-bar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(8, 10, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.reel-bar[hidden] {
  display: none !important;
}
.reel-frame:hover .reel-bar,
.reel-frame:focus-within .reel-bar,
.reel-frame.is-playing .reel-bar {
  opacity: 1;
  pointer-events: auto;
}
@media (hover: none) {
  .reel-frame.has-media .reel-bar {
    opacity: 1;
    pointer-events: auto;
  }
}
.reel-play {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: rgba(125, 255, 208, 0.18);
  color: #e8fff6;
  cursor: pointer;
  font-size: 12px;
  flex: 0 0 auto;
}
.reel-play:hover {
  background: rgba(125, 255, 208, 0.32);
}
.reel-time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #e8eef2;
  white-space: nowrap;
  min-width: 7.5em;
}
.reel-seek {
  flex: 1;
  accent-color: #7dffd0;
  cursor: pointer;
}
.confirm-right {
  /* 上方已定义 flex 布局 */
  min-width: 0;
}
.confirm-grid {
  display: none; /* 已改用 confirm-stats */
}
.confirm-k {
  font-size: 11px;
  color: var(--muted);
}
.confirm-v {
  font-variant-numeric: tabular-nums;
}
.confirm-voice {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.confirm-voice .field {
  min-width: 0;
  margin: 0;
}
.confirm-voice .seg {
  width: 100%;
}
.voice-field {
  max-width: none;
}
.voice-rate-voice .voice-pick {
  position: relative;
  width: 100%;
  max-width: 200px;
  min-width: 0;
}
.voice-rate-voice .voice-slot-static {
  max-width: 200px;
}
.voice-rate-voice .voice-trigger {
  min-height: 40px;
}
.voice-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.12s, background 0.12s;
}
.voice-trigger:hover {
  border-color: rgba(125, 255, 208, 0.28);
  background: rgba(0, 0, 0, 0.45);
}
.voice-pick.open .voice-trigger {
  border-color: rgba(125, 255, 208, 0.35);
}
.voice-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
  transition: transform 0.12s;
}
.voice-pick.open .voice-caret {
  transform: rotate(180deg);
}
.voice-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 100%;
  width: max-content;
  max-height: min(52vh, 360px);
  overflow-y: auto;
  padding: 4px;
  border-radius: 10px;
  background: rgba(22, 24, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 255, 208, 0.4) transparent;
}
.voice-menu::-webkit-scrollbar {
  width: 6px;
}
.voice-menu::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}
.voice-menu::-webkit-scrollbar-thumb {
  background: rgba(125, 255, 208, 0.35);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
.voice-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(125, 255, 208, 0.55);
  background-clip: padding-box;
  border: 1px solid transparent;
}
.voice-menu::-webkit-scrollbar-corner {
  background: transparent;
}
.voice-menu[hidden] { display: none !important; }
.voice-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.voice-option:hover {
  background: rgba(125, 255, 208, 0.12);
  color: #fff;
}
.voice-option.on {
  background: rgba(125, 255, 208, 0.18);
  color: #7dffd0;
}
.confirm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 2px;
}
.confirm-toolbar-slot {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.confirm-toolbar-slot .field-note {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.confirm-toolbar-slot:has(.a-player:not([hidden])) .field-note {
  display: none;
}
.confirm-status {
  margin: 0;
  text-align: left;
  min-height: 1.4em;
  line-height: 1.45;
}
.btn-sm {
  width: auto !important;
  min-width: 0;
  min-height: 36px !important;
  margin-top: 0 !important;
  padding: 0 14px;
  font-size: 13px;
  flex-shrink: 0;
}
.confirm-sample audio,
.confirm-audio audio {
  display: none;
}
.a-player {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.a-player-sm {
  margin-top: 0;
  padding: 4px 8px;
  gap: 8px;
}
.a-player-sm .a-play {
  width: 28px;
  height: 28px;
}
.a-player[hidden] { display: none !important; }
.a-play {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  transition: background 0.12s, transform 0.12s;
}
.a-play:hover {
  background: rgba(125, 255, 208, 0.22);
  transform: scale(1.04);
}
.a-ico-pause { letter-spacing: -1px; font-size: 10px; }
.a-time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 78px;
}
.a-seek {
  flex: 1;
  min-width: 0;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.a-seek:focus { outline: none; }
.a-seek:focus-visible {
  outline: 2px solid rgba(125, 255, 208, 0.55);
  outline-offset: 3px;
}
.a-seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}
.a-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: #7dffd0;
  border: none;
  box-shadow: 0 0 8px rgba(125, 255, 208, 0.35);
}
.a-seek::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
}
.a-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7dffd0;
  border: none;
}

.confirm-result[hidden] { display: none !important; }

.progress-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 16px 20px;
  gap: 12px;
}
.progress-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.progress-title {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.progress-status {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  min-height: 1.4em;
}
.progress-elapsed {
  margin: 0;
  max-width: 420px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
}
.progress-track {
  width: min(360px, 80%);
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  border: 1px solid var(--line-soft);
}
.progress-bar {
  height: 100%;
  width: 8%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(125, 255, 208, 0.5), #7dffd0);
  transition: width 0.45s ease;
}
.progress-steps {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}
.progress-steps li {
  font-size: 13px;
  color: var(--dim);
  position: relative;
  padding-left: 16px;
}
.progress-steps li[hidden] {
  display: none !important;
}
.progress-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}
.progress-steps li.on {
  color: #fff;
}
.progress-steps li.on::before {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(125, 255, 208, 0.45);
}
.progress-steps li.done {
  color: var(--muted);
}
.progress-steps li.done::before {
  background: rgba(125, 255, 208, 0.55);
}

.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.preview-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.preview-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.preview-save {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.preview-save .field-label {
  margin: 0;
}
.preview-save-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.export-name {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: #f4f1ea;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.01em;
}
.export-name:focus {
  outline: none;
  border-color: rgba(244, 241, 234, 0.42);
}
.export-name::placeholder {
  color: rgba(244, 241, 234, 0.32);
}
.preview-save .field-note {
  margin: 0;
}
@media (max-width: 640px) {
  .preview-save-row {
    flex-direction: column;
    align-items: stretch;
  }
}
.btn-ghost {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}
.preview-player {
  display: flex;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  overflow: hidden;
  min-height: 320px;
}
.preview-player video {
  width: 100%;
  max-height: min(68vh, 640px);
  background: #000;
  display: block;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 50;
  background: rgba(20, 22, 30, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  max-width: min(90vw, 520px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.tts-card:focus-visible,
.auth-chip:focus-visible,
.auth-entry:focus-visible,
.auth-submit:focus-visible,
.style:focus-visible,
.ratio:focus-visible,
.seg-item:focus-visible,
.voice-trigger:focus-visible,
.reel-play:focus-visible,
.a-play:focus-visible {
  outline: 2px solid rgba(125, 255, 208, 0.65);
  outline-offset: 2px;
}

@media (max-width: 960px) {
  .workspace { grid-template-columns: 1fr; }
  .stepper {
    flex-wrap: wrap;
    gap: 10px 0;
    padding: 8px 16px 12px;
    justify-content: flex-start;
  }
  .step-arrow { padding: 0 12px; max-width: none; flex: 0 0 auto; }
  .step-desc { white-space: normal; }
  .preview-head { flex-direction: column; }
  .confirm-split { grid-template-columns: 1fr; }
  .confirm-left { position: static; }
  .confirm-right .tts-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .confirm-right .tts-card { min-height: 64px; }
  .confirm-align-bar {
    grid-template-columns: 1fr 1fr;
  }
  .confirm-align-bar .confirm-hint {
    grid-column: 1 / -1;
  }
  .voice-rate-row { grid-template-columns: 1fr; }
  .reel-frame {
    max-height: min(52vh, 420px);
    max-width: min(100%, 320px);
  }
  .confirm-toolbar {
    flex-wrap: wrap;
  }
  .confirm-toolbar .btn-primary {
    margin-left: auto;
  }
  .timeline-foot {
    flex-wrap: wrap;
  }
  .timeline-foot-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .timeline-foot .btn-primary {
    min-width: 120px;
  }
  .seg-5 {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
  }
  .seg-6 {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
  }
  .tts-pick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
