:root {
  --bg: #04101d;
  --bg-deep: #020811;
  --panel: rgba(7, 21, 39, 0.94);
  --panel-strong: rgba(9, 28, 49, 0.96);
  --panel-soft: rgba(10, 24, 42, 0.92);
  --panel-border: rgba(111, 197, 255, 0.14);
  --panel-border-strong: rgba(111, 197, 255, 0.24);
  --text: #eaf8ff;
  --muted: #8eaec4;
  --accent: #4dc8ff;
  --accent-2: #6ef0ba;
  --accent-3: #ff7e67;
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  --table-line: rgba(255, 255, 255, 0.07);
  font-family: "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei",
    "IBM Plex Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(77, 200, 255, 0.08), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(110, 240, 186, 0.05), transparent 24%),
    linear-gradient(180deg, #081728 0%, var(--bg) 46%, var(--bg-deep) 100%);
}

.background-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.background-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(2, 7, 14, 0.08) 0%,
    rgba(2, 7, 14, 0.2) 38%,
    rgba(2, 7, 14, 0.58) 100%
  );
}

.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.9;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 30px 0 44px;
}

.hero,
.panel,
.stat-card,
.hero-meta-card {
  position: relative;
  overflow: hidden;
}

.hero::before,
.panel::before,
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.03),
    transparent 30%,
    transparent 70%,
    rgba(77, 200, 255, 0.04)
  );
  pointer-events: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(120px, 180px) minmax(320px, 380px);
  align-items: stretch;
  gap: 22px;
  padding: 30px;
  border: 1px solid var(--panel-border-strong);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(7, 24, 43, 0.88), rgba(7, 20, 36, 0.78));
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-2);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: 0.02em;
}

.hero-subtitle {
  margin: 18px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
}

.hero-side {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(111, 197, 255, 0.18);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(8, 27, 47, 0.76), rgba(6, 16, 30, 0.76));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.hero-side-header {
  display: grid;
  gap: 12px;
}

.hero-side-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-badge-stack {
  display: grid;
  gap: 10px;
}

.hero-mascot {
  width: clamp(92px, 10vw, 124px);
  padding: 8px;
  border-radius: 24px;
  border: 1px solid rgba(111, 197, 255, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.hero-mascot img {
  display: block;
  width: 100%;
  aspect-ratio: 88 / 146;
  object-fit: cover;
  border-radius: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
  font-size: 0.88rem;
  white-space: nowrap;
}

.badge-muted {
  color: #ffdd8c;
}

.badge-live {
  color: #041e2d;
  background: linear-gradient(135deg, #6ef0ba, #4dc8ff);
}

.badge-error {
  color: #fff4f1;
  background: rgba(255, 108, 79, 0.18);
  border-color: rgba(255, 108, 79, 0.26);
}

.badge-subtle {
  color: var(--muted);
}

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

.hero-meta-card {
  padding: 14px 14px 16px;
  border: 1px solid rgba(111, 197, 255, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
}

.hero-meta-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-meta-value {
  display: block;
  font-size: 0.98rem;
  line-height: 1.35;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.stat-card {
  min-height: 138px;
  padding: 20px 22px;
  border-radius: 22px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel-soft));
  box-shadow: var(--shadow);
}

.stat-card-primary {
  border-color: rgba(77, 200, 255, 0.24);
}

.stat-card-alert {
  border-color: rgba(255, 126, 103, 0.24);
  background:
    radial-gradient(circle at top right, rgba(255, 126, 103, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(30, 17, 22, 0.85), rgba(10, 20, 34, 0.84));
}

.stat-label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.stat-value {
  display: block;
  font-size: clamp(1.42rem, 2vw, 2.2rem);
  line-height: 1.1;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.88fr);
  gap: 18px;
  margin-top: 22px;
}

.dashboard-side {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 22px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(9, 25, 45, 0.86), rgba(8, 20, 37, 0.78));
  box-shadow: var(--shadow);
}

.panel-throughput {
  min-height: 430px;
}

.panel-distribution {
  grid-column: 1 / -1;
  min-height: 318px;
}

.panel-side {
  min-height: 296px;
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel-signal-group {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.signal-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(111, 197, 255, 0.16);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

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

.panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.panel-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.chart {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
}

.chart-empty::after {
  content: attr(data-empty);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.7;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(6, 18, 32, 0.22),
    rgba(6, 18, 32, 0.52)
  );
  border: 1px dashed rgba(111, 197, 255, 0.18);
  border-radius: 18px;
  pointer-events: none;
}

.chart-large {
  height: 340px;
}

.chart-medium {
  height: 236px;
}

.chart-compact {
  height: 250px;
}

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

.alerts-list li {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 126, 103, 0.18);
  background: linear-gradient(180deg, rgba(255, 126, 103, 0.12), rgba(20, 22, 35, 0.42));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.alert-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 6px;
  font-weight: 600;
}

.alert-meta,
.empty-state,
.empty-row {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.connections-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(4, 10, 18, 0.2);
}

.connections-table th,
.connections-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--table-line);
  white-space: nowrap;
}

.connections-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(7, 20, 34, 0.88);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
}

.connections-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.protocol-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.protocol-pill-tcp {
  color: #062a3d;
  background: linear-gradient(135deg, #6ef0ba, #4dc8ff);
  box-shadow: 0 0 16px rgba(77, 200, 255, 0.1);
}

.protocol-pill-udp {
  color: #f6fcff;
  background: rgba(118, 184, 255, 0.14);
  border: 1px solid rgba(118, 184, 255, 0.18);
}

.retrans-hot {
  color: #ffd2c8;
}

.loss-hot {
  color: #ffd8a8;
}

@media (max-width: 1260px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    justify-content: flex-start;
  }

  .hero-side {
    max-width: 560px;
  }

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

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .panel-throughput {
    min-height: auto;
  }

  .panel-signal-group {
    justify-items: start;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 18px;
  }

  .hero,
  .panel,
  .stat-card {
    border-radius: 22px;
  }

  .hero {
    padding: 22px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  .hero-side,
  .hero-meta-grid {
    grid-template-columns: 1fr;
  }

  .hero-mascot {
    width: 92px;
  }

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

  .chart-large {
    height: 280px;
  }

  .chart-medium,
  .chart-compact {
    height: 240px;
  }

  .panel-signal-group {
    width: 100%;
  }

  .signal-pill {
    white-space: normal;
  }

}
