/* ============================================================
   债务人纾困 · 智能诊断  —  设计系统
   风格：法律/金融专业感（深蓝 + 金）· 移动优先 · 高可读
   ============================================================ */

:root {
  /* 品牌 */
  --brand-900: #0b2d52;
  --brand-800: #0f3d6e;
  --brand-700: #14508f;
  --brand-600: #1665b3;
  --brand-500: #2a7fd4;
  --brand-050: #eef4fc;
  --gold: #b8860b;
  --gold-soft: #fdf6e3;

  /* 语义 */
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --danger-bd: #f3b4ad;
  --warn: #b26a00;
  --warn-bg: #fff8e6;
  --warn-bd: #f0dca0;
  --ok: #0f7b3e;
  --ok-bg: #eaf7ee;
  --ok-bd: #b9e3c6;

  /* 中性 */
  --ink: #16202e;
  --ink-2: #3c4a5c;
  --muted: #6b7a8d;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --surface: #ffffff;
  --bg: #f4f7fb;

  /* 形状 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-1: 0 1px 2px rgba(16, 40, 80, .06), 0 1px 3px rgba(16, 40, 80, .04);
  --shadow-2: 0 4px 14px rgba(16, 40, 80, .08);
  --shadow-3: 0 12px 32px rgba(16, 40, 80, .12);

  --maxw: 860px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 顶部 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-900));
  color: #fff;
  box-shadow: var(--shadow-2);
}

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 18px 0;
}

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

.brand-mark {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ffd97a, var(--gold));
  color: var(--brand-900);
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.brand-text b {
  display: block;
  font-size: 16.5px;
  letter-spacing: .3px;
  line-height: 1.25;
}

.brand-text span {
  display: block;
  font-size: 11.5px;
  opacity: .72;
  letter-spacing: 1.2px;
}

/* 进度条 */
.progress {
  height: 3px;
  background: rgba(255,255,255,.18);
  border-radius: 3px;
  margin: 12px 0 0;
  overflow: hidden;
}
.progress > i {
  display: block; height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffd97a, var(--gold));
  border-radius: 3px;
  transition: width .45s cubic-bezier(.4,0,.2,1);
}

/* 步骤导航 */
.steps {
  display: flex;
  gap: 2px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 10px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.steps::-webkit-scrollbar { display: none; }

.steps button {
  flex: 1 0 auto;
  min-width: 62px;
  background: none;
  border: 0;
  color: rgba(255,255,255,.6);
  font-family: inherit;
  font-size: 12.5px;
  padding: 5px 6px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color .2s, background .2s;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.steps button .dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.35);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  transition: all .25s;
}
.steps button.done { color: rgba(255,255,255,.9); }
.steps button.done .dot {
  background: var(--gold); border-color: var(--gold); color: var(--brand-900);
}
.steps button.on { color: #fff; font-weight: 600; }
.steps button.on .dot {
  background: #fff; border-color: #fff; color: var(--brand-800);
  transform: scale(1.12);
  box-shadow: 0 0 0 4px rgba(255,255,255,.16);
}
.steps button:disabled { cursor: default; opacity: .5; }

/* ---------------- 布局 ---------------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px 120px;
}

.panel { display: none; animation: rise .34s cubic-bezier(.2,.7,.3,1); }
.panel.on { display: block; }

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

.card-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}

h1 { font-size: 24px; line-height: 1.35; margin: 0 0 10px; letter-spacing: -.2px; }
h2 { font-size: 19px; margin: 0 0 4px; letter-spacing: -.1px; }
h3 {
  font-size: 15px; margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px; color: var(--brand-800);
}
h3::before {
  content: ""; width: 4px; height: 15px;
  background: var(--brand-600); border-radius: 2px; flex: 0 0 4px;
}

.section-head { margin-bottom: 16px; }
.section-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.lead { font-size: 15.5px; color: var(--ink-2); margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }

/* ---------------- 欢迎页 ---------------- */
.hero {
  background: linear-gradient(140deg, var(--brand-800), var(--brand-900) 70%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 30px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-3);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,217,122,.22), transparent 70%);
}
.hero h1 { color: #fff; margin-bottom: 10px; font-size: 25px; }
.hero p { color: rgba(255,255,255,.86); margin: 0; font-size: 15px; }
.hero .eta {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px; padding: 6px 14px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px; font-size: 13px;
}

.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 16px;
}
.feature {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 14px; text-align: center;
  box-shadow: var(--shadow-1);
}
.feature .ic { font-size: 22px; }
.feature b { display: block; font-size: 14px; margin: 6px 0 3px; }
.feature span { font-size: 12px; color: var(--muted); line-height: 1.5; display: block; }

.flow { list-style: none; padding: 0; margin: 0; counter-reset: f; }
.flow li {
  counter-increment: f;
  position: relative;
  padding: 10px 0 10px 42px;
  font-size: 14.5px;
  border-bottom: 1px dashed var(--line-soft);
}
.flow li:last-child { border-bottom: 0; }
.flow li::before {
  content: counter(f);
  position: absolute; left: 0; top: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-050); color: var(--brand-700);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}
.flow li em { font-style: normal; color: var(--muted); font-size: 13px; display: block; }

/* ---------------- 主页三选一 ---------------- */
.choice-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 16px;
}
.choice {
  display: flex; flex-direction: column; align-items: flex-start;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 16px 16px;
  cursor: pointer;
  font-family: inherit; color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  position: relative; overflow: hidden;
}
.choice:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); }
.choice:active { transform: translateY(-1px); }
.choice .c-ic {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; font-size: 24px; margin-bottom: 12px;
}
.choice .c-t { font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; margin-bottom: 6px; color: var(--ink); }
.choice .c-d { font-size: 12.8px; color: var(--muted); line-height: 1.6; flex: 1 1 auto; }
.choice .c-go {
  margin-top: 14px; font-size: 13.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
}
.choice.c-blue { border-color: #cfe0f3; }
.choice.c-blue .c-ic { background: var(--brand-050); }
.choice.c-blue .c-go { color: var(--brand-700); }
.choice.c-blue:hover { border-color: var(--brand-500); }
.choice.c-green { border-color: #cfe9d8; }
.choice.c-green .c-ic { background: #e7f6ec; }
.choice.c-green .c-go { color: var(--ok); }
.choice.c-green:hover { border-color: var(--ok); }
.choice.c-gold { border-color: #f0e2bf; }
.choice.c-gold .c-ic { background: var(--gold-soft); }
.choice.c-gold .c-go { color: var(--gold); }
.choice.c-gold:hover { border-color: var(--gold); }
.choice .c-go::after { content: "→"; transition: transform .18s; }
.choice:hover .c-go::after { transform: translateX(3px); }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field > .lb {
  display: block; font-size: 13.5px; font-weight: 600;
  margin-bottom: 7px; color: var(--ink-2);
}
.field > .lb .req { color: var(--danger); margin-left: 3px; }
.field > .lb .opt-tag {
  font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px;
}
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

input[type="text"], input[type="tel"], input[type="number"], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(42,127,212,.13);
}
input::placeholder, textarea::placeholder { color: #a9b4c2; }
textarea { min-height: 78px; resize: vertical; line-height: 1.6; }
.ta-sm { min-height: 46px; line-height: 1.55; font-size: 13.5px; margin-top: 8px; }
.field > .ta-sm:first-of-type { margin-top: 10px; }

/* 下拉框（出生年份 / 所在城市）自定义箭头 */
.sel {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%237a8aa0' stroke-width='2' d='M1 1.5L6 6.5L11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}
.sel option { color: var(--ink); }
.sel-2 { margin-top: 8px; }
.hidden-input {
  width: 100%;
  margin-top: 8px;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
}
.hidden-input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(42,127,212,.13); }

.field.err input, .field.err textarea, .field.err .chips {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(192,57,43,.1);
}
.err-msg { color: var(--danger); font-size: 12.5px; margin-top: 5px; display: none; }
.field.err .err-msg { display: block; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* 点选 chips —— 核心：让客户少打字 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 15px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .16s;
  user-select: none;
}
.chip:hover { border-color: var(--brand-500); color: var(--brand-700); }
.chip.on {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(22,101,179,.28);
}
.chip.on.danger { background: var(--danger); border-color: var(--danger); box-shadow: 0 2px 8px rgba(192,57,43,.25); }
.chip.on.ok { background: var(--ok); border-color: var(--ok); box-shadow: 0 2px 8px rgba(15,123,62,.25); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand-500); color: var(--brand-700); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(15,61,110,.28);
}
.btn.primary:hover { box-shadow: 0 6px 20px rgba(15,61,110,.36); color: #fff; }
.btn.gold {
  background: linear-gradient(135deg, #d9a520, var(--gold));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(184,134,11,.3);
}
.btn.green {
  background: linear-gradient(135deg, #1ba25a, var(--ok));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(15,123,62,.28);
}
.btn.green:hover { color: #fff; }
.btn.gold:hover { color: #fff; }
.btn.small { padding: 8px 14px; font-size: 13.5px; }
.btn.ghost { background: transparent; border-style: dashed; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }

.actions {
  display: flex; gap: 10px; justify-content: space-between;
  margin-top: 22px; flex-wrap: wrap;
}
.actions .btn { flex: 1 1 auto; }

/* ---------------- 上传 ---------------- */
.dropzone {
  border: 2px dashed #c3d2e4;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #fbfdff, #f4f8fd);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--brand-500);
  background: var(--brand-050);
  transform: scale(1.005);
}
.dropzone .ic { font-size: 40px; line-height: 1; }
.dropzone b { display: block; margin: 10px 0 4px; font-size: 15.5px; }
.dropzone span { font-size: 13px; color: var(--muted); }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }

/* OCR 进度 */
.ocr-progress { margin-top: 16px; display: none; }
.ocr-progress.on { display: block; }
.ocr-stages { display: flex; flex-direction: column; gap: 9px; }
.stage {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; color: var(--muted);
  transition: color .3s;
}
.stage .sdot {
  width: 18px; height: 18px; flex: 0 0 18px;
  border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; font-size: 10px;
  transition: all .3s;
}
.stage.active { color: var(--brand-700); font-weight: 600; }
.stage.active .sdot {
  border-color: var(--brand-600);
  border-top-color: transparent;
  animation: spin .8s linear infinite;
}
.stage.done { color: var(--ok); }
.stage.done .sdot { background: var(--ok); border-color: var(--ok); color: #fff; animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 债务编辑器 ---------------- */
.sum-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 14px 0;
}
.sum-bar .s {
  flex: 1 1 120px;
  background: var(--brand-050);
  border: 1px solid #d7e5f7;
  border-radius: var(--r-md);
  padding: 11px 14px;
}
.sum-bar .s span { font-size: 12px; color: var(--brand-700); display: block; }
.sum-bar .s b { font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.sum-bar .s.red { background: var(--danger-bg); border-color: var(--danger-bd); }
.sum-bar .s.red span { color: var(--danger); }
.sum-bar .s.red b { color: var(--danger); }

/* 债务卡（移动优先，桌面变两列） */
.debt-list { display: grid; gap: 12px; }
.debt-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  background: #fff;
  position: relative;
  transition: box-shadow .2s, border-color .2s;
}
.debt-item:hover { box-shadow: var(--shadow-2); border-color: #cfdcec; }
.debt-item .idx {
  position: absolute; left: -1px; top: -1px;
  background: var(--brand-700); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--r-md) 0 var(--r-md) 0;
}
.debt-item .del {
  position: absolute; right: 8px; top: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff;
  color: var(--muted); cursor: pointer; font-size: 13px;
  display: grid; place-items: center; transition: all .18s;
}
.debt-item .del:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.debt-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px;
}
.debt-grid .f-full { grid-column: 1 / -1; }
.debt-grid label { font-size: 11.5px; color: var(--muted); display: block; margin-bottom: 3px; font-weight: 600; }
.debt-grid input, .debt-grid select { padding: 8px 10px; font-size: 14px; }
.debt-note {
  margin-top: 10px; padding: 8px 12px; border-radius: 8px;
  background: #fff7e6; border: 1px solid #ffe1a8; color: #8a5a00;
  font-size: 12.5px; line-height: 1.5;
}

/* ---------------- 量表 ---------------- */
.scale-head {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--brand-050); border: 1px solid #d7e5f7;
  border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 12px;
}
.scale-head .t { font-size: 14px; font-weight: 600; color: var(--brand-800); }
.scale-head .sc { font-size: 13px; }
.scale-head .sc b { font-size: 17px; font-variant-numeric: tabular-nums; }

.scale { display: grid; gap: 8px; }
.sq {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  background: #fdfdfe;
}
.sq .q { font-size: 13.8px; display: block; margin-bottom: 8px; line-height: 1.5; }
.sq .q i { font-style: normal; color: var(--muted); margin-right: 5px; }
.sq .opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sq .opts button {
  padding: 7px 2px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  font-family: inherit; font-size: 12px; color: var(--ink-2);
  cursor: pointer; transition: all .15s; line-height: 1.3;
}
.sq .opts button:hover { border-color: var(--brand-500); }
.sq .opts button.on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; font-weight: 600; }
.sq.critical { border-color: var(--danger-bd); background: var(--danger-bg); }
.sq.critical .opts button.on { background: var(--danger); border-color: var(--danger); }

/* ---------------- 提示条 ---------------- */
.notice {
  border-radius: var(--r-md);
  padding: 12px 15px;
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 14px;
  border: 1px solid;
}
.notice.warn { background: var(--warn-bg); border-color: var(--warn-bd); color: #7a5b00; }
.notice.danger { background: var(--danger-bg); border-color: var(--danger-bd); color: #9c2b1e; }
.notice.info { background: var(--brand-050); border-color: #d7e5f7; color: var(--brand-800); }
.notice.ok { background: var(--ok-bg); border-color: var(--ok-bd); color: #0d5f31; }
.notice b { font-weight: 700; }

/* 折叠 */
details.fold {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-top: 14px;
  overflow: hidden;
  background: #fff;
}
details.fold summary {
  padding: 11px 15px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  list-style: none;
  display: flex; align-items: center; gap: 7px;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::before { content: "▸"; color: var(--muted); transition: transform .2s; }
details.fold[open] summary::before { transform: rotate(90deg); }
details.fold pre {
  margin: 0; padding: 12px 15px;
  border-top: 1px solid var(--line-soft);
  background: #fafbfd;
  max-height: 340px; overflow: auto;
  font-size: 11.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all;
  color: var(--ink-2);
}

/* ---------------- 报告区 ---------------- */
.report-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  margin-bottom: 12px;
}
.report-frame {
  width: 100%;
  height: 78vh;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: var(--shadow-2);
}

/* 骨架 */
.skeleton { display: grid; gap: 12px; }
.sk {
  height: 16px; border-radius: 6px;
  background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: sheen 1.3s ease infinite;
}
.sk.lg { height: 72px; }
.sk.w60 { width: 60%; } .sk.w40 { width: 40%; } .sk.w80 { width: 80%; }
@keyframes sheen { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--ink); color: #fff;
  padding: 11px 20px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow-3);
  opacity: 0; pointer-events: none;
  transition: all .3s cubic-bezier(.2,.8,.3,1);
  z-index: 200; max-width: 88vw; text-align: center;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { background: var(--ok); }
#toast.err { background: var(--danger); }

/* 草稿恢复条 */
.draft-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow-3);
  padding: 8px 10px 8px 18px;
  display: none; align-items: center; gap: 10px;
  font-size: 13.5px; z-index: 180; max-width: 92vw;
}
.draft-bar.on { display: flex; }

/* 底部安全区 */
.footnote {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 24px 10px 0; line-height: 1.7;
}

/* 匿名数据同意勾选 */
.consent {
  display: flex; align-items: flex-start; gap: 10px; margin: 16px 2px 4px;
  padding: 12px 14px; background: var(--brand-050); border: 1px solid #dce8f6;
  border-radius: 12px; font-size: 13px; color: #2c4257; cursor: pointer; line-height: 1.6;
}
.consent input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--brand-700); flex: none; }
.consent b { color: var(--brand-800); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { padding: 16px 12px 100px; }
  .card-box { padding: 16px 14px; border-radius: var(--r-md); }
  h1 { font-size: 21px; } .hero h1 { font-size: 21px; }
  .hero { padding: 24px 18px; }
  .grid2 { grid-template-columns: 1fr; gap: 12px; }
  .feature-grid { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .feature { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; }
  .feature .ic { font-size: 20px; }
  .feature b { margin: 0 0 2px; }
  .actions { flex-direction: column-reverse; }
  .actions .btn { width: 100%; }
  .sq .opts { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .sq .opts button { font-size: 11px; padding: 8px 1px; }
  .report-frame { height: 70vh; }
  .steps button { min-width: 56px; font-size: 11.5px; }
}

@media (min-width: 768px) {
  .debt-list { grid-template-columns: 1fr 1fr; }
  .debt-grid { grid-template-columns: 1fr 1fr; }
}

@media print {
  .topbar, .actions, .report-toolbar, #toast, .draft-bar { display: none !important; }
}
