/* ============================================================
   红马快融 · 扫码预审批 H5 样式（移动端优先）
   ============================================================ */
:root {
  --brand-1: #0B4EA2;
  --brand-2: #1C7CE0;
  --brand-soft: #EAF2FE;
  --gold: #C8961E;
  --gold-soft: #FDF6E3;
  --bg: #F2F5FA;
  --card: #FFFFFF;
  --text: #17203A;
  --muted: #6B7A90;
  --line: #E4EAF3;
  --danger: #D93B4A;
  --danger-soft: #FDECEE;
  --warn: #C77A0A;
  --warn-soft: #FEF4E4;
  --ok: #0F9D6E;
  --ok-soft: #E8F7F1;
  --radius: 16px;
  --shadow: 0 2px 8px rgba(16, 40, 82, .06), 0 12px 32px rgba(16, 40, 82, .06);
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------------- 顶部 ---------------- */
.topbar {
  background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 18px 18px 16px;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 8px 24px rgba(11, 78, 162, .22);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 15.5px; font-weight: 600; letter-spacing: .3px; }
.brand .logo {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 26px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.brand small { font-weight: 400; opacity: .75; font-size: 12px; margin-left: auto; }
.topbar .slogan { font-size: 12px; opacity: .72; margin-top: 5px; letter-spacing: .2px; }

.steps { display: flex; gap: 6px; margin-top: 14px; }
.steps div {
  flex: 1; height: 3px; border-radius: 3px;
  background: rgba(255,255,255,.26);
  transition: background .3s;
}
.steps div.on { background: #fff; }
.step-labels { display: flex; justify-content: space-between; margin-top: 7px; font-size: 10.5px; opacity: .68; }
.step-labels span.active { opacity: 1; font-weight: 600; }

/* ---------------- 主体 ---------------- */
main { flex: 1; padding: 14px 14px 96px; }

.panel { display: none; animation: fade .28s ease both; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 6px;
  margin-bottom: 12px;
}
.card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.card-head h2 { font-size: 15.5px; margin: 0; font-weight: 650; }
.card-head span { font-size: 11.5px; color: var(--muted); }
.card-tip {
  font-size: 11.5px; color: var(--muted); line-height: 1.6;
  background: var(--brand-soft); border-radius: 10px;
  padding: 9px 11px; margin: 8px 0 4px;
}

/* ---------------- 表单 ---------------- */
.field { padding: 11px 0 10px; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: none; }
.field > label {
  display: block; font-size: 13px; color: var(--muted);
  margin-bottom: 7px; font-weight: 500;
}
.field > label .req { color: var(--danger); margin-left: 2px; }

input[type="text"], input[type="tel"], input[type="number"], input[type="date"], select {
  width: 100%; border: none; outline: none; background: transparent;
  font-size: 16px; color: var(--text); padding: 2px 0; font-family: inherit;
  appearance: none; -webkit-appearance: none;
}
input::placeholder { color: #B4BECC; font-size: 15px; }
input:disabled { color: var(--muted); }

.money-wrap { display: flex; align-items: center; gap: 4px; }
.money-wrap .unit { color: var(--brand-1); font-weight: 600; font-size: 15px; }
.money-wrap .suffix { color: var(--muted); font-size: 13px; padding-left: 6px; }

/* 分段选择器 */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 13.5px; font-family: inherit; padding: 8px 13px; border-radius: 10px;
  cursor: pointer; transition: all .16s; line-height: 1.2;
}
.seg button:active { transform: scale(.97); }
.seg button.sel {
  background: var(--brand-soft); border-color: var(--brand-2);
  color: var(--brand-1); font-weight: 600;
  box-shadow: 0 0 0 1px var(--brand-2) inset;
}

.id-result {
  display: none; margin-top: 10px; padding: 10px 12px;
  background: var(--ok-soft); border-radius: 10px;
  font-size: 12.5px; color: #0B6E4F; line-height: 1.75;
}
.id-result.show { display: block; animation: fade .25s ease both; }
.id-result b { font-weight: 650; }

.err { color: var(--danger); font-size: 12px; margin-top: 7px; display: none; }
.err.show { display: block; }
.field.invalid input { color: var(--danger); }

/* ---------------- 底部操作条 ---------------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: 480px; margin: 0 auto;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex; gap: 10px;
}
.btn {
  flex: 1; border: none; font-family: inherit; font-size: 15.5px; font-weight: 600;
  padding: 13px 0; border-radius: 13px; cursor: pointer; transition: all .16s;
  letter-spacing: .5px;
}
.btn:active { transform: scale(.985); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; box-shadow: 0 6px 18px rgba(11, 78, 162, .28);
}
.btn-ghost { background: #EEF2F8; color: var(--text); flex: 0 0 105px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------------- 审批中遮罩 ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center;
  background: rgba(9, 25, 50, .62);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.overlay.show { display: flex; }
.loading-box {
  width: 246px; background: #fff; border-radius: 20px;
  padding: 26px 22px 22px; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
}
.spinner { width: 46px; height: 46px; margin: 0 auto 14px; position: relative; }
.spinner::before, .spinner::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid transparent;
}
.spinner::before { border-top-color: var(--brand-2); border-right-color: var(--brand-2); animation: spin .85s linear infinite; }
.spinner::after { border-bottom-color: rgba(28,124,224,.24); border-left-color: rgba(28,124,224,.24); animation: spin 1.5s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 650; }
.loading-box p { margin: 0; font-size: 12.5px; color: var(--muted); min-height: 19px; }
.loading-bar { height: 4px; background: var(--line); border-radius: 4px; margin-top: 15px; overflow: hidden; }
.loading-bar i { display: block; height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); transition: width .45s ease; }

/* ---------------- 结果页 ---------------- */
.result-hero {
  border-radius: 20px; padding: 22px 20px 20px; color: #fff;
  background: linear-gradient(140deg, #0B4EA2 0%, #1C7CE0 100%);
  box-shadow: 0 14px 34px rgba(11, 78, 162, .3);
  position: relative; overflow: hidden;
}
.result-hero::after {
  content: ''; position: absolute; right: -50px; top: -60px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.09);
}
.result-hero.review { background: linear-gradient(140deg, #A86400 0%, #F0A020 100%);
  box-shadow: 0 14px 34px rgba(168, 100, 0, .28); }
.result-hero.rejected { background: linear-gradient(140deg, #6B2530 0%, #C0394B 100%);
  box-shadow: 0 14px 34px rgba(107, 37, 48, .26); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.2); border-radius: 20px;
  font-size: 12px; padding: 4px 11px; font-weight: 600;
  backdrop-filter: blur(4px);
}
.badge i { width: 6px; height: 6px; border-radius: 50%; background: #fff; display: inline-block; }
.hero-label { font-size: 12.5px; opacity: .8; margin: 16px 0 2px; letter-spacing: .4px; }
.hero-amount { font-size: 40px; font-weight: 700; letter-spacing: -1px; line-height: 1.15;
  font-variant-numeric: tabular-nums; }
.hero-amount .cur { font-size: 22px; font-weight: 600; margin-right: 2px; }
.hero-amount .wan { font-size: 15px; font-weight: 500; opacity: .82; margin-left: 5px; }
.hero-sub { font-size: 12.5px; opacity: .82; margin-top: 5px; }
.hero-grid {
  display: flex; margin-top: 18px; padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,.22); gap: 8px;
}
.hero-grid > div { flex: 1; }
.hero-grid dt { font-size: 11.5px; opacity: .78; margin: 0 0 3px; }
.hero-grid dd { margin: 0; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.hero-grid dd em { font-size: 11.5px; font-style: normal; opacity: .78; font-weight: 400; }

.sec-title {
  font-size: 14px; font-weight: 650; margin: 18px 4px 9px;
  display: flex; align-items: center; gap: 7px;
}
.sec-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-1), var(--brand-2));
}

/* 还款计划 */
.plan-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.plan-tabs button {
  flex: 1; border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-family: inherit; font-size: 13.5px; padding: 9px 0; border-radius: 11px; cursor: pointer;
  transition: all .16s;
}
.plan-tabs button.sel {
  background: var(--brand-soft); border-color: var(--brand-2);
  color: var(--brand-1); font-weight: 650;
}
.plan-main { text-align: center; padding: 6px 0 12px; }
.plan-main .num { font-size: 30px; font-weight: 700; color: var(--brand-1);
  font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.plan-main .num em { font-size: 15px; font-style: normal; font-weight: 600; }
.plan-main .cap { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; font-variant-numeric: tabular-nums; }
.kv b.gold { color: var(--gold); }
.kv b.danger { color: var(--danger); }
.kv b.ok { color: var(--ok); }

/* 评分 */
.score-row { display: flex; align-items: center; gap: 12px; }
.score-num { font-size: 30px; font-weight: 700; color: var(--brand-1);
  font-variant-numeric: tabular-nums; line-height: 1; }
.score-num em { font-size: 13px; color: var(--muted); font-style: normal; font-weight: 400; }
.score-body { flex: 1; }
.score-track { height: 7px; background: var(--line); border-radius: 7px; overflow: hidden; margin-top: 6px; }
.score-track i { display: block; height: 100%; border-radius: 7px; width: 0;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.score-track.review i { background: linear-gradient(90deg, #C77A0A, #F0A020); }
.score-track.rejected i { background: linear-gradient(90deg, #8A2B38, #D93B4A); }
.score-cap { font-size: 11.5px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; }

/* 明细项 */
.item { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.item:last-child { border-bottom: none; }
.item .dot { width: 7px; height: 7px; border-radius: 50%; margin-right: 9px; flex: 0 0 7px; }
.item .dot.plus { background: var(--ok); }
.item .dot.minus { background: var(--danger); }
.item .dot.warn { background: var(--warn); }
.item .lb { color: var(--muted); }
.item .vl { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.item .dl { width: 46px; text-align: right; font-size: 12.5px; font-weight: 650;
  font-variant-numeric: tabular-nums; margin-left: 8px; }
.dl.plus { color: var(--ok); }
.dl.minus { color: var(--danger); }
.dl.zero { color: var(--muted); font-weight: 400; }

.alert { border-radius: 12px; padding: 11px 13px; font-size: 12.5px; line-height: 1.7; margin-top: 10px; }
.alert.danger { background: var(--danger-soft); color: #A3242F; }
.alert.warn { background: var(--warn-soft); color: #8A5604; }
.alert.info { background: var(--brand-soft); color: #14498F; }
.alert b { font-weight: 650; }

.reject-list { margin: 6px 0 0; padding-left: 17px; }
.reject-list li { margin-bottom: 3px; }

.disclaimer { font-size: 11px; color: #98A4B5; line-height: 1.75; padding: 14px 6px 4px; text-align: justify; }
.disclaimer b { color: #7A8798; }
