/**
 * 监控模块样式
 */

/* 监控容器 */
.monitoring-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f9fafb;
}

/* 顶部工具栏 */
.monitoring-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  gap: 1rem;
}

.monitoring-nav {
  display: flex;
  gap: 0.5rem;
}

.monitoring-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #6b7280;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.monitoring-nav-item:hover {
  background: #f3f4f6;
  color: #111827;
}

.monitoring-nav-item.active {
  background: #3b82f6;
  color: white;
}

.monitoring-nav-item .nav-icon {
  font-size: 1.25rem;
}

.monitoring-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kb-selector {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: white;
  cursor: pointer;
}

.kb-selector:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-refresh {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: white;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.2s;
}

.btn-refresh:hover {
  background: #f3f4f6;
  transform: rotate(90deg);
}

.btn-refresh:active {
  transform: rotate(180deg);
}

/* 内容区域 */
.monitoring-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* 加载和错误状态 */
.loading,
.error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6b7280;
}

.error {
  color: #ef4444;
}

.error h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
}

.error p {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
}

.error button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  background: #3b82f6;
  color: white;
  cursor: pointer;
  font-size: 0.875rem;
}

.error button:hover {
  background: #2563eb;
}

/* 卡片通用样式 */
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.card-title {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* 状态标签 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-healthy {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-critical {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

/* 趋势指示器 */
.trend-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.trend-indicator.improving {
  color: #10b981;
}

.trend-indicator.degrading {
  color: #ef4444;
}

.trend-indicator.stable {
  color: #6b7280;
}

/* 指标卡片 */
.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metric-card .metric-label {
  font-size: 0.875rem;
  color: #6b7280;
}

.metric-card .metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
}

.metric-card .metric-change {
  font-size: 0.875rem;
  color: #6b7280;
}

/* 图表容器 */
.chart-container {
  position: relative;
  height: 300px;
  margin-top: 1rem;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: #9ca3af;
  text-align: center;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state-text {
  font-size: 1rem;
  margin: 0;
}

/* 响应式 */
@media (max-width: 768px) {
  .monitoring-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .monitoring-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .monitoring-nav-item .nav-label {
    display: none;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 健康度页面样式 ===== */

.health-overview {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 健康度评分 Hero */
.health-score-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
}

.health-score-hero-content {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.score-circle {
  flex-shrink: 0;
}

.score-summary h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.score-summary .status-badge {
  display: inline-block;
}

.score-summary .badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 0.875rem;
}

/* 维度卡片 */
.dimension-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dimension-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dimension-icon {
  font-size: 1.5rem;
}

.dimension-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
}

.dimension-score {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.dimension-score .score-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #111827;
}

.dimension-score .score-trend {
  font-size: 1.25rem;
}

.dimension-score .score-trend.improving {
  color: #10b981;
}

.dimension-score .score-trend.degrading {
  color: #ef4444;
}

.dimension-score .score-trend.stable {
  color: #6b7280;
}

/* 进度条 */
.dimension-progress {
  margin-top: 0.5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.dimension-status {
  display: flex;
  justify-content: flex-start;
}

/* Top Issues */
.top-issues-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.issue-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 0.5rem;
}

.issue-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.issue-content {
  flex: 1;
}

.issue-text {
  margin: 0;
  font-size: 0.875rem;
  color: #92400e;
}

/* 响应式 */
@media (max-width: 768px) {
  .health-score-hero-content {
    flex-direction: column;
    text-align: center;
  }

  .score-circle svg {
    width: 150px;
    height: 150px;
  }
}

/* ===== 快速统计样式 ===== */

.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

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

.stat-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: #6b7280;
}

/* 优化健康度评分样式 */

.health-score-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.health-score-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}

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

.health-score-hero-content {
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.score-circle-wrapper {
  flex-shrink: 0;
}

.score-circle .score-progress {
  animation: drawCircle 1s ease-out forwards;
}

@keyframes drawCircle {
  from {
    stroke-dasharray: 0 339.292;
  }
}

.score-summary {
  flex: 1;
}

.score-summary h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
}

.score-description {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.trend-chart-container {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  backdrop-filter: blur(10px);
}

.trend-chart-label {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

/* 优化维度卡片样式 */

.dimension-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.2s;
}

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

.dimension-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.dimension-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.dimension-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.dimension-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}

.dimension-description {
  font-size: 0.75rem;
  color: #9ca3af;
}

.dimension-score {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.dimension-score .score-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.dimension-score .score-max {
  font-size: 1rem;
  color: #9ca3af;
}

.dimension-score .score-trend {
  font-size: 1.25rem;
  margin-left: 0.5rem;
}

.dimension-score .score-trend.improving {
  color: #10b981;
}

.dimension-score .score-trend.degrading {
  color: #ef4444;
}

.dimension-score .score-trend.stable {
  color: #6b7280;
}

.dimension-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dimension-change {
  font-size: 0.875rem;
  font-weight: 500;
}

.dimension-change.improving {
  color: #10b981;
}

.dimension-change.degrading {
  color: #ef4444;
}

.dimension-change.stable {
  color: #6b7280;
}

/* 优化 Top Issues 样式 */

.top-issues-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.issue-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.issue-item:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateX(4px);
}

.issue-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.issue-content {
  flex: 1;
}

.issue-text {
  margin: 0;
  font-size: 0.875rem;
  color: #92400e;
  line-height: 1.5;
}

/* 按钮样式 */

.btn-primary {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  background: #3b82f6;
  color: white;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #2563eb;
}

/* 响应式优化 */

@media (max-width: 1024px) {
  .quick-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .health-score-hero-content {
    flex-direction: column;
    text-align: center;
  }

  .score-circle svg {
    width: 150px;
    height: 150px;
  }

  .quick-stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .dimension-score .score-value {
    font-size: 2rem;
  }
}

/* ===== 实时指标页面样式 ===== */

.metrics-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 时间范围选择器 */

.time-range-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.time-range-selector label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
}

.time-range-buttons {
  display: flex;
  gap: 0.5rem;
}

.time-range-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: white;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.time-range-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

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

/* 核心指标卡片 */

.metrics-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.metric-card-large {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

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

.metric-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.metric-icon {
  font-size: 1.5rem;
}

.metric-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
}

.metric-value-large {
  font-size: 2.25rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.metric-change {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.metric-change .trend-icon {
  font-size: 1rem;
}

.metric-change.improving {
  color: #10b981;
}

.metric-change.degrading {
  color: #ef4444;
}

.metric-change.stable {
  color: #6b7280;
}

.metric-change .change-value {
  font-weight: 600;
}

.metric-change .change-label {
  color: #9ca3af;
}

/* 图表区域 */

.charts-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chart-card {
  padding: 1.5rem;
}

.chart-card .card-title {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.chart-container {
  position: relative;
  height: 300px;
  margin-top: 1rem;
}

.chart-container-small {
  height: 250px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* 响应式 */

@media (max-width: 1024px) {
  .metrics-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .time-range-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .time-range-buttons {
    flex-wrap: wrap;
  }

  .time-range-btn {
    flex: 1;
    min-width: 60px;
  }

  .metrics-cards-grid {
    grid-template-columns: 1fr;
  }

  .metric-value-large {
    font-size: 1.75rem;
  }

  .chart-container {
    height: 250px;
  }

  .chart-container-small {
    height: 200px;
  }
}

/* ===== 异常告警页面样式 ===== */

.anomalies-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 异常概览卡片 */

.anomaly-overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.overview-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-left-width: 4px;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.overview-card.critical {
  border-left-color: #ef4444;
}

.overview-card.warning {
  border-left-color: #f59e0b;
}

.overview-card.info {
  border-left-color: #3b82f6;
}

.overview-icon {
  font-size: 2rem;
}

.overview-content {
  flex: 1;
}

.overview-value {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.overview-label {
  font-size: 0.875rem;
  color: #6b7280;
}

/* 过滤器和视图切换 */

.anomaly-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  gap: 1rem;
}

.anomaly-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: white;
  font-size: 0.875rem;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-secondary {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: white;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: white;
  color: #374151;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn:hover {
  background: #f9fafb;
}

.view-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

/* 异常列表（表格视图） */

.anomaly-list-table {
  overflow-x: auto;
}

.anomaly-table {
  width: 100%;
  border-collapse: collapse;
}

.anomaly-table th {
  padding: 0.75rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  background: #f9fafb;
}

.anomaly-table td {
  padding: 0.75rem;
  font-size: 0.875rem;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}

.anomaly-row {
  transition: background 0.2s;
  cursor: pointer;
}

.anomaly-row:hover {
  background: #f9fafb;
}

.anomaly-description {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.severity-badge.severity-critical {
  background: #fee2e2;
  color: #991b1b;
}

.severity-badge.severity-warning {
  background: #fef3c7;
  color: #92400e;
}

.severity-badge.severity-info {
  background: #dbeafe;
  color: #1e40af;
}

.btn-link {
  padding: 0;
  border: none;
  background: none;
  color: #3b82f6;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:hover {
  color: #2563eb;
}

/* 异常列表（卡片视图） */

.anomaly-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.anomaly-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border-left-width: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.anomaly-card.anomaly-critical {
  border-left-color: #ef4444;
}

.anomaly-card.anomaly-warning {
  border-left-color: #f59e0b;
}

.anomaly-card.anomaly-info {
  border-left-color: #3b82f6;
}

.anomaly-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.anomaly-time {
  font-size: 0.75rem;
  color: #9ca3af;
}

.anomaly-card-body {
  flex: 1;
}

.anomaly-type {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.anomaly-card-body .anomaly-description {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
}

.anomaly-scope {
  font-size: 0.875rem;
  color: #6b7280;
}

.anomaly-card-footer {
  display: flex;
  justify-content: flex-end;
}

/* 异常详情抽屉 */

.anomaly-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.anomaly-drawer.open {
  pointer-events: auto;
  opacity: 1;
}

.drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 500px;
  max-width: 90vw;
  background: white;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
}

.anomaly-drawer.open .drawer-panel {
  transform: translateX(0);
}

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

.drawer-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

.drawer-close {
  padding: 0.25rem;
  border: none;
  background: none;
  font-size: 2rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
}

.drawer-close:hover {
  color: #111827;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.anomaly-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-section h5 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-severity {
  margin-bottom: 0.5rem;
}

.detail-type {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

.detail-time {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.detail-section p {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
}

.affected-list,
.action-list,
.trace-list {
  margin: 0;
  padding-left: 1.5rem;
  list-style: disc;
}

.affected-list li,
.action-list li,
.trace-list li {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
}

.trace-list code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.75rem;
  padding: 0.125rem 0.25rem;
  background: #f3f4f6;
  border-radius: 0.25rem;
}

/* 响应式 */

@media (max-width: 1024px) {
  .anomaly-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .anomaly-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .anomaly-overview-cards {
    grid-template-columns: 1fr;
  }

  .anomaly-filters {
    width: 100%;
  }

  .filter-select {
    flex: 1;
  }

  .anomaly-table {
    font-size: 0.75rem;
  }

  .anomaly-table th,
  .anomaly-table td {
    padding: 0.5rem;
  }

  .drawer-panel {
    width: 100%;
    max-width: 100vw;
  }
}

/* ===== 容量规划页面样式 ===== */

.capacity-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 容量仪表盘 */

.capacity-gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.capacity-gauge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
}

.gauge-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
}

.gauge-icon {
  font-size: 1.5rem;
}

.gauge-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.gauge-visual {
  margin: 0.5rem 0;
}

.gauge-progress {
  animation: drawGauge 1s ease-out forwards;
}

@keyframes drawGauge {
  from {
    stroke-dasharray: 0 339.292;
  }
}

.gauge-details {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.gauge-current {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.gauge-limit {
  font-size: 0.875rem;
  color: #9ca3af;
}

/* 当前状态快照 */

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.snapshot-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.snapshot-label {
  font-size: 0.875rem;
  color: #6b7280;
}

.snapshot-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
}

/* 容量预测控制 */

.capacity-projection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.capacity-projection-header .card-title {
  margin: 0;
}

.projection-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.projection-controls label {
  font-size: 0.875rem;
  color: #6b7280;
}

/* 智能建议 */

.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.recommendation-item {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: #f9fafb;
  border-left: 4px solid #3b82f6;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.recommendation-item:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateX(4px);
}

.recommendation-item.recommendation-critical {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.recommendation-item.recommendation-warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.recommendation-item.recommendation-info {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

.recommendation-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.recommendation-content {
  flex: 1;
}

.recommendation-title {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.recommendation-description {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
}

.recommendation-actions {
  margin: 0;
  padding-left: 1.5rem;
  list-style: disc;
}

.recommendation-actions li {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: #374151;
}

/* 响应式 */

@media (max-width: 1024px) {
  .capacity-gauges {
    grid-template-columns: repeat(2, 1fr);
  }

  .snapshot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .capacity-gauges {
    grid-template-columns: 1fr;
  }

  .snapshot-grid {
    grid-template-columns: 1fr;
  }

  .capacity-projection-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .projection-controls {
    justify-content: space-between;
  }

  .gauge-visual svg {
    width: 120px;
    height: 120px;
  }

  .snapshot-value {
    font-size: 1.5rem;
  }
}
