/* 漫译声 · AnimeDub — Dark Cinema Dubbing Studio Design System */

:root {
  --bg-main: #0b0f17;
  --bg-surface: #121826;
  --bg-elevated: #182134;
  --bg-input: #0e1420;
  --bg-glass: rgba(18, 24, 38, 0.82);

  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-deep: #059669;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --emerald-border: rgba(16, 185, 129, 0.34);

  --amber: #f59e0b;
  --amber-bright: #fbbf24;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(245, 158, 11, 0.34);

  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.14);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-subtle: rgba(148, 163, 184, 0.13);
  --border-strong: rgba(148, 163, 184, 0.24);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-card: 0 12px 32px rgba(2, 6, 23, 0.42);
  --shadow-glow: 0 0 0 1px rgba(16, 185, 129, 0.22), 0 10px 30px rgba(16, 185, 129, 0.12);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  background-color: var(--bg-main);
  background-image:
    radial-gradient(ellipse 68% 36% at 18% -6%, rgba(16, 185, 129, 0.13), transparent 60%),
    radial-gradient(ellipse 52% 30% at 86% -8%, rgba(245, 158, 11, 0.09), transparent 62%);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.36);
}

/* ==========================================================================
   Top Navigation Header
   ========================================================================== */

.studio-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 15, 23, 0.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(245, 158, 11, 0.16));
  border: 1px solid var(--emerald-border);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.16);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f8fafc;
}

.brand-sub {
  font-size: 11px;
  color: var(--emerald-bright);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(18, 24, 38, 0.78);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  max-width: 100%;
}

.nav-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  color: #f8fafc;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.08));
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.34);
}

.nav-tab svg {
  width: 15px;
  height: 15px;
  opacity: 0.85;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.auth-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--emerald-border);
  border-radius: 999px;
}

.auth-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), #0d9488);
  color: #03150e;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.auth-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--emerald-bright);
  background: var(--emerald-soft);
  padding: 2px 7px;
  border-radius: 999px;
}

.auth-quota-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-bright);
  box-shadow: 0 0 8px var(--emerald);
}

/* ==========================================================================
   Buttons, Inputs & Badges
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: #202c44;
  border-color: var(--border-strong);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  border-color: rgba(52, 211, 153, 0.45);
  color: #03150e;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.24);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--emerald-bright), var(--emerald));
  border-color: rgba(110, 231, 183, 0.65);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.34);
}

.btn-amber {
  background: linear-gradient(135deg, var(--amber), #d97706);
  border-color: rgba(251, 191, 36, 0.45);
  color: #1c1202;
}

.btn-amber:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--amber-bright), var(--amber));
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-emerald-soft {
  background: var(--emerald-soft);
  border-color: var(--emerald-border);
  color: var(--emerald-bright);
}

.btn-emerald-soft:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.22);
}

.btn-amber-soft {
  background: var(--amber-soft);
  border-color: var(--amber-border);
  color: var(--amber-bright);
}

.btn-amber-soft:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.22);
}

.btn-danger-soft {
  background: var(--danger-soft);
  border-color: rgba(244, 63, 94, 0.34);
  color: #fda4af;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-lg {
  padding: 11px 18px;
  font-size: 14px;
  border-radius: 12px;
}

.btn-block {
  width: 100%;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.textarea {
  resize: vertical;
  line-height: 1.55;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.badge-emerald {
  background: var(--emerald-soft);
  border-color: var(--emerald-border);
  color: var(--emerald-bright);
}

.badge-amber {
  background: var(--amber-soft);
  border-color: var(--amber-border);
  color: var(--amber-bright);
}

.badge-platform-youku {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.badge-platform-qq {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fcd34d;
}

.badge-platform-bilibili {
  background: rgba(244, 114, 182, 0.14);
  border-color: rgba(244, 114, 182, 0.32);
  color: #f9a8d4;
}

.badge-platform-iqiyi {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(74, 222, 128, 0.32);
  color: #86efac;
}

/* ==========================================================================
   Main Container & Cards
   ========================================================================== */

.app-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}

.view-section {
  display: none;
  animation: fadeSlideIn 0.22s ease;
}

.view-section.active {
  display: block;
}

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

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 18px;
}

/* ==========================================================================
   Page 1: AI 配音工坊 (Studio)
   ========================================================================== */

.studio-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(18, 24, 38, 0.96), rgba(16, 185, 129, 0.08) 65%, rgba(245, 158, 11, 0.07));
  border: 1px solid var(--border-subtle);
}

.hero-left h1 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #f8fafc;
}

.hero-left h1 span {
  color: var(--emerald-bright);
}

.hero-left p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.auth-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12), rgba(245, 158, 11, 0.08));
  border: 1px solid var(--emerald-border);
}

.auth-callout-text {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-callout-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.18);
  color: var(--emerald-bright);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.auth-callout strong {
  display: block;
  font-size: 13.5px;
  color: #f8fafc;
}

.auth-callout span {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.auth-callout-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.studio-grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.input-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.mode-tab {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  transition: all 0.15s ease;
}

.mode-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.mode-tab.active {
  color: var(--emerald-bright);
  background: var(--emerald-soft);
  border-color: var(--emerald-border);
}

.demo-script-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-script-btn {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.demo-script-btn:hover {
  border-color: var(--emerald-border);
  background: rgba(16, 185, 129, 0.06);
}

.demo-script-btn strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #f8fafc;
  margin-bottom: 3px;
}

.demo-script-btn p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  padding: 22px 16px;
  text-align: center;
  background: rgba(14, 20, 32, 0.7);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.07);
}

.dropzone-title {
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.dictation-box {
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.dictation-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}

.rec-dot.live {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
  animation: pulseDot 1.1s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.25); }
}

.dictation-interim {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-subtle);
  color: var(--amber-bright);
  font-size: 12.5px;
  margin-top: 10px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.config-full {
  grid-column: 1 / -1;
}

.ai-progress-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid var(--emerald-border);
}

.progress-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--emerald), var(--amber));
  transition: width 0.25s ease;
}

.stream-snippet {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  max-height: 76px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  background: rgba(11, 15, 23, 0.72);
  padding: 8px;
  border-radius: 8px;
}

/* Workbench Right Column */
.roles-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(14, 20, 32, 0.52);
}

.role-chip-card {
  flex: 1 1 215px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.role-chip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.role-name-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 13px;
}

.role-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.role-sliders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

.role-sliders input[type='range'] {
  width: 100%;
  accent-color: var(--emerald);
}

.cue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  max-height: 690px;
  overflow-y: auto;
}

.cue-card {
  padding: 13px 15px;
  border-radius: 13px;
  background: rgba(14, 20, 32, 0.76);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.cue-card:hover {
  border-color: var(--border-strong);
}

.cue-card.speaking {
  border-color: var(--emerald);
  box-shadow: var(--shadow-glow);
}

.cue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.cue-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cue-index {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.cue-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--amber-bright);
  background: var(--amber-soft);
  padding: 2px 8px;
  border-radius: 6px;
}

.cue-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cue-zh {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.cue-en-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: rgba(16, 185, 129, 0.05);
  color: #f8fafc;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  resize: none;
  min-height: 44px;
  outline: none;
}

.cue-en-input:focus {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.09);
}

.cue-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.cue-notes {
  font-size: 12px;
  color: var(--text-secondary);
  flex: 1 1 240px;
}

.cue-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--amber-border);
  background: var(--amber-soft);
  color: var(--amber-bright);
  font-size: 11.5px;
  font-weight: 600;
  transition: background 0.14s ease, transform 0.12s ease;
}

.kw-chip:hover {
  background: rgba(245, 158, 11, 0.26);
  transform: translateY(-1px);
}

.workbench-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(14, 20, 32, 0.88);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ==========================================================================
   Page 2: 同步观影剧场 (Theater)
   ========================================================================== */

.theater-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.theater-toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.theater-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.stage-shell {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #06090f;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.stage-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #05080f;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-viewport.dragover::after {
  content: '松开即可载入本地视频或外挂英文音轨';
  position: absolute;
  inset: 12px;
  z-index: 25;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 2px dashed var(--emerald);
  background: rgba(11, 15, 23, 0.88);
  color: var(--emerald-bright);
  font-size: 16px;
  font-weight: 700;
}

.stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-video {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.stage-top-hud {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.stage-top-hud > * {
  pointer-events: auto;
}

.stage-speaker-bubble {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -68%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  pointer-events: none;
}

.speaker-orb {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(52, 211, 153, 0.35), rgba(18, 24, 38, 0.92));
  border: 2px solid var(--emerald-border);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  color: #f8fafc;
  box-shadow: 0 0 32px rgba(16, 185, 129, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.speaker-orb.active {
  transform: scale(1.06);
  box-shadow: 0 0 42px rgba(16, 185, 129, 0.48);
}

.speaker-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(11, 15, 23, 0.78);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  font-weight: 600;
  color: #f8fafc;
}

.stage-subtitle-overlay {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.sub-box {
  max-width: 90%;
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(6, 10, 18, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.sub-en-line {
  font-size: clamp(15px, 1.9vw, 20px);
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.4;
}

.sub-zh-line {
  margin-top: 4px;
  font-size: 13.5px;
  color: #cbd5e1;
}

.clickable-word {
  display: inline-block;
  padding: 0 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.clickable-word:hover {
  background: rgba(245, 158, 11, 0.28);
  color: var(--amber-bright);
}

.stage-controls {
  padding: 14px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.scrubber-wrap {
  position: relative;
  margin-bottom: 12px;
}

.scrubber-bar {
  position: relative;
  height: 10px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.16);
  cursor: pointer;
  overflow: hidden;
}

.scrubber-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--emerald), var(--emerald-bright));
  border-radius: 99px;
  pointer-events: none;
}

.scrubber-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scrubber-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(245, 158, 11, 0.55);
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.controls-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
}

.seg-btn {
  padding: 4px 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.seg-btn.active {
  background: var(--emerald-soft);
  color: var(--emerald-bright);
}

.duck-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}

.duck-control input[type='range'] {
  width: 78px;
  accent-color: var(--emerald);
}

/* Theater Right Script Panel */
.script-panel {
  display: flex;
  flex-direction: column;
  max-height: 620px;
}

.script-scroll {
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.script-item {
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: rgba(14, 20, 32, 0.68);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.script-item:hover {
  border-color: var(--border-strong);
}

.script-item.active {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.1);
}

.script-item.looping {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.script-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.script-item-en {
  font-size: 13.5px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.45;
}

.script-item-zh {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ==========================================================================
   Page 3: 配音包广场 & 我的生词本
   ========================================================================== */

.subnav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.pack-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.pack-card:hover {
  transform: translateY(-2px);
  border-color: var(--emerald-border);
  box-shadow: var(--shadow-glow);
}

.pack-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.pack-id-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  color: var(--amber-bright);
}

.pack-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.pack-ep {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.pack-quote {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-input);
  border-left: 3px solid var(--emerald);
  margin-bottom: 12px;
}

.pack-quote-en {
  font-size: 13px;
  color: #f1f5f9;
  font-weight: 500;
  margin-bottom: 4px;
}

.pack-quote-zh {
  font-size: 12px;
  color: var(--text-secondary);
}

.pack-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.pack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* Vocab Grid */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.vocab-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.vocab-word {
  font-size: 18px;
  font-weight: 800;
  color: var(--amber-bright);
}

.vocab-phonetic {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 6px;
}

.vocab-meaning {
  font-size: 13.5px;
  color: #f1f5f9;
  margin-top: 4px;
}

.vocab-example {
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--bg-input);
  font-size: 12.5px;
}

.vocab-example-en {
  color: var(--emerald-bright);
  margin-bottom: 3px;
}

.vocab-example-zh {
  color: var(--text-secondary);
}

/* ==========================================================================
   Page 4: 安装浏览器插件 (Extension)
   ========================================================================== */

.ext-hero {
  padding: 26px 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(125deg, rgba(18, 24, 38, 0.98), rgba(16, 185, 129, 0.13) 60%, rgba(245, 158, 11, 0.1));
  border: 1px solid var(--emerald-border);
  margin-bottom: 20px;
}

.ext-hero h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
  color: #f8fafc;
}

.ext-hero p {
  margin: 0 0 18px;
  max-width: 780px;
  color: var(--text-secondary);
  font-size: 14px;
}

.download-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.download-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.step-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-bright);
  font-family: var(--font-mono);
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.step-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #f8fafc;
}

.step-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--amber-border);
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   Page 5: 商业化与平台用量看板 (Billing & Usage)
   ========================================================================== */

.funnel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.funnel-step {
  position: relative;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.funnel-step strong {
  display: block;
  font-size: 14.5px;
  color: #f8fafc;
  margin: 8px 0 4px;
}

.funnel-step p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.15;
}

.kpi-card.emerald .kpi-value {
  color: var(--emerald-bright);
}

.kpi-card.amber .kpi-value {
  color: var(--amber-bright);
}

.billing-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.usage-table-wrap {
  overflow-x: auto;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.usage-table th,
.usage-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.usage-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Drawers, Popovers, Modals & Toasts
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: flex-end;
}

.coach-drawer {
  width: min(500px, 95vw);
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--emerald-border);
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.55);
}

.coach-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  line-height: 1.7;
  font-size: 13.5px;
}

.coach-body h3,
.coach-body h4 {
  color: var(--emerald-bright);
  margin: 14px 0 6px;
}

.coach-body code {
  font-family: var(--font-mono);
  background: rgba(245, 158, 11, 0.14);
  color: var(--amber-bright);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 12.5px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-card {
  width: min(500px, 100%);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.big-pack-id {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--amber-bright);
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--amber-border);
  margin: 12px 0;
}

.word-popover {
  position: fixed;
  z-index: 65;
  width: min(320px, 92vw);
  padding: 14px;
  border-radius: 14px;
  background: #161f32;
  border: 1px solid var(--amber-border);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, 92vw);
}

.toast {
  padding: 11px 15px;
  border-radius: 11px;
  background: #172135;
  border: 1px solid var(--border-strong);
  color: #f8fafc;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeSlideIn 0.18s ease;
}

.toast-success {
  border-color: var(--emerald-border);
}

.toast-warn {
  border-color: var(--amber-border);
}

.toast-error {
  border-color: rgba(244, 63, 94, 0.45);
}

.empty-state {
  text-align: center;
  padding: 42px 20px;
  color: var(--text-secondary);
}

.empty-state strong {
  display: block;
  color: #f8fafc;
  font-size: 15px;
  margin-bottom: 6px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 1120px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
  .theater-grid {
    grid-template-columns: 1fr;
  }
  .billing-split {
    grid-template-columns: 1fr;
  }
  .funnel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 10px 14px;
  }
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
  .studio-hero,
  .auth-callout {
    flex-direction: column;
    align-items: flex-start;
  }
  .app-main {
    padding: 14px 12px 56px;
  }
}

@media (max-width: 540px) {
  .config-grid {
    grid-template-columns: 1fr;
  }
  .funnel-grid {
    grid-template-columns: 1fr;
  }
  .auth-callout-actions,
  .hero-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}
