:root {
  --bg: #08111a;
  --bg-2: #0d1a24;
  --surface: #10202b;
  --surface-2: #142a37;
  --line: #29485a;
  --line-soft: rgba(117, 151, 170, 0.28);
  --text: #eef7fb;
  --muted: #9fb6c3;
  --cyan: #4dd0e1;
  --teal: #2dd4bf;
  --green: #8bd66b;
  --amber: #f4c95d;
  --orange: #f59e0b;
  --red: #ef6f6c;
  --violet: #a78bfa;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(77, 208, 225, 0.17), transparent 32%),
    linear-gradient(135deg, #071017 0%, #0b1822 42%, #11212b 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.56;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 17, 26, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(77, 208, 225, 0.44);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.2), rgba(244, 201, 93, 0.12));
  color: var(--cyan);
  font-weight: 800;
}

.brand-title {
  display: block;
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
}

.brand-subtitle {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #cfe0e8;
  font-size: 14px;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  border-color: rgba(77, 208, 225, 0.42);
  background: rgba(77, 208, 225, 0.12);
  color: #ffffff;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 220px;
}

.status-pill,
.small-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: #d7e7ee;
  font-size: 13px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 16px rgba(139, 214, 107, 0.7);
}

.page {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 52px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 22px;
  min-height: 430px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(13, 40, 55, 0.92), rgba(9, 28, 39, 0.72)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 80px);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34%;
  background:
    linear-gradient(90deg, rgba(77, 208, 225, 0.18), rgba(45, 212, 191, 0.1), rgba(244, 201, 93, 0.1)),
    repeating-linear-gradient(135deg, transparent 0 18px, rgba(255, 255, 255, 0.04) 18px 19px);
  clip-path: polygon(0 54%, 14% 38%, 26% 62%, 40% 30%, 54% 48%, 70% 24%, 84% 42%, 100% 18%, 100% 100%, 0 100%);
  pointer-events: none;
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 12px;
  color: #ffffff;
  font-size: 40px;
  line-height: 1.15;
}

.lead {
  max-width: 760px;
  margin-bottom: 22px;
  color: #cfe0e8;
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(77, 208, 225, 0.42);
  border-radius: 6px;
  background: rgba(77, 208, 225, 0.14);
  color: #ffffff;
  font-weight: 700;
}

.button.primary {
  border-color: rgba(45, 212, 191, 0.64);
  background: linear-gradient(135deg, #087f8c, #12a594);
}

.button.warning {
  border-color: rgba(244, 201, 93, 0.58);
  background: rgba(244, 201, 93, 0.13);
  color: #ffe6a3;
}

.button.ghost {
  background: transparent;
}

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

.metric {
  min-height: 118px;
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(16, 32, 43, 0.72);
}

.metric strong {
  display: block;
  color: #ffffff;
  font-size: 28px;
  line-height: 1.12;
}

.metric span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.hero-visual {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  min-height: 100%;
  padding: 18px;
  border: 1px solid rgba(77, 208, 225, 0.18);
  border-radius: var(--radius);
  background: rgba(7, 16, 23, 0.48);
}

.visual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #dff5fb;
  font-weight: 800;
}

.chain-visual {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  gap: 8px;
}

.chain-step {
  position: relative;
  min-height: 205px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(77, 208, 225, 0.13), rgba(16, 32, 43, 0.72));
}

.chain-step::before {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 80px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 0;
  opacity: 0.74;
}

.chain-step b {
  position: relative;
  display: block;
  color: #ffffff;
  font-size: 15px;
}

.chain-step small {
  position: relative;
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.visual-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.micro-stat {
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.micro-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.micro-stat strong {
  color: #ffffff;
  font-size: 18px;
}

.section {
  margin-top: 22px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.section-head h2 {
  margin-bottom: 2px;
  color: #ffffff;
  font-size: 24px;
}

.page-title {
  margin-bottom: 2px;
  color: #ffffff;
  font-size: 28px;
  line-height: 1.25;
}

.section-head p {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

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

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.panel,
.module-card,
.agent-card,
.scenario-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(16, 32, 43, 0.78);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.card,
.module-card,
.agent-card,
.scenario-card {
  padding: 18px;
}

.panel {
  padding: 20px;
  overflow-x: auto;
}

.card h3,
.module-card h3,
.agent-card h3,
.scenario-card h3,
.panel h2,
.panel h3 {
  margin-bottom: 8px;
  color: #ffffff;
}

.card p,
.module-card p,
.agent-card p,
.scenario-card p,
.panel p {
  color: #c5d8e1;
}

.module-card {
  display: grid;
  min-height: 225px;
  align-content: space-between;
  gap: 14px;
}

.module-kicker {
  display: inline-flex;
  width: max-content;
  padding: 3px 8px;
  border: 1px solid rgba(77, 208, 225, 0.28);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.tag-row,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: #d9e8ee;
  font-size: 12px;
}

.tag.green {
  border-color: rgba(139, 214, 107, 0.38);
  color: #c8f6b8;
}

.tag.amber {
  border-color: rgba(244, 201, 93, 0.4);
  color: #ffe4a1;
}

.tag.red {
  border-color: rgba(239, 111, 108, 0.4);
  color: #ffc4c3;
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: #ffffff;
  background: rgba(77, 208, 225, 0.08);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table td {
  color: #cfe0e8;
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.break-text {
  overflow-wrap: anywhere;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.timeline-time {
  color: var(--amber);
  font-weight: 800;
}

.checklist {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.checklist li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: #d8e8ee;
  background: rgba(255, 255, 255, 0.035);
}

.checklist li::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-top: 5px;
  border: 1px solid rgba(77, 208, 225, 0.58);
  border-radius: 4px;
  background: rgba(77, 208, 225, 0.08);
}

.chart-panel {
  min-height: 276px;
}

.chart-canvas {
  width: 100%;
  height: 220px;
  margin-top: 8px;
}

.map-board {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.grid-map {
  display: grid;
  grid-template-columns: repeat(12, minmax(20px, 1fr));
  gap: 5px;
  min-height: 380px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(77, 208, 225, 0.08), rgba(244, 201, 93, 0.05)),
    rgba(7, 16, 23, 0.56);
}

.map-cell {
  min-height: 26px;
  border: 1px solid rgba(159, 182, 195, 0.14);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
}

.map-cell.source {
  background: rgba(77, 208, 225, 0.48);
}

.map-cell.plant {
  background: rgba(45, 212, 191, 0.42);
}

.map-cell.warning {
  background: rgba(244, 201, 93, 0.48);
}

.map-cell.response {
  background: rgba(139, 214, 107, 0.4);
}

.map-cell.alert {
  background: rgba(239, 111, 108, 0.48);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--cyan);
}

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

.process-step {
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.process-step strong {
  display: block;
  color: #ffffff;
}

.process-step span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.command-tree {
  display: grid;
  gap: 10px;
  text-align: center;
}

.command-node {
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(77, 208, 225, 0.08);
  color: #ffffff;
  font-weight: 800;
}

.command-branches {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.command-branch {
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: #dcecf2;
  background: rgba(255, 255, 255, 0.04);
}

.agent-layout,
.sandbox-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
}

.agent-list,
.scenario-list {
  display: grid;
  gap: 10px;
}

.agent-card,
.scenario-card {
  display: grid;
  gap: 8px;
}

.agent-card.is-active,
.scenario-card.is-active {
  border-color: rgba(77, 208, 225, 0.64);
  background: rgba(77, 208, 225, 0.1);
}

.prompt-box,
.output-box,
.scenario-output {
  width: 100%;
  min-height: 168px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #071018;
  color: #e7f4fa;
  resize: vertical;
}

.output-box,
.scenario-output {
  white-space: pre-wrap;
}

.score-grid {
  display: grid;
  gap: 12px;
}

.score-item {
  display: grid;
  grid-template-columns: 135px 1fr 50px;
  align-items: center;
  gap: 12px;
}

.score-item label {
  color: #d9e7ed;
}

.score-item input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.score-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #ffffff;
}

.score-total strong {
  color: var(--green);
  font-size: 40px;
}

.offline-note {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid rgba(244, 201, 93, 0.32);
  border-radius: var(--radius);
  background: rgba(244, 201, 93, 0.08);
  color: #ffe6a3;
}

.data-pill {
  border-color: rgba(244, 201, 93, 0.42);
  color: #ffe4a1;
}


.footer {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 34px;
  color: var(--muted);
  font-size: 13px;
}

.footer-credit {
  display: inline-flex;
  margin-left: 10px;
  color: var(--cyan);
  font-weight: 700;
}

.read-count-pill strong {
  color: var(--amber);
  font-size: 15px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand,
  .top-actions {
    min-width: 0;
  }

  .main-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .hero,
  .map-board,
  .agent-layout,
  .sandbox-layout {
    grid-template-columns: 1fr;
  }

  .hero-metrics,
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .process,
  .command-branches {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  .topbar {
    gap: 10px;
  }

  .topbar,
  .hero,
  .panel,
  .card,
  .module-card,
  .agent-card,
  .scenario-card {
    padding: 14px;
  }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
  }

  .main-nav a {
    width: 100%;
    padding-inline: 6px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .section-actions {
    justify-content: flex-start;
  }

  .page,
  .footer {
    width: min(100% - 24px, 1480px);
  }

  h1 {
    font-size: 30px;
  }

  .hero-metrics,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .visual-footer,
  .process,
  .command-branches {
    grid-template-columns: 1fr;
  }

  .chain-visual {
    grid-template-columns: 1fr;
  }

  .chain-step {
    min-height: 94px;
  }

  .timeline-item,
  .score-item {
    grid-template-columns: 1fr;
  }

  .grid-map {
    grid-template-columns: repeat(6, minmax(24px, 1fr));
  }
}
