/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --brand: #4a9eff;
  --brand-light: #2b7fe0;
  --accent: #e63946;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-sub: #6b7280;
  --line: #e5e9f0;
  --radius: 14px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom);
}

.page { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }

/* ===== 头部 ===== */
.hero {
  padding: 36px 8px 26px;
  text-align: center;
}
.hero h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 1px;
}
.hero-sub {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-sub);
}

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(26, 77, 143, 0.06);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  flex: 0 0 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.pick-badge {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-sub);
  background: #f1f5f9;
  padding: 3px 12px;
  border-radius: 12px;
}
.pick-badge b { color: var(--brand); font-size: 15px; }

.card-desc {
  font-size: 13.5px;
  color: var(--text-sub);
  margin: 6px 0 16px;
  padding-left: 36px;
}
.card-desc b { color: var(--accent); }

/* ===== 输入 ===== */
.field { display: block; margin-top: 16px; }
.field .label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  color: var(--text);
  background: #fbfcfe;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  -webkit-appearance: none;
}
.field input:focus {
  border-color: var(--brand-light);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(45, 108, 181, .12);
}
.field input.err { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230, 57, 70, .1); }
.field input::placeholder { color: #b6bec9; }

.hint { font-size: 13px; margin: 8px 0 0 2px; min-height: 0; }
.hint.err { color: var(--accent); }
.hint.ok { color: #16a34a; }

/* ===== 小标题 ===== */
.sub-title {
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  margin: 20px 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--brand);
}

/* ===== 品牌 ===== */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}
.brand-item {
  padding: 14px 6px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  background: #fbfcfe;
  transition: all .16s;
}
.brand-item:active { transform: scale(.97); }
.brand-item .bn { font-size: 15px; font-weight: 700; }
.brand-item .be {
  font-size: 10.5px;
  color: #9aa4b2;
  letter-spacing: .5px;
  margin-top: 2px;
}
.brand-item.on {
  border-color: var(--brand);
  background: linear-gradient(135deg, #eaf4ff, #fff);
  box-shadow: 0 2px 10px rgba(26, 77, 143, .14);
}
.brand-item.on .bn { color: var(--brand); }
.brand-item .cnt {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: #9aa4b2;
}

/* ===== 车型 ===== */
.model-grid { display: flex; flex-direction: column; gap: 10px; }
.model-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  cursor: pointer;
  transition: all .16s;
}
.model-item:active { transform: scale(.99); }
.model-item .chk {
  flex: 0 0 22px;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: transparent;
  transition: all .16s;
}
.model-item .mi-body { flex: 1; min-width: 0; }
.model-item .mn { font-size: 15px; font-weight: 600; }
.model-item .mmeta {
  font-size: 12.5px;
  color: var(--text-sub);
  margin-top: 2px;
}
.model-item.on {
  border-color: var(--brand);
  background: linear-gradient(135deg, #eaf4ff, #fff);
}
.model-item.on .chk {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.model-item.disabled { opacity: .45; cursor: not-allowed; }
.model-item .mrank {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  padding: 2px 8px;
  border-radius: 8px;
}

.empty-tip {
  text-align: center;
  color: #b6bec9;
  font-size: 14px;
  padding: 26px 0;
}

/* ===== 已选 ===== */
.picked-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.picked-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f7f9fc;
  border-radius: 9px;
  font-size: 14px;
}
.picked-row .pr-idx {
  flex: 0 0 20px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.picked-row .pr-name { flex: 1; font-weight: 600; }
.picked-row .pr-del {
  color: #b6bec9;
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.picked-row .pr-del:active { color: var(--accent); }

/* ===== 提交 ===== */
.submit-btn {
  display: block;
  width: 100%;
  height: 52px;
  margin-top: 22px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(26, 77, 143, .28);
  transition: all .18s;
}
.submit-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 3px 10px rgba(26,77,143,.24); }
.submit-btn:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
}

.foot-tip {
  text-align: center;
  font-size: 12px;
  color: #a8b2bf;
  margin-top: 14px;
}

/* ===== 成功页 ===== */
.done-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 24px 32px;
  margin-top: 40px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(26, 77, 143, .08);
}
.done-icon {
  width: 68px; height: 68px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(34, 197, 94, .3);
}
.done-card h2 { font-size: 22px; font-weight: 800; }
.done-tip { font-size: 13.5px; color: var(--text-sub); margin-top: 18px; }
.done-code {
  font-size: 26px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 1.5px;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
  word-break: break-all;
}
.done-name { font-size: 14px; color: var(--text-sub); margin-top: 10px; }
.done-list {
  text-align: left;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.done-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.done-row .dr-idx {
  flex: 0 0 20px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #eaf4ff;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.done-row .dr-brand { color: var(--text-sub); font-size: 13px; flex: 0 0 auto; }
.done-row .dr-model { font-weight: 600; flex: 1; }
.again-btn {
  margin-top: 30px;
  padding: 12px 34px;
  border: 1.5px solid var(--brand);
  border-radius: 24px;
  background: #fff;
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.again-btn:active { background: #eaf4ff; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 12%;
  transform: translate(-50%, 20px);
  max-width: 80vw;
  padding: 12px 22px;
  border-radius: 10px;
  background: rgba(23, 32, 45, .92);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== 移动端 ===== */
@media (max-width: 480px) {
  .page { padding: 0 14px 34px; }
  .hero { padding: 28px 4px 20px; }
  .hero h1 { font-size: 22px; }
  .hero-sub { font-size: 13px; }
  .card { padding: 18px 16px; border-radius: 12px; }
  .card-title { font-size: 16px; }
  .card-desc { padding-left: 0; }
  .brand-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .brand-item { padding: 12px 4px; }
  .brand-item .bn { font-size: 14px; }
  .done-card { padding: 32px 18px 26px; margin-top: 28px; }
  .done-code { font-size: 22px; }
  .submit-btn { height: 50px; font-size: 16px; }
}
