:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-soft: #f7f9fb;
  --text: #17202a;
  --muted: #66717f;
  --line: #d9e0e8;
  --blue: #2563eb;
  --green: #17855d;
  --amber: #c26a16;
  --red: #c83d3d;
  --shadow: 0 18px 44px rgba(21, 33, 49, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  width: min(1440px, calc(100vw - 32px));
  margin: 16px auto;
}

.control-panel,
.result-panel,
.section-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.control-panel {
  align-self: start;
  padding: 22px;
  position: sticky;
  top: 16px;
}

.result-panel {
  padding: 22px;
}

.brand-row,
.summary-strip,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.18;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 17px;
}

.data-badge,
.confidence,
.section-head span {
  white-space: nowrap;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid var(--line);
}

.confidence.high {
  color: var(--green);
  border-color: rgba(23, 133, 93, 0.28);
  background: rgba(23, 133, 93, 0.08);
}

.confidence.low {
  color: var(--amber);
  border-color: rgba(194, 106, 22, 0.28);
  background: rgba(194, 106, 22, 0.08);
}

.field-grid {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

select,
input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

select:focus,
input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.2);
  border-color: var(--blue);
}

.notice-line {
  margin-top: 20px;
  padding: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #7c3f12;
  display: grid;
  gap: 5px;
  line-height: 1.45;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.metric {
  min-height: 118px;
  padding: 16px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.metric.primary {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.route-visual {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc, #eef6f0);
  border: 1px solid var(--line);
}

.route-node {
  min-width: 72px;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  background: var(--panel);
  border: 1px solid var(--line);
}

.route-node.start {
  color: var(--blue);
}

.route-node.end {
  color: var(--green);
}

.route-line {
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
  overflow: hidden;
}

.route-fill {
  display: block;
  width: 68%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.section-block {
  box-shadow: none;
  padding: 16px;
}

.stage-list,
.insight-list {
  margin-top: 14px;
}

.stage-item {
  display: grid;
  grid-template-columns: 90px 1fr 90px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.stage-item:last-child {
  border-bottom: 0;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
}

.insight-list {
  padding-left: 20px;
  color: var(--text);
  line-height: 1.6;
}

.evidence-block {
  margin-top: 14px;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: var(--panel-soft);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

@media (max-width: 960px) {
  .app-shell,
  .content-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: 100%;
    margin: 0;
    gap: 0;
  }

  .control-panel,
  .result-panel {
    border-radius: 0;
    box-shadow: none;
    border-left: 0;
    border-right: 0;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 21px;
  }

  .stage-item {
    grid-template-columns: 76px 1fr 78px;
  }
}
