:root {
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --border: #E5EAF0;
  --text: #0F172A;
  --muted: #64748B;
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --success: #059669;
  --success-bg: #ECFDF5;
  --warning: #D97706;
  --warning-bg: #FFFBEB;
  --danger: #DC2626;
  --bg-accent: #EFF6FF;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  font-family: "PingFang SC", "Noto Sans SC", Inter, system-ui, -apple-system, sans-serif;
}

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

.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px 56px;
}

/* ——— Top bar ——— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid transparent;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--bg-accent);
  color: var(--primary);
  border: 1px solid #DBEAFE;
}
.brand-name { display: block; font-size: 1.05rem; font-weight: 650; letter-spacing: 0.01em; }
.brand-tag { font-size: 0.75rem; color: var(--muted); }
.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav a:hover { color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.price-pill {
  background: var(--bg-accent);
  color: var(--primary);
  border: 1px solid #BFDBFE;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ——— Hero ——— */
.hero {
  padding: 28px 0 8px;
  text-align: left;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero-sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 1rem;
}
.trust-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}
.trust-strip li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}
.trust-strip svg { color: var(--primary); flex-shrink: 0; }

.pay-banner {
  margin: 18px 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.pay-banner p { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }
.pay-banner strong { color: var(--text); }

/* ——— Steps ——— */
.steps {
  list-style: none;
  margin: 22px 0 18px;
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 8px;
  z-index: 20;
}
.step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}
.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #EEF2F7;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.step.on {
  color: var(--primary);
  background: var(--bg-accent);
}
.step.on .step-num {
  background: var(--primary);
  color: #fff;
}
.step.done { color: var(--success); }
.step.done .step-num {
  background: var(--success-bg);
  color: var(--success);
}
.step.done .step-num::after { content: none; }
.step.processing .step-num {
  background: var(--warning-bg);
  color: var(--warning);
}

/* ——— Workbench ——— */
.workbench {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.15fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) {
  .workbench {
    grid-template-columns: 1fr;
  }
  .preview-panel { order: -1; }
  .nav { display: none; }
  .steps { border-radius: 16px; }
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.panel-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 650;
}
.panel-title.spaced { margin-top: 20px; }

/* Drop zone */
.drop {
  border: 1.5px dashed #CBD5E1;
  border-radius: 12px;
  background: #FAFBFC;
  min-height: 168px;
  display: grid;
  place-items: center;
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.drop:hover, .drop:focus-visible, .drop.drag {
  border-color: var(--primary);
  background: var(--bg-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.drop-inner { text-align: center; }
.drop-icon {
  width: 64px; height: 64px;
  margin: 0 auto 10px;
  border-radius: 16px;
  background: var(--bg-accent);
  color: var(--primary);
  display: grid; place-items: center;
}
.drop-title { margin: 0 0 4px; font-weight: 600; font-size: 0.98rem; }
.drop-hint { margin: 0 0 14px; color: var(--muted); font-size: 0.84rem; }
.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: var(--bg-accent);
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--text);
}
.linkish {
  appearance: none;
  border: 0;
  background: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.86rem;
}
.privacy-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.privacy-line svg { margin-top: 2px; color: var(--success); flex-shrink: 0; }

/* Fields & chips */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.field-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.field-label em {
  font-style: normal;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
input[type="search"], select {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
}
input[type="search"]:focus, select:focus, input[type="range"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
input[type="range"] { width: 100%; accent-color: var(--primary); }
.inline-color {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.inline-color .field-label { margin: 0; }
input[type="color"] {
  width: 40px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}

.purpose-row, .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.chip, .purpose {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  height: 36px;
  padding: 0 14px;
  font-size: 0.86rem;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s, color 0.1s;
}
.chip:hover, .purpose:hover { border-color: #93C5FD; }
.chip.active, .purpose.active {
  background: var(--bg-accent);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.chip .mm {
  color: var(--muted);
  font-size: 0.72rem;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}
.chip.active .mm { color: #60A5FA; }
.colors .chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.swatch {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}
.chip.active .swatch {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--primary);
}

.sliders { display: flex; flex-direction: column; gap: 4px; }
.options-row { margin: 8px 0 4px; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}
.check input { accent-color: var(--primary); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-sm);
  height: 44px;
  padding: 0 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, filter 0.1s;
}
.btn.sm { height: 36px; padding: 0 12px; font-size: 0.84rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-secondary:hover:not(:disabled) { background: #F8FAFC; border-color: #CBD5E1; }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--primary);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-accent); }

.status {
  min-height: 1.35em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.status.error { color: var(--danger); }
.status.ok { color: var(--success); }

/* ——— Preview ——— */
.preview-card { position: sticky; top: 72px; }
.preview-stage {
  min-height: 380px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #F8FAFC 0%, #EEF2F7 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 16px;
}
.preview-empty { text-align: center; width: 100%; max-width: 420px; }
.preview-empty-title { margin: 16px 0 4px; font-weight: 650; }
.preview-empty-hint { margin: 0; color: var(--muted); font-size: 0.86rem; }

.demo-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
}
.demo-card {
  width: 110px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px 8px;
  box-shadow: var(--shadow-sm);
  font-size: 0.72rem;
  color: var(--muted);
}
.demo-face {
  height: 120px;
  border-radius: 6px;
  margin-bottom: 8px;
  background:
    radial-gradient(circle at 50% 42%, #F1C27D 0 18%, transparent 19%),
    radial-gradient(circle at 50% 78%, #334155 0 28%, transparent 29%),
    linear-gradient(180deg, #E2E8F0, #CBD5E1);
}
.demo-face.on-blue {
  background:
    radial-gradient(circle at 50% 42%, #E8B86D 0 18%, transparent 19%),
    radial-gradient(circle at 50% 78%, #1E293B 0 28%, transparent 29%),
    linear-gradient(180deg, #438EDB, #3B7FC4);
}
.demo-arrow { color: var(--muted); font-size: 1.2rem; }

.preview-wrap { width: 100%; text-align: center; }
.preview-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
}
#preview {
  max-width: min(100%, 340px);
  width: auto;
  height: auto;
  min-height: 280px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
  border: 1px solid var(--border);
}
.processing-overlay {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  place-content: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
}
.spinner {
  width: 28px; height: 28px;
  margin: 0 auto;
  border: 3px solid #DBEAFE;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.meta-bar { margin-top: 14px; }
.meta-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
@media (max-width: 520px) {
  .meta-stats { grid-template-columns: repeat(2, 1fr); }
}
.meta-stats > div {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
.meta-k {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 2px;
}
.meta-stats strong {
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tabular { font-variant-numeric: tabular-nums; }

.pass-bar {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #F8FAFC;
  color: var(--muted);
}
.pass-bar.ok {
  background: var(--success-bg);
  border-color: #A7F3D0;
  color: var(--success);
}
.pass-bar.bad {
  background: var(--warning-bg);
  border-color: #FDE68A;
  color: var(--warning);
}
.pass-bar.idle { font-weight: 500; }

.checklist {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.checklist h3 {
  margin: 0 0 8px;
  font-size: 0.86rem;
  font-weight: 650;
}
.checklist ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.checklist li {
  font-size: 0.84rem;
  color: var(--muted);
  padding-left: 22px;
  position: relative;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid #CBD5E1;
  background: #fff;
}
.checklist li.ok { color: var(--success); }
.checklist li.ok::before {
  border-color: var(--success);
  background: var(--success);
  box-shadow: inset 0 0 0 2px #fff;
}
.checklist li.bad { color: var(--warning); }
.checklist li.bad::before {
  border-color: var(--warning);
  background: var(--warning-bg);
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* ——— Below ——— */
.below { margin-top: 28px; display: grid; gap: 12px; }
.fold {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 16px 12px;
  box-shadow: var(--shadow-sm);
}
.fold summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.95rem;
  padding: 12px 0;
  list-style: none;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 500;
}
.fold[open] summary::after { content: "–"; }
.tips-list {
  margin: 0 0 8px;
  padding-left: 1.1em;
  color: var(--muted);
  font-size: 0.9rem;
}
.tips-list li { margin-bottom: 8px; }
.tips-list strong { color: var(--text); }
.faq-item { margin-bottom: 14px; }
.faq-item h4 { margin: 0 0 4px; font-size: 0.9rem; }
.faq-item p { margin: 0; color: var(--muted); font-size: 0.88rem; }

.spec-table-wrap { overflow-x: auto; margin-bottom: 8px; }
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.spec-table th { color: var(--muted); font-weight: 600; }
.spec-table td { font-variant-numeric: tabular-nums; }

.footer {
  margin-top: 36px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}
.footer p { margin: 0 0 6px; }
.footer-meta { opacity: 0.85; }
