:root {
  --bg: #071112;
  --panel: rgba(12, 24, 24, 0.88);
  --panel-strong: rgba(15, 33, 32, 0.96);
  --line: rgba(125, 255, 231, 0.16);
  --line-strong: rgba(125, 255, 231, 0.34);
  --text: #eefbf7;
  --muted: #91a8a3;
  --cyan: #25d4e7;
  --mint: #4ee6a3;
  --amber: #f5b84b;
  --orange: #ff7b54;
  --violet: #9c7cff;
  --red: #ff5c7a;
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.32);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(37, 212, 231, 0.1), transparent 30%),
    linear-gradient(315deg, rgba(78, 230, 163, 0.08), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(156, 124, 255, 0.12), transparent 24%),
    var(--bg);
}

body {
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1880px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: rgba(5, 14, 15, 0.78);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
}

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

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border: 1px solid rgba(37, 212, 231, 0.42);
  background: #061214;
}

.brand-title {
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.topbar-metrics {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.metric-pill {
  min-width: 148px;
  border: 1px solid var(--line);
  background: rgba(18, 41, 39, 0.74);
  padding: 9px 12px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.metric-pill strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.35;
}

.ghost-btn,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-width: 128px;
  padding: 0 15px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(37, 212, 231, 0.4);
  background: linear-gradient(135deg, rgba(37, 212, 231, 0.18), rgba(78, 230, 163, 0.1));
}

.workspace {
  display: grid;
  grid-template-columns: 290px minmax(560px, 1fr) 330px;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.left-rail,
.right-rail {
  display: grid;
  gap: 14px;
}

.left-rail.panel {
  padding: 16px;
  position: sticky;
  top: 114px;
}

.section-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

.section-subtitle {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.section-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-label {
  display: block;
  margin-top: 18px;
  margin-bottom: 8px;
  color: #cde9e2;
  font-size: 13px;
}

.input-select,
.chat-form input {
  width: 100%;
  min-height: 44px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(6, 17, 18, 0.9);
  outline: none;
  padding: 0 12px;
}

.input-select:focus,
.chat-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(37, 212, 231, 0.12);
}

.driver-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(78, 230, 163, 0.2);
  background: rgba(78, 230, 163, 0.08);
}

.avatar-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #061214;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--mint));
}

.driver-name {
  font-weight: 800;
}

.driver-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.vehicle-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.vehicle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.vehicle-row strong {
  color: var(--text);
}

.soc-card {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 13px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.soc-ring {
  --soc: 36%;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at center, #071112 57%, transparent 59%),
    conic-gradient(var(--mint) var(--soc), rgba(255, 255, 255, 0.12) 0);
}

.soc-ring span {
  font-size: 18px;
  font-weight: 900;
}

.soc-title {
  font-weight: 800;
}

.soc-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.quick-prompts {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.quick-prompts button {
  display: block;
  width: 100%;
  min-height: 38px;
  margin-top: 8px;
  color: #d9fff7;
  text-align: left;
  border: 1px solid rgba(145, 168, 163, 0.22);
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 10px;
}

.quick-prompts button:hover,
.ghost-btn:hover,
.ghost-link:hover,
.chat-form button:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.center-stage {
  display: grid;
  gap: 16px;
}

.hero-panel {
  min-height: 278px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(37, 212, 231, 0.16), transparent 36%),
    linear-gradient(315deg, rgba(245, 184, 75, 0.08), transparent 31%),
    var(--panel-strong);
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(37, 212, 231, 0.18);
  transform: rotate(18deg);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: #061214;
  font-size: 12px;
  font-weight: 900;
  background: var(--mint);
}

.hero-panel h1 {
  margin: 18px 0 10px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-panel p {
  max-width: 720px;
  margin: 0;
  color: #c9ddd9;
  font-size: 15px;
  line-height: 1.7;
}

.action-list {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.action-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-height: 34px;
  color: #e7fff9;
  font-size: 13px;
  line-height: 1.55;
}

.action-index {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #061214;
  font-size: 11px;
  font-weight: 900;
  background: var(--cyan);
}

.score-board {
  display: grid;
  gap: 10px;
  align-content: center;
}

.score-card {
  min-height: 72px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.052);
}

.score-card.primary {
  border-color: rgba(78, 230, 163, 0.34);
  background: rgba(78, 230, 163, 0.09);
}

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

.score-card strong {
  display: block;
  margin-top: 8px;
  font-size: 27px;
  line-height: 1;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 16px;
}

.chat-panel,
.route-panel,
.economics-panel,
.brain-panel,
.proof-panel,
.narrative-panel,
.right-rail > .panel {
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 26px;
  color: #061214;
  font-size: 12px;
  font-weight: 900;
  background: var(--mint);
}

.chat-window {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 324px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  scroll-behavior: smooth;
}

.message {
  max-width: 86%;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.message.user {
  align-self: flex-end;
  color: #061214;
  background: linear-gradient(135deg, var(--cyan), var(--mint));
}

.message.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
  margin-top: 10px;
}

.chat-form button {
  color: #061214;
  font-weight: 900;
  border: 0;
  background: var(--mint);
}

.route-line {
  display: grid;
  gap: 11px;
}

.route-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.route-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #061214;
  font-size: 12px;
  font-weight: 900;
  background: var(--cyan);
}

.route-step.charge .route-dot {
  background: var(--amber);
}

.route-step.delivery .route-dot {
  background: var(--mint);
}

.route-name {
  font-weight: 800;
  line-height: 1.35;
}

.route-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.station-highlight {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(245, 184, 75, 0.28);
  background: rgba(245, 184, 75, 0.08);
}

.station-highlight strong {
  display: block;
  margin-bottom: 7px;
}

.station-highlight p {
  margin: 0;
  color: #ecdcc0;
  font-size: 13px;
  line-height: 1.6;
}

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

.cost-item {
  display: grid;
  align-content: end;
  min-height: 132px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.cost-bar {
  height: var(--bar-height);
  min-height: 12px;
  background: var(--bar-color);
  margin-bottom: 9px;
}

.cost-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.cost-value {
  margin-top: 3px;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
}

.brain-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.brain-node {
  display: grid;
  place-items: center;
  min-height: 48px;
  text-align: center;
  color: #d9fff7;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  font-weight: 800;
}

.brain-node.active {
  color: #061214;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--mint));
}

.brain-caption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.station-list,
.proof-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.station-card,
.proof-item {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.station-card.best {
  border-color: rgba(78, 230, 163, 0.34);
  background: rgba(78, 230, 163, 0.08);
}

.station-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.station-card span,
.proof-item {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.proof-item {
  color: #d9fff7;
}

.narrative-panel {
  overflow: hidden;
}

.narrative-panel img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.narrative-title {
  margin-top: 12px;
  font-size: 17px;
  font-weight: 900;
}

.narrative-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.tone-green {
  color: var(--mint);
}

.tone-amber {
  color: var(--amber);
}

.tone-red {
  color: var(--red);
}

@media (max-width: 1320px) {
  .workspace {
    grid-template-columns: 260px minmax(520px, 1fr);
  }

  .right-rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .narrative-panel img {
    height: 120px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 10px;
  }

  .topbar,
  .workspace,
  .grid-two,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .left-rail.panel {
    position: static;
  }

  .right-rail {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .topbar-metrics {
    justify-content: stretch;
  }

  .metric-pill,
  .ghost-btn,
  .ghost-link {
    width: 100%;
  }

  .brand-title {
    font-size: 20px;
  }

  .hero-panel {
    padding: 18px;
  }

  .hero-panel h1 {
    font-size: 30px;
  }

  .chat-window {
    height: 280px;
  }

  .message {
    max-width: 96%;
  }

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