/* ═══════════════════════════════════════════════════════
   MC 服务器仪表盘 — 毛玻璃 · 轻量动效
   ═══════════════════════════════════════════════════════ */

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

:root {
  --bg:            #f0f2f5;
  --glass:         rgba(255,255,255,0.68);
  --glass-hover:   rgba(255,255,255,0.82);
  --glass-border:  rgba(255,255,255,0.55);
  --text-primary:  #14142b;
  --text-secondary:#4e4e66;
  --text-tertiary: #8e8e9a;
  --accent:        #5b5fef;
  --online:        #0cce6b;
  --offline:       #ef4444;
  --radius:        14px;
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  height: 100%;
  font-family: 'PingFang SC', 'Inter', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 48px 20px 20px;
}

/* ═══ 毛玻璃基类 ═══ */
.glass {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background 0.3s var(--ease-out);
}
.glass:hover {
  background: var(--glass-hover);
  transform: translateY(-3px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.08);
}

main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
}

/* ═══ 标题栏 ═══ */
.dashboard-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 4px;
}
.dashboard-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.header-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ═══ 卡片行 ═══ */
.card-row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.card-row:first-of-type { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
.card-row:nth-of-type(2) { grid-template-columns: 1fr; }
.card-row:last-of-type { grid-template-columns: 1.5fr 1fr; }

/* ═══ 状态大卡 ═══ */
.status-hero {
  display: flex;
  align-items: center;
  padding: 28px 32px;
  min-height: 103px;
}
.hero-indicator { display: flex; align-items: center; gap: 14px; }
.dot {
  position: relative;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #d1d5db;
  flex-shrink: 0;
  transition: background 0.4s;
}
.dot-glow {
  position: absolute; inset: -6px;
  border-radius: 50%; opacity: 0;
  transition: opacity 0.4s;
}
body.online .dot { background: var(--online); }
body.online .dot-glow { background: var(--online); opacity: 0.35; animation: breathe 2.2s ease-in-out infinite; }
body.offline .dot { background: var(--offline); }
body.offline .dot-glow { background: var(--offline); opacity: 0.3; animation: pulse 1.6s ease-in-out infinite; }

.hero-text { font-size: 22px; font-weight: 700; letter-spacing: 0.3px; }

/* ═══ 统计小卡 ═══ */
.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 22px 24px;
  min-height: 140px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.stat-card:hover::after { transform: scaleX(1); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-tertiary);
}
.stat-value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}
.stat-sub { font-size: 12px; color: var(--text-tertiary); }

/* ═══ 图表卡 ═══ */
.chart-card { padding: 24px 28px 20px; }
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.chart-title { font-size: 14px; font-weight: 600; }
.chart-legend { display: flex; gap: 18px; font-size: 11px; font-weight: 500; }
.legend-online::before,
.legend-offline::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}
.legend-online::before { background: var(--online); }
.legend-offline::before { background: var(--offline); }
.legend-online { color: var(--online); }
.legend-offline { color: var(--offline); }

#chartCanvas { width: 100%; height: 220px; }

/* ═══ MOTD & 更新 ═══ */
.motd-card { padding: 20px 24px; min-height: 80px; }
.motd-text {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}
.updated-card { padding: 20px 24px; min-height: 80px; }
.updated-time { margin-top: 10px; font-size: 18px; font-weight: 600; }

/* ═══ 动画 ═══ */
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50%      { transform: scale(2.3); opacity: 0.06; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50%      { transform: scale(1.9); opacity: 0.06; }
}

/* ═══ Footer ═══ */
footer {
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ═══ 响应式 ═══ */
@media (max-width: 768px) {
  .card-row:first-of-type { grid-template-columns: 1fr 1fr; }
  .card-row:first-of-type .status-hero { grid-column: span 2; }
  .card-row:last-of-type { grid-template-columns: 1fr; }
  .stat-value { font-size: 26px; }
  .dashboard-header h1 { font-size: 20px; }
}
