/* ============ 爱情短剧工坊 · 样式表 ============ */
:root {
  --bg: #faf6f2;
  --card: #ffffff;
  --ink: #2e2622;
  --ink-2: #6b5c52;
  --ink-3: #a89a90;
  --gold: #b8873f;
  --gold-soft: #d4a95f;
  --rose: #c2657a;
  --rose-soft: #f4dfe3;
  --line: #ece3da;
  --shadow: 0 8px 30px rgba(120, 85, 55, .08);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---------- 顶部 ---------- */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  padding: 24px clamp(16px, 4vw, 48px);
  background: linear-gradient(135deg, #fff 0%, #fdf8f4 100%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand-mark {
  width: 56px; height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  color: #fff; border-radius: 16px;
  font-size: 13px; font-weight: 800; letter-spacing: -1px;
  box-shadow: 0 6px 16px rgba(194, 101, 122, .28);
}
.brand-mark span { font-size: 18px; margin: 0 1px; }
.brand h1 { font-size: clamp(20px, 2.5vw, 26px); letter-spacing: 1px; }
.brand p { font-size: 13px; color: var(--ink-2); }
.engine-badge {
  font-size: 12px; color: #5a8a5a; background: #eef7ee;
  padding: 6px 14px; border-radius: 20px; border: 1px solid #d5e8d5;
}

/* ---------- 主体布局 ---------- */
.layout {
  max-width: 1240px; margin: 0 auto;
  padding: clamp(20px, 3vw, 40px) clamp(16px, 4vw, 40px);
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 28px;
  align-items: start;
}
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow);
}
.panel-title {
  font-size: 16px; font-weight: 700; margin: 0 0 18px;
  display: flex; align-items: center; gap: 10px;
}
.panel-title:not(:first-child) { margin-top: 32px; }
.step {
  width: 26px; height: 26px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--rose-soft); color: var(--rose);
  border-radius: 8px; font-size: 12px; font-weight: 800;
}

/* ---------- 上传 ---------- */
.photo-upload { display: flex; align-items: center; gap: 14px; }
.upload-box {
  flex: 1; aspect-ratio: 1; max-height: 220px;
  border: 2px dashed var(--line); border-radius: 14px;
  cursor: pointer; overflow: hidden; position: relative;
  transition: .25s; background: #fdfaf8;
  display: flex; align-items: center; justify-content: center;
}
.upload-box:hover { border-color: var(--gold-soft); background: #fdf6ee; }
.upload-box.filled { border-style: solid; border-color: var(--gold-soft); }
.upload-placeholder { text-align: center; color: var(--ink-2); padding: 10px; }
.upload-icon { display: block; font-size: 36px; color: var(--gold-soft); line-height: 1; }
.upload-label { display: block; font-weight: 700; margin-top: 8px; color: var(--ink); }
.upload-hint { display: block; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.preview-img { display: none; width: 100%; height: 100%; object-fit: cover; }
.upload-box.filled .preview-img { display: block; }
.upload-box.filled .upload-placeholder { display: none; }
.heart { color: var(--rose); font-size: 24px; flex-shrink: 0; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input, .field select {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; color: var(--ink); background: #fdfbf9;
  outline: none; transition: .2s; font-family: inherit;
}
.field input:focus, .field select:focus { border-color: var(--gold-soft); background: #fff; }

/* ---------- 风格选择 ---------- */
.style-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.style-btn {
  padding: 14px 6px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fdfbf9; cursor: pointer; transition: .2s; font-family: inherit;
  text-align: center;
}
.style-btn b { display: block; font-size: 14px; color: var(--ink); }
.style-btn span { display: block; font-size: 10px; color: var(--ink-3); margin-top: 4px; }
.style-btn:hover { border-color: var(--gold-soft); }
.style-btn.active { border-color: var(--rose); background: var(--rose-soft); }
.style-btn.active b { color: var(--rose); }

.option-row { display: grid; grid-template-columns: 1fr 0.8fr 0.8fr; gap: 12px; margin-top: 18px; }
.toggle-field { justify-content: flex-end; }
.switch { position: relative; width: 46px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: #d9d0c8; border-radius: 26px;
  cursor: pointer; transition: .25s;
}
.slider:before {
  content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .25s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--rose); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* ---------- 生成按钮 ---------- */
.generate-btn {
  width: 100%; margin-top: 26px; padding: 16px;
  background: linear-gradient(135deg, var(--rose), #a95066);
  color: #fff; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer; transition: .25s; font-family: inherit;
  box-shadow: 0 6px 18px rgba(194, 101, 122, .3);
}
.generate-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(194,101,122,.4); }
.generate-btn:disabled { opacity: .55; cursor: not-allowed; }
.privacy-note { text-align: center; font-size: 11px; color: var(--ink-3); margin-top: 12px; }

/* ---------- 预览区 ---------- */
.preview-panel { position: sticky; top: 24px; }
.video-stage {
  width: 100%; aspect-ratio: 9 / 16; max-height: 560px;
  background: linear-gradient(135deg, #2e2622, #4a3a30);
  border-radius: 14px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.stage-empty { text-align: center; color: #c9b8a8; padding: 24px; }
.stage-icon { font-size: 48px; color: var(--gold-soft); margin-bottom: 12px; }
.stage-empty p { font-size: 14px; line-height: 1.8; }
.stage-progress { text-align: center; color: #e8dccf; width: 80%; }
.spinner {
  width: 44px; height: 44px; margin: 0 auto 18px;
  border: 3px solid rgba(212,169,95,.25); border-top-color: var(--gold-soft);
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-text { font-size: 15px; margin-bottom: 14px; }
.progress-bar { height: 6px; background: rgba(255,255,255,.15); border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--rose), var(--gold-soft)); transition: width .3s; }
.progress-hint { font-size: 11px; color: #a99686; margin-top: 10px; }
.result-video { width: 100%; height: 100%; object-fit: contain; background: #1a1410; }
.hidden { display: none !important; }

.result-actions { display: flex; gap: 10px; margin-top: 16px; }
.download-btn, .regen-btn {
  flex: 1; text-align: center; padding: 13px; border-radius: 10px;
  font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
  font-family: inherit; transition: .2s;
}
.download-btn { background: var(--gold); color: #fff; }
.download-btn:hover { background: #a8782f; }
.regen-btn { background: #f5efe9; color: var(--ink-2); border: 1px solid var(--line); }
.regen-btn:hover { background: #ece2d8; }

.tips-box { margin-top: 24px; background: #fdf6ee; border: 1px solid #f0e2d2; border-radius: 12px; padding: 18px 20px; }
.tips-box h3 { font-size: 13px; color: var(--gold); margin-bottom: 10px; }
.tips-box ul { list-style: none; font-size: 12px; color: var(--ink-2); line-height: 1.9; }
.tips-box li:before { content: "· "; color: var(--rose); font-weight: 700; }
.tips-box b { color: var(--ink); }

/* ---------- 页脚 ---------- */
.site-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 24px clamp(16px, 4vw, 48px); margin-top: 20px;
  border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .video-stage { max-height: 480px; }
}
@media (max-width: 560px) {
  .form-grid, .option-row { grid-template-columns: 1fr; }
  .style-row { grid-template-columns: 1fr; }
  .style-btn { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; text-align: left; }
  .style-btn span { margin-top: 0; }
  .photo-upload { gap: 8px; }
  .upload-box { max-height: 160px; }
  .heart { font-size: 18px; }
  .site-header { padding: 18px 16px; }
  .brand-mark { width: 46px; height: 46px; }
}
