:root {
  --ink: #172033;
  --muted: #647287;
  --blue: #1f5ea8;
  --blue-dark: #123c75;
  --green: #1d7f65;
  --soft-blue: #eaf3ff;
  --soft-green: #eaf8f3;
  --gold: #b47b24;
  --soft-gold: #fff7e8;
  --red: #c2413b;
  --line: #d8e4f0;
  --bg: #f3f7fb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #eaf4fb 0%, var(--bg) 340px, #f8fafc 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
}

.app-shell {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 34px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 36px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 16px;
  font-weight: 850;
}

h1 {
  margin: 0 0 14px;
  color: #111d32;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy {
  margin: 0;
  max-width: 900px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.85;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hero-stats div,
.panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 50px rgba(37, 65, 98, .06);
}

.hero-stats div { padding: 18px 18px; min-height: 106px; }
.hero-stats span, .mini-label { display: block; color: var(--muted); font-size: 14px; }
.hero-stats strong {
  display: block;
  margin-top: 8px;
  color: var(--blue-dark);
  font-size: 25px;
  line-height: 1.12;
}
.hero-stats em { display: block; margin-top: 6px; color: var(--muted); font-style: normal; font-size: 13px; }

.workbench {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.panel { padding: 24px; }

.panel-title {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.panel-title.compact { margin-bottom: 16px; }
.panel-title h2 { margin: 0 0 4px; font-size: 22px; }
.panel-title p { margin: 0; color: var(--muted); line-height: 1.55; }

.step-dot {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-weight: 850;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #384252;
  font-size: 14px;
  font-weight: 750;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #cfd9e8;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input, select { height: 42px; padding: 0 12px; }
textarea { min-height: 94px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31, 94, 168, .2); border-color: var(--blue); }

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toggle-line { display: flex; flex-direction: row; align-items: center; gap: 9px; }
.toggle-line input { width: 18px; height: 18px; }

button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--blue);
  font-weight: 850;
  cursor: pointer;
}

.result-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.result-card div { padding: 18px; background: var(--soft-blue); border: 1px solid #d7e5f7; }
.result-card strong { display: block; margin-top: 8px; color: var(--blue-dark); font-size: 27px; line-height: 1.1; }

.insight {
  padding: 14px 16px;
  margin-bottom: 16px;
  color: #4e3b1d;
  background: var(--soft-gold);
  border-left: 4px solid var(--gold);
  line-height: 1.7;
}

.recommendation-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.recommendation-columns > div { border: 1px solid var(--line); padding: 14px; min-height: 190px; }
.recommendation-columns h3 { margin: 0 0 10px; color: var(--blue-dark); font-size: 17px; }
ul { margin: 0; padding-left: 18px; }
li { margin-bottom: 10px; line-height: 1.45; }
.major-meta { margin-top: 2px; color: var(--muted); font-size: 12px; }
.empty-recommendation { color: var(--red); }

.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
  gap: 22px;
  margin-top: 22px;
}

.direction-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.direction-card, .risk-item, .contact-item {
  border: 1px solid var(--line);
  padding: 14px;
  background: #fff;
}
.direction-card h3 { margin: 0 0 8px; font-size: 16px; }
.direction-card p, .risk-item p, .contact-item p { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.risk-item { margin-bottom: 10px; }
.risk-item strong { display: block; margin-bottom: 5px; color: var(--red); }

.contact-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 14px;
  align-items: start;
}
.qr-card { text-align: center; }
.qr-card img { width: 150px; max-width: 100%; border: 1px solid var(--line); }
.qr-card p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

.transfer-form { display: grid; gap: 12px; }
.copy-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.scope-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, .7fr); }
.pill-groups { display: grid; gap: 14px; }
.pill-group h3, .history-box h3 { margin: 0 0 10px; color: var(--blue-dark); font-size: 16px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-list span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #d9e5f4;
  border-radius: 999px;
  color: #22324d;
  background: #f7faff;
  font-size: 13px;
  line-height: 1.25;
}
.history-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e8eef6;
}
.history-row strong { color: var(--blue-dark); }
.history-row p { margin: 0; color: var(--muted); line-height: 1.55; }

.table-panel { margin-top: 22px; }
.table-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}
.table-toolbar h2 { margin: 0 0 4px; font-size: 22px; }
.table-toolbar p { margin: 0; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e8eef6; text-align: left; font-size: 13px; white-space: nowrap; }
th { background: #edf4fc; color: var(--blue-dark); }
.tag { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #eef4ff; color: var(--blue-dark); }
.warn { color: var(--red); font-weight: 750; }
.sources { padding: 20px 4px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.sources a { color: var(--blue); }

@media (max-width: 980px) {
  .app-shell { width: min(100% - 28px, 760px); padding-top: 28px; }
  .hero, .workbench, .details-grid { grid-template-columns: 1fr; }
  .hero-stats, .recommendation-columns, .direction-cards, .result-card, .table-toolbar, .contact-box { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  h1 { font-size: 38px; }
  .hero-copy { font-size: 17px; }
}
