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

@font-face {
  font-family: 'DS-Digital';
  src: local('Consolas');
}

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: linear-gradient(135deg, #0a0f24 0%, #0d1b3e 30%, #0a1628 60%, #0c1f3f 100%);
  color: #fff;
  min-height: 100vh;
  overflow: hidden;
}

#app {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  gap: 8px;
}

/* 顶部标题栏 */
.header {
  height: 72px;
  background: linear-gradient(180deg, rgba(0, 102, 204, 0.15) 0%, rgba(0, 68, 136, 0.08) 100%);
  border-bottom: 2px solid rgba(0, 170, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  border-radius: 4px 4px 0 0;
}

.header::before,
.header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  width: 160px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00d4ff, transparent);
}

.header::before { left: 20%; }
.header::after { right: 20%; }

.header-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
  background: linear-gradient(180deg, #fff 0%, #8ec5fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-title .icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #00d4ff, #0066cc);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  -webkit-text-fill-color: #fff;
}

.header-info {
  position: absolute;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: #8ec5fc;
}

.header-info .time {
  font-family: 'DS-Digital', 'Consolas', monospace;
  font-size: 18px;
  color: #00d4ff;
}

.header-info .divider {
  width: 1px;
  height: 16px;
  background: rgba(0, 212, 255, 0.3);
}

/* 主体内容区 */
.main-content {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 0;
}

/* 面板通用样式 */
.panel {
  background: rgba(6, 26, 58, 0.75);
  border: 1px solid rgba(0, 170, 255, 0.2);
  border-radius: 6px;
  padding: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), transparent);
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: #8ec5fc;
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 3px solid #00d4ff;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.panel-body {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
}

.panel-body.fixed {
  flex: none;
}

/* 统计卡片区域 */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  flex-shrink: 0;
}

.stat-card {
  background: rgba(6, 26, 58, 0.75);
  border: 1px solid rgba(0, 170, 255, 0.2);
  border-radius: 6px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.06) 0%, transparent 70%);
  transform: translate(20px, -20px);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-card .stat-icon.blue { background: linear-gradient(135deg, rgba(0,102,204,0.4), rgba(0,170,255,0.2)); }
.stat-card .stat-icon.green { background: linear-gradient(135deg, rgba(0,200,83,0.4), rgba(0,230,118,0.2)); }
.stat-card .stat-icon.orange { background: linear-gradient(135deg, rgba(255,107,53,0.4), rgba(255,152,0,0.2)); }
.stat-card .stat-icon.red { background: linear-gradient(135deg, rgba(255,58,58,0.4), rgba(255,82,82,0.2)); }

.stat-card .stat-info .stat-value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'DS-Digital', 'Consolas', monospace;
}

.stat-card .stat-info .stat-label {
  font-size: 12px;
  color: #8ec5fc;
  margin-top: 2px;
}

.stat-card .stat-trend {
  font-size: 11px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card .stat-trend.up { color: #ff5252; }
.stat-card .stat-trend.down { color: #00e676; }

/* 地图容器 */
.map-panel {
  grid-row: 1 / 3;
  grid-column: 2 / 3;
}

/* 覆盖特定面板的grid位置 */
.ai-vision-panel { grid-row: 1; grid-column: 1; }
.warning-trend-panel { grid-row: 2; grid-column: 1; }
.warning-level-panel { grid-row: 1; grid-column: 3; }
.device-panel { grid-row: 2; grid-column: 3; }

/* 预警列表滚动 */
.warning-list {
  list-style: none;
  overflow: hidden;
}

.warning-list .warning-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0, 170, 255, 0.1);
  gap: 10px;
  transition: background 0.3s;
  cursor: pointer;
}

.warning-list .warning-item:hover {
  background: rgba(0, 170, 255, 0.08);
}

.warning-level {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.warning-level.critical {
  background: #ff3a3a;
  box-shadow: 0 0 8px #ff3a3a;
  animation: pulse-red 1.5s infinite;
}

.warning-level.major {
  background: #ff9800;
  box-shadow: 0 0 6px #ff9800;
  animation: pulse-orange 2s infinite;
}

.warning-level.minor {
  background: #ffeb3b;
  box-shadow: 0 0 4px #ffeb3b;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.8); }
}

@keyframes pulse-orange {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.5); }
}

.warning-info {
  flex: 1;
  min-width: 0;
}

.warning-info .warning-mine {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.warning-info .warning-desc {
  font-size: 11px;
  color: #8899aa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.warning-time {
  font-size: 11px;
  color: #6688aa;
  flex-shrink: 0;
}

/* AI视觉识别列表 */
.ai-result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.ai-result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: rgba(0, 170, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(0, 170, 255, 0.1);
}

.ai-result-thumb {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 1px solid rgba(0, 170, 255, 0.15);
}

.ai-result-detail {
  flex: 1;
  min-width: 0;
}

.ai-result-detail .ai-label {
  font-size: 12px;
  color: #ff9800;
  font-weight: 600;
  margin-bottom: 2px;
}

.ai-result-detail .ai-desc {
  font-size: 11px;
  color: #8ec5fc;
  line-height: 1.4;
}

.ai-result-time {
  font-size: 10px;
  color: #6688aa;
  margin-top: 2px;
}

/* 视觉模型状态指示器 */
.model-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.2);
}

.model-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 6px #00e676;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 170, 255, 0.2);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 170, 255, 0.4);
}

/* 响应式 */
@media (max-width: 1400px) {
  .main-content {
    grid-template-columns: 280px 1fr 280px;
  }
  .header-title { font-size: 24px; }
}
