:root {
  --bg: #05080c;
  --bg-soft: #080d13;
  --panel: #0d151e;
  --panel-2: #111c27;
  --panel-3: #162433;
  --line: #233443;
  --line-soft: rgba(157, 192, 219, .10);
  --text: #eef6fb;
  --muted: #91a5b7;
  --soft: #607487;
  --red: #ff5d6c;
  --green: #42dda0;
  --blue: #55c8ff;
  --yellow: #f7c95f;
  --purple: #a994ff;
  --orange: #ff9d5c;
  --font: "Bahnschrift", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --mono: "Cascadia Mono", "Consolas", monospace;
  --radius: 5px;
}

html, body {
  background: #05080c;
}

body.v3-command-center {
  background:
    linear-gradient(rgba(85, 200, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(85, 200, 255, .018) 1px, transparent 1px),
    radial-gradient(circle at 73% -15%, rgba(85, 200, 255, .12), transparent 32%),
    #05080c;
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.v3-command-center .app {
  grid-template-columns: 236px minmax(0, 1fr);
}

.v3-command-center .sidebar {
  padding: 18px 13px;
  background: linear-gradient(180deg, #07101a 0%, #080d13 62%, #060a0f 100%);
  border-right-color: #243d50;
  box-shadow: 14px 0 38px rgba(0, 0, 0, .22);
}

.v3-command-center .brand {
  align-items: flex-start;
  padding: 2px 5px 17px;
  border-bottom-color: #203748;
}

.v3-command-center .mark {
  width: 42px;
  height: 42px;
  border-color: #2e789d;
  border-radius: 3px;
  color: #68d6ff;
  background: linear-gradient(145deg, #0e2634, #08121a);
  box-shadow: inset 0 0 18px rgba(85, 200, 255, .07);
}

.v3-command-center .brand h1 {
  font-size: 16px;
  letter-spacing: .04em;
}

.v3-command-center .brand p {
  margin-top: 5px;
  color: #68d6ff;
  font: 700 10px/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.v3-edition {
  display: inline-flex;
  margin-top: 7px;
  padding: 3px 6px;
  border: 1px solid rgba(85, 200, 255, .35);
  color: #a8e7ff;
  background: rgba(85, 200, 255, .07);
  font: 700 9px/1 var(--mono);
  letter-spacing: .12em;
}

.v3-command-center .nav {
  gap: 3px;
}

.v3-command-center .nav button {
  position: relative;
  min-height: 40px;
  border-radius: 2px;
  padding-left: 13px;
  font-size: 13px;
  letter-spacing: .025em;
}

.v3-command-center .nav button:hover {
  color: #d7e8f2;
  background: rgba(85, 200, 255, .045);
}

.v3-command-center .nav button.active {
  color: #f4fbff;
  background: linear-gradient(90deg, rgba(85, 200, 255, .15), rgba(85, 200, 255, .025));
  border-color: #28465a;
  box-shadow: inset 3px 0 0 #55c8ff;
}

.v3-command-center .nav button[data-view="architecture"] {
  margin-top: 8px;
  border-top-color: #2a3f50;
}

.v3-command-center .main {
  max-width: 1840px;
  padding: 16px 24px 92px;
}

.v3-mission-rail {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) repeat(3, minmax(130px, .65fr));
  min-height: 54px;
  margin-bottom: 12px;
  border: 1px solid #284155;
  border-left: 3px solid #55c8ff;
  background: linear-gradient(90deg, rgba(85, 200, 255, .08), rgba(13, 21, 30, .82) 34%, rgba(13, 21, 30, .96));
  box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

.v3-mission-main,
.v3-mission-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 9px 13px;
}

.v3-mission-cell {
  border-left: 1px solid var(--line-soft);
}

.v3-mission-main label,
.v3-mission-cell label {
  color: #7890a4;
  font: 700 9px/1.2 var(--mono);
  letter-spacing: .12em;
}

.v3-mission-main strong,
.v3-mission-cell strong {
  margin-top: 5px;
  color: #eff9ff;
  font: 800 12px/1.3 var(--mono);
  overflow-wrap: anywhere;
}

.v3-mission-cell.legacy strong { color: #61e5a8; }
.v3-mission-cell.next strong { color: #67cfff; }
.v3-mission-cell.paper strong { color: #f7c95f; }

.v3-mission-cell.next {
  cursor: pointer;
}

.v3-mission-cell.next:hover {
  background: rgba(85, 200, 255, .055);
}

.v3-command-center .topbar {
  top: 0;
  margin: 0 -8px 14px;
  padding: 10px 8px 11px;
  background: rgba(5, 8, 12, .91);
  border-bottom-color: rgba(85, 200, 255, .12);
}

.v3-command-center .topbar h2 {
  font-size: 21px;
  letter-spacing: .025em;
}

.v3-command-center .mode-pill {
  border-radius: 2px;
}

.v3-command-center .refresh-all {
  border-radius: 3px;
  background: #0a1822;
}

.v3-command-center .panel,
.v3-command-center .metric,
.v3-command-center .row-card,
.v3-command-center .source-card,
.v3-command-center .summary-card,
.v3-command-center .hero-card,
.v3-command-center .command-tile {
  border-radius: 4px;
  border-color: #233746;
  background-color: rgba(13, 21, 30, .94);
  box-shadow: 0 9px 26px rgba(0, 0, 0, .12);
}

.v3-command-center .panel-head {
  min-height: 42px;
  padding: 10px 12px;
  border-bottom-color: #213442;
  background: linear-gradient(90deg, rgba(85, 200, 255, .035), transparent 48%);
}

.v3-command-center .panel-title {
  color: #7bd7ff;
  letter-spacing: .025em;
}

.v3-command-center .summary-strip {
  border-radius: 4px;
  border-color: #243847;
  background: rgba(11, 18, 26, .94);
}

.v3-command-center .metric strong,
.v3-command-center .command-tile strong,
.v3-command-center code {
  font-family: var(--mono);
}

.v3-command-center .view.active {
  animation: v3-view-in .22s ease-out both;
}

@keyframes v3-view-in {
  from { opacity: .55; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.v3-architecture-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .7fr);
  gap: 12px;
}

.v3-architecture-hero {
  min-height: 168px;
  padding: 22px;
  border: 1px solid #2b4b61;
  border-left: 4px solid #55c8ff;
  background:
    radial-gradient(circle at 92% 14%, rgba(85, 200, 255, .15), transparent 30%),
    linear-gradient(135deg, #0c1721, #0b1219);
}

.v3-eyebrow {
  color: #64cfff;
  font: 800 10px/1.2 var(--mono);
  letter-spacing: .16em;
}

.v3-architecture-hero h3 {
  max-width: 760px;
  margin: 12px 0 9px;
  font-size: clamp(22px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -.025em;
}

.v3-architecture-hero p {
  max-width: 760px;
  margin: 0;
  color: #a8bac8;
  font-size: 14px;
  line-height: 1.65;
}

.v3-legacy-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  margin-top: 17px;
  padding: 8px 11px;
  border: 1px solid rgba(66, 221, 160, .42);
  color: #79ecb7;
  background: rgba(66, 221, 160, .06);
  text-decoration: none;
  font: 700 11px/1 var(--mono);
}

.v3-legacy-link:hover { background: rgba(66, 221, 160, .12); }

.v3-guard-panel {
  padding: 17px;
  border: 1px solid #3c3b2c;
  background: rgba(247, 201, 95, .045);
}

.v3-guard-panel h3 {
  margin: 0 0 12px;
  color: #f7d678;
  font-size: 14px;
}

.v3-guard-list {
  display: grid;
  gap: 9px;
}

.v3-guard-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  color: #aebbc5;
  font-size: 12px;
  line-height: 1.5;
}

.v3-guard-item::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: 6px;
  background: #f7c95f;
}

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

.v3-surface {
  min-width: 0;
  border: 1px solid #293f50;
  background: rgba(11, 18, 26, .96);
}

.v3-surface.legacy { border-top: 3px solid #42dda0; }
.v3-surface.next { border-top: 3px solid #55c8ff; }

.v3-surface-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  border-bottom: 1px solid #223746;
}

.v3-surface-head h3 {
  margin: 0;
  font-size: 17px;
}

.v3-surface-head p {
  margin: 5px 0 0;
  color: #768ca0;
  font: 10px/1.45 var(--mono);
  overflow-wrap: anywhere;
}

.v3-state-tag {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid currentColor;
  font: 800 10px/1 var(--mono);
  letter-spacing: .08em;
}

.legacy .v3-state-tag { color: #55e1a4; background: rgba(66, 221, 160, .06); }
.next .v3-state-tag { color: #63ccff; background: rgba(85, 200, 255, .06); }

.v3-surface-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.v3-surface-fact {
  min-width: 0;
  min-height: 70px;
  padding: 12px 14px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.v3-surface-fact:nth-child(even) { border-right: 0; }

.v3-surface-fact label {
  display: block;
  color: #6f8497;
  font-size: 10px;
}

.v3-surface-fact strong {
  display: block;
  margin-top: 7px;
  color: #e7f1f7;
  font: 750 12px/1.45 var(--mono);
  overflow-wrap: anywhere;
}

.v3-surface-next {
  padding: 13px 14px;
  color: #9dafbc;
  font-size: 12px;
  line-height: 1.55;
}

.v3-comparison {
  overflow: hidden;
  border: 1px solid #253b4b;
  background: rgba(10, 16, 23, .96);
}

.v3-comparison-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--line-soft);
}

.v3-comparison-row:last-child { border-bottom: 0; }

.v3-comparison-row > div {
  min-width: 0;
  padding: 11px 13px;
  color: #aebcc7;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.v3-comparison-row > div + div { border-left: 1px solid var(--line-soft); }
.v3-comparison-row.head > div { color: #7fd7ff; font: 800 10px/1.3 var(--mono); letter-spacing: .08em; }
.v3-comparison-row > div:first-child { color: #71879a; }

.v3-architecture-loading {
  padding: 28px;
  color: #8197aa;
  text-align: center;
  font: 12px var(--mono);
}

@media (max-width: 1180px) {
  .v3-command-center .app { grid-template-columns: minmax(0, 1fr); }
  .v3-command-center .bottom-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    overflow-x: hidden;
    padding: 5px 5px calc(5px + env(safe-area-inset-bottom));
  }
  .v3-command-center .bottom-tabs button {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 4px 2px;
    font-size: 11px;
  }
}

@media (max-width: 760px) {
  .v3-command-center .main { padding: 10px 9px calc(112px + env(safe-area-inset-bottom)); }
  .v3-command-center .rank-tabs,
  .v3-command-center .growth-toolbar {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .v3-command-center .rank-tabs button,
  .v3-command-center .growth-toolbar button {
    flex: 1 1 72px;
    min-width: 0;
    text-align: center;
  }
  .v3-mission-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 8px;
  }
  .v3-mission-main { grid-column: 1 / -1; border-bottom: 1px solid var(--line-soft); }
  .v3-mission-cell { padding: 8px 9px; }
  .v3-mission-cell:first-of-type { border-left: 0; }
  .v3-mission-main strong, .v3-mission-cell strong { font-size: 10px; }
  .v3-command-center .topbar { margin-bottom: 10px; }
  .v3-architecture-intro,
  .v3-surface-grid { grid-template-columns: minmax(0, 1fr); }
  .v3-architecture-hero { min-height: auto; padding: 17px; }
  .v3-comparison-row { grid-template-columns: 95px minmax(0, 1fr) minmax(0, 1fr); }
  .v3-comparison-row > div { padding: 9px 8px; font-size: 10px; }
}

@media (max-width: 420px) {
  .v3-command-center .bottom-tabs button { min-height: 36px; font-size: 10px; }
  .v3-mission-cell label { font-size: 8px; letter-spacing: .06em; }
  .v3-surface-body { grid-template-columns: minmax(0, 1fr); }
  .v3-surface-fact,
  .v3-surface-fact:nth-child(even) { border-right: 0; }
}
