/* CCP 联邦网络健康面板 — 样式 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-glow: #818cf8;
  --healthy: #22c55e;
  --degraded: #eab308;
  --offline: #ef4444;
  --gradient-start: #4f46e5;
  --gradient-end: #7c3aed;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.header {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  padding: 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.status-overview {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.status-indicator {
  display: inline-block;
  padding: 0.25rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.status-indicator.healthy {
  background: rgba(34, 197, 94, 0.3);
  border: 1px solid var(--healthy);
}

.status-indicator.degraded {
  background: rgba(234, 179, 8, 0.3);
  border: 1px solid var(--degraded);
}

.status-indicator.offline {
  background: rgba(239, 68, 68, 0.3);
  border: 1px solid var(--offline);
}

.timestamp {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}

.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  gap: 1.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-card {
  text-align: center;
  padding: 1rem;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-glow);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.node-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.node-badge {
  font-size: 0.85rem;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.node-badge.healthy {
  color: var(--healthy);
}
.node-badge.degraded {
  color: var(--degraded);
}
.node-badge.offline {
  color: var(--offline);
}

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.75rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.status-dot.healthy {
  background: var(--healthy);
}
.status-dot.degraded {
  background: var(--degraded);
}
.status-dot.offline {
  background: var(--offline);
}
.status-dot.unknown {
  background: var(--text-muted);
}
.status-dot.stale {
  background: var(--degraded);
}

.coverage-bar {
  position: relative;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.coverage-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  border-radius: 12px;
  transition: width 0.5s ease;
}

.coverage-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.coverage-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.telemetry-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.telemetry-card {
  text-align: center;
  padding: 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 8px;
}

.telemetry-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-glow);
}

.telemetry-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.telemetry-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.telemetry-type-tag {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 6px;
  color: var(--text);
}

.categories-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.category-label {
  width: 100px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
}

.category-track {
  flex: 1;
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.category-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  border-radius: 4px;
  transition: width 0.5s ease;
}

.category-count {
  width: 40px;
  font-size: 0.8rem;
  color: var(--text);
  text-align: left;
}

.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .dashboard {
    padding: 0.75rem;
  }

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

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