/* ============================================
   GasPipe-Monitor 后台监控大屏样式
   ============================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: #0a1628;
  color: #e0e0e0;
  overflow: hidden;
  height: 100vh;
}

/* ---------- 顶部标题栏 ---------- */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
  padding: 0 24px;
  background: linear-gradient(90deg, #0d2137 0%, #132d45 100%);
  border-bottom: 1px solid rgba(26, 92, 58, 0.3);
  z-index: 1000;
  position: relative;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-title {
  font-size: 18px;
  font-weight: 700;
  color: #4caf50;
  letter-spacing: 2px;
}
.header-subtitle {
  font-size: 12px;
  color: #607d8b;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: #90a4ae;
}
.connection-status {
  font-size: 12px;
  color: #9e9e9e;
}
.btn-export {
  padding: 6px 16px;
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid #4caf50;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}
.btn-export:hover {
  background: rgba(76, 175, 80, 0.3);
}
.btn-logout {
  padding: 6px 16px;
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
  border: 1px solid #f44336;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

/* ---------- 主容器 ---------- */
.main-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 56px);
}

/* ---------- 数据看板覆盖层 ---------- */
.stats-overlay {
  position: absolute;
  top: 16px;
  left: 24px;
  z-index: 100;
  display: flex;
  gap: 12px;
}
.stat-card {
  background: rgba(13, 33, 55, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 22px;
  text-align: center;
  min-width: 100px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.stat-card.blue {
  border-top: 3px solid #1976d2;
}
.stat-card.green {
  border-top: 3px solid #4caf50;
}
.stat-card.yellow {
  border-top: 3px solid #fbc02d;
}
.stat-card.red {
  border-top: 3px solid #f44336;
  animation: pulse-alert 2s infinite;
}
.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}
.stat-card.red .stat-num {
  color: #f44336;
}
.stat-label {
  font-size: 12px;
  color: #90a4ae;
  margin-top: 2px;
}

@keyframes pulse-alert {
  0%, 100% { border-top-color: #f44336; }
  50% { border-top-color: #ff7961; }
}

/* ---------- 地图容器 ---------- */
#mapContainer {
  width: 100%;
  height: 100%;
}

/* ---------- 右侧面板 ---------- */
.right-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 340px;
  background: rgba(13, 33, 55, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.panel-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.tab-btn {
  flex: 1;
  padding: 14px 0;
  background: none;
  border: none;
  color: #90a4ae;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.tab-btn.active {
  color: #4caf50;
  border-bottom-color: #4caf50;
}
.tab-btn:hover {
  color: #b0bec5;
}
.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

/* 滚动条 */
.panel-content::-webkit-scrollbar {
  width: 4px;
}
.panel-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.empty-panel {
  text-align: center;
  color: #607d8b;
  padding: 40px 0;
  font-size: 13px;
}

/* 填报动态列表 */
.report-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-left: 3px solid transparent;
  transition: background 0.2s;
}
.report-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.report-item.abnormal-highlight {
  border-left-color: #f44336;
  background: rgba(244, 67, 54, 0.1);
}
.report-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.report-project {
  font-size: 12px;
  color: #4caf50;
  font-weight: 600;
}
.report-time {
  font-size: 11px;
  color: #607d8b;
}
.report-detail {
  font-size: 12px;
  color: #b0bec5;
  margin: 4px 0;
  line-height: 1.5;
}
.report-hazard {
  font-size: 12px;
  color: #ff7961;
  margin: 4px 0;
}
.report-footer {
  font-size: 11px;
  color: #607d8b;
  margin-top: 4px;
}

/* 异常清单 */
.abnormal-section {
  margin-bottom: 16px;
}
.abnormal-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  margin-bottom: 8px;
}
.abnormal-dot {
  width: 10px;
  height: 10px;
  background: #e65100;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.abnormal-dot.red {
  background: #f44336;
}
.abnormal-name {
  display: block;
  font-size: 12px;
  color: #e0e0e0;
  font-weight: 600;
}
.abnormal-project {
  display: block;
  font-size: 11px;
  color: #78909c;
  margin-top: 2px;
}
.abnormal-hazard {
  font-size: 12px;
  color: #ff7961;
  margin: 0;
}
.abnormal-time {
  font-size: 10px;
  color: #607d8b;
}

/* 操作日志 */
.log-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
}
.log-action {
  color: #4caf50;
  font-weight: 600;
  width: 80px;
}
.log-user {
  color: #b0bec5;
  flex: 1;
  text-align: center;
}
.log-time {
  color: #607d8b;
  font-size: 11px;
}

/* ---------- 图例覆盖层 ---------- */
.legend-overlay {
  position: absolute;
  bottom: 20px;
  left: 24px;
  display: flex;
  gap: 16px;
  background: rgba(13, 33, 55, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 18px;
  z-index: 100;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #b0bec5;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* ---------- 异常告警弹窗 ---------- */
.alert-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}
.alert-content {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 2px solid #f44336;
  border-radius: 16px;
  padding: 36px 44px;
  text-align: center;
  max-width: 440px;
  box-shadow: 0 0 40px rgba(244, 67, 54, 0.3);
  animation: scaleIn 0.3s;
}
.alert-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.alert-icon {
  font-size: 36px;
}
.alert-title {
  font-size: 22px;
  font-weight: 700;
  color: #f44336;
}
.alert-msg {
  font-size: 15px;
  color: #e0e0e0;
  line-height: 1.6;
  margin: 0 0 24px;
}
.alert-close {
  padding: 10px 40px;
  background: #f44336;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.alert-close:hover {
  background: #d32f2f;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .right-panel {
    width: 280px;
  }
  .stats-overlay {
    flex-wrap: wrap;
  }
  .stat-card {
    min-width: 80px;
    padding: 10px 14px;
  }
  .stat-num {
    font-size: 22px;
  }
}
