/* ============================================================
   深色科技风数据监测大屏 - dashboard.css
   所有样式限定在 .dashboard 容器内，不影响系统其他模块
   ============================================================ */

/* ---------- CSS 变量 ---------- */
.dashboard {
  --primary: #00d4ff;
  --accent: #a855f7;
  --success: #00f0ff;
  --warning: #faad14;
  --danger: #ff4d4f;
  --bg-dark: #0a1929;
  --bg-dark-end: #1a2a4a;
  --bg-card: rgba(10, 30, 60, 0.7);
  --text: #e0e6ed;
  --text-muted: #7a8ba0;
  --border-glow: rgba(0, 212, 255, 0.3);
  --font-family: -apple-system, 'Microsoft YaHei', sans-serif;
  --topbar-height: 60px;
  --bottombar-height: 40px;
  --grid-gap: 16px;
  --card-radius: 12px;
  --card-padding: 14px;
}

/* ============================================================
   大屏主容器
   ============================================================ */
.dashboard {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: calc(100vh - 60px);
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-end) 100%);
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
}

/* ============================================================
   粒子背景
   ============================================================ */
.dashboard .particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.dashboard .particles .particle {
  position: absolute;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  animation: dbParticleFloat linear infinite;
}

.dashboard .particles .particle:nth-child(1)  { width:2px;height:2px;left:5vw;top:10vh;animation-duration:12s;animation-delay:0s; }
.dashboard .particles .particle:nth-child(2)  { width:3px;height:3px;left:12vw;top:25vh;animation-duration:15s;animation-delay:1s; }
.dashboard .particles .particle:nth-child(3)  { width:2px;height:2px;left:20vw;top:60vh;animation-duration:10s;animation-delay:2s; }
.dashboard .particles .particle:nth-child(4)  { width:4px;height:4px;left:30vw;top:15vh;animation-duration:18s;animation-delay:0.5s; }
.dashboard .particles .particle:nth-child(5)  { width:2px;height:2px;left:38vw;top:80vh;animation-duration:11s;animation-delay:3s; }
.dashboard .particles .particle:nth-child(6)  { width:3px;height:3px;left:45vw;top:5vh;animation-duration:14s;animation-delay:1.5s; }
.dashboard .particles .particle:nth-child(7)  { width:2px;height:2px;left:52vw;top:45vh;animation-duration:13s;animation-delay:2.5s; }
.dashboard .particles .particle:nth-child(8)  { width:3px;height:3px;left:60vw;top:70vh;animation-duration:16s;animation-delay:0.8s; }
.dashboard .particles .particle:nth-child(9)  { width:2px;height:2px;left:68vw;top:20vh;animation-duration:12s;animation-delay:3.5s; }
.dashboard .particles .particle:nth-child(10) { width:4px;height:4px;left:75vw;top:55vh;animation-duration:17s;animation-delay:1.2s; }
.dashboard .particles .particle:nth-child(11) { width:2px;height:2px;left:82vw;top:35vh;animation-duration:11s;animation-delay:4s; }
.dashboard .particles .particle:nth-child(12) { width:3px;height:3px;left:90vw;top:90vh;animation-duration:15s;animation-delay:0.3s; }
.dashboard .particles .particle:nth-child(13) { width:2px;height:2px;left:8vw;top:50vh;animation-duration:14s;animation-delay:2.2s; }
.dashboard .particles .particle:nth-child(14) { width:3px;height:3px;left:18vw;top:85vh;animation-duration:16s;animation-delay:1.8s; }
.dashboard .particles .particle:nth-child(15) { width:2px;height:2px;left:25vw;top:30vh;animation-duration:10s;animation-delay:3.2s; }
.dashboard .particles .particle:nth-child(16) { width:4px;height:4px;left:35vw;top:5vh;animation-duration:18s;animation-delay:0.6s; }
.dashboard .particles .particle:nth-child(17) { width:2px;height:2px;left:42vw;top:65vh;animation-duration:13s;animation-delay:2.8s; }
.dashboard .particles .particle:nth-child(18) { width:3px;height:3px;left:55vw;top:40vh;animation-duration:15s;animation-delay:1.4s; }
.dashboard .particles .particle:nth-child(19) { width:2px;height:2px;left:63vw;top:10vh;animation-duration:12s;animation-delay:3.8s; }
.dashboard .particles .particle:nth-child(20) { width:3px;height:3px;left:72vw;top:75vh;animation-duration:17s;animation-delay:0.9s; }

@keyframes dbParticleFloat {
  0%   { opacity:0; transform:translateY(0) scale(0.5); }
  10%  { opacity:0.6; }
  50%  { opacity:0.3; transform:translateY(-30vh) scale(1); }
  90%  { opacity:0.6; }
  100% { opacity:0; transform:translateY(-60vh) scale(0.5); }
}

/* ============================================================
   顶部栏
   ============================================================ */
.dashboard .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 24px;
  background: rgba(10, 25, 41, 0.85);
  border-bottom: 1px solid rgba(0, 212, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.dashboard .topbar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 20%, var(--accent) 50%, var(--primary) 80%, transparent 100%);
  opacity: 0.6;
}

.dashboard .topbar__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.dashboard .topbar__logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.dashboard .topbar__subtitle {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 3px;
  color: var(--text-muted);
}

.dashboard .topbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard .topbar__time {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}

/* 全屏按钮 */
.dashboard .btn-fullscreen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 6px;
  background: rgba(0, 212, 255, 0.08);
  color: var(--primary);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.dashboard .btn-fullscreen:hover {
  background: rgba(0, 212, 255, 0.18);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

.dashboard .btn-fullscreen:active {
  transform: scale(0.92);
}

/* ============================================================
   三栏布局
   ============================================================ */
.dashboard .dashboard-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 25% 50% 25%;
  gap: var(--grid-gap);
  padding: var(--grid-gap);
  min-height: 0;
  position: relative;
  z-index: 1;
}

.dashboard .dashboard-grid__left,
.dashboard .dashboard-grid__center,
.dashboard .dashboard-grid__right {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  min-height: 0;
}

/* ============================================================
   面板卡片 - 玻璃拟态 + 霓虹发光 + 透视
   ============================================================ */
.dashboard .panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 0 15px rgba(0, 212, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: perspective(1000px) rotateX(1deg);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.dashboard .panel:hover {
  box-shadow:
    0 0 20px rgba(0, 212, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: perspective(1000px) rotateX(0deg);
}

.dashboard .panel__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 2px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.dashboard .panel__title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--primary);
}

/* 科技感角落装饰 */
.dashboard .panel--decorated::before,
.dashboard .panel--decorated::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.dashboard .panel--decorated::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--primary);
  border-left: 2px solid var(--primary);
  border-top-left-radius: var(--card-radius);
  box-shadow: -2px -2px 8px rgba(0, 212, 255, 0.2);
}

.dashboard .panel--decorated::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  border-bottom-right-radius: var(--card-radius);
  box-shadow: 2px 2px 8px rgba(168, 85, 247, 0.2);
}

/* ============================================================
   KPI 数字卡片
   ============================================================ */
.dashboard .kpi-card {
  position: relative;
  background: rgba(10, 30, 60, 0.5);
  border: 1px solid rgba(0, 212, 255, 0.1);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.dashboard .kpi-card:hover {
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(10, 30, 60, 0.7);
}

.dashboard .kpi-card__label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.dashboard .kpi-card__value {
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.dashboard .kpi-card__unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 2px;
}

/* KPI 颜色变体 */
.dashboard .kpi-card--primary .kpi-card__value {
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.6), 0 0 20px rgba(0, 212, 255, 0.3);
}
.dashboard .kpi-card--accent .kpi-card__value {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.6), 0 0 20px rgba(168, 85, 247, 0.3);
}
.dashboard .kpi-card--success .kpi-card__value {
  color: var(--success);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6), 0 0 20px rgba(0, 240, 255, 0.3);
}
.dashboard .kpi-card--warning .kpi-card__value {
  color: var(--warning);
  text-shadow: 0 0 10px rgba(250, 173, 20, 0.6), 0 0 20px rgba(250, 173, 20, 0.3);
}
.dashboard .kpi-card--danger .kpi-card__value {
  color: var(--danger);
  text-shadow: 0 0 10px rgba(255, 77, 79, 0.6), 0 0 20px rgba(255, 77, 79, 0.3);
}

/* KPI 行 */
.dashboard .kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

/* ============================================================
   图表容器
   ============================================================ */
.dashboard .chart-container {
  position: relative;
  width: 100%;
  border-radius: 8px;
  background: rgba(5, 15, 30, 0.4);
  border: 1px solid rgba(0, 212, 255, 0.06);
  padding: 4px;
  overflow: hidden;
}

/* ============================================================
   慢病监测预留位
   ============================================================ */
.dashboard .panel--placeholder {
  border: 2px dashed rgba(0, 212, 255, 0.2);
  background: rgba(10, 30, 60, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.dashboard .panel__placeholder-content {
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 3px;
  opacity: 0.5;
  animation: dbPlaceholderPulse 3s ease-in-out infinite;
}

@keyframes dbPlaceholderPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* ============================================================
   底部栏
   ============================================================ */
.dashboard .bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--bottombar-height);
  padding: 0 24px;
  background: rgba(10, 25, 41, 0.85);
  border-top: 1px solid rgba(0, 212, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
}

.dashboard .bottombar::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 30%, var(--primary) 70%, transparent 100%);
  opacity: 0.4;
}

.dashboard .bottombar__countdown-value,
.dashboard #refresh-countdown {
  color: var(--primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   响应式
   ============================================================ */
@media screen and (max-width: 1400px) {
  .dashboard .dashboard-grid {
    grid-template-columns: 22% 56% 22%;
    gap: 12px;
    padding: 12px;
  }
  .dashboard .kpi-card__value {
    font-size: 26px;
  }
}

@media screen and (max-width: 1200px) {
  .dashboard .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
  .dashboard .panel {
    transform: none;
  }
  .dashboard .panel:hover {
    transform: none;
  }
}

/* ============================================================
   扫描线装饰（可选）
   ============================================================ */
.dashboard .scanline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 212, 255, 0.15) 50%, transparent 100%);
  animation: dbScanlineMove 8s linear infinite;
  pointer-events: none;
  z-index: 999;
}

@keyframes dbScanlineMove {
  0%   { top: -2px; }
  100% { top: 100%; }
}
