:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #17202a;
  --muted: #66717f;
  --line: #e1e6ed;
  --hairline: rgba(0, 0, 0, 0.04);
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --green: #13895f;
  --green-soft: #eaf8f1;
  --amber: #b86516;
  --amber-soft: #fff7ed;
  --red: #c73737;
  --red-soft: #fef2f2;
  --shadow: 0 12px 30px rgba(26, 39, 56, 0.07);
  --radius: 12px;
}

* {
  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;
}

button,
select {
  font: inherit;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
}

.top-nav__inner {
  width: min(1200px, calc(100vw - 28px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-area,
.status-area,
.origin-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-area {
  min-width: 0;
}

.brand-name {
  flex: 0 0 auto;
  font-size: 18px;
}

.origin-tabs {
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.origin-tab {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.origin-tab.active {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(37, 99, 235, 0.18);
  font-weight: 700;
}

.origin-tab.planned {
  opacity: 0.5;
  cursor: not-allowed;
}

.origin-tab span {
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--panel-soft);
  font-size: 11px;
}

.status-area {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
}

.health-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
}

.health-green {
  background: var(--green);
}

.health-yellow {
  background: var(--amber);
}

.health-red {
  background: var(--red);
}

.page-shell,
.data-footnote {
  width: min(1200px, calc(100vw - 28px));
  margin: 18px auto;
}

.page-shell {
  display: grid;
  gap: 14px;
}

.hero-card,
.destination-section,
.filters-card,
.result-card,
.stage-section,
.insight-section,
.evidence-section,
.data-footnote {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
}

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

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

h1,
h2,
h3,
h4 {
  margin: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
}

h2 {
  font-size: clamp(22px, 3vw, 30px);
}

h3 {
  font-size: 18px;
}

.hero-copy {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-stat {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
}

.destination-section,
.filters-card,
.stage-section,
.insight-section,
.evidence-section,
.result-card {
  padding: 16px;
}

.section-head,
.route-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-head span,
.confidence {
  flex: 0 0 auto;
  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(19, 137, 95, 0.3);
  background: var(--green-soft);
}

.confidence.low {
  color: var(--amber);
  border-color: rgba(184, 101, 22, 0.28);
  background: var(--amber-soft);
}

.destination-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.destination-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
}

.destination-pill strong {
  font-size: 15px;
}

.destination-pill span {
  color: var(--muted);
  font-size: 12px;
}

.destination-pill.active,
.destination-pill:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--blue-soft);
  color: var(--blue);
}

.destination-pill.empty {
  color: var(--muted);
}

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

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

select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 0 12px;
}

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

.data-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.decision-panel {
  position: sticky;
  top: 82px;
}

.decision-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.decision-primary,
.decision-metrics div,
.stage-card,
.evidence-card,
.empty-state {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.decision-primary {
  padding: 16px;
  display: grid;
  gap: 10px;
  background: var(--blue-soft);
  border-color: rgba(37, 99, 235, 0.18);
}

.decision-primary span,
.decision-primary small,
.decision-metrics span {
  color: var(--muted);
}

.decision-primary strong {
  font-size: 32px;
  line-height: 1.1;
}

.decision-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.decision-metrics div {
  min-height: 76px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.decision-metrics strong {
  font-size: 18px;
}

.risk-badge {
  justify-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 18px;
}

.risk-smooth {
  color: var(--green);
  background: var(--green-soft);
}

.risk-slow {
  color: var(--amber);
  background: var(--amber-soft);
}

.risk-jam,
.risk-heavy {
  color: var(--red);
  background: var(--red-soft);
}

.risk-unknown {
  color: var(--muted);
  background: var(--panel-soft);
}

.range-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.detail-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.stage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.stage-card {
  position: relative;
  min-height: 148px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.stage-card.best {
  border-color: rgba(19, 137, 95, 0.28);
  background: linear-gradient(180deg, var(--green-soft), #ffffff);
}

.stage-card h4 {
  font-size: 16px;
}

.stage-card strong {
  font-size: 21px;
}

.stage-card small,
.stage-card span {
  color: var(--muted);
  font-size: 13px;
}

.stage-type {
  justify-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf2f7;
  font-size: 12px;
}

.stage-type.holiday {
  color: var(--amber);
  background: var(--amber-soft);
}

.mini-risk,
.recommend-mark {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.recommend-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--green);
  background: var(--green-soft);
}

.insight-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.65;
}

.ghost-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}

.evidence-panel {
  margin-top: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  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);
}

.source-tag {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

.source-api {
  color: var(--blue);
  background: var(--blue-soft);
}

.source-shot {
  color: var(--purple);
  background: var(--purple-soft);
}

.evidence-cards {
  display: none;
}

.evidence-card {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.evidence-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.evidence-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0;
  font-size: 14px;
}

.evidence-card dt {
  color: var(--muted);
}

.evidence-card dd {
  margin: 0;
}

.empty-state {
  padding: 16px;
  color: var(--muted);
}

.data-footnote {
  padding: 16px;
  color: var(--muted);
  line-height: 1.55;
  box-shadow: none;
}

.data-footnote p {
  margin: 4px 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(26, 39, 56, 0.18);
  color: var(--text);
  line-height: 1.5;
}

@media (max-width: 920px) {
  .top-nav__inner {
    min-height: auto;
    padding: 10px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-area,
  .status-area {
    width: 100%;
  }

  .status-area {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .field-grid,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .decision-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .page-shell,
  .data-footnote,
  .top-nav__inner {
    width: calc(100vw - 20px);
  }

  .page-shell {
    margin-top: 10px;
    gap: 10px;
  }

  .hero-card,
  .destination-section,
  .filters-card,
  .result-card,
  .stage-section,
  .insight-section,
  .evidence-section,
  .data-footnote {
    box-shadow: 0 6px 16px rgba(26, 39, 56, 0.05);
  }

  .hero-card {
    padding: 18px 14px;
  }

  h1 {
    font-size: 24px;
  }

  .hero-copy {
    font-size: 14px;
  }

  .brand-area {
    display: grid;
    gap: 8px;
  }

  .origin-tabs,
  .destination-tabs {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .destination-pill {
    flex: 0 0 auto;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .decision-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .decision-primary {
    padding: 14px;
  }

  .decision-primary strong {
    font-size: 26px;
  }

  .stage-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-card {
    min-height: 140px;
    padding: 12px;
  }

  .table-wrap {
    display: none;
  }

  .evidence-cards {
    display: grid;
    gap: 10px;
  }
}
