:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background: #eef2f6;
  color: #162033;
  --blue: #1f5fbf;
  --blue-deep: #173f86;
  --green: #13795b;
  --line: #d8e1ec;
  --muted: #657386;
  --panel: #ffffff;
  --soft: #f6f8fb;
  --warning: #8a5a00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(220px, auto) 1fr auto;
  min-height: 68px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.brand-mark {
  align-items: center;
  background: var(--blue);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.topbar nav a {
  border-radius: 6px;
  color: #2c3b52;
  font-size: 14px;
  padding: 8px 10px;
}

.topbar nav a:hover {
  background: #edf4ff;
  color: var(--blue-deep);
}

.top-action {
  background: var(--blue);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
  white-space: nowrap;
}

main {
  margin: 0 auto;
  max-width: 1360px;
  padding: 28px;
}

.hero-shell {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  overflow: hidden;
}

.hero-copy {
  padding: 34px 38px;
}

.eyebrow {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.hero-copy h1 {
  font-size: 42px;
  line-height: 1.15;
  margin: 0 0 14px;
}

.hero-copy p {
  color: #44536a;
  font-size: 18px;
  line-height: 1.7;
  margin: 0;
  max-width: 780px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.primary-link,
.secondary-link {
  align-items: center;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  padding: 12px 16px;
  text-decoration: none;
}

.primary-link {
  background: var(--blue);
  color: #fff;
}

.secondary-link {
  background: #edf4ff;
  color: var(--blue-deep);
}

.primary-link:hover,
.top-action:hover {
  background: var(--blue-deep);
}

.secondary-link:hover {
  background: #dbeafe;
}

.hero-visual {
  min-height: 320px;
  position: relative;
}

.hero-visual img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.visual-overlay {
  background: rgba(10, 22, 42, 0.82);
  border-radius: 8px;
  bottom: 24px;
  color: #fff;
  display: grid;
  gap: 5px;
  left: 24px;
  max-width: calc(100% - 48px);
  padding: 14px 16px;
  position: absolute;
}

.visual-overlay span {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.visual-overlay strong {
  line-height: 1.45;
}

.workspace {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 280px minmax(0, 1fr);
  margin-top: 18px;
}

.path-list {
  display: grid;
  gap: 10px;
  position: sticky;
  top: 88px;
}

.path-item {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 15px;
}

.path-item.active {
  border-color: var(--blue);
  box-shadow: inset 4px 0 0 var(--blue);
}

.path-item strong {
  font-size: 15px;
}

.path-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.content-panel {
  display: grid;
  gap: 16px;
}

.mode-panel,
.route-detail,
.flow-panel,
.action-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-panel {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 14px 16px;
}

.mode-panel strong {
  color: #1d2b43;
  white-space: nowrap;
}

.mode-panel span {
  color: var(--muted);
  line-height: 1.65;
}

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

.card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 196px;
  padding: 20px;
}

.card span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.card h2 {
  font-size: 21px;
  line-height: 1.35;
  margin: 14px 0 10px;
}

.card p {
  color: #526174;
  line-height: 1.7;
  margin: 0;
}

.route-detail {
  padding: 18px;
}

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

.detail-grid article {
  background: var(--soft);
  border: 1px solid #e4ebf3;
  border-radius: 8px;
  padding: 16px;
}

.detail-grid strong {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
}

.detail-grid p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.catalog-links {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
}

.catalog-links h2 {
  font-size: 20px;
  margin: 0 0 6px;
}

.catalog-links p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.catalog-link-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e4ebf3;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1fr) minmax(0, 2fr) auto;
  padding: 14px;
}

.catalog-link-row span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.catalog-link-row strong {
  color: #1d2b43;
}

.catalog-link-row b {
  color: #2c3b52;
}

.catalog-link-row button {
  background: #ffffff;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue-deep);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 9px 12px;
  white-space: nowrap;
}

.catalog-link-row button:hover {
  background: #edf4ff;
}

.tool-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
}

.tool-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.tool-head h2 {
  font-size: 20px;
  margin: 0;
}

.api-badge {
  background: #eef6f3;
  border: 1px solid #cfe4dc;
  border-radius: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 8px;
  white-space: nowrap;
}

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

.tool-grid label {
  color: #2c3b52;
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
}

.tool-grid input,
.tool-grid select,
.tool-grid textarea {
  background: #ffffff;
  border: 1px solid #cfd9e6;
  border-radius: 6px;
  color: #162033;
  font: inherit;
  min-height: 40px;
  padding: 9px 10px;
  width: 100%;
}

.tool-grid textarea {
  line-height: 1.55;
  min-height: 116px;
  resize: vertical;
}

.tool-grid .wide {
  grid-column: span 3;
}

.quote-inputs {
  grid-template-columns: 1.2fr 0.9fr 0.9fr 0.6fr auto;
}

.bom-inputs {
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 2fr) auto auto;
}

.tool-button {
  align-self: end;
  background: var(--blue);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  padding: 9px 13px;
  text-decoration: none;
  white-space: nowrap;
}

.tool-button.muted {
  background: #edf4ff;
  color: var(--blue-deep);
}

.tool-button:hover {
  background: var(--blue-deep);
}

.tool-button.muted:hover {
  background: #dbeafe;
}

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

.result-table table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

.result-table th,
.result-table td {
  border-bottom: 1px solid #e4ebf3;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.result-table th {
  color: #2c3b52;
  font-size: 13px;
}

.result-table td {
  color: #526174;
  font-size: 14px;
}

.quote-result {
  background: #f7fafc;
  border: 1px solid #e4ebf3;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 15px;
}

.quote-result strong {
  color: #0b5f4f;
  font-size: 22px;
}

.quote-result span,
.result-note,
.empty-state {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.flow-panel {
  padding: 18px;
}

.flow-panel h2 {
  font-size: 20px;
  margin: 0 0 14px;
}

.flow-steps {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.flow-steps article {
  background: #f7fafc;
  border: 1px solid #e4ebf3;
  border-radius: 8px;
  min-height: 150px;
  padding: 14px;
}

.flow-steps span {
  color: var(--blue);
  display: block;
  font-weight: 900;
  margin-bottom: 10px;
}

.flow-steps strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.flow-steps p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 8px 0 0;
}

.action-panel {
  align-items: center;
  display: flex;
  gap: 16px;
  min-height: 78px;
  padding: 16px;
}

.primary-action {
  background: var(--blue);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 12px 18px;
}

.primary-action:hover {
  background: var(--blue-deep);
}

.action-panel p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.external-note {
  color: var(--warning);
  font-weight: 700;
}

@media (max-width: 1120px) {
  .topbar,
  .hero-shell,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
    padding: 16px;
  }

  .topbar nav {
    justify-content: start;
  }

  .path-list {
    position: static;
  }

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

  .catalog-link-row {
    grid-template-columns: 1fr;
  }

  .tool-grid,
  .quote-inputs,
  .bom-inputs {
    grid-template-columns: 1fr;
  }

  .tool-grid .wide {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  main {
    padding: 14px;
  }

  .hero-copy {
    padding: 24px;
  }

  .hero-copy h1 {
    font-size: 32px;
  }

  .cards,
  .detail-grid,
  .flow-steps {
    grid-template-columns: 1fr;
  }

  .mode-panel,
  .action-panel {
    align-items: flex-start;
    flex-direction: column;
  }
}
