:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #2b2622;
  --muted: #6f6862;
  --faint: #9a928a;
  --accent: #c1452a;
  --accent-dark: #9c331d;
  --line: #e8ded2;
  --line-strong: #d7c9b8;
  --error: #c0392b;
  --ok: #2f7d52;
  --radius: 12px;
  --gap: 18px;
}

* { box-sizing: border-box; }
/* hidden 必须压过 .btn/.option 等显式 display（否则 [hidden] 的 UA display:none 被覆盖） */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 20px calc(40px + env(safe-area-inset-bottom));
}

.hero { margin-bottom: 20px; }
.brand {
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 10px; font-weight: 500;
}
.hero h1 { font-size: 25px; line-height: 1.3; margin: 0 0 8px; font-weight: 600; }
.lede { color: var(--muted); margin: 0; }

/* 进度 */
.progress { margin: 22px 0 26px; }
.progress-bar {
  height: 5px; background: var(--line); border-radius: 99px; overflow: hidden;
}
.progress-bar span {
  display: block; height: 100%; width: 0; background: var(--accent);
  border-radius: 99px; transition: width .35s ease;
}
.progress-text { font-size: 13px; color: var(--faint); margin: 8px 0 0; text-align: right; }

/* 步骤 */
.step { border: 0; padding: 0; margin: 0; }
.step[hidden] { display: none; }
.step-title { font-size: 19px; font-weight: 600; padding: 0; margin: 0 0 4px; }
.step-intro { color: var(--muted); margin: 0 0 20px; font-size: 15px; }

/* 字段 */
.field { margin-bottom: var(--gap); }
.field[hidden] { display: none; }
.field-label { display: block; font-weight: 500; margin-bottom: 8px; }
.req { color: var(--accent); margin-left: 3px; }
.field-help { font-size: 13px; color: var(--faint); margin: -2px 0 8px; }

.input {
  width: 100%; padding: 13px 14px; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(193,69,42,.12); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }

/* 单选 / 多选：整行可点，≥48px 触控 */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; min-height: 52px;
  padding: 12px 15px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.option input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.option-label { flex: 1; }
.option:has(input:checked) { border-color: var(--accent); background: #fdf1ed; }
.option:active { background: #f4ece4; }

/* 校验 */
.field-error { color: var(--error); font-size: 13px; min-height: 0; margin: 6px 0 0; }
.field-error:empty { display: none; }
.has-error .input,
.has-error .option { border-color: var(--error); }
.form-error { color: var(--error); text-align: center; min-height: 20px; margin: 4px 0 0; }
.form-error:empty { display: none; }
.privacy-note { color: var(--faint); font-size: 13px; line-height: 1.5; margin: 14px 0 0; }

/* 导航 */
.nav { display: flex; gap: 12px; margin-top: 26px; }
.btn {
  flex: 1; min-height: 52px; padding: 14px 20px; font-size: 16px; font-weight: 500;
  border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: background .15s, opacity .15s; text-align: center; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-dark); }
.btn-primary[disabled] { opacity: .6; cursor: default; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:active { background: #f1e9df; }

/* 蜜罐：移出视口，aria-hidden */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 成功页 / 错误页 */
.done { text-align: center; padding: 48px 8px; }
.done-mark {
  width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%;
  background: var(--ok); color: #fff; font-size: 34px; line-height: 64px;
}
.done h1 { font-size: 26px; margin: 6px 0 14px; }
.done-body { color: var(--muted); margin: 0 auto 28px; max-width: 360px; }
.done .btn { display: inline-flex; flex: none; min-width: 180px; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1916; --surface: #262220; --ink: #ece5dc; --muted: #b3a99e;
    --faint: #8a8077; --line: #3a342f; --line-strong: #4a423b;
  }
  .option:has(input:checked) { background: #38211b; }
  .option:active { background: #2f2a26; }
}
