:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #020b18;
  color: #e9f7ff;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 1180px;
  min-height: 100vh;
  margin: 0;
  overflow-x: auto;
  background:
    radial-gradient(circle at 50% 24%, rgba(0, 132, 255, 0.15), transparent 35%),
    linear-gradient(rgba(20, 108, 172, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 108, 172, 0.045) 1px, transparent 1px),
    #020b18;
  background-size: auto, 32px 32px, 32px 32px, auto;
}

button {
  font: inherit;
}

.dashboard-shell {
  width: min(1920px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 28px 16px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 4px 18px;
  border-bottom: 1px solid rgba(73, 178, 255, 0.22);
}

.brand-block,
.header-meta,
.panel-heading,
.side-heading,
.detail-header,
.map-actions,
.data-status,
.clock-block,
.map-legend,
.map-footnote,
.dashboard-footer {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 16px;
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(42, 194, 255, 0.65);
  transform: rotate(45deg);
  box-shadow: 0 0 20px rgba(0, 170, 255, 0.22), inset 0 0 16px rgba(0, 170, 255, 0.12);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  inset: 7px;
  border: 1px solid rgba(74, 225, 255, 0.4);
}

.brand-mark span {
  position: absolute;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #63edff;
  box-shadow: 0 0 8px #18bfff;
}

.brand-mark span:nth-child(1) { top: 8px; }
.brand-mark span:nth-child(2) { top: 19px; }
.brand-mark span:nth-child(3) { top: 30px; }

.eyebrow,
.panel-kicker {
  display: block;
  margin: 0 0 4px;
  color: #4ea8d8;
  font-family: Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.17em;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-shadow: 0 0 24px rgba(79, 203, 255, 0.24);
}

h2 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.header-meta {
  gap: 24px;
}

.data-status {
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid rgba(75, 185, 255, 0.26);
  border-radius: 4px;
  color: #83c9ee;
  background: rgba(7, 43, 69, 0.55);
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 9px currentColor;
}

.data-status[data-state="live"] .status-dot {
  background: #4dffbd;
}

.data-status[data-state="demo"] .status-dot,
.data-status[data-state="mixed"] .status-dot {
  background: #ffd166;
}

.data-status[data-state="error"] .status-dot {
  background: #ff637d;
}

.clock-block {
  min-width: 178px;
  flex-direction: column;
  align-items: flex-end;
}

.clock-block strong {
  color: #f4fbff;
  font-family: Consolas, monospace;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.clock-block span {
  margin-top: 2px;
  color: #6ca5c6;
  font-size: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0 14px;
}

.metric-card {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 106px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid rgba(64, 166, 231, 0.22);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(8, 38, 65, 0.88), rgba(3, 24, 46, 0.72));
  box-shadow: inset 0 1px rgba(130, 220, 255, 0.04);
}

.metric-card::after {
  position: absolute;
  right: -22px;
  bottom: -38px;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(69, 182, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.metric-primary {
  border-color: rgba(60, 221, 255, 0.52);
  background: linear-gradient(135deg, rgba(7, 73, 104, 0.82), rgba(4, 30, 57, 0.78));
  box-shadow: 0 0 22px rgba(0, 175, 255, 0.08), inset 0 0 22px rgba(39, 205, 255, 0.06);
}

.metric-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-right: 16px;
  place-items: center;
  border: 1px solid rgba(71, 205, 255, 0.3);
  border-radius: 50%;
  color: #5ee8ff;
  background: rgba(15, 113, 154, 0.1);
  box-shadow: 0 0 18px rgba(29, 193, 255, 0.1);
  font-size: 24px;
}

.metric-label,
.metric-note {
  display: block;
}

.metric-label {
  color: #7eabc4;
  font-size: 13px;
}

.metric-value {
  display: block;
  margin: 5px 0 2px;
  color: #f1fbff;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 31px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.metric-primary .metric-value {
  color: #76f2ff;
  text-shadow: 0 0 16px rgba(49, 221, 255, 0.3);
}

.metric-note {
  color: #527d98;
  font-size: 11px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(760px, 1fr) 390px;
  gap: 14px;
  min-height: calc(100vh - 300px);
}

.map-panel,
.side-panel {
  min-height: 630px;
  border: 1px solid rgba(56, 157, 221, 0.2);
  border-radius: 6px;
  background: rgba(3, 20, 39, 0.68);
  box-shadow: inset 0 0 40px rgba(19, 107, 165, 0.035);
}

.map-panel {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 12px;
}

.panel-heading,
.side-heading,
.detail-header {
  justify-content: space-between;
}

.map-actions {
  gap: 8px;
}

.refresh-label,
.ranking-unit {
  margin-right: 6px;
  color: #547f99;
  font-size: 11px;
}

button {
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(76, 176, 236, 0.32);
  border-radius: 4px;
  color: #8cc9eb;
  background: rgba(9, 52, 79, 0.62);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

button:hover,
button:focus-visible {
  border-color: rgba(95, 224, 255, 0.7);
  color: #e7fbff;
  outline: none;
  background: rgba(12, 78, 111, 0.72);
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.primary-button {
  border-color: rgba(75, 219, 255, 0.58);
  color: #071c2b;
  background: linear-gradient(135deg, #6aeeff, #38b8ed);
}

.primary-button:hover,
.primary-button:focus-visible {
  color: #061522;
  background: linear-gradient(135deg, #8ef5ff, #55caf5);
}

.text-button {
  min-height: auto;
  padding: 4px 0;
  border: 0;
  color: #56bee9;
  background: transparent;
  font-size: 12px;
}

.map-stage {
  position: relative;
  flex: 1;
  min-height: 500px;
  margin-top: 8px;
  overflow: hidden;
}

.map-stage::before {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: 72%;
  aspect-ratio: 1;
  border: 1px solid rgba(30, 156, 220, 0.08);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
  box-shadow: 0 0 80px rgba(0, 153, 255, 0.045), inset 0 0 80px rgba(0, 153, 255, 0.025);
}

#chinaMap {
  position: absolute;
  z-index: 1;
  inset: 0;
}

.map-loading {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: #6fbadf;
  background: rgba(3, 20, 39, 0.72);
  font-size: 13px;
  transition: opacity 240ms ease;
}

.map-loading[hidden] {
  display: none;
}

.loading-ring {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(61, 197, 255, 0.16);
  border-top-color: #55ddff;
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.map-legend {
  position: absolute;
  z-index: 3;
  bottom: 12px;
  left: 8px;
  gap: 18px;
  padding: 8px 10px;
  border: 1px solid rgba(52, 145, 205, 0.16);
  border-radius: 3px;
  color: #658da6;
  background: rgba(2, 15, 29, 0.66);
  font-size: 11px;
}

.legend-dot,
.legend-halo {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #67edff;
  box-shadow: 0 0 8px #31c5ff;
}

.legend-halo {
  background: #9fffff;
  box-shadow: 0 0 3px #8ef5ff, 0 0 10px #41d9ff, 0 0 16px rgba(31, 148, 255, 0.75);
}

.map-footnote {
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(52, 143, 201, 0.13);
  color: #4f748c;
  font-size: 11px;
}

.side-panel {
  display: grid;
  grid-template-rows: minmax(350px, 1.12fr) minmax(270px, 0.88fr);
  overflow: hidden;
}

.ranking-section,
.detail-section {
  min-height: 0;
  padding: 18px;
}

.ranking-section {
  border-bottom: 1px solid rgba(56, 157, 221, 0.16);
}

.ranking-list {
  display: grid;
  gap: 7px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.ranking-item {
  display: grid;
  grid-template-columns: 28px 54px minmax(80px, 1fr) 66px;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #86adc3;
  cursor: pointer;
}

.ranking-item:hover,
.ranking-item.is-active {
  border-color: rgba(56, 194, 244, 0.22);
  color: #d9f7ff;
  background: rgba(14, 77, 111, 0.24);
}

.rank-index {
  color: #4c7892;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.ranking-item:nth-child(-n+3) .rank-index {
  color: #65e7ff;
}

.rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.rank-bar,
.city-bar {
  height: 4px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(67, 150, 192, 0.13);
}

.rank-bar span,
.city-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1b8ed2, #5ce8ff);
  box-shadow: 0 0 8px rgba(74, 219, 255, 0.36);
}

.rank-value {
  color: #d9f8ff;
  font-family: Consolas, monospace;
  font-size: 12px;
  text-align: right;
}

.detail-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 14px;
}

.detail-summary div {
  padding: 10px 12px;
  border-left: 2px solid rgba(65, 212, 255, 0.5);
  background: linear-gradient(90deg, rgba(20, 110, 154, 0.17), transparent);
}

.detail-summary span,
.detail-summary strong {
  display: block;
}

.detail-summary span {
  color: #5d879f;
  font-size: 11px;
}

.detail-summary strong {
  margin-top: 3px;
  color: #79efff;
  font-family: Consolas, monospace;
  font-size: 20px;
  font-weight: 500;
}

.city-list {
  display: grid;
  gap: 9px;
  max-height: 164px;
  overflow-y: auto;
  padding-right: 3px;
}

.city-list::-webkit-scrollbar {
  width: 4px;
}

.city-list::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgba(59, 171, 226, 0.3);
}

.city-row {
  display: grid;
  grid-template-columns: 64px minmax(80px, 1fr) 54px;
  align-items: center;
  gap: 8px;
  color: #729bb2;
  font-size: 11px;
}

.city-row strong {
  color: #bdefff;
  font-family: Consolas, monospace;
  font-weight: 400;
  text-align: right;
}

.empty-detail,
.error-detail {
  padding: 18px 6px;
  color: #567c93;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.error-detail {
  color: #ff899b;
}

.dashboard-footer {
  justify-content: space-between;
  min-height: 34px;
  padding: 10px 4px 0;
  color: #3f667f;
  font-size: 10px;
  letter-spacing: 0.03em;
}

@media (max-width: 1450px) {
  .dashboard-shell {
    padding-inline: 18px;
  }

  .main-grid {
    grid-template-columns: minmax(720px, 1fr) 350px;
  }

  .metric-card {
    padding-inline: 15px;
  }

  .metric-icon {
    width: 46px;
    height: 46px;
    margin-right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
