:root {
  color-scheme: dark;
  --bg: #17182c;
  --bg-soft: #20233d;
  --surface: rgba(27, 30, 54, 0.88);
  --surface-soft: rgba(45, 51, 87, 0.5);
  --text: #f7f8ff;
  --muted: #8b8fa9;
  --muted-strong: #a7abc3;
  --cyan: #5bf7ff;
  --purple: #b56cff;
  --yellow: #f6ea73;
  --navy-arc: #2a3b66;
  --border: rgba(151, 158, 205, 0.12);
  --shadow: 0 28px 80px rgba(5, 7, 20, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top center, rgba(76, 88, 146, 0.18), transparent 28%),
    radial-gradient(circle at bottom left, rgba(149, 98, 255, 0.14), transparent 30%),
    linear-gradient(180deg, #17182c 0%, #181a31 100%);
}

.dashboard-shell {
  width: min(100%, 1600px);
  min-height: 100vh;
  margin: 0 auto;
}

.hero-stage {
  min-height: 100vh;
  padding: 56px 36px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top-metrics {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  align-items: start;
}

.metric-cluster {
  text-align: center;
}

.metric-title-row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--muted-strong);
  font-size: 1.05rem;
}

.metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  border: 2px solid currentColor;
}

.metric-icon.down {
  color: var(--cyan);
}

.metric-icon.up {
  color: var(--purple);
}

.metric-headline {
  display: block;
  margin-top: 6px;
  font-size: clamp(3.8rem, 9vw, 5.7rem);
  line-height: 1;
  font-weight: 300;
  letter-spacing: -0.06em;
}

.latency-strip {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted-strong);
}

.latency-label {
  font-size: 1.15rem;
}

.latency-chip-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.latency-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.latency-chip-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: 2px solid currentColor;
}

.latency-chip-icon.ping {
  color: var(--yellow);
}

.latency-chip-icon.down {
  color: var(--cyan);
}

.latency-chip-icon.up {
  color: var(--purple);
}

.latency-chip strong {
  font-size: 1.1rem;
  font-weight: 500;
}

.gauge-stage {
  width: min(100%, 860px);
  margin-top: 34px;
}

.gauge-wrap {
  position: relative;
  width: min(100%, 720px);
  margin: 0 auto;
}

.speed-gauge {
  width: 100%;
  display: block;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.24));
}

.gauge-center {
  position: absolute;
  left: 50%;
  bottom: 62px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 260px;
}

.gauge-mode {
  color: var(--muted);
  font-size: 0.96rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gauge-value {
  margin-top: 6px;
  font-size: clamp(4rem, 10vw, 5.4rem);
  line-height: 1;
  font-weight: 300;
  letter-spacing: -0.06em;
}

.gauge-unit {
  margin-top: 10px;
  font-size: 1.7rem;
  color: var(--muted);
}

.client-band {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: -8px;
}

.client-cell {
  min-width: 0;
  text-align: center;
}

.client-cell-right {
  text-align: left;
}

.client-caption {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-primary {
  display: block;
  font-size: clamp(1.15rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.client-secondary {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 1rem;
}

.client-seal {
  width: 76px;
  height: 76px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(167, 171, 195, 0.32);
  color: var(--muted-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.02);
}

.control-bar {
  width: min(100%, 760px);
  margin-top: 28px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.button-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, #4ef0ff 0%, #b85cff 100%);
  color: #111427;
  box-shadow: 0 18px 34px rgba(130, 105, 255, 0.28);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-block {
  min-width: 0;
}

.status-text {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}

.steps {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.step-item {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.step-item.active {
  color: var(--text);
  border-color: rgba(91, 247, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(91, 247, 255, 0.2);
}

.step-item.complete {
  color: #0f1223;
  background: linear-gradient(135deg, #5bf7ff, #b56cff);
  border-color: transparent;
}

.timeline-panel {
  width: min(100%, 980px);
  margin-top: 34px;
  padding: 22px 24px 24px;
  border-radius: 26px;
  background: rgba(17, 19, 36, 0.54);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.timeline-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.timeline-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.timeline-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.timeline-pill {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.timeline-pill.accent {
  color: var(--text);
  border-color: rgba(91, 247, 255, 0.24);
}

.timeline-shell {
  min-height: 220px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.latency-chart-empty {
  min-height: 194px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.98rem;
}

.latency-chart {
  width: 100%;
  height: 194px;
  display: block;
}

@media (max-width: 980px) {
  .top-metrics,
  .client-band,
  .control-bar {
    width: min(100%, 900px);
  }

  .control-bar {
    grid-template-columns: 1fr;
  }

  .button-stack {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .hero-stage {
    padding: 26px 16px 28px;
  }

  .top-metrics {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .latency-strip {
    flex-direction: column;
    gap: 14px;
  }

  .client-band {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .client-cell,
  .client-cell-right {
    text-align: center;
  }

  .client-seal {
    order: 3;
  }

  .timeline-header {
    flex-direction: column;
  }

  .timeline-stats {
    justify-content: flex-start;
  }
}
