/* ===================================================
   AI短剧创作平台 — 主样式
   Theme: Cinematic Dark  |  Accent: Crimson Gold
=================================================== */

:root {
  --bg:          #0a0a0f;
  --bg2:         #111118;
  --bg3:         #18181f;
  --bg4:         #1e1e28;
  --border:      #2a2a38;
  --border2:     #3a3a4e;
  --accent:      #e63950;
  --accent2:     #f5a623;
  --accent3:     #7b5cfa;
  --text:        #f0f0f5;
  --text-muted:  #888899;
  --text-dim:    #555566;
  --success:     #22c55e;
  --warning:     #f59e0b;
  --error:       #ef4444;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,.5);
  --shadow-lg:   0 8px 48px rgba(0,0,0,.7);
  --font-main:   'Noto Serif SC', serif;
  --font-mono:   'Space Mono', monospace;
}

/* Light theme */
body.light {
  --bg:         #f4f3ef;
  --bg2:        #edecea;
  --bg3:        #e4e3df;
  --bg4:        #d8d7d2;
  --border:     #cccbc6;
  --border2:    #b8b7b2;
  --text:       #1a1a22;
  --text-muted: #666677;
  --text-dim:   #999aaa;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---- Particle Canvas ---- */
#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .35;
}

/* ---- Header ---- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 18px; font-weight: 700; color: var(--text); }
.logo-text em { font-style: normal; color: var(--accent); }
.logo-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 1px;
}
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.nav-link:hover { color: var(--text); background: var(--bg3); }
.header-actions { display: flex; gap: 10px; align-items: center; }

/* ---- Buttons ---- */
.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all .2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 14px;
  font-family: var(--font-main);
  cursor: pointer;
  font-weight: 600;
  transition: all .2s;
}
.btn-primary:hover { background: #c42d42; transform: translateY(-1px); }

.btn-hero {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 14px 32px;
  font-size: 16px;
  font-family: var(--font-main);
  font-weight: 700;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 0 32px rgba(230,57,80,.35);
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 0 48px rgba(230,57,80,.5); }

.btn-hero-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 32px;
  font-size: 16px;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all .25s;
}
.btn-hero-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-generate {
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px 28px;
  font-size: 15px;
  font-family: var(--font-main);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .25s;
  box-shadow: 0 0 24px rgba(230,57,80,.25);
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(230,57,80,.45); }
.btn-generate:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-icon { font-size: 18px; }

.btn-secondary {
  background: var(--bg3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all .2s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--text); }

.btn-sm {
  background: var(--bg4);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  font-family: var(--font-main);
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

.btn-next, .btn-prev {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px 24px;
  font-size: 14px;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all .2s;
}
.btn-next { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-next:hover { background: #c42d42; }
.btn-prev:hover { border-color: var(--border2); background: var(--bg4); }

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 24px 60px;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(230,57,80,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230,57,80,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.hero-bg-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(230,57,80,.12) 0%, transparent 70%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto 0 10%;
  animation: heroIn .9s cubic-bezier(.22,1,.36,1) both;
}
@keyframes heroIn {
  from { opacity:0; transform: translateY(40px); }
  to   { opacity:1; transform: none; }
}
.hero-badge {
  display: inline-block;
  background: rgba(230,57,80,.12);
  border: 1px solid rgba(230,57,80,.3);
  color: var(--accent);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 28px;
  animation: pulse 3s ease infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(230,57,80,.3); }
  50%      { box-shadow: 0 0 0 8px rgba(230,57,80,0); }
}
.hero-title {
  display: flex;
  flex-direction: column;
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
}
.hero-title .line1 { color: var(--text-muted); font-size: .6em; }
.hero-title .line2 { color: var(--text); }
.hero-title .line2 em { font-style: normal; color: var(--accent); }
.hero-title .line3 { color: var(--text-muted); font-size: .45em; font-weight: 400; margin-top: 8px; }
.hero-desc {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 32px;
}
.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 8px;
}
.stat { text-align: center; padding: 0 16px; }
.stat-num { display: block; font-size: 28px; font-weight: 700; font-family: var(--font-mono); color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-muted); }
.stat-divider { width: 1px; height: 36px; background: var(--border); }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  animation: heroIn .9s .3s cubic-bezier(.22,1,.36,1) both;
}
.film-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: rotate(8deg);
}
.film-frame {
  width: 160px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  transition: all .3s;
  animation: float 4s ease-in-out infinite;
}
.film-frame:nth-child(2) { animation-delay: .4s; }
.film-frame:nth-child(3) { animation-delay: .8s; }
.film-frame:nth-child(4) { animation-delay: 1.2s; }
.film-frame:nth-child(5) { animation-delay: 1.6s; }
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.frame-content { font-size: 24px; }
.film-frame span { font-size: 12px; color: var(--text-muted); }

/* ---- Workspace ---- */
.workspace {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}

/* ---- Steps Bar ---- */
.steps-bar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 32px;
  margin-bottom: 32px;
}
.steps-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  opacity: .45;
  transition: all .3s;
  position: relative;
}
.step-item.active, .step-item.done { opacity: 1; }
.step-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all .3s;
  flex-shrink: 0;
}
.step-item.active .step-circle {
  border-color: var(--accent);
  background: rgba(230,57,80,.15);
  box-shadow: 0 0 16px rgba(230,57,80,.3);
}
.step-item.done .step-circle { border-color: var(--success); background: rgba(34,197,94,.15); }
.step-label { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.step-item.active .step-label { color: var(--text); font-weight: 600; }
.step-line {
  width: 32px;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* ---- Panel ---- */
.panels-container { position: relative; }
.panel {
  display: none;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  animation: panelIn .4s cubic-bezier(.22,1,.36,1);
}
.panel.active { display: block; }
@keyframes panelIn {
  from { opacity:0; transform: translateY(16px); }
  to   { opacity:1; transform: none; }
}
.panel-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg3), var(--bg2));
}
.panel-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.panel-header p { color: var(--text-muted); font-size: 14px; }
.panel-body { padding: 28px 32px; }
.panel-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg3);
}

/* ---- Form Elements ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media(max-width:768px) { .form-grid { grid-template-columns: 1fr; } }
.form-col { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-row { display: flex; gap: 12px; align-items: flex-end; }
.form-group.half { flex: 1; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; }
.hint { font-size: 11px;  font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-dim); }
.form-input, .form-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-main);
  padding: 10px 14px;
  width: 100%;
  transition: border-color .2s;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230,57,80,.12);
}
.form-input.half { width: auto; flex: 1; }
.form-textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-main);
  padding: 12px 14px;
  width: 100%;
  min-height: 140px;
  resize: vertical;
  transition: border-color .2s;
  line-height: 1.7;
}
.form-textarea.short { min-height: 80px; }
.form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230,57,80,.12); }
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-item { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-muted); cursor: pointer; }
.radio-item input { accent-color: var(--accent); }
.slider-wrap { display: flex; align-items: center; gap: 12px; }
.slider { flex: 1; accent-color: var(--accent); cursor: pointer; }
.slider-val { font-family: var(--font-mono); font-size: 14px; color: var(--accent); min-width: 28px; text-align: right; }
.slider-hints { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* Model Selector */
.model-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.model-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
  font-size: 13px;
}
.model-card:hover { border-color: var(--border2); }
.model-card.selected { border-color: var(--accent); background: rgba(230,57,80,.08); }
.model-logo {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--bg4);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.model-name { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.model-card.selected .model-name { color: var(--text); }

/* Model Logo Colors */
.model-openai   { background: #10a37f22; border: 1px solid #10a37f44; }
.model-openai::after { content: 'GPT'; font-size: 8px; color: #10a37f; font-weight: 700; }
.model-claude   { background: #c96a3222; border: 1px solid #c96a3244; }
.model-claude::after { content: 'CL'; font-size: 9px; color: #c96a32; font-weight: 700; }
.model-gemini   { background: #4285f422; border: 1px solid #4285f444; }
.model-gemini::after { content: 'GM'; font-size: 9px; color: #4285f4; font-weight: 700; }
.model-deepseek { background: #1677ff22; border: 1px solid #1677ff44; }
.model-deepseek::after { content: 'DS'; font-size: 9px; color: #1677ff; font-weight: 700; }
.model-qwen     { background: #ff6a0022; border: 1px solid #ff6a0044; }
.model-qwen::after { content: 'QW'; font-size: 9px; color: #ff6a00; font-weight: 700; }
.model-zhipu    { background: #2563eb22; border: 1px solid #2563eb44; }
.model-zhipu::after { content: 'ZP'; font-size: 9px; color: #2563eb; font-weight: 700; }
.model-moonshot { background: #7c3aed22; border: 1px solid #7c3aed44; }
.model-moonshot::after { content: 'KM'; font-size: 9px; color: #7c3aed; font-weight: 700; }
.model-baidu    { background: #2932e122; border: 1px solid #2932e144; }
.model-baidu::after { content: 'BD'; font-size: 9px; color: #2932e1; font-weight: 700; }
.model-midjourney { background: #00000022; border: 1px solid #ffffff22; }
.model-midjourney::after { content: 'MJ'; font-size: 9px; color: #ccc; font-weight: 700; }
.model-dalle    { background: #10a37f22; border: 1px solid #10a37f44; }
.model-dalle::after { content: 'DE'; font-size: 9px; color: #10a37f; font-weight: 700; }
.model-stable_diffusion { background: #7209b722; border: 1px solid #7209b744; }
.model-stable_diffusion::after { content: 'SD'; font-size: 9px; color: #7209b7; font-weight: 700; }
.model-flux     { background: #f72585; background: #f7258522; border: 1px solid #f7258544; }
.model-flux::after { content: 'FX'; font-size: 9px; color: #f72585; font-weight: 700; }
.model-jimeng   { background: #1d4ed822; border: 1px solid #1d4ed844; }
.model-jimeng::after { content: 'JM'; font-size: 9px; color: #1d4ed8; font-weight: 700; }
.model-tongyi_wanx { background: #ff6a0022; border: 1px solid #ff6a0044; }
.model-tongyi_wanx::after { content: 'WX'; font-size: 9px; color: #ff6a00; font-weight: 700; }
.model-kling    { background: #e91e6322; border: 1px solid #e91e6344; }
.model-kling::after { content: 'KL'; font-size: 9px; color: #e91e63; font-weight: 700; }
.model-sora     { background: #10a37f22; border: 1px solid #10a37f44; }
.model-sora::after { content: 'SR'; font-size: 9px; color: #10a37f; font-weight: 700; }
.model-runway   { background: #00000022; border: 1px solid #ffffff22; }
.model-runway::after { content: 'RW'; font-size: 9px; color: #aaa; font-weight: 700; }
.model-minimax  { background: #8b5cf622; border: 1px solid #8b5cf644; }
.model-minimax::after { content: 'MM'; font-size: 9px; color: #8b5cf6; font-weight: 700; }
.model-pika     { background: #ec489922; border: 1px solid #ec489944; }
.model-pika::after { content: 'PK'; font-size: 9px; color: #ec4899; font-weight: 700; }
.model-luma     { background: #06b6d422; border: 1px solid #06b6d444; }
.model-luma::after { content: 'LM'; font-size: 9px; color: #06b6d4; font-weight: 700; }
.model-vidu     { background: #f5952322; border: 1px solid #f5952344; }
.model-vidu::after { content: 'VD'; font-size: 9px; color: #f59523; font-weight: 700; }
.model-wan      { background: #0ea5e922; border: 1px solid #0ea5e944; }
.model-wan::after { content: 'HY'; font-size: 9px; color: #0ea5e9; font-weight: 700; }
.model-elevenlabs { background: #f59e0b22; border: 1px solid #f59e0b44; }
.model-elevenlabs::after { content: 'EL'; font-size: 9px; color: #f59e0b; font-weight: 700; }
.model-openai_tts { background: #10a37f22; border: 1px solid #10a37f44; }
.model-openai_tts::after { content: 'TTS'; font-size: 8px; color: #10a37f; font-weight: 700; }
.model-minimax_tts { background: #8b5cf622; border: 1px solid #8b5cf644; }
.model-minimax_tts::after { content: 'TTS'; font-size: 8px; color: #8b5cf6; font-weight: 700; }
.model-azure_tts { background: #0078d422; border: 1px solid #0078d444; }
.model-azure_tts::after { content: 'AZ'; font-size: 9px; color: #0078d4; font-weight: 700; }
.model-suno     { background: #84cc1622; border: 1px solid #84cc1644; }
.model-suno::after { content: 'SN'; font-size: 9px; color: #84cc16; font-weight: 700; }
.model-udio     { background: #a855f722; border: 1px solid #a855f744; }
.model-udio::after { content: 'UD'; font-size: 9px; color: #a855f7; font-weight: 700; }
.model-logo-sm { width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0; }

/* Style Tags */
.style-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.style-tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  color: var(--text-muted);
}
.style-tag:hover { border-color: var(--border2); color: var(--text); }
.style-tag.selected {
  background: rgba(230,57,80,.12);
  border-color: var(--accent);
  color: var(--text);
}

/* Ratio / Duration Selector */
.ratio-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.ratio-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .2s;
}
.ratio-btn:hover { border-color: var(--border2); color: var(--text); }
.ratio-btn.selected { border-color: var(--accent); color: var(--accent); background: rgba(230,57,80,.08); }

/* API Key Bar */
.apikey-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 20px 0;
}
.apikey-icon { font-size: 18px; }
.apikey-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-mono);
  outline: none;
}
.apikey-input::placeholder { color: var(--text-dim); }
.apikey-status { font-size: 12px; }
.apikey-status.ok  { color: var(--success); }
.apikey-status.err { color: var(--error); }

/* Action Row */
.action-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Output Area */
.output-area {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 240px;
  padding: 24px;
  margin-top: 16px;
  position: relative;
  overflow-y: auto;
  max-height: 480px;
}
.output-placeholder { text-align: center; padding: 40px 20px; color: var(--text-dim); }
.placeholder-icon { font-size: 48px; margin-bottom: 16px; }
.output-area pre, .output-area p { font-size: 14px; line-height: 1.8; color: var(--text); white-space: pre-wrap; }
.output-area h3 { color: var(--accent); margin: 16px 0 8px; font-size: 16px; }

/* Progress */
.progress-wrap { margin-top: 16px; }
.progress-wrap.hidden { display: none; }
.progress-bar { height: 6px; background: var(--bg4); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent3)); border-radius: 3px; width: 0; transition: width .4s ease; }
.progress-text { font-size: 12px; color: var(--text-muted); margin-top: 8px; display: block; }

/* Character Workspace */
.character-workspace { display: grid; grid-template-columns: 200px 1fr; gap: 16px; min-height: 280px; }
.char-list {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.char-add-btn {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  color: var(--text-dim);
  transition: all .2s;
}
.char-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.char-add-btn span { font-size: 24px; display: block; }
.char-add-btn p { font-size: 12px; margin-top: 4px; }
.char-item {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.char-item:hover, .char-item.active { border-color: var(--accent); }
.char-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.char-detail {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}
.char-placeholder { color: var(--text-dim); font-size: 14px; }

/* Storyboard Grid */
.storyboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.sb-placeholder { grid-column: 1/-1; text-align: center; padding: 40px; color: var(--text-dim); font-size: 14px; }
.sb-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all .2s;
}
.sb-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.sb-thumb { height: 110px; background: var(--bg4); display: flex; align-items: center; justify-content: center; font-size: 32px; position: relative; overflow: hidden; }
.sb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sb-info { padding: 8px; }
.sb-info p { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.sb-num { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }

/* Video Grid */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 12px; margin-top: 16px; }
.video-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.video-thumb { height: 140px; background: var(--bg4); display: flex; align-items: center; justify-content: center; font-size: 40px; cursor: pointer; position: relative; }
.video-thumb:hover .play-btn { opacity: 1; }
.play-btn { position: absolute; font-size: 32px; opacity: 0; transition: opacity .2s; }
.video-info { padding: 10px; }

/* Voice Preview */
.voice-preview { margin-top: 16px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); min-height: 120px; padding: 16px; }
.audio-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--bg4); border-radius: var(--radius-sm); margin-bottom: 8px; }
.audio-item audio { flex: 1; height: 32px; }

/* Export Summary */
.export-summary { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; margin: 20px 0; }
.summary-item { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.summary-icon { font-size: 22px; display: block; margin-bottom: 6px; }
.summary-label { font-size: 12px; color: var(--text-muted); display: block; }
.summary-status { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); display: block; margin-top: 4px; }
.summary-status.done { color: var(--success); }
.export-progress.hidden { display: none; }
.export-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.export-step { display: flex; align-items: center; gap: 12px; }
.es-icon { font-size: 18px; }
.export-step span { font-size: 13px; width: 80px; color: var(--text-muted); }
.es-bar { flex: 1; height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.es-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent3)); width: 0; transition: width .6s ease; }
.btn-export { background: linear-gradient(135deg, var(--accent2), var(--accent)); }

/* Section Styles */
.section-models, .section-gallery, .section-settings {
  position: relative; z-index: 1;
  padding: 80px 24px;
  border-top: 1px solid var(--border);
}
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 32px; font-weight: 700; margin-bottom: 10px; }
.section-header p { color: var(--text-muted); font-size: 16px; }
.section-models { background: var(--bg); }
.section-gallery { background: var(--bg2); }
.section-settings { background: var(--bg); }

/* Model Categories */
.model-categories { display: flex; flex-direction: column; gap: 32px; }
.model-category h3 { font-size: 16px; color: var(--text-muted); margin-bottom: 16px; font-weight: 600; letter-spacing: .5px; }
.model-cards-row { display: flex; flex-wrap: wrap; gap: 12px; }
.model-showcase-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all .2s;
  min-width: 180px;
}
.model-showcase-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.msc-logo { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.msc-info { display: flex; flex-direction: column; gap: 2px; }
.msc-info strong { font-size: 14px; }
.msc-info span { font-size: 11px; color: var(--text-dim); }
.msc-badge { margin-left: auto; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: var(--success); font-size: 10px; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 20px; }
.gallery-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all .25s;
}
.gallery-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.gc-thumb {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.gc-icon { font-size: 56px; }
.gc-play {
  position: absolute;
  width: 48px; height: 48px;
  background: rgba(0,0,0,.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0;
  transition: opacity .2s;
}
.gallery-card:hover .gc-play { opacity: 1; }
.gc-duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); }
.gc-info { padding: 14px; }
.gc-info strong { display: block; font-size: 14px; margin-bottom: 4px; }
.gc-info span { font-size: 12px; color: var(--text-muted); }

/* Settings — redesigned */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}
.settings-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.settings-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg3), var(--bg2));
}
.settings-cat {
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .4px;
  margin: 0;
}
.settings-cat-icon { font-size: 16px; }
.settings-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.settings-row {
  display: grid;
  grid-template-columns: 120px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s;
}
.settings-row:hover { border-color: var(--border2); }
.sr-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
}
.sr-label-logo {
  width: 20px; height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
}
.sr-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sr-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-mono);
  padding: 2px 4px;
  width: 100%;
  min-width: 0;
  transition: color .2s;
}
.sr-input:focus { outline: none; color: var(--accent); }
.sr-input::placeholder { color: var(--text-dim); font-size: 12px; }
.sr-status { font-size: 11px; white-space: nowrap; }
.sr-status.ok  { color: var(--success); }
.sr-status.err { color: var(--error); }
.sr-status.saved { color: var(--accent2); }
.settings-row .btn-sm { flex-shrink: 0; padding: 4px 10px; font-size: 11px; }


/* Footer */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  background: var(--bg);
}
.footer-inner { max-width: 800px; margin: 0 auto; }
.footer-logo { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.footer p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.footer-links { display: flex; gap: 24px; justify-content: center; margin-bottom: 16px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 14px; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { color: var(--text-dim) !important; font-size: 12px !important; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(8px); }
.modal-box {
  position: relative; z-index: 1;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 36px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: panelIn .3s cubic-bezier(.22,1,.36,1);
}
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
.modal-box h3 { font-size: 22px; margin-bottom: 4px; }
.demo-steps { display: flex; flex-direction: column; gap: 10px; }
.ds { display: flex; align-items: center; gap: 14px; padding: 10px; background: var(--bg3); border-radius: var(--radius-sm); font-size: 14px; }
.ds-num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }

/* Generating animation */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.generating {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
  border-radius: var(--radius-sm);
  height: 16px;
  margin: 8px 0;
}

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toastIn .3s cubic-bezier(.22,1,.36,1);
  max-width: 320px;
}
@keyframes toastIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: none; } }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.info    { border-left: 3px solid var(--accent3); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Responsive */
@media(max-width: 900px) {
  .hero { flex-direction: column; padding-top: 100px; }
  .hero-content { margin: 0 auto; text-align: center; }
  .hero-visual { display: none; }
  .hero-stats { justify-content: center; }
  .hero-cta { justify-content: center; }
  .steps-inner { gap: 4px; }
  .step-label { display: none; }
  .step-line { width: 16px; }
  .character-workspace { grid-template-columns: 1fr; }
  .export-summary { grid-template-columns: repeat(3,1fr); }
  .panel-body { padding: 20px 16px; }
}

/* ---- User Pill (header) ---- */
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px 4px 4px;
}
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role {
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 1px;
  font-family: var(--font-mono);
}
.user-logout {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color .2s;
}
.user-logout:hover { color: var(--error); }

/* ---- Guest Feature Section ---- */
.guest-section {
  position: relative;
  z-index: 1;
  padding: 60px 24px 80px;
}
.guest-inner { max-width: 1200px; margin: 0 auto; }
.guest-header {
  text-align: center;
  margin-bottom: 40px;
}
.guest-header h2 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.guest-header p  { color: var(--text-muted); font-size: 15px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media(max-width: 900px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media(max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: all .25s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.fc-cta {
  background: linear-gradient(135deg, rgba(230,57,80,.1), rgba(123,92,250,.1));
  border-color: rgba(230,57,80,.25);
  text-align: center;
  align-items: center;
}
.fc-icon { font-size: 32px; }
.feature-card h3 { font-size: 16px; font-weight: 700; }
.feature-card p  { color: var(--text-muted); font-size: 13px; line-height: 1.7; flex: 1; }
.fc-models {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  background: var(--bg3);
  border-radius: 6px;
  padding: 5px 10px;
  margin-top: 4px;
}

/* ---- WeChat env overrides ---- */
[data-env="wechat"] .header { padding-top: env(safe-area-inset-top); }
[data-env="wechat"] .btn-hero-outline { display: none; }
[data-env="miniprogram"] .nav { display: none; }
.wechat-only { display: none; }

/* ============================================
   全站响应式 — 平板 & 手机
   ============================================ */

/* ---- 平板 (max 1024px) ---- */
@media (max-width: 1024px) {
  .hero { padding: 90px 20px 50px; }
  .hero-visual { display: none; }
  .hero-title { font-size: clamp(32px,5vw,64px); }
  .workspace { padding: 60px 16px 40px; }
  .steps-bar { padding: 16px 12px; overflow-x: auto; }
  .steps-inner { min-width: 520px; }
  .panel-body { padding: 20px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .model-cards-row { flex-wrap: wrap; }
  .section-models,.section-gallery,.section-settings { padding: 60px 20px; }
  .gallery-grid { grid-template-columns: repeat(2,1fr); }
  .export-summary { grid-template-columns: repeat(3,1fr); }
}

/* ---- 手机大屏 (max 768px) ---- */
@media (max-width: 768px) {
  /* Header */
  .header-inner { padding: 0 14px; height: 56px; gap: 10px; }
  .nav { display: none; }
  .logo-text { font-size: 15px; }
  .logo-badge { display: none; }
  .user-name { display: none; }

  /* Hero */
  .hero { padding: 76px 16px 44px; text-align: center; min-height: auto; }
  .hero-content { margin: 0 auto; }
  .hero-stats { justify-content: center; gap: 4px; }
  .stat { padding: 0 10px; }
  .stat-num { font-size: 22px; }
  .hero-cta { justify-content: center; flex-direction: column; align-items: center; gap: 10px; }
  .btn-hero, .btn-hero-outline { width: 100%; max-width: 300px; text-align: center; }

  /* Steps */
  .steps-bar { padding: 12px 10px; border-radius: 12px; }
  .steps-inner { gap: 2px; min-width: auto; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .step-item { flex-direction: column; gap: 4px; min-width: 56px; }
  .step-label { font-size: 10px; text-align: center; }
  .step-circle { width: 34px; height: 34px; font-size: 15px; }
  .step-line { width: 12px; margin: 0; align-self: flex-start; margin-top: 17px; }

  /* Panel */
  .panel-header { padding: 18px 16px 14px; }
  .panel-header h2 { font-size: 18px; }
  .panel-body { padding: 16px; }
  .panel-footer { padding: 14px 16px; flex-wrap: wrap; }
  .apikey-bar { flex-wrap: wrap; gap: 8px; }
  .action-row { flex-direction: column; align-items: stretch; }
  .action-row .btn-generate, .action-row .btn-secondary { width: 100%; justify-content: center; }
  .form-row { flex-direction: column; }
  .form-group.half { flex: unset; width: 100%; }
  .output-area { min-height: 180px; max-height: 360px; }
  .storyboard-grid { grid-template-columns: repeat(2,1fr); }
  .video-grid { grid-template-columns: 1fr; }
  .character-workspace { grid-template-columns: 1fr; }
  .export-summary { grid-template-columns: repeat(2,1fr); }
  .export-steps { gap: 8px; }
  .radio-group { flex-direction: column; gap: 8px; }

  /* Settings */
  .settings-grid { grid-template-columns: 1fr; gap: 14px; }
  .settings-row { grid-template-columns: 100px 1fr auto; }
  .settings-row .sr-status { display: none; }

  /* Gallery */
  .gallery-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }
  .gc-thumb { height: 120px; }

  /* Models */
  .model-categories { gap: 20px; }
  .model-cards-row { gap: 8px; }
  .model-showcase-card { min-width: 150px; padding: 10px 12px; }

  /* Feature grid (guest) */
  .feature-grid { grid-template-columns: 1fr; gap: 12px; }
  .feature-card { padding: 18px; }

  /* Footer */
  .footer { padding: 28px 16px; }
  .footer-links { gap: 16px; flex-wrap: wrap; justify-content: center; }

  /* Modal */
  .modal-box { padding: 24px 18px; }
  .demo-steps { gap: 8px; }

  /* Toast */
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
}

/* ---- 手机小屏 (max 480px) ---- */
@media (max-width: 480px) {
  .hero-title { font-size: 32px; }
  .hero-badge { font-size: 10px; padding: 5px 12px; }
  .hero-stats { gap: 2px; }
  .stat { padding: 0 6px; }
  .stat-divider { display: none; }
  .steps-inner { gap: 0; }
  .step-line { width: 8px; }
  .logo-icon { font-size: 20px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .export-summary { grid-template-columns: repeat(3,1fr); }
  .model-selector { gap: 6px; }
  .model-card { padding: 6px 8px; }
  .model-name { display: none; }
  .style-grid { gap: 6px; }
  .style-tag { padding: 4px 10px; font-size: 12px; }
  .btn-generate { padding: 10px 18px; font-size: 14px; }
  .settings-row { grid-template-columns: 90px 1fr auto; }
  .sr-label span { display: none; }
  .sr-label-logo { width: 18px; height: 18px; }
  .section-header h2 { font-size: 22px; }
  .panel-header h2 { font-size: 16px; }
}

/* ---- 横屏手机修正 ---- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 70px 20px 30px; }
  .hero-title { font-size: 28px; }
}

/* ---- 微信内嵌安全区 ---- */
[data-env="wechat"] body,
[data-env="miniprogram"] body {
  padding-bottom: env(safe-area-inset-bottom);
}
[data-env="miniprogram"] .header {
  display: none;
}
[data-env="miniprogram"] .main {
  padding-top: 0;
}

/* ---- 平板竖屏 (768-1024) ---- */
@media (min-width: 769px) and (max-width: 1024px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .export-summary { grid-template-columns: repeat(5,1fr); }
  .gallery-grid { grid-template-columns: repeat(3,1fr); }
  .steps-inner { min-width: auto; }
  .step-label { font-size: 11px; }
  .step-line { width: 20px; }
  .nav { display: flex; }
  .header-inner { padding: 0 20px; }
}

/* ---- 触摸设备优化 ---- */
@media (hover: none) {
  .film-frame { animation: none; }
  .gallery-card:hover { transform: none; }
  .model-showcase-card:hover { transform: none; }
  .btn-hero:hover { transform: none; }
  .btn-generate:hover { transform: none; }
  /* 增大触摸目标 */
  .btn-sm { min-height: 36px; padding: 6px 14px; }
  .radio-item { min-height: 36px; }
  .style-tag { padding: 8px 16px; }
  .nav-link { padding: 8px 16px; }
}

/* ---- 滚动优化 ---- */
.steps-inner { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.steps-inner::-webkit-scrollbar { display: none; }
.output-area { -webkit-overflow-scrolling: touch; }


/* ============================================
   全站响应式 — 平板 & 手机
   ============================================ */

/* 平板 max-1024 */
@media (max-width: 1024px) {
  .hero { padding: 90px 20px 50px; }
  .hero-visual { display: none; }
  .hero-title { font-size: clamp(32px,5vw,64px); }
  .workspace { padding: 60px 16px 40px; }
  .steps-bar { padding: 16px 12px; overflow-x: auto; }
  .steps-inner { min-width: 520px; }
  .panel-body { padding: 20px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .model-cards-row { flex-wrap: wrap; }
  .section-models,.section-gallery,.section-settings { padding: 60px 20px; }
  .gallery-grid { grid-template-columns: repeat(2,1fr); }
  .export-summary { grid-template-columns: repeat(3,1fr); }
}

/* 手机大屏 max-768 */
@media (max-width: 768px) {
  .header-inner { padding: 0 14px; height: 56px; gap: 10px; }
  .nav { display: none; }
  .logo-text { font-size: 15px; }
  .logo-badge { display: none; }
  .user-name { display: none; }
  .hero { padding: 76px 16px 44px; text-align: center; min-height: auto; }
  .hero-content { margin: 0 auto; }
  .hero-stats { justify-content: center; gap: 4px; }
  .stat { padding: 0 10px; }
  .stat-num { font-size: 22px; }
  .hero-cta { justify-content: center; flex-direction: column; align-items: center; gap: 10px; }
  .btn-hero, .btn-hero-outline { width: 100%; max-width: 300px; text-align: center; }
  .steps-bar { padding: 12px 10px; border-radius: 12px; }
  .steps-inner { gap: 2px; min-width: auto; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .step-item { flex-direction: column; gap: 4px; min-width: 56px; }
  .step-label { font-size: 10px; text-align: center; }
  .step-circle { width: 34px; height: 34px; font-size: 15px; }
  .step-line { width: 12px; margin: 0; align-self: flex-start; margin-top: 17px; }
  .panel-header { padding: 18px 16px 14px; }
  .panel-header h2 { font-size: 18px; }
  .panel-body { padding: 16px; }
  .panel-footer { padding: 14px 16px; flex-wrap: wrap; }
  .apikey-bar { flex-wrap: wrap; gap: 8px; }
  .action-row { flex-direction: column; align-items: stretch; }
  .action-row .btn-generate, .action-row .btn-secondary { width: 100%; justify-content: center; }
  .form-row { flex-direction: column; }
  .form-group.half { flex: unset; width: 100%; }
  .output-area { min-height: 180px; max-height: 360px; }
  .storyboard-grid { grid-template-columns: repeat(2,1fr); }
  .video-grid { grid-template-columns: 1fr; }
  .character-workspace { grid-template-columns: 1fr; }
  .export-summary { grid-template-columns: repeat(2,1fr); }
  .export-steps { gap: 8px; }
  .radio-group { flex-direction: column; gap: 8px; }
  .settings-grid { grid-template-columns: 1fr; gap: 14px; }
  .settings-row { grid-template-columns: 100px 1fr auto; }
  .settings-row .sr-status { display: none; }
  .gallery-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }
  .gc-thumb { height: 120px; }
  .model-categories { gap: 20px; }
  .model-cards-row { gap: 8px; }
  .model-showcase-card { min-width: 150px; padding: 10px 12px; }
  .feature-grid { grid-template-columns: 1fr; gap: 12px; }
  .feature-card { padding: 18px; }
  .footer { padding: 28px 16px; }
  .footer-links { gap: 16px; flex-wrap: wrap; justify-content: center; }
  .modal-box { padding: 24px 18px; }
  .demo-steps { gap: 8px; }
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
  .user-pill { padding: 3px 8px 3px 3px; }
}

/* 手机小屏 max-480 */
@media (max-width: 480px) {
  .hero-title { font-size: 32px; }
  .hero-badge { font-size: 10px; padding: 5px 12px; }
  .stat-divider { display: none; }
  .stat { padding: 0 6px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .model-card { padding: 6px 8px; }
  .model-name { display: none; }
  .style-tag { padding: 4px 10px; font-size: 12px; }
  .btn-generate { padding: 10px 18px; font-size: 14px; }
  .settings-row { grid-template-columns: 36px 1fr auto; }
  .sr-label span { display: none; }
  .section-header h2 { font-size: 22px; }
  .panel-header h2 { font-size: 16px; }
  .export-summary { grid-template-columns: repeat(3,1fr); }
}

/* 横屏手机 */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 70px 20px 30px; }
  .hero-title { font-size: 28px; }
}

/* 平板竖屏 768-1024 */
@media (min-width: 769px) and (max-width: 1024px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .export-summary { grid-template-columns: repeat(5,1fr); }
  .gallery-grid { grid-template-columns: repeat(3,1fr); }
  .steps-inner { min-width: auto; }
  .step-label { font-size: 11px; }
  .step-line { width: 20px; }
  .nav { display: flex; }
  .header-inner { padding: 0 20px; }
}

/* 微信安全区 */
[data-env="wechat"] body,[data-env="miniprogram"] body { padding-bottom: env(safe-area-inset-bottom); }
[data-env="miniprogram"] .header { display: none; }

/* 触摸设备优化 */
@media (hover: none) {
  .film-frame { animation: none; }
  .gallery-card:hover,.model-showcase-card:hover,.btn-hero:hover,.btn-generate:hover { transform: none; }
  .btn-sm { min-height: 36px; }
  .style-tag { padding: 8px 16px; }
}

/* 滚动优化 */
.steps-inner { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.steps-inner::-webkit-scrollbar { display: none; }
.output-area { -webkit-overflow-scrolling: touch; }
