/* QuickFaceSwap v2 — main.css
   反 AI 味：米色奶油背景 + 番茄红强调 + Bricolage Grotesque 标题
   复古印刷风：硬阴影 + 混用圆角 + 衬线标题
   工具优先：首屏就是工具，无 marketing hero */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,800&family=JetBrains+Mono:wght@500&display=swap');

:root {
  /* 米色奶油 + 深棕 */
  --bg: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-warm: #F4EFE6;
  --bg-dark: #2D2419;
  --text: #2D2419;
  --text-dim: #6B5D4F;
  --text-muted: #A89B89;
  --on-dark: #FAF7F2;

  /* 强调色：番茄红（不是紫蓝） */
  --accent: #FF5C39;
  --accent-hover: #E64A26;
  --accent-soft: #FFE5DD;

  --success: #2D7D5A;
  --success-soft: #DCEEDF;
  --danger: #C73E1D;
  --danger-soft: #FCE0DA;
  --warning: #E8B547;
  --warning-soft: #FDF1D6;

  --border: #E5DDD0;
  --border-strong: #C7BBA6;

  /* 混用圆角（不是统一 12px） */
  --r-button: 24px;
  --r-upload: 8px;
  --r-card: 4px;
  --r-pill: 999px;

  /* 硬阴影（不是模糊渐变阴影） */
  --shadow-sm: 0 1px 0 var(--border-strong);
  --shadow: 0 2px 0 var(--border-strong);
  --shadow-accent: 3px 3px 0 var(--accent);
  --shadow-dark: 4px 4px 0 var(--bg-dark);

  --font-display: 'Bricolage Grotesque', Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --max-width: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Display font helper */
.display { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.mono { font-family: var(--font-mono); }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  color: var(--text); text-decoration: none;
  font-family: var(--font-display); font-weight: 800; font-size: 19px;
  letter-spacing: -0.02em;
}
.logo-mark {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 2px 2px 0 var(--bg-dark);
}
.logo-mark svg { width: 16px; height: 16px; }
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; gap: 18px; }
.nav-links a {
  color: var(--text-dim); font-size: 14px; text-decoration: none;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); }
.quota-badge {
  font-family: var(--font-mono); font-size: 12px;
  padding: 4px 10px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-dim);
}
.quota-badge b { color: var(--accent); }
@media (max-width: 640px) {
  .nav-links { display: none; }
}

/* ============ Tool (首屏) ============ */
.tool-section {
  padding: 24px 0 32px;
}
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 880px) {
  .tool-grid { grid-template-columns: 1fr; }
}

.tool-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.tool-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 800;
}
.tool-subtitle {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 24px;
  max-width: 540px;
}

/* 上传区 */
.uploads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 520px) {
  .uploads { grid-template-columns: 1fr; }
}
.upload-box {
  background: var(--bg-card);
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-upload);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.upload-box:hover, .upload-box.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.upload-box.has-image {
  padding: 0;
  border-style: solid;
  border-color: var(--bg-dark);
  box-shadow: var(--shadow-dark);
  overflow: hidden;
}
.upload-box .upload-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}
.upload-box .upload-label strong { color: var(--text); }
.upload-box .upload-icon {
  width: 28px; height: 28px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.upload-box.has-image .upload-label,
.upload-box.has-image .upload-icon {
  display: none;
}

/* Swap button — 大圆角 + 硬阴影 */
.swap-btn {
  width: 100%;
  padding: 16px 24px;
  background: var(--accent);
  color: white;
  border: 2px solid var(--bg-dark);
  border-radius: var(--r-button);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--bg-dark);
  transition: transform 0.08s, box-shadow 0.08s;
  letter-spacing: -0.01em;
}
.swap-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}
.swap-btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--bg-dark);
}
.swap-btn:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: 2px 2px 0 var(--border-strong);
}
.swap-btn.loading {
  background: var(--bg-warm);
  color: var(--text-dim);
  pointer-events: none;
}

/* Result panel */
.result-panel {
  background: var(--bg-card);
  border: 2px solid var(--bg-dark);
  border-radius: var(--r-upload);
  box-shadow: var(--shadow-dark);
  min-height: 280px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Empty state inside result panel */
.result-empty {
  text-align: center;
  color: var(--text-muted);
}
.result-empty svg {
  width: 64px; height: 64px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.result-empty p {
  font-size: 14px;
  max-width: 280px;
}

/* Loading state */
.result-loading {
  text-align: center;
}
.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.result-loading p { font-size: 14px; color: var(--text-dim); }

/* Done state */
.result-done { width: 100%; text-align: center; }
.result-done img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--r-upload);
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto 16px;
}
.result-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  padding: 10px 18px;
  border-radius: var(--r-button);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn:hover { background: var(--bg-warm); }
.btn-primary {
  background: var(--bg-dark);
  color: var(--on-dark);
  border-color: var(--bg-dark);
}
.btn-primary:hover { background: var(--text); }

/* ============ Messages ============ */
.message {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--r-upload);
  font-size: 14px;
  display: none;
  border-left: 4px solid;
}
.message.show { display: block; }
.message.error {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}
.message.warning {
  background: var(--warning-soft);
  border-color: var(--warning);
  color: #8B6914;
}
.message.success {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

/* ============ Sections ============ */
.section { padding: 40px 0; border-top: 1px dashed var(--border-strong); }
.section-title {
  font-family: var(--font-display);
  font-size: 26px;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.section-title em { color: var(--accent); font-style: italic; }

/* How it works — 横向 3 步 */
.steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .steps { grid-template-columns: 1fr; }
}
.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px;
  position: relative;
}
.step-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.step h3 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 6px 0 4px;
}
.step p { color: var(--text-dim); font-size: 13px; }

/* Features — 不是 grid 卡片，改成 checklist */
.feature-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 20px 24px;
}
.feature-list ul { list-style: none; }
.feature-list li {
  padding: 8px 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14.5px;
}
.feature-list li svg {
  width: 18px; height: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}
.feature-list li strong { color: var(--text); }

/* Examples — 不规则 grid */
.examples {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
@media (max-width: 640px) {
  .examples { grid-template-columns: repeat(3, 1fr); }
}
.example img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r-upload);
  border: 1px solid var(--border);
  background: var(--bg-warm);
}

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.faq-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  list-style: none;
  padding-right: 28px;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0; top: -2px;
  color: var(--accent);
  font-size: 22px;
  font-family: var(--font-mono);
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 14px;
  max-width: 680px;
}

/* ============ Footer ============ */
footer {
  border-top: 1px dashed var(--border-strong);
  padding: 24px 0 36px;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-warm);
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
}
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links a { color: var(--text-dim); font-size: 13px; text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-disclaimer {
  padding: 10px 14px;
  background: var(--warning-soft);
  border-left: 3px solid var(--warning);
  color: var(--text-dim);
  font-size: 12px;
  border-radius: 4px;
}
.footer-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 16px;
}

/* ============ Legal pages ============ */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 0;
}
.legal h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.legal h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 32px 0 10px;
}
.legal p, .legal li {
  color: var(--text-dim);
  margin-bottom: 8px;
  font-size: 15px;
}
.legal ul {
  margin-left: 24px;
  margin-bottom: 16px;
}
.legal .meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
  font-family: var(--font-mono);
}
.legal strong { color: var(--text); }

/* ============ Consent & age check ============ */
.consent-banner {
  background: var(--warning-soft);
  border-left: 3px solid var(--warning);
  padding: 10px 14px;
  border-radius: var(--r-upload);
  font-size: 13px;
  color: #8B6914;
  margin-bottom: 20px;
  max-width: 680px;
}
.consent-banner strong { color: #6B520E; }
.consent-banner a { color: var(--accent); }

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0;
  padding: 10px 12px;
  background: var(--bg-warm);
  border-radius: var(--r-upload);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dim);
}
.consent-check input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.consent-check strong { color: var(--text); }
.consent-check a { color: var(--accent); }
/* when consent required but not checked, dim the swap button extra */
.consent-check:has(input:not(:checked)) ~ .swap-btn {
  opacity: 0.5;
}

/* ============ Footer v3 ============ */
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.footer-social a {
  color: var(--text-dim);
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: all 0.15s;
}
.footer-social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.footer-social svg { width: 16px; height: 16px; }

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 640px) {
  .footer-links-grid { grid-template-columns: repeat(2, 1fr); }
}
.footer-links-grid h4 {
  font-family: var(--font-display);
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text);
}
.footer-links-grid a {
  display: block;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  padding: 3px 0;
}
.footer-links-grid a:hover {
  color: var(--accent);
}

/* ============ Cookie banner ============ */
.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 520px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 2px solid var(--bg-dark);
  border-radius: var(--r-upload);
  padding: 14px 16px;
  box-shadow: var(--shadow-dark);
  display: none;
  z-index: 200;
}
.cookie-banner.show { display: block; }
.cookie-banner p { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.cookie-banner .actions { display: flex; gap: 8px; }

/* utility */
.hidden { display: none !important; }
