:root {
  --bg: #f2f4f7;
  --bg-soft: #f7f8fa;
  --card: #ffffff;
  --line: rgba(16, 24, 40, 0.09);
  --line-strong: rgba(16, 24, 40, 0.16);
  --text: #101828;
  --muted: #667085;
  --faint: #98a2b3;
  --gold: #e8a723;
  --gold-deep: #c98a12;
  --gold-soft: rgba(232, 167, 35, 0.10);
  --red: #d92d20;
  --green: #12b76a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(16, 24, 40, 0.06);
  font-family: "SF Pro SC", "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

body {
  padding-bottom: env(safe-area-inset-bottom);
}

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg);
}

/* ── 顶栏 ───────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f5b73c, var(--gold-deep));
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.4px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(232, 167, 35, 0.28);
}
/* 上传的品牌图标；未上传时自动退回文字标识 */
.brand-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.brand-mark b { display: none; }
.brand-mark.no-logo img { display: none; }
.brand-mark.no-logo b { display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: 0.1px; color: var(--text); }
.brand-text small { color: var(--muted); font-size: 11.5px; }

.badge {
  font-size: 11px;
  color: var(--gold-deep);
  border: 1px solid rgba(232, 167, 35, 0.35);
  background: var(--gold-soft);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.warn { color: var(--red); border-color: rgba(217, 45, 32, 0.28); background: rgba(217, 45, 32, 0.08); }

/* ── 进度条 ─────────────────────────────────────── */
.progress { display: flex; gap: 6px; padding: 0 2px; }
.progress span {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.08);
  transition: background 0.3s ease;
}
.progress span.active { background: linear-gradient(90deg, #f5b73c, var(--gold-deep)); }
.progress span.done { background: rgba(232, 167, 35, 0.45); }

/* ── 卡片 ───────────────────────────────────────── */
.stage { flex: 1; display: flex; }

.card {
  position: relative;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px 24px;
  animation: rise 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero { display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.hero-glow {
  position: absolute;
  inset: -50% -30% auto -30%;
  height: 240px;
  background: radial-gradient(circle at 50% 0%, rgba(232, 167, 35, 0.14), transparent 68%);
  pointer-events: none;
}
.hero-title {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.3px;
  color: var(--text);
}
.hero-sub { margin: 0; color: #475467; font-size: 13.5px; line-height: 1.72; }
.hero-sub strong { color: var(--gold-deep); }

.hero-points { margin: 2px 0 4px; padding: 0; list-style: none; display: grid; gap: 9px; }
.hero-points li { position: relative; padding-left: 22px; font-size: 13px; color: #475467; }
.hero-points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: linear-gradient(140deg, #f5b73c, var(--gold-deep));
  transform: rotate(45deg);
}

/* ── 步骤头 ─────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 11px;
  color: var(--gold-deep);
  letter-spacing: 0.6px;
  font-weight: 600;
  margin-bottom: 8px;
}
.step-title { margin: 0 0 8px; font-size: 20px; letter-spacing: -0.2px; color: var(--text); }
.step-sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.step-sub strong { color: var(--gold-deep); }

.notice {
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #7a5a12;
  margin-bottom: 16px;
}
.notice.success { border-color: var(--green); background: rgba(18, 183, 106, 0.08); color: #05603a; }
.notice code { color: var(--gold-deep); font-weight: 600; }

/* ── 表单 ───────────────────────────────────────── */
.fields { display: grid; gap: 14px; margin-bottom: 18px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #344054;
  font-weight: 500;
}
.field-label em { font-style: normal; font-size: 11px; color: var(--faint); font-weight: 400; }

.field input {
  appearance: none;
  width: 100%;
  padding: 14px 15px;
  font-size: 16px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  font-family: inherit;
}
.field input::placeholder { color: #b0b8c4; }
.field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 167, 35, 0.16);
}

.field-error { min-height: 14px; font-size: 11.5px; color: var(--red); }

/* ── 按钮 ───────────────────────────────────────── */
.btn {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 15px;
  font-size: 15.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.18s ease, background 0.18s ease;
}
.btn:active { transform: scale(0.988); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary {
  color: #ffffff;
  background: linear-gradient(135deg, #f5b73c, var(--gold-deep));
  box-shadow: 0 6px 16px rgba(232, 167, 35, 0.28);
}
.btn.primary.loading { position: relative; color: transparent; }
.btn.primary.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn.ghost {
  color: #344054;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  font-weight: 500;
}
.btn.ghost:hover { background: var(--bg-soft); }

/* ── 自动获取手机号：主行动入口，需要一眼可见 ─────── */
.auto-phone {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(232, 167, 35, 0.55);
  background: linear-gradient(180deg, #fff8e8, #fff2d6);
  box-shadow: 0 3px 10px rgba(232, 167, 35, 0.18);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.auto-phone:active { transform: scale(0.988); }
.auto-phone:disabled { opacity: 0.62; cursor: not-allowed; }

.auto-phone-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(232, 167, 35, 0.22);
}

.auto-phone-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.auto-phone-body b { font-size: 15px; font-weight: 700; color: #8a5a08; letter-spacing: 0.1px; }
.auto-phone-body small { font-size: 11.5px; color: #a8752a; line-height: 1.45; }

.auto-phone-arrow {
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1;
  color: var(--gold-deep);
  opacity: 0.75;
}

.auto-phone.busy {
  border-color: rgba(232, 167, 35, 0.35);
  background: #fffaef;
}

/* 上一步 / 下一步 并排 */
.step-actions { display: flex; gap: 10px; align-items: stretch; }
.step-actions .btn.primary { flex: 1 1 60%; }
.step-actions .btn.ghost { flex: 0 0 36%; margin-top: 0; }
.step-actions:not(:has(.btn.ghost)) .btn.primary { flex: 1 1 100%; }

.step-card .btn.ghost + .btn.ghost,
.step-card > .btn.ghost { margin-top: 10px; }

.footnote { margin: 14px 0 0; font-size: 11.5px; color: var(--faint); text-align: center; line-height: 1.6; }
.footnote code { color: var(--gold-deep); }

/* ── 完成页 ─────────────────────────────────────── */
.done-card { text-align: center; }
.done-mark {
  width: 62px;
  height: 62px;
  margin: 4px auto 14px;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: #ffffff;
  border-radius: 50%;
  background: linear-gradient(140deg, #32d583, var(--green));
  box-shadow: 0 8px 20px rgba(18, 183, 106, 0.28);
}
.done-card .step-title { margin-bottom: 10px; }
.done-card .step-sub { margin-bottom: 18px; }

.kv {
  text-align: left;
  display: grid;
  gap: 1px;
  background: var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-soft);
  font-size: 13px;
}
.kv span { color: var(--muted); }
.kv b {
  color: var(--text);
  font-weight: 600;
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 提示 ───────────────────────────────────────── */
/* 固定在顶部：底部会压住输入框与提交按钮，导致错误提示反而挡住用户改错 */
.toast {
  position: fixed;
  left: 50%;
  top: calc(14px + env(safe-area-inset-top));
  transform: translate(-50%, -14px);
  max-width: 88vw;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(16, 24, 40, 0.94);
  color: #ffffff;
  font-size: 13px;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.22);
  z-index: 50;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #b42318; }
.toast.success { background: #027a48; }

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.42);
  display: grid;
  place-items: end center;
  z-index: 60;
  padding: 16px;
  animation: fade 0.2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet[hidden] { display: none; }
.sheet-body {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 18px;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  animation: rise 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  box-shadow: 0 -8px 28px rgba(16, 24, 40, 0.14);
}
.sheet-body h3 { margin: 0 0 10px; font-size: 17px; color: var(--text); }
.sheet-body p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.75; white-space: pre-line; }

@media (max-width: 360px) {
  .hero-title { font-size: 21px; }
  #app { padding: 12px 12px 24px; }
}

@media (max-width: 340px) {
  .step-actions { flex-direction: column-reverse; }
  .step-actions .btn.primary,
  .step-actions .btn.ghost { flex: 1 1 auto; }
}
