:root {
  --ink: #172033;
  --muted: #687386;
  --blue: #235ca8;
  --blue-dark: #12396f;
  --soft-blue: #eaf2ff;
  --gold: #b88125;
  --soft-gold: #fff6e6;
  --red: #c2413b;
  --line: #d9e3f0;
  --bg: #f3f7fc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #edf4fc 0%, var(--bg) 340px, #f7f9fc 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 32px;
}

.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: 800;
}

h1 {
  margin: 0 0 14px;
  color: #121d33;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy {
  margin: 0;
  max-width: 860px;
  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 20px; min-height: 102px; }

.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.15;
}

.hero-stats em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.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 h2 { margin: 0 0 4px; font-size: 22px; }
.panel-title p { margin: 0; color: var(--muted); line-height: 1.55; }
.panel-title.compact { margin-bottom: 16px; }

.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: 800;
}

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

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid #cfd9e8;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

input:focus,
select:focus { outline: 2px solid rgba(35, 92, 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; }

.art-fields {
  display: none;
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid #d8e4f2;
  background: #f5f8fd;
}

.art-fields.is-visible { display: block; }

.formula-note {
  margin-bottom: 10px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

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.4fr) minmax(320px, .6fr);
  gap: 22px;
  margin-top: 22px;
}

.direction-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.direction-card,
.risk-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 { 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); }

.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: 900px; }
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); }
.sources { padding: 20px 4px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.sources a { color: var(--blue); }

.scope-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, .7fr);
}

.pill-groups {
  display: grid;
  gap: 14px;
}

.pill-group h3,
.scope-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;
}

.scope-box {
  display: grid;
  gap: 14px;
}

.scope-note {
  margin: 0;
  padding: 12px 14px;
  color: #4e3b1d;
  background: var(--soft-gold);
  border-left: 4px solid var(--gold);
  line-height: 1.65;
}

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