:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --secondary: #0891b2;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #1e293b;
  --light: #f8fafc;
  --gray: #94a3b8;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 基本布局 */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* 左侧导航栏 */
.sidebar {
  width: 240px;
  background-color: #f8fafc;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-menu {
  padding: 1rem 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #64748b;
  text-decoration: none;
}

.sidebar-item:hover {
  background-color: #f1f5f9;
}

.sidebar-item.active {
  background-color: #e0f2fe;
  color: #0ea5e9;
  border-left: 3px solid #0ea5e9;
}

.sidebar-icon {
  margin-right: 0.75rem;
  width: 1.25rem;
}

/* 主内容区 */
.main-content {
  flex: 1;
  overflow-y: auto;
  background-color: #f1f5f9;
}

.top-bar {
  padding: 1rem;
  background-color: white;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.time-filter {
  display: flex;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  overflow: hidden;
}

.time-filter-btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  border: none;
  background: none;
  cursor: pointer;
}

.time-filter-btn.active {
  background-color: #3b82f6;
  color: white;
}

/* 右侧告警栏 */
.alert-sidebar {
  width: 280px;
  background-color: white;
  border-left: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.alert-header {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-item {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.alert-item.error {
  border-left: 3px solid #ef4444;
}

.alert-item.warning {
  border-left: 3px solid #f59e0b;
}

/* 确保图表容器有高度 */
canvas {
  max-width: 100%;
}

/* 响应式调整 */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
  }
  
  .alert-sidebar {
    width: 100%;
  }
}

.dashboard-grid {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.stat-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.25rem;
  transition: all 0.2s;
}

.stat-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.device-status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-normal {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* 图表容器样式 */
.chart-container {
  width: 100%;
  height: 250px;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  margin-bottom: 1rem;
} 