/* ========== 设计系统变量 ========== */
:root {
  /* 主色系 - 品牌色 */
  --color-primary: #6366f1;
  --color-primary-hover: #5558e3;
  --color-primary-light: #818cf8;
  
  /* 辅色系 */
  --color-secondary: #64748b;
  --color-secondary-hover: #475569;
  
  /* 警示色系 */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;
  
  /* 中性色系 */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f8fafc;
  --color-bg-tertiary: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  
  /* 文字色系 */
  --color-text-primary: #1e293b;
  --color-text-secondary: #475569;
  --color-text-tertiary: #64748b;
  --color-text-disabled: #94a3b8;
}

/* ========== 暗色模式变量 ========== */
[data-theme="dark"] {
  /* 主色系 - 暗色模式调整 */
  --color-primary: #818cf8;
  --color-primary-hover: #a5b4fc;
  --color-primary-light: #6366f1;
  
  /* 辅色系 */
  --color-secondary: #94a3b8;
  --color-secondary-hover: #cbd5e1;
  
  /* 警示色系 - 暗色模式调整 */
  --color-success: #34d399;
  --color-warning: #fbbf24;
  --color-danger: #f87171;
  --color-info: #60a5fa;
  
  /* 中性色系 - 暗色模式 */
  --color-bg-primary: #0f172a;
  --color-bg-secondary: #1e293b;
  --color-bg-tertiary: #334155;
  --color-border: #334155;
  --color-border-hover: #475569;
  
  /* 文字色系 - 暗色模式 */
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-text-tertiary: #94a3b8;
  --color-text-disabled: #64748b;
  
  /* 阴影 - 暗色模式 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.5);
}
  
  /* 间距系统 - 基于8px网格 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  
  /* 圆角系统 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* 阴影系统 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.1);
  
  /* 字体系统 */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 13px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 32px;
  
  /* 过渡动画 */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* 触控区域最小尺寸 */
  --touch-target-min: 44px;
}

/* ========== 重置样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 基础文字选择高亮 */
::selection {
  background-color: var(--color-primary-light);
  color: white;
}

/* 
 * 系统字体栈 - 跨平台最佳实践
 * 浏览器会按顺序尝试使用系统原生字体：
 * - macOS/iOS: San Francisco (-apple-system)
 * - Windows: Segoe UI
 * - Android: Roboto
 * - Linux: Oxygen/Ubuntu
 * - 最终备用: sans-serif
 * 这确保了每个平台都使用最佳的原生字体，而非"5种不同字体"
 */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* 暗色模式背景 */
[data-theme="dark"] body {
  background: var(--color-bg-primary);
}

/* ========== 登录页 ========== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 400px;
}

.login-container h1 {
  text-align: center;
  margin-bottom: 32px;
  font-size: 24px;
  color: #1e293b;
}

.login-container h1 i {
  color: #6366f1;
  margin-right: 8px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #6366f1;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #6366f1;
  color: white;
}

.btn-primary:hover {
  background: #5558e3;
}

.btn-secondary {
  background: #f1f5f9;
  color: #64748b;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ========== 主应用 ========== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== 顶部导航 ========== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-left h1 {
  font-size: 20px;
  color: #1e293b;
}

.header-left h1 i {
  color: #6366f1;
  margin-right: 8px;
}
/* ========== 左侧边栏布局 ========== */

/* 应用主体容器 */
.app-body {
  display: flex;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* 侧边栏切换按钮 */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 12px;
  color: #64748b;
  font-size: 18px;
}

.sidebar-toggle:hover {
  background: #f1f5f9;
  color: #6366f1;
}

/* 侧边栏遮罩 */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* 左侧边栏 */
.sidebar {
  width: 240px;
  background: white;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

/* 侧边栏导航 */
.sidebar-nav {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
}

/* 侧边栏项目 */
.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 24px;
  min-height: 44px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  box-sizing: border-box;
}

.sidebar-item i {
  width: 20px;
  margin-right: 12px;
  font-size: 16px;
  text-align: center;
}

.sidebar-item:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-left-color: #6366f1;
}

.sidebar-item.active {
  background: #eef2ff;
  color: #6366f1;
  border-left-color: #6366f1;
  font-weight: 600;
}

.sidebar-item.active i {
  color: #6366f1;
}

/* 移动端响应式 */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
  }

  .header-left h1 {
    font-size: 16px;
  }

  /* 侧边栏在移动端为固定定位，从左侧滑出 */
  .sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    height: calc(100vh - 64px);
    z-index: 1000;
    transform: translateX(-100%);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* 主内容区域在移动端占满宽度 */
  .main {
    width: 100%;
    padding: 16px;
  }

  /* 遮罩层在移动端显示 */
  .sidebar-overlay {
    display: block;
    opacity: 0;
    pointer-events: none;
  }

  .sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
}

/* 桌面端隐藏遮罩 */
@media (min-width: 769px) {
  .sidebar-overlay {
    display: none !important;
  }
}

/* 平板和桌面端侧边栏切换按钮样式 */
@media (min-width: 769px) {
  .sidebar-toggle {
    display: flex;
  }
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab {
  background: transparent;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.tab:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.tab.active {
  background: #6366f1;
  color: white;
}

/* ========== 主内容 ========== */
.main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100vh - 64px);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ========== 首页统计 ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  cursor: pointer;
}

/* Dashboard面板宽度样式 */
.stat-card.full-width {
  grid-column: 1 / -1;
}

.stat-card.half-width {
  grid-column: span 1;
}

.stat-card.third-width {
  grid-column: span 1;
}

.stat-card.quarter-width {
  grid-column: span 1;
}

/* 响应式面板宽度调整 */
@media (min-width: 1200px) {
  .stat-card.third-width {
    grid-column: span 1;
  }
  .stat-card.quarter-width {
    grid-column: span 1;
  }
}

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

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.projects {
  background: #dbeafe;
  color: #3b82f6;
}

.stat-icon.agents {
  background: #fce7f3;
  color: #ec4899;
}

.stat-icon.workflows {
  background: #d1fae5;
  color: #10b981;
}

.stat-info h3 {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 4px;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
}

/* ========== 页面标题 ========== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 20px;
  color: #1e293b;
}

.page-header h2 i {
  color: #6366f1;
  margin-right: 8px;
}

/* ========== 项目卡片 ========== */
.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* 项目高亮效果 - 快速搜索使用 */
.project-card.highlighted {
  animation: highlight-pulse 2s ease-out;
  box-shadow: 0 0 0 3px var(--primary), 0 8px 24px rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

@keyframes highlight-pulse {
  0% {
    box-shadow: 0 0 0 3px var(--primary), 0 8px 24px rgba(99, 102, 241, 0.5);
    background-color: rgba(99, 102, 241, 0.1);
  }
  50% {
    box-shadow: 0 0 0 3px var(--primary), 0 8px 24px rgba(99, 102, 241, 0.4);
    background-color: rgba(99, 102, 241, 0.05);
  }
  100% {
    box-shadow: 0 0 0 0px transparent, 0 4px 16px rgba(0, 0, 0, 0.08);
    background-color: transparent;
  }
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.project-header h3 {
  font-size: 16px;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.project-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-completed {
  background: #d1fae5;
  color: #10b981;
}

.status-in-progress {
  background: #dbeafe;
  color: #3b82f6;
}

.status-pending {
  background: #f1f5f9;
  color: #64748b;
}

.project-description {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 12px;
}

.project-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #94a3b8;
}

.project-meta i {
  margin-right: 4px;
}

/* ========== AI员工卡片 ========== */
.agents-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.agent-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 16px;
}

.agent-avatar {
  width: 56px;
  height: 56px;
  background: #f3e8ff;
  color: #9333ea;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.agent-info h3 {
  font-size: 16px;
  color: #1e293b;
  margin-bottom: 4px;
}

.agent-role {
  font-size: 14px;
  color: #6366f1;
  margin-bottom: 8px;
}

.agent-description {
  font-size: 12px;
  color: #64748b;
}

/* ========== 用户/代理卡片 ========== */
.users-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 20px;
}

.user-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.user-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 4px 0;
}

.user-info .badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.user-info .badge.role-ai {
  background: #dbeafe;
  color: #1d4ed8;
}

.user-info .badge.role-human {
  background: #dcfce7;
  color: #15803d;
}

.user-body {
  padding: 12px 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.user-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-meta i {
  width: 16px;
  color: #94a3b8;
}

.user-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ========== 工作流卡片 ========== */
.workflows-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.workflow-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.workflow-card h3 {
  font-size: 16px;
  color: #1e293b;
  margin-bottom: 12px;
}

.workflow-card h3 i {
  color: #6366f1;
  margin-right: 8px;
}

.workflow-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #94a3b8;
}

.workflow-meta i {
  margin-right: 4px;
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 14px;
}

/* ========== 模态框 ========== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-xlarge {
  max-width: 1200px;
}

.modal-large {
  max-width: 800px;
}

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

.modal-header h2 {
  font-size: 20px;
  color: #1e293b;
}

.modal-header h2 i {
  color: #6366f1;
  margin-right: 8px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* ========== 项目详情 ========== */
.project-detail {
  padding: 24px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.info-item {
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
}

.info-item label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.info-item span {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.workflow-section {
  margin-top: 32px;
}

.workflow-section h3 {
  font-size: 18px;
  color: #1e293b;
  margin-bottom: 16px;
}

.workflow-section h3 i {
  color: #6366f1;
  margin-right: 8px;
}

.workflow-nodes {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.workflow-node {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 16px;
}

.workflow-node.node-completed {
  border-color: #10b981;
  background: #f0fdf4;
}

.workflow-node.node-in-progress {
  border-color: #3b82f6;
  background: #eff6ff;
}

.node-icon {
  font-size: 24px;
}

.node-info {
  flex: 1;
}

.node-name {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.node-assignee {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 8px;
}

.node-assignee i {
  margin-right: 4px;
}

.node-result {
  font-size: 12px;
  color: #16a34a;
  background: #dcfce7;
  padding: 8px 12px;
  border-radius: 6px;
}

/* ========== 骨架屏加载样式 ========== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 16px;
}

.skeleton-avatar {
  width: 56px;
  height: 56px;
  border-radius: 12px;
}

.skeleton-card {
  height: 120px;
  margin-bottom: 16px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== 列表项入场动画 ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.3s ease forwards;
}

/* 列表项依次入场延迟 */
.items-container .item-card:nth-child(1) { animation-delay: 0ms; }
.items-container .item-card:nth-child(2) { animation-delay: 50ms; }
.items-container .item-card:nth-child(3) { animation-delay: 100ms; }
.items-container .item-card:nth-child(4) { animation-delay: 150ms; }
.items-container .item-card:nth-child(5) { animation-delay: 200ms; }
.items-container .item-card:nth-child(6) { animation-delay: 250ms; }
.items-container .item-card:nth-child(7) { animation-delay: 300ms; }
.items-container .item-card:nth-child(8) { animation-delay: 350ms; }
.items-container .item-card:nth-child(9) { animation-delay: 400ms; }
.items-container .item-card:nth-child(10) { animation-delay: 450ms; }

/* 项目卡片入场 */
.projects-container .project-card:nth-child(1) { animation-delay: 0ms; }
.projects-container .project-card:nth-child(2) { animation-delay: 50ms; }
.projects-container .project-card:nth-child(3) { animation-delay: 100ms; }
.projects-container .project-card:nth-child(4) { animation-delay: 150ms; }
.projects-container .project-card:nth-child(5) { animation-delay: 200ms; }
.projects-container .project-card:nth-child(6) { animation-delay: 250ms; }

/* ========== 增强的卡片悬停效果 ========== */
.project-card:hover,
.stat-card:hover,
.agent-card:hover,
.workflow-card:hover,
.item-card:hover,
.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ========== 按钮悬停增强效果 ========== */
.btn {
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: #5558e3;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-secondary:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

/* ========== 页面切换过渡 ========== */
.tab-content {
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tab-content.active {
  opacity: 1;
  transform: translateX(0);
}

/* ========== 响应式 ========== */
/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 16px;
    padding: 12px 16px;
  }
  
  .header-center {
    width: 100%;
    overflow-x: auto;
  }
  
  .tabs {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  
  .tabs::-webkit-scrollbar {
    display: none;
  }
  
  .tab {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .main {
    width: 100%;
    padding: 16px;
  }

  .projects-container,
  .agents-container,
  .workflows-container {
    grid-template-columns: 1fr;
  }
}

/* ========== 项目进度显示 ========== */
.project-progress {
  margin-top: 12px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
  text-align: right;
}

.project-tasks {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.node-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin-bottom: 8px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 13px;
}

.node-status.node-completed {
  background: #f0fdf4;
  color: #16a34a;
}

.node-status.node-in-progress {
  background: #eff6ff;
  color: #3b82f6;
}

.node-status.node-pending {
  background: #f8fafc;
  color: #64748b;
}

.node-icon {
  font-size: 16px;
}

.node-name {
  font-weight: 500;
}

.task-list {
  margin-left: 24px;
  margin-top: 4px;
}

.task-item {
  font-size: 12px;
  padding: 4px 8px;
  margin: 2px 0;
  color: #475569;
}

.task-item.task-completed {
  color: #16a34a;
}

.task-item.task-in-progress {
  color: #3b82f6;
}
/* 在style.css中添加交付物显示样式 */
.project-deliverables {
  margin-top: 8px;
  padding: 8px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 11px;
}

.deliverable-label {
  font-weight: 600;
  color: #92400e;
  margin-bottom: 4px;
}

.deliverable-item {
  color: #78350f;
  margin: 2px 0;
}

/* ========== 工作流可视化增强 ========== */
.workflow-graph-container {
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 24px;
}

.workflow-graph {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.workflow-nodes {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.workflow-node-wrapper {
  display: flex;
  align-items: center;
}

.workflow-node {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: white;
  border-radius: 12px;
  border: 2px solid var(--gray-200, #e5e7eb);
  transition: all 0.3s ease;
  min-width: 180px;
  position: relative;
}

.workflow-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.node-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.node-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.node-name {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
}

.node-assignee {
  font-size: 12px;
  color: #6b7280;
}

.node-status-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
}

/* 节点连接线 */
.node-connector {
  display: flex;
  align-items: center;
  margin: 0 8px;
}

.connector-line {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, #e5e7eb 0%, #3b82f6 50%, #e5e7eb 100%);
  background-size: 200% 100%;
  animation: flowAnimation 2s ease-in-out infinite;
  position: relative;
}

.connector-arrow {
  font-size: 12px;
  margin-left: -6px;
  animation: pulseAnimation 2s ease-in-out infinite;
}

@keyframes flowAnimation {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes pulseAnimation {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.9);
  }
}

/* 状态图例 */
.workflow-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ========== 进度展示增强 ========== */
.progress-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.execution-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 6px 12px;
  border-radius: 6px;
}

.progress-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar-container {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
  transition: width 0.5s ease;
  border-radius: 4px;
}

.progress-label {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  min-width: 50px;
  text-align: right;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
}

/* ========== 实时日志样式 ========== */
.realtime-logs {
  background: #1f2937;
  border-radius: 8px;
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.log-placeholder {
  color: #6b7280;
  text-align: center;
  padding: 20px;
}

.log-entry {
  padding: 4px 0;
  color: #d1d5db;
  border-bottom: 1px solid #374151;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-time {
  color: #6b7280;
  margin-right: 8px;
}

.log-source {
  font-weight: 600;
  margin-right: 8px;
}

.log-message {
  color: #e5e7eb;
}

/* Log level colors */
.log-level {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
  text-transform: uppercase;
}

.log-error .log-level {
  background: #fee2e2;
  color: #dc2626;
}

.log-warn .log-level {
  background: #fef3c7;
  color: #d97706;
}

.log-info .log-level {
  background: #dbeafe;
  color: #2563eb;
}

.log-timestamp {
  color: #6b7280;
  margin-right: 8px;
  font-family: monospace;
  font-size: 12px;
}

.log-entry.log-error {
  background: rgba(220, 38, 38, 0.1);
}

.log-entry.log-warn {
  background: rgba(217, 119, 6, 0.1);
}

.logs-empty, .error-state {
  color: #6b7280;
  text-align: center;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.logs-empty i, .error-state i {
  font-size: 24px;
  color: #9ca3af;
}

/* ========== 节点列表样式 ========== */
.nodes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.node-item {
  background: #f8fafc;
  border-radius: 8px;
  padding: 16px;
  border-left: 3px solid #e5e7eb;
  transition: all 0.2s ease;
}

.node-item:hover {
  background: #f1f5f9;
}

.node-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.node-item-name {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.node-item-status {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.node-item-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #6b7280;
}

.empty-text {
  text-align: center;
  color: #9ca3af;
  padding: 20px;
}

/* ========== 详情动作按钮 ========== */
.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn i {
  font-size: 12px;
}

/* ========== Bug 卡片样式 ========== */
.items-container {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.item-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s;
  border: 1px solid #e2e8f0;
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
}

.item-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.item-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  margin-right: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  max-width: 100%;
}

.item-body {
  margin-bottom: 12px;
  max-width: 100%;
  overflow: hidden;
}

.item-description {
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.item-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #94a3b8;
}

.item-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.item-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.item-actions .btn {
  padding: 6px 12px;
  font-size: 13px;
}

/* ========== 徽章样式 ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge.priority-critical {
  background: #fef2f2;
  color: #dc2626;
}

.badge.priority-high {
  background: #fff7ed;
  color: #ea580c;
}

.badge.priority-medium {
  background: #fefce8;
  color: #ca8a04;
}

.badge.priority-low {
  background: #f0fdf4;
  color: #16a34a;
}

.badge.status-open {
  background: #eff6ff;
  color: #2563eb;
}

.badge.status-in_progress {
  background: #fefce8;
  color: #ca8a04;
}

.badge.status-fixed {
  background: #f0fdf4;
  color: #16a34a;
}

.badge.status-closed {
  background: #f8fafc;
  color: #64748b;
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 16px;
}

/* ========== 筛选栏 ========== */
.filter-bar {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  max-width: 100%;
  overflow-x: auto;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  color: #475569;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: #6366f1;
}


/* ========== 工作流图可视化样式 ========== */

.workflow-graph-container {
  margin: 20px 0;
}

.workflow-legend {
  display: flex;
  gap: 20px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 20px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.completed {
  background: #10b981;
}

.legend-dot.in-progress {
  background: #f59e0b;
}

.legend-dot.pending {
  background: #94a3b8;
}

.workflow-graph {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.workflow-level {
  display: flex;
  justify-content: center;
  width: 100%;
}

.parallel-container {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.workflow-node {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  min-width: 200px;
  max-width: 280px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.workflow-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #6366f1;
}

.workflow-node.node-completed {
  border-color: #10b981;
  background: #f0fdf4;
}

.workflow-node.node-in-progress {
  border-color: #f59e0b;
  background: #fffbeb;
}

.workflow-node.node-pending {
  border-color: #94a3b8;
  background: #f8fafc;
}

.workflow-node .node-icon {
  font-size: 24px;
  text-align: center;
  margin-bottom: 8px;
}

.workflow-node .node-content {
  text-align: center;
}

.workflow-node .node-name {
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 6px;
}

.workflow-node .node-assignee {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.workflow-node .node-status-text {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.workflow-connectors {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
}

.connector-line {
  width: 2px;
  height: 20px;
  background: #cbd5e1;
}

.connector-arrow {
  color: #94a3b8;
  font-size: 16px;
}

/* 并行节点标记 */
.parallel-container::before {
  content: '⟨ 并行 ⟩';
  display: block;
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: #6366f1;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* 节点详情面板 */
.node-detail-panel {
  margin-top: 20px;
  background: #f8fafc;
  border-radius: 12px;
  border: 2px solid #6366f1;
  overflow: hidden;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.node-detail-content {
  padding: 0;
}

.node-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #6366f1;
  color: white;
}

.node-detail-header h3 {
  margin: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 20px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.node-detail-body {
  padding: 20px;
}

.detail-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row label {
  font-weight: 600;
  color: #475569;
  min-width: 100px;
  font-size: 13px;
}

.detail-row span {
  color: #1e293b;
  font-size: 14px;
}

.detail-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid #e2e8f0;
}

.detail-section h4 {
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-content {
  background: white;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* 项目信息网格 */
.project-info-section {
  margin-top: 24px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
}

.project-info-section h3 {
  font-size: 16px;
  color: #1e293b;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.project-info-grid .info-item {
  background: white;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.project-info-grid .info-item label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.project-info-grid .info-item span {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
}

/* 响应式 */
@media (max-width: 768px) {
  .workflow-node {
    min-width: 150px;
    max-width: 200px;
    padding: 12px;
  }
  
  .workflow-node .node-name {
    font-size: 13px;
  }
  
  .parallel-container {
    flex-direction: column;
    gap: 12px;
  }
  
  .project-info-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== PRD 可折叠控件样式 ========== */

.prd-accordion {
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.prd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}

.prd-header:hover {
  background: #f1f5f9;
}

.prd-header i:first-child {
  color: #6366f1;
  font-size: 16px;
}

.prd-header span {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
}

.prd-toggle-icon {
  color: #94a3b8;
  font-size: 12px;
  transition: transform 0.3s;
}

.prd-body {
  padding: 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
}

.markdown-content {
  color: #475569;
  line-height: 1.8;
  font-size: 14px;
}

.markdown-content h2 {
  color: #1e293b;
  font-size: 16px;
  font-weight: 600;
  margin: 16px 0 8px 0;
  padding-left: 12px;
  border-left: 3px solid #6366f1;
}

.markdown-content h3 {
  color: #334155;
  font-size: 15px;
  font-weight: 600;
  margin: 12px 0 6px 0;
}

.markdown-content h4 {
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  margin: 10px 0 4px 0;
}

.markdown-content p {
  margin: 8px 0;
}

.markdown-content ul {
  margin: 8px 0;
  padding-left: 24px;
}

.markdown-content li {
  margin: 4px 0;
  list-style-type: disc;
}

.markdown-content strong {
  color: #1e293b;
  font-weight: 600;
}

.markdown-content em {
  color: #64748b;
  font-style: italic;
}

.markdown-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #6366f1;
}

.markdown-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
}

.markdown-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ========== 优化图例样式 ========== */

.workflow-legend {
  display: flex;
  gap: 24px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 8px;
  margin-bottom: 20px;
  justify-content: center;
  border: 1px solid #e2e8f0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.legend-dot.completed {
  background: #10b981;
}

.legend-dot.in-progress {
  background: #f59e0b;
}

.legend-dot.pending {
  background: #94a3b8;
}

/* ========== 测试报告样式 ========== */

.test-report-content {
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.test-report {
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}

.test-report .report-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.test-report .report-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.test-report h5 {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.test-report ul {
  margin: 8px 0;
  padding-left: 20px;
}

.test-report li {
  margin: 6px 0;
  list-style-type: disc;
}

.test-report .score-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.test-report .score-value {
  font-size: 32px;
  font-weight: 700;
  color: #6366f1;
}

.test-report .score-max {
  font-size: 16px;
  color: #94a3b8;
}

/* 报表页面样式 */
.time-range-selector {
  display: flex;
  gap: 10px;
}

.time-range-selector .btn.active {
  background: var(--primary);
  color: white;
}

.kpi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.kpi-icon.projects {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.kpi-icon.active {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.kpi-icon.bugs {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: white;
}

.kpi-icon.warning {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
  color: #c00;
}

.kpi-icon.success {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: #0a0;
}

.kpi-icon.tasks {
  background: linear-gradient(135deg, #96fbc4 0%, #f9f586 100%);
  color: #060;
}

.kpi-content h3 {
  margin: 0 0 5px 0;
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.kpi-value {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #333;
}

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

.chart-container {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chart-header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.chart-header h3 {
  margin: 0;
  font-size: 16px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart {
  height: 300px;
}

/* 布局控制样式 */
.layout-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
}

.layout-controls .btn {
  display: flex;
  align-items: center;
  gap: 6px;
}

.layout-hint {
  color: #6b7280;
  font-size: 13px;
  margin-left: auto;
}

/* 拖拽样式 */
.chart-container {
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chart-container:active {
  cursor: grabbing;
}

.chart-container.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.chart-container.drag-over {
  border: 2px dashed #3b82f6;
}

.chart-container.gu-placeholder {
  background: #e0f2fe;
  border: 2px dashed #0284c7;
  border-radius: 12px;
  min-height: 350px;
}

@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  
  .kpi-cards {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

/* 消息中心样式 */
.messages-list {
  display: grid;
  gap: 12px;
}

.message-card {
  background: var(--bg-secondary, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.message-card.status-unread {
  border-left: 4px solid #2196F3;
  background: #f0f7ff;
}

.message-card.status-read {
  border-left: 4px solid #4CAF50;
}

.message-card.status-handled {
  border-left: 4px solid #9E9E9E;
  opacity: 0.7;
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.message-type {
  background: var(--primary-color, #2196F3);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.message-time {
  color: #999;
  font-size: 12px;
}

.message-subject {
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.message-content-preview {
  color: #666;
  font-size: 14px;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-footer {
  font-size: 12px;
  color: #999;
}

/* Tooltip样式 */
[title] {
  position: relative;
}

[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

[title]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% - 5px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
  z-index: 1000;
}

/* ==================== 预警面板样式 ==================== */
.btn-alert {
  position: relative;
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 18px;
  padding: 8px 12px;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-alert:hover {
  color: #3b82f6;
}

.badge-count {
  position: absolute;
  top: 0;
  right: 0;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.alert-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
}

.alert-stat {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: 8px;
}

.alert-stat.critical { background: #fef2f2; }
.alert-stat.high { background: #fff7ed; }
.alert-stat.medium { background: #fefce8; }
.alert-stat.low { background: #f0fdf4; }

.alert-stat-count {
  display: block;
  font-size: 28px;
  font-weight: bold;
}

.alert-stat.critical .alert-stat-count { color: #dc2626; }
.alert-stat.high .alert-stat-count { color: #ea580c; }
.alert-stat.medium .alert-stat-count { color: #ca8a04; }
.alert-stat.low .alert-stat-count { color: #16a34a; }

.alert-stat-label {
  font-size: 12px;
  color: #6b7280;
}

.alerts-list {
  max-height: 500px;
  overflow-y: auto;
}

.alert-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.alert-card.severity-critical { border-left: 4px solid #dc2626; }
.alert-card.severity-high { border-left: 4px solid #ea580c; }
.alert-card.severity-medium { border-left: 4px solid #ca8a04; }
.alert-card.severity-low { border-left: 4px solid #16a34a; }

.alert-card.status-resolved {
  opacity: 0.6;
}

.alert-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.alert-severity {
  font-weight: bold;
  font-size: 14px;
}

.alert-card.severity-critical .alert-severity { color: #dc2626; }
.alert-card.severity-high .alert-severity { color: #ea580c; }
.alert-card.severity-medium .alert-severity { color: #ca8a04; }
.alert-card.severity-low .alert-severity { color: #16a34a; }

.alert-status {
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
}

.alert-title {
  font-weight: bold;
  margin-bottom: 8px;
}

.alert-message {
  color: #4b5563;
  font-size: 14px;
  margin-bottom: 8px;
}

.alert-meta {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 12px;
}

.alert-actions {
  display: flex;
  gap: 8px;
}

/* ==================== 智能调度样式 ==================== */
.dashboard-section {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.section-header h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: #1f2937;
}

.load-list {
  margin-top: 16px;
}

.load-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  gap: 12px;
}

.load-item:last-child {
  border-bottom: none;
}

.load-employee {
  width: 150px;
  font-weight: 500;
}

.load-bar-container {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.load-bar {
  height: 100%;
  background: #22c55e;
  transition: width 0.3s;
}

.load-item.load-warning .load-bar { background: #f59e0b; }
.load-item.load-overloaded .load-bar { background: #ef4444; }

.load-rate {
  width: 50px;
  text-align: right;
  font-weight: bold;
}

.load-item.load-normal .load-rate { color: #22c55e; }
.load-item.load-warning .load-rate { color: #f59e0b; }
.load-item.load-overloaded .load-rate { color: #ef4444; }

.load-tasks {
  width: 80px;
  font-size: 12px;
  color: #9ca3af;
}

.recommendations-list {
  display: grid;
  gap: 12px;
}

.recommendation-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 16px;
}

.recommendation-header {
  font-size: 12px;
  color: #0369a1;
  margin-bottom: 8px;
}

.recommendation-title {
  font-weight: bold;
  margin-bottom: 8px;
}

.recommendation-details {
  font-size: 14px;
  color: #475569;
}

.recommendation-action {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #bae6fd;
  font-size: 13px;
  color: #0369a1;
}

/* 调度页面图表容器 */
#load-chart {
  height: 300px;
  margin-bottom: 20px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .alert-stats {
    flex-wrap: wrap;
  }
  
  .alert-stat {
    min-width: 45%;
  }
  
  .load-item {
    flex-wrap: wrap;
  }
  
  .load-employee {
    width: 100%;
    margin-bottom: 8px;
  }
  
  .load-bar-container {
    width: 100%;
    order: 3;
  }
}

/* ========== Proactive Agent 巡检中心样式 ========== */
.proactive-stats .stat-icon {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.proactive-stats .stat-icon.active {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.proactive-stats .stat-icon.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.proactive-stats .stat-icon.success {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* 巡检任务卡片 */
.check-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #64748b;
}

.check-card.enabled {
  border-left-color: #22c55e;
}

.check-card.disabled {
  border-left-color: #94a3b8;
  opacity: 0.7;
}

.check-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.check-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #0284c7;
  flex-shrink: 0;
}

.check-info {
  flex: 1;
}

.check-info h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: #1e293b;
}

.check-description {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #64748b;
}

.check-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #94a3b8;
}

.check-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.check-status {
  flex-shrink: 0;
}

.check-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

/* 巡检报告卡片 */
.report-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-card.success {
  border-left: 4px solid #22c55e;
}

.report-card.warning {
  border-left: 4px solid #f59e0b;
}

.report-card.error {
  border-left: 4px solid #ef4444;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.report-status {
  font-weight: 600;
  font-size: 14px;
}

.report-card.success .report-status {
  color: #22c55e;
}

.report-card.warning .report-status {
  color: #f59e0b;
}

.report-card.error .report-status {
  color: #ef4444;
}

.report-time {
  font-size: 12px;
  color: #94a3b8;
}

.report-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.report-details {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #64748b;
}

.report-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.report-summary {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-size: 13px;
  color: #475569;
}

/* 触发规则卡片 */
.trigger-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #8b5cf6;
}

.trigger-card.enabled {
  border-left-color: #8b5cf6;
}

.trigger-card.disabled {
  border-left-color: #a78bfa;
  opacity: 0.7;
}

.trigger-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.trigger-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.trigger-info {
  flex: 1;
}

.trigger-info h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: #1e293b;
}

.trigger-description {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #64748b;
}

.trigger-condition,
.trigger-action {
  font-size: 12px;
  color: #475569;
  margin-bottom: 4px;
}

.trigger-condition .label,
.trigger-action .label {
  font-weight: 600;
  color: #64748b;
}

.trigger-status {
  flex-shrink: 0;
}

.trigger-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

/* 开关样式 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #22c55e;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Proactive 仪表盘区块 */
#proactive-tab .dashboard-section {
  margin-bottom: 24px;
}

#proactive-tab .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#proactive-tab .section-header h3 {
  margin: 0;
  font-size: 18px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

#proactive-tab .section-header h3 i {
  color: #0284c7;
}

/* 消息中心样式 */
.message-detail .detail-row {
  display: flex;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.message-detail .detail-row:last-child {
  border-bottom: none;
}

.message-detail .detail-row label {
  font-weight: 600;
  width: 80px;
  flex-shrink: 0;
  color: #666;
}

.message-detail .detail-row span {
  flex: 1;
}

.message-content-full {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
  margin-top: 4px;
}

/* 消息状态徽章 */
.badge-warning {
  background: #ffc107;
  color: #000;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.badge-info {
  background: #17a2b8;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.badge-success {
  background: #28a745;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.badge-danger {
  background: #dc3545;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.badge-secondary {
  background: #6c757d;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

/* ========== 可访问性优化 ========== */

/* 焦点指示器 - 符合WCAG AA标准 */
*:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* 增强焦点样式 */
.btn:focus-visible,
.tab:focus-visible,
.filter-select:focus-visible,
input:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* 链接焦点样式 */
a:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  background: rgba(99, 102, 241, 0.1);
}

/* 跳过链接 - 键盘导航支持 */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #6366f1;
  color: white;
  padding: 8px 16px;
  z-index: 10000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* 触控区域最小尺寸 - 符合无障碍标准 */
.btn,
.tab,
.filter-select {
  min-height: 44px;
  min-width: 44px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid currentColor;
  }
  
  .project-card,
  .stat-card,
  .item-card {
    border: 2px solid #1e293b;
  }
}

/* 减少动画支持 - 尊重用户偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 移动端汉堡菜单 */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: #1e293b;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  position: relative;
  pointer-events: auto;
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
  opacity: 1;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: white;
  z-index: 1000;
  padding: 60px 16px 16px;
  overflow-y: auto;
  transition: right 0.3s ease;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav .tab {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  margin-bottom: 4px;
  border-radius: 8px;
}

.mobile-nav .tab.active {
  background: #6366f1;
  color: white;
}

.mobile-nav .tab:hover {
  background: #f1f5f9;
}

.mobile-nav .tab.active:hover {
  background: #5558e3;
}

/* 响应式 - 平板端 */
@media (max-width: 1200px) {
  .header-center {
    display: none;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .mobile-nav {
    display: block;
  }
  
  .mobile-menu-overlay {
    display: block;
  }
}

/* 响应式 - 移动端 */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .kpi-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .charts-grid {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .main {
    padding: 16px;
  }
  
  .header {
    padding: 12px 16px;
  }
}

/* 更小屏幕 */
@media (max-width: 480px) {
  .kpi-cards {
    grid-template-columns: 1fr;
  }
  
  .login-container {
    padding: 24px;
    margin: 16px;
  }
  
  .modal-content {
    width: 95%;
    margin: 8px;
  }

  /* 移动端header优化 */
  .header {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-left h1 {
    font-size: 14px;
  }

  .header-left h1 i {
    margin-right: 4px;
  }

  /* 搜索框移动端优化 */
  .header-right {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  /* 按钮优化 */
  .theme-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .btn-secondary {
    padding: 8px 10px;
    font-size: 12px;
  }

  .btn-secondary i {
    margin-right: 4px;
  }

  .btn-alert {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .badge-count {
    top: -4px;
    right: -4px;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
  }

  /* 侧边栏按钮优化 - 更大的触摸区域 */
  .sidebar-item {
    padding: 12px 16px;
    min-height: 48px;
    font-size: 14px;
  }

  .sidebar-item i {
    font-size: 18px;
    width: 24px;
  }

  .sidebar-item-text {
    display: inline;
  }

  /* 移动端卡片优化 */
  .stat-card, .kpi-card {
    padding: 12px;
  }

  .stat-value, .kpi-value {
    font-size: 20px;
  }

  .stat-label, .kpi-label {
    font-size: 12px;
  }

  /* 移动端表格优化 */
  .data-table {
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 6px;
  }

  .data-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 移动端按钮优化 */
  .btn {
    padding: 10px 16px;
    font-size: 14px;
    min-height: 40px;
    touch-action: manipulation;
  }

  .btn:active {
    transform: scale(0.97);
  }

  /* 移动端模态框 */
  .modal-content {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 移动端工作流卡片 */
  .workflow-card {
    padding: 12px;
  }

  .workflow-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* 移动端标签页 */
  .tab-buttons {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* 超小屏幕适配 (320px - 375px) */
@media (max-width: 360px) {
  .header {
    padding: 8px 10px;
  }

  .header-left h1 {
    font-size: 13px;
  }

  .sidebar-toggle {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .sidebar-item {
    padding: 10px 12px;
    font-size: 13px;
  }

  .kpi-value {
    font-size: 18px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .sidebar-item:hover {
    background: transparent;
  }

  .sidebar-item:active {
    background: var(--primary-light, #e0e7ff);
    color: var(--primary, #6366f1);
  }

  .btn:hover {
    transform: none;
  }

  .btn:active {
    transform: scale(0.97);
    transition: transform 0.1s;
  }

  /* 触摸设备隐藏hover效果 */
  .card:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .card:active {
    transform: scale(0.99);
    transition: transform 0.1s;
  }
}

/* 暗色模式样式覆盖 */
[data-theme="dark"] {
  /* 卡片 */
  .stat-card,
  .kpi-card,
  .workflow-card,
  .task-card,
  .bug-card,
  .check-card,
  .report-card,
  .trigger-card {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
  }
  
  /* 头部 */
  .header {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
  }
  
  .header h1,
  .header h2 {
    color: var(--color-text-primary);
  }
  
  /* 页签 */
  .tab {
    color: var(--color-text-secondary);
  }
  
  .tab.active {
    background: var(--color-primary);
    color: white;
  }
  
  /* 模态框 */
  .modal-content {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
  }
  
  .modal-header h2 {
    color: var(--color-text-primary);
  }
  
  .modal-header,
  .modal-body {
    border-color: var(--color-border);
  }
  
  /* 表单 */
  .form-group label {
    color: var(--color-text-secondary);
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    background: var(--color-bg-primary);
    border-color: var(--color-border);
    color: var(--color-text-primary);
  }
  
  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    border-color: var(--color-primary);
  }
  
  /* 登录页 */
  .login-container {
    background: var(--color-bg-secondary);
  }
  
  .login-container h1 {
    color: var(--color-text-primary);
  }
  
  .form-group label {
    color: var(--color-text-secondary);
  }
  
  /* 页面标题 */
  .page-header h2 {
    color: var(--color-text-primary);
  }
  
  /* 项目详情 */
  .project-header h2,
  .project-detail-header h2 {
    color: var(--color-text-primary);
  }
  
  .project-meta span {
    color: var(--color-text-tertiary);
  }
  
  .project-description {
    color: var(--color-text-secondary);
  }
  
  /* 筛选栏 */
  .filter-bar {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
  }
  
  .filter-select,
  .filter-input {
    background: var(--color-bg-primary);
    border-color: var(--color-border);
    color: var(--color-text-primary);
  }
  
  /* 按钮 */
  .btn-secondary {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    border-color: var(--color-border);
  }
  
  .btn-secondary:hover {
    background: var(--color-border);
  }
  
  /* 空状态 */
  .empty-state {
    color: var(--color-text-tertiary);
  }
  
  /* 图表容器 */
  .chart-container {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
  }
  
  .chart-header h3 {
    color: var(--color-text-primary);
  }
  
  /* 移动端导航 */
  .mobile-nav {
    background: var(--color-bg-secondary);
  }
  
  .mobile-nav .tab {
    color: var(--color-text-primary);
  }
  
  /* 消息列表 */
  .message-item {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
  }
  
  .message-subject {
    color: var(--color-text-primary);
  }
  
  .message-preview {
    color: var(--color-text-tertiary);
  }
  
  /* KPI卡片 */
  .kpi-content h3 {
    color: var(--color-text-tertiary);
  }
  
  .kpi-value {
    color: var(--color-text-primary);
  }
  
  /* 预警面板 */
  .alert-stats {
    background: var(--color-bg-tertiary);
  }
  
  /* 表格 */
  .items-container table {
    border-color: var(--color-border);
  }
  
  .items-container th,
  .items-container td {
    border-color: var(--color-border);
    color: var(--color-text-primary);
  }
  
  .items-container th {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
  }
  
  /* 负载列表 */
  .load-item {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
  }
  
  .employee-name {
    color: var(--color-text-primary);
  }
  
  /* 推荐列表 */
  .recommendation-item {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
  }
  
  .recommendation-content h4 {
    color: var(--color-text-primary);
  }
  
  /* 登录页背景 - 暗色模式保持深色 */
  .login-page {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  }
  
  /* Logo 图标颜色调整 */
  .header h1 i,
  .page-header h2 i,
  .modal-header h2 i,
  .kpi-icon i {
    color: var(--color-primary);
  }
  
  /* 图标背景调整 */
  .stat-icon.projects,
  .kpi-icon.projects {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
  }
  
  .stat-icon.agents,
  .kpi-icon.active {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
  }
  
  .stat-icon.workflows,
  .kpi-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
  }
  
  .stat-icon.warning,
  .kpi-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
  }
  
  .stat-icon.bugs {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
  }
  
  .stat-icon.tasks {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
  }
  
  /* 调度统计图标 */
  .stat-icon.suggestions {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
  }
  
  /* 巡检 */
  .proactive-stats .stat-icon {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
  }
}

/* ========== 主题设置按钮 ========== */
.theme-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-size: 16px;
}

.theme-btn:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

/* ========== 主题设置模态框 ========== */
.theme-settings-section {
  margin-bottom: 24px;
}

.theme-settings-section h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--color-text-primary);
}

.theme-mode-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.theme-mode-btn {
  flex: 1;
  padding: 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.theme-mode-btn:hover {
  border-color: var(--color-primary);
}

.theme-mode-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: white;
}

.theme-mode-btn i {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}

.color-picker-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.color-picker-item {
  text-align: center;
}

.color-picker-item label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.color-picker-item input[type="color"] {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.color-picker-item input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-item input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius-md);
}

/* ========== 预设主题样式 ========== */
.preset-themes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.preset-theme-btn {
  flex: 1;
  min-width: 70px;
  padding: 12px 8px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.preset-theme-btn:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.preset-theme-btn.active {
  border-color: var(--color-primary);
  background: var(--color-bg-secondary);
}

.preset-theme-btn .preset-color {
  display: block;
  width: 100%;
  height: 24px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.preset-theme-btn span:last-child {
  font-size: 12px;
  color: var(--color-text-primary);
}

/* ========== 主题切换动画 ========== */
body.theme-transitioning * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* 暗色模式过渡效果 */
[data-theme="dark"] {
  transition: all 0.3s ease;
}

/* 主题切换时的闪烁防护 */
.theme-switch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-primary);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.15s ease;
}

.theme-switch-overlay.active {
  opacity: 0.03;
}

.layout-preview {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.layout-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.layout-option {
  padding: 12px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.layout-option:hover {
  border-color: var(--color-primary);
}

.layout-option.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: white;
}

.layout-option i {
  font-size: 20px;
  margin-bottom: 4px;
  display: block;
}

.layout-option span {
  font-size: 12px;
}

/* ========== 紧凑布局 ========== */
body.layout-compact {
  --spacing-md: 12px;
  --spacing-lg: 16px;
}

body.layout-compact .stat-card {
  padding: 12px;
}

body.layout-compact .items-container {
  padding: 12px;
}

body.layout-compact .chart-container {
  padding: 12px;
}

/* ========== 宽屏布局 ========== */
body.layout-wide {
  --spacing-md: 24px;
  --spacing-lg: 32px;
}

body.layout-wide .stat-card {
  padding: 24px;
}

body.layout-wide .items-container {
  padding: 24px;
}

body.layout-wide .chart-container {
  padding: 24px;
}

body.layout-wide .main {
  max-width: 1600px;
  margin: 0 auto;
}

/* ========== 问题诊断面板 ========== */
.health-overview {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.health-score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 20px;
}

.health-score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  font-size: 36px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.health-score-circle.warning {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.health-score-circle.danger {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.health-score-label {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.health-score-value {
  font-size: 36px;
  font-weight: bold;
}

.health-excellent { color: #10B981; }
.health-good { color: #3B82F6; }
.health-warning { color: #F59E0B; }
.health-danger { color: #EF4444; }

.health-checks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.health-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 8px;
}

.health-check-item.pass .check-icon {
  color: #10B981;
}

.health-check-item.warning .check-icon {
  color: #F59E0B;
}

.health-check-item.fail .check-icon {
  color: #EF4444;
}

.check-icon {
  font-size: 20px;
}

.check-info h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.check-info p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

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

.diag-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.diag-stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
}

.diag-stat-icon.projects { background: linear-gradient(135deg, #6366F1, #4F46E5); }
.diag-stat-icon.tasks { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.diag-stat-icon.bugs { background: linear-gradient(135deg, #EF4444, #DC2626); }
.diag-stat-icon.critical { background: linear-gradient(135deg, #F59E0B, #D97706); }

.diag-stat-info h4 {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.diag-stat-number {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
}

.diag-stat-info small {
  font-size: 12px;
  color: var(--text-secondary);
}

.diagnosis-issues {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.issues-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.issues-header h3 {
  margin: 0;
  font-size: 18px;
}

.issues-filters {
  display: flex;
  gap: 12px;
}

.issues-list {
  max-height: 400px;
  overflow-y: auto;
}

.issue-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.issue-item:last-child {
  border-bottom: none;
}

.issue-severity {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.issue-severity.critical {
  background: #FEE2E2;
  color: #DC2626;
}

.issue-severity.high {
  background: #FEF3C7;
  color: #D97706;
}

.issue-severity.medium {
  background: #DBEAFE;
  color: #2563EB;
}

.issue-severity.low {
  background: #E5E7EB;
  color: #6B7280;
}

.issue-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 3px solid var(--border-color);
}

.issue-card:hover {
  background: var(--bg-secondary);
}

.issue-severity-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  height: fit-content;
}

.issue-severity-badge.critical { background: #FEE2E2; color: #DC2626; }
.issue-severity-badge.high { background: #FEF3C7; color: #D97706; }
.issue-severity-badge.medium { background: #DBEAFE; color: #2563EB; }
.issue-severity-badge.low { background: #E5E7EB; color: #6B7280; }

.issue-content h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
}

.issue-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.issue-type {
  padding: 2px 6px;
  background: var(--bg-secondary);
  border-radius: 4px;
}

.issue-info {
  flex: 1;
}

.issue-info h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.issue-info p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.issue-type {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--bg-primary);
  color: var(--text-secondary);
}

.diagnosis-team-load {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.diagnosis-team-load h3 {
  margin: 0 0 16px;
  font-size: 18px;
}

.team-load-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-load-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-load-info {
  min-width: 120px;
}

.team-load-info h4 {
  margin: 0;
  font-size: 14px;
}

.team-load-info span {
  font-size: 12px;
  color: var(--text-secondary);
}

.team-load-bar {
  flex: 1;
  height: 24px;
  background: var(--bg-primary);
  border-radius: 12px;
  overflow: hidden;
}

.team-load-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.3s ease;
}

.team-load-fill.idle { background: #10B981; }
.team-load-fill.normal { background: #3B82F6; }
.team-load-fill.busy { background: #F59E0B; }
.team-load-fill.overloaded { background: #EF4444; }

.team-load-count {
  min-width: 60px;
  text-align: right;
  font-size: 14px;
  font-weight: 500;
}

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

.team-load-table th,
.team-load-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.team-load-table th {
  font-weight: 600;
  color: var(--text-secondary);
}

.load-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

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

.load-fill.idle { background: #10B981; }
.load-fill.normal { background: #3B82F6; }
.load-fill.busy { background: #F59E0B; }
.load-fill.overloaded { background: #EF4444; }

.diagnosis-trends {
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.diagnosis-trends h3 {
  margin: 0 0 16px;
  font-size: 18px;
}

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

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* ========== 布局定制样式 ========== */
.layout-actions {
  display: flex;
  gap: 10px;
}

.layout-selector {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.layout-selector h3 {
  margin: 0 0 16px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.layout-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.layout-item {
  background: var(--bg-main);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.layout-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.layout-item.active {
  border-color: var(--primary-color);
  background: var(--primary-light, #eef2ff);
}

.layout-item-name {
  font-weight: 500;
}

.layout-item-actions {
  display: flex;
  gap: 6px;
  margin-left: 8px;
}

.layout-item-actions button {
  padding: 4px 8px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.layout-item-actions button:hover {
  background: var(--primary-color);
  color: white;
}

.layout-editor {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.layout-editor h3 {
  margin: 0 0 16px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.layout-controls-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.layout-hint {
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.draggable-panels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  min-height: 200px;
}

.draggable-panel {
  background: var(--bg-main);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 16px;
  cursor: grab;
  transition: all 0.2s ease;
  position: relative;
}

.draggable-panel:active {
  cursor: grabbing;
}

.draggable-panel.dragging {
  opacity: 0.5;
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.draggable-panel.drag-over {
  border-color: var(--primary-color);
  background: var(--primary-light, #eef2ff);
}

.draggable-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.draggable-panel-title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.draggable-panel-visibility {
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.draggable-panel-visibility:hover {
  color: var(--primary-color);
}

.draggable-panel-visibility.hidden {
  opacity: 0.4;
}

.draggable-panel-size-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.size-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-main);
  cursor: pointer;
  transition: all 0.2s;
}

.size-btn:hover {
  border-color: var(--primary-color);
}

.size-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.layout-responsive-preview {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.layout-responsive-preview h3 {
  margin: 0 0 16px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-modes {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.preview-mode-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-main);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.preview-mode-btn:hover {
  border-color: var(--primary-color);
}

.preview-mode-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.preview-container {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  min-height: 300px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.preview-panel.width-full { width: 100%; }
.preview-panel.width-half { width: calc(50% - 6px); }
.preview-panel.width-third { width: calc(33.33% - 8px); }
.preview-panel.width-quarter { width: calc(25% - 9px); }
.preview-panel.hidden { opacity: 0.3; }

.preview-panel.height-small { min-height: 100px; }
.preview-panel.height-medium { min-height: 200px; }
.preview-panel.height-large { min-height: 300px; }

/* 响应式预览尺寸 */
.preview-container.preview-mobile { 
  max-width: 375px; 
  margin: 0 auto;
}

.preview-container.preview-tablet { 
  max-width: 768px; 
  margin: 0 auto;
}

.preview-container.preview-desktop {
  max-width: 100%;
}

/* 新建布局模态框 */
#new-layout-modal .modal-content {
  max-width: 400px;
}

/* ==================== 拖拽式Dashboard布局样式 ==================== */
.drag-drop-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 16px;
  min-height: 400px;
  position: relative;
}

.drag-drop-dashboard[data-grid-cols="1"] {
  grid-template-columns: 1fr;
}

.drag-drop-dashboard[data-grid-cols="2"] {
  grid-template-columns: repeat(2, 1fr);
}

.drag-drop-dashboard[data-grid-cols="3"] {
  grid-template-columns: repeat(3, 1fr);
}

.drag-drop-dashboard[data-grid-cols="4"] {
  grid-template-columns: repeat(4, 1fr);
}

/* 拖拽卡片 */
.draggable-card {
  position: relative;
  background: var(--bg-card, #fff);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  cursor: default;
  min-height: 120px;
}

.draggable-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.draggable-card.dragging {
  opacity: 0.8;
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 1000;
  cursor: grabbing;
}

.draggable-card.resizing {
  cursor: se-resize;
}

.draggable-card.collapsed {
  min-height: 40px;
}

.draggable-card.collapsed .stat-info,
.draggable-card.collapsed .card-actions {
  display: none;
}

/* 网格列宽 */
.grid-col-1 { grid-column: span 1; }
.grid-col-2 { grid-column: span 2; }
.grid-col-3 { grid-column: span 3; }
.grid-col-4 { grid-column: span 4; }

/* 拖拽手柄 */
.drag-handle {
  position: absolute;
  top: 8px;
  right: 40px;
  padding: 4px 8px;
  cursor: grab;
  color: var(--text-muted, #9ca3af);
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.drag-handle:hover {
  background: var(--bg-hover, #f3f4f6);
  color: var(--text-primary, #374151);
}

.drag-handle:active {
  cursor: grabbing;
}

/* 调整大小手柄 */
.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: se-resize;
  opacity: 0;
  transition: opacity 0.2s;
}

.resize-handle::after {
  content: '';
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted, #9ca3af);
  border-bottom: 2px solid var(--text-muted, #9ca3af);
}

.draggable-card:hover .resize-handle {
  opacity: 1;
}

.resize-handle:hover::after {
  border-color: var(--primary, #3b82f6);
}

/* 拖拽占位符 */
.drag-placeholder {
  background: var(--bg-hover, #e5e7eb);
  border: 2px dashed var(--primary, #3b82f6);
  border-radius: 12px;
  transition: all 0.2s;
  min-height: 120px;
}

/* 拖拽激活状态 */
.drag-drop-dashboard.drag-active {
  background: var(--bg-hover, #f9fafb);
}

/* 卡片操作按钮 */
.card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.card-action-btn {
  padding: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.card-action-btn:hover {
  background: var(--bg-hover, #f3f4f6);
  color: var(--text-primary, #374151);
}

.card-action-btn.card-delete-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* 统计卡片 */
.stat-card .stat-icon {
  font-size: 24px;
  color: var(--primary, #3b82f6);
  margin-bottom: 8px;
}

.stat-card .stat-info h3 {
  font-size: 14px;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 4px 0;
}

.stat-card .stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0;
}

/* 响应式适配 */
@media (max-width: 1440px) {
  .drag-drop-dashboard {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-col-4 { grid-column: span 3; }
}

@media (max-width: 1024px) {
  .drag-drop-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-col-3, .grid-col-4 { grid-column: span 2; }
}

@media (max-width: 768px) {
  .drag-drop-dashboard {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .grid-col-1, .grid-col-2, .grid-col-3, .grid-col-4 {
    grid-column: span 1;
  }
  .drag-handle, .resize-handle {
    display: none;
  }
}

/* 布局工具栏 */
.layout-toolbar {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card, #fff);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.layout-toolbar .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-main, #fff);
  color: var(--text-primary, #374151);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.layout-toolbar .btn:hover {
  background: var(--bg-hover, #f3f4f6);
  border-color: var(--primary, #3b82f6);
}

.layout-toolbar .btn-primary {
  background: var(--primary, #3b82f6);
  border-color: var(--primary, #3b82f6);
  color: #fff;
}

.layout-toolbar .btn-primary:hover {
  background: var(--primary-dark, #2563eb);
}

/* ========== 自然语言查询助手样式 ========== */
.query-assistant {
  background: var(--bg-card, #fff);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.query-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.query-header h2 {
  font-size: 18px;
  color: var(--text-primary, #1f2937);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.query-header h2 i {
  color: var(--primary, #3b82f6);
}

.query-input-area {
  margin-bottom: 20px;
}

.query-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input, #f9fafb);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  padding: 4px;
  transition: border-color 0.2s;
}

.query-input-wrapper:focus-within {
  border-color: var(--primary, #3b82f6);
}

.query-icon {
  padding-left: 16px;
  color: var(--text-secondary, #9ca3af);
}

.query-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 8px;
  font-size: 15px;
  color: var(--text-primary, #1f2937);
  outline: none;
}

.query-input::placeholder {
  color: var(--text-secondary, #9ca3af);
}

.query-input-wrapper .btn {
  padding: 10px 20px;
  border-radius: 8px;
}

.query-suggestions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.suggestion-label {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
}

.suggestion-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 20px;
  background: var(--bg-main, #fff);
  color: var(--text-secondary, #6b7280);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-btn:hover {
  border-color: var(--primary, #3b82f6);
  color: var(--primary, #3b82f6);
  background: rgba(59, 130, 246, 0.05);
}

/* 查询结果区域 */
.query-result {
  min-height: 100px;
}

.query-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary, #6b7280);
  font-size: 15px;
}

.query-loading i {
  margin-right: 8px;
}

.query-answer {
  background: var(--bg-input, #f9fafb);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary, #1f2937);
  border-left: 4px solid var(--primary, #3b82f6);
}

.query-chart {
  margin-bottom: 16px;
  min-height: 200px;
}

.query-understanding {
  background: rgba(59, 130, 246, 0.05);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
}

.query-understanding strong {
  color: var(--text-primary, #374151);
}

/* 查询历史面板 */
.query-history-panel {
  position: fixed;
  right: 0;
  top: 60px;
  width: 320px;
  height: calc(100vh - 80px);
  background: var(--bg-card, #fff);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.history-header h3 {
  font-size: 16px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.query-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  padding: 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.history-item:hover {
  border-color: var(--primary, #3b82f6);
  background: rgba(59, 130, 246, 0.05);
}

.history-item-query {
  font-size: 14px;
  color: var(--text-primary, #1f2937);
  margin-bottom: 4px;
}

.history-item-time {
  font-size: 12px;
  color: var(--text-secondary, #9ca3af);
}

.history-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary, #9ca3af);
}

/* 结果表格样式 */
.query-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.query-result-table th,
.query-result-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.query-result-table th {
  background: var(--bg-input, #f9fafb);
  font-weight: 600;
  color: var(--text-primary, #374151);
}

.query-result-table tr:hover td {
  background: rgba(59, 130, 246, 0.03);
}

/* 结果卡片样式 */
.query-result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.query-result-card {
  background: var(--bg-input, #f9fafb);
  border-radius: 10px;
  padding: 16px;
  border-left: 4px solid var(--primary, #3b82f6);
}

.query-result-card-title {
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin-bottom: 8px;
  font-size: 14px;
}

.query-result-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary, #3b82f6);
}

.query-result-card-label {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  margin-top: 4px;
}

/* ==================== 智能数据解读助手样式 ==================== */
.interpret-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin-top: 20px;
}

.interpret-chat {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
}

.chat-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text-primary, #1f2937);
}

.chat-messages {
  height: 400px;
  overflow-y: auto;
  padding: 20px;
}

.chat-message {
  margin-bottom: 16px;
  display: flex;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message .message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-message.system .message-content {
  background: var(--bg-secondary, #f3f4f6);
  color: var(--text-primary, #1f2937);
  border-bottom-left-radius: 4px;
}

.chat-message.user .message-content {
  background: var(--primary, #3b82f6);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.chat-input:focus {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.interpret-insights {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 20px;
}

.interpret-insights h3 {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--text-primary, #1f2937);
}

.insights-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insight-card {
  padding: 14px;
  border-radius: 8px;
  border-left: 4px solid;
}

.insight-card.critical {
  background: #fef2f2;
  border-color: #ef4444;
}

.insight-card.warning {
  background: #fffbeb;
  border-color: #f59e0b;
}

.insight-card.info {
  background: #eff6ff;
  border-color: #3b82f6;
}

.insight-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--text-primary, #1f2937);
}

.insight-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
}

.interpret-result {
  margin-top: 20px;
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
}

.result-header h3 {
  margin: 0;
  font-size: 16px;
}

.result-content {
  padding: 20px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ==================== 模板市场样式 ==================== */
.template-filters {
  display: flex;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 14px;
  color: var(--text-secondary, #6b7280);
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  font-size: 14px;
  background: var(--card-bg, #fff);
  cursor: pointer;
}

.filter-input {
  padding: 8px 12px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  font-size: 14px;
  width: 200px;
}

.search-group {
  margin-left: auto;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.template-card {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.template-thumbnail {
  height: 140px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 48px;
}

.template-card-body {
  padding: 16px;
}

.template-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin: 0 0 8px;
}

.template-card-desc {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 12px;
  line-height: 1.5;
}

.template-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
}

.template-card-rating {
  color: #f59e0b;
}

.template-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.template-tag {
  padding: 2px 8px;
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary, #6b7280);
}

/* ==================== 异常预测样式 ==================== */
.anomaly-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.overview-card {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.overview-card.critical .overview-icon {
  color: #ef4444;
  background: #fef2f2;
}

.overview-card.warning .overview-icon {
  color: #f59e0b;
  background: #fffbeb;
}

.overview-card.info .overview-icon {
  color: #3b82f6;
  background: #eff6ff;
}

.overview-card.resolved .overview-icon {
  color: #10b981;
  background: #ecfdf5;
}

.overview-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.overview-info {
  display: flex;
  flex-direction: column;
}

.overview-count {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
}

.overview-label {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
}

.anomaly-prediction {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 20px;
}

.anomaly-prediction h3 {
  margin: 0 0 16px;
  font-size: 16px;
}

.prediction-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.prediction-chart {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 8px;
  color: var(--text-secondary, #6b7280);
}

.anomaly-alerts {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 20px;
}

.anomaly-alerts h3 {
  margin: 0 0 16px;
  font-size: 16px;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  border-left: 4px solid;
}

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

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

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

.alert-icon {
  font-size: 20px;
}

.alert-item.critical .alert-icon { color: #ef4444; }
.alert-item.warning .alert-icon { color: #f59e0b; }
.alert-item.info .alert-icon { color: #3b82f6; }

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.alert-message {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
}

.alert-time {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  white-space: nowrap;
}

.alert-actions {
  display: flex;
  gap: 8px;
}

/* ==================== 项目延期预测样式 ==================== */
.delay-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.delay-overview .overview-card {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.delay-overview .overview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.delay-overview .overview-card.critical { border-left: 4px solid #dc2626; }
.delay-overview .overview-card.warning { border-left: 4px solid #ea580c; }
.delay-overview .overview-card.medium { border-left: 4px solid #ca8a04; }
.delay-overview .overview-card.success { border-left: 4px solid #16a34a; }

.delay-trend-section,
.delay-predictions-section,
.delay-recommendations-section {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 20px;
}

.delay-trend-section h3,
.delay-predictions-section h3,
.delay-recommendations-section h3 {
  margin: 0 0 16px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.delay-trend-chart {
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 8px;
  padding: 16px;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  width: 100%;
  height: 100%;
}

.trend-bar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.trend-bar {
  width: 24px;
  background: linear-gradient(to top, #3b82f6, #60a5fa);
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 20px;
}

.trend-bar-critical {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #dc2626;
  border-radius: 4px 4px 0 0;
}

.trend-label {
  font-size: 11px;
  color: var(--text-secondary, #6b7280);
}

.delay-prediction-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.delay-prediction-item {
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid;
  background: var(--bg-primary, #fff);
  transition: transform 0.2s;
}

.delay-prediction-item:hover {
  transform: translateX(4px);
}

.delay-prediction-item.critical { border-color: #dc2626; background: #fef2f2; }
.delay-prediction-item.high { border-color: #ea580c; background: #fff7ed; }
.delay-prediction-item.medium { border-color: #ca8a04; background: #fefce8; }
.delay-prediction-item.low { border-color: #16a34a; background: #f0fdf4; }

.delay-prediction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.delay-project-title {
  font-weight: 600;
  font-size: 15px;
}

.delay-risk-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.delay-prediction-body {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
}

.delay-info {
  display: flex;
  gap: 8px;
}

.delay-label {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
}

.delay-value {
  font-size: 13px;
  font-weight: 500;
}

.delay-value.text-danger { color: #dc2626; }
.delay-value.text-success { color: #16a34a; }

.delay-prediction-actions {
  display: flex;
  gap: 8px;
}

.delay-recommendations {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recommendation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  margin-bottom: 12px;
}

.recommendation-header h4 {
  margin: 0;
  font-size: 16px;
}

.risk-score {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
}

.recommendation-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-secondary, #f9fafb);
}

.recommendation-item.high { background: #fef2f2; }
.recommendation-item.medium { background: #fffbeb; }
.recommendation-item.low { background: #f0fdf4; }

.recommendation-icon {
  font-size: 20px;
}

.recommendation-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.recommendation-text {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
}

/* ==================== 模态框补充样式 ==================== */
/* 注意：基础模态框样式在第791行已定义，此处只补充样式 */

.modal-content.modal-lg {
  max-width: 800px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary, #6b7280);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid var(--border, #d1d5db);
  background: var(--card-bg, #fff);
  border-radius: 6px;
  cursor: pointer;
}

.pagination button.active {
  background: var(--primary, #3b82f6);
  color: white;
  border-color: var(--primary, #3b82f6);
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary, #6b7280);
}

/* ========== 系统监控面板样式 ========== */
.monitor-actions {
  display: flex;
  gap: 0.75rem;
}

/* 系统整体状态概览卡片 */
.system-overview-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  color: white;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.system-overview-card.status-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.system-overview-card.status-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

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

.overview-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.status-text {
  font-size: 1.125rem;
  font-weight: 600;
}

.overview-time {
  font-size: 0.875rem;
  opacity: 0.9;
}

.overview-stats {
  display: flex;
  gap: 2rem;
}

.overview-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.overview-stat .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.overview-stat .stat-label {
  font-size: 0.75rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 一键诊断按钮动画 */
#quick-diagnosis-btn {
  position: relative;
  overflow: hidden;
}

#quick-diagnosis-btn.diagnosing {
  pointer-events: none;
}

#quick-diagnosis-btn.diagnosing i {
  animation: pulse-diagnose 1s ease-in-out infinite;
}

@keyframes pulse-diagnose {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.monitor-health-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.health-card {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.health-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.health-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.health-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.health-label {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  font-weight: 500;
}

.health-status {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text, #1e293b);
}

.health-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d1d5db;
  transition: all 0.3s ease;
}

.health-indicator.healthy {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulse-green 2s infinite;
}

.health-indicator.unhealthy {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
  animation: pulse-red 1s infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.1); }
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.1); }
}

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

.metric-card {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.metric-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 1rem;
}

.metric-header i {
  color: var(--primary, #6366f1);
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text, #1e293b);
  margin-bottom: 0.75rem;
  line-height: 1;
}

.metric-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.metric-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 50%, #ef4444 100%);
  background-size: 300% 100%;
  transition: width 0.5s ease;
  border-radius: 4px;
}

.metric-detail {
  font-size: 0.813rem;
  color: var(--text-secondary, #6b7280);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.success-count {
  color: #10b981;
}

.error-count {
  color: #ef4444;
}

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

.monitor-detail-card {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.monitor-detail-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: var(--text, #1e293b);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border, #e5e7eb);
}

.monitor-detail-card h3 i {
  color: var(--primary, #6366f1);
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border, #f3f4f6);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
}

.info-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #1e293b);
  font-family: 'Monaco', 'Menlo', monospace;
}

.monitor-footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-secondary, #6b7280);
  font-size: 0.875rem;
  border-top: 1px solid var(--border, #e5e7eb);
}

.monitor-footer i {
  margin-right: 0.5rem;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .monitor-health-cards,
  .monitor-metrics-grid,
  .monitor-details-grid {
    grid-template-columns: 1fr;
  }
  
  .metric-value {
    font-size: 2rem;
  }
  
  .health-card {
    padding: 1rem;
  }
  
  .health-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}

/* 深色模式适配 */
[data-theme="dark"] .health-card,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .monitor-detail-card {
  background: var(--card-bg, #1e293b);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] .metric-bar {
  background: #374151;
}

/* ========== 工作流节点编辑器样式 ========== */
.workflow-nodes-editor {
  max-height: 500px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg, #f8fafc);
  border-radius: 0.5rem;
  border: 1px solid var(--border, #e2e8f0);
}

.workflow-node-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.workflow-node-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: var(--primary, #6366f1);
}

.workflow-node-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary, #f1f5f9);
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.workflow-node-number {
  font-weight: 600;
  color: var(--primary, #6366f1);
  font-size: 0.875rem;
  min-width: 2rem;
}

.workflow-node-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--text, #1e293b);
  transition: all 0.2s;
}

.workflow-node-name:focus {
  background: var(--card-bg, #ffffff);
  border-color: var(--primary, #6366f1);
  outline: none;
}

.workflow-node-badges {
  display: flex;
  gap: 0.5rem;
}

.workflow-node-body {
  padding: 1rem;
}

.workflow-node-body .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.workflow-node-body .form-group {
  margin-bottom: 0;
}

.workflow-node-body .form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  display: block;
}

.workflow-node-id,
.workflow-node-assignee,
.workflow-node-timeout,
.workflow-node-next,
.workflow-node-description {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--text, #1e293b);
  background: var(--card-bg, #ffffff);
  transition: border-color 0.2s;
}

.workflow-node-id:focus,
.workflow-node-assignee:focus,
.workflow-node-timeout:focus,
.workflow-node-next:focus,
.workflow-node-description:focus {
  outline: none;
  border-color: var(--primary, #6366f1);
}

.workflow-node-description {
  resize: vertical;
  font-family: inherit;
}

/* 模态框超大尺寸 */
.modal-xlarge {
  max-width: 900px;
  max-height: 90vh;
}

.modal-xlarge .modal-body {
  max-height: calc(90vh - 200px);
  overflow-y: auto;
}

/* 深色模式适配 */
[data-theme="dark"] .workflow-nodes-editor {
  background: var(--bg-secondary, #1e293b);
  border-color: var(--border, #334155);
}

[data-theme="dark"] .workflow-node-card {
  background: var(--card-bg, #1e293b);
  border-color: var(--border, #334155);
}

[data-theme="dark"] .workflow-node-header {
  background: var(--bg-tertiary, #0f172a);
  border-color: var(--border, #334155);
}

[data-theme="dark"] .workflow-node-name,
[data-theme="dark"] .workflow-node-id,
[data-theme="dark"] .workflow-node-assignee,
[data-theme="dark"] .workflow-node-timeout,
[data-theme="dark"] .workflow-node-next,
[data-theme="dark"] .workflow-node-description {
  background: var(--bg-secondary, #1e293b);
  border-color: var(--border, #334155);
  color: var(--text, #f1f5f9);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .workflow-node-body .form-row {
    grid-template-columns: 1fr;
  }
  
  .workflow-node-header {
    flex-wrap: wrap;
  }
  
  .workflow-node-name {
    width: 100%;
    order: 2;
  }
  
  .workflow-node-badges {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
}

/* ============================================
   快速搜索 / 命令面板
   ============================================ */

.quick-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.quick-search-overlay.active {
  display: flex;
  opacity: 1;
}

.quick-search-container {
  width: 100%;
  max-width: 640px;
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.2s ease;
}

.quick-search-overlay.active .quick-search-container {
  transform: translateY(0);
}

.quick-search-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  gap: 12px;
}

.quick-search-header i {
  color: var(--text-muted, #64748b);
  font-size: 18px;
}

.quick-search-header input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
  color: var(--text, #1e293b);
}

.quick-search-header input::placeholder {
  color: var(--text-muted, #94a3b8);
}

.quick-search-hint {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.quick-search-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
}

.quick-search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.quick-search-group {
  margin-bottom: 8px;
}

.quick-search-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #94a3b8);
  padding: 8px 12px 4px;
}

.quick-search-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  gap: 12px;
  transition: all 0.15s ease;
}

.quick-search-item:hover,
.quick-search-item.selected {
  background: var(--primary-light, #eef2ff);
}

.quick-search-item.selected {
  background: var(--primary, #6366f1);
  color: #fff;
}

.quick-search-item.selected .quick-search-item-icon {
  color: #fff;
}

.quick-search-item.selected .quick-search-item-desc {
  color: rgba(255, 255, 255, 0.8);
}

.quick-search-item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 8px;
  color: var(--primary, #6366f1);
  font-size: 14px;
}

.quick-search-item.selected .quick-search-item-icon {
  background: rgba(255, 255, 255, 0.2);
}

.quick-search-item-content {
  flex: 1;
  min-width: 0;
}

.quick-search-item-title {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-search-item-desc {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-search-item-shortcut {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

.quick-search-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px 20px;
  border-top: 1px solid var(--border, #e2e8f0);
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.quick-search-footer kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  margin: 0 2px;
}

.quick-search-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted, #94a3b8);
}

.quick-search-empty i {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* 深色模式适配 */
[data-theme="dark"] .quick-search-container {
  background: var(--card-bg, #1e293b);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .quick-search-header {
  border-color: var(--border, #334155);
}

[data-theme="dark"] .quick-search-header input {
  color: var(--text, #f1f5f9);
}

[data-theme="dark"] .quick-search-hint kbd,
[data-theme="dark"] .quick-search-footer kbd {
  background: var(--bg-tertiary, #0f172a);
  border-color: var(--border, #334155);
}

[data-theme="dark"] .quick-search-item:hover {
  background: var(--bg-tertiary, #0f172a);
}

[data-theme="dark"] .quick-search-item-icon {
  background: var(--bg-tertiary, #0f172a);
}

[data-theme="dark"] .quick-search-footer {
  border-color: var(--border, #334155);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .quick-search-overlay {
    padding-top: 10vh;
  }

  .quick-search-container {
    max-width: calc(100% - 32px);
    margin: 0 16px;
  }

  .quick-search-hint {
    display: none;
  }

  .quick-search-results {
    max-height: 300px;
  }

  .quick-search-footer {
    display: none;
  }
}

/* Log Search & Highlight */
.log-search-input {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 13px;
  width: 150px;
  transition: width 0.2s, border-color 0.2s;
}

.log-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  width: 200px;
}

.log-search-input::placeholder {
  color: var(--text-muted);
}

.log-highlight {
  background: #ffeb3b;
  color: #000;
  padding: 0 2px;
  border-radius: 2px;
}

[data-theme="dark"] .log-highlight {
  background: #ffc107;
  color: #000;
}

/* ========== 实时数据推送面板 ========== */
.realtime-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 350px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  overflow: hidden;
}

.realtime-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.realtime-panel .panel-header h3 {
  margin: 0;
  font-size: 14px;
  color: var(--text-color);
}

.realtime-panel .connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.realtime-panel .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
  transition: background 0.3s;
}

.realtime-panel .status-dot.connected {
  background: #22c55e;
  animation: pulse 2s infinite;
}

.realtime-panel .status-dot.disconnected {
  background: #ef4444;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.realtime-panel .status-text {
  font-size: 12px;
  color: var(--text-muted);
}

.realtime-panel .panel-content {
  max-height: 400px;
  overflow-y: auto;
}

.realtime-panel .realtime-metrics {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.realtime-panel .realtime-logs {
  padding: 8px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 11px;
  max-height: 250px;
  overflow-y: auto;
}

.realtime-panel .log-item {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.realtime-panel .log-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ========== 审计日志样式 ========== */
.audit-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.audit-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.audit-icon {
  font-size: 20px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.audit-content {
  flex: 1;
  min-width: 0;
}

.audit-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.audit-type {
  font-weight: 600;
  color: var(--primary-color);
  padding: 2px 8px;
  background: var(--primary-bg);
  border-radius: 4px;
  font-size: 12px;
}

.audit-user {
  color: var(--text-primary);
  font-weight: 500;
}

.audit-time {
  color: var(--text-muted);
  font-size: 12px;
}

.audit-details {
  color: var(--text-secondary);
  margin-bottom: 4px;
  word-break: break-word;
}

.audit-ip {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Monaco', 'Menlo', monospace;
}

#audit-container .loading,
#audit-container .empty-state,
#audit-container .error-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* ========== Dashboard Widgets ========== */
#widget-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px;
}

.dashboard-widget {
  background: var(--bg-card, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  min-height: 150px;
  display: flex;
  flex-direction: column;
}

.dashboard-widget.widget-full {
  grid-column: span 2;
}

.dashboard-widget.widget-half {
  grid-column: span 1;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.widget-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary, #1e293b);
}

.widget-actions {
  display: flex;
  gap: 4px;
}

.widget-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #94a3b8);
  transition: all 0.2s;
}

.widget-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-primary, #334155);
}

.widget-btn.widget-remove:hover {
  background: #fee2e2;
  color: #ef4444;
}

.widget-content {
  padding: 16px;
  flex: 1;
  overflow: auto;
}

.widget-loading,
.widget-error,
.widget-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted, #94a3b8);
}

/* Clock Widget */
.widget-clock {
  text-align: center;
}

.clock-time {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color, #6366f1);
  font-family: 'Monaco', 'Menlo', monospace;
}

.clock-date {
  font-size: 14px;
  color: var(--text-secondary, #64748b);
  margin-top: 4px;
}

/* Weather Widget */
.widget-weather {
  text-align: center;
}

.weather-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.weather-temp {
  font-size: 28px;
  font-weight: 600;
}

.weather-condition {
  font-size: 14px;
  color: var(--text-secondary, #64748b);
}

.weather-details {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  margin-top: 8px;
}

/* Quick Actions Widget */
.widget-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-card, #fff);
  cursor: pointer;
  transition: all 0.2s;
}

.quick-action-btn:hover {
  border-color: var(--primary-color, #6366f1);
  background: var(--bg-hover, #f8fafc);
}

.quick-action-btn i {
  font-size: 20px;
  color: var(--primary-color, #6366f1);
}

.quick-action-btn span {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

/* Notifications Widget */
.widget-notifications {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-item {
  padding: 8px;
  border-radius: 6px;
  background: var(--bg-secondary, #f8fafc);
  border-left: 3px solid var(--primary-color, #6366f1);
}

.notification-item.notification-warning {
  border-left-color: #f59e0b;
}

.notification-item.notification-error {
  border-left-color: #ef4444;
}

.notification-item.notification-success {
  border-left-color: #10b981;
}

.notification-title {
  font-size: 13px;
  font-weight: 500;
}

.notification-time {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

/* Stats Widget */
.widget-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
}

.stat-item {
  padding: 12px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color, #6366f1);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  margin-top: 4px;
}

/* Activities Widget */
.widget-activities {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  font-size: 13px;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-action {
  font-weight: 500;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

/* Shortcuts Widget */
.widget-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shortcut-item kbd {
  padding: 4px 8px;
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 4px;
  font-size: 11px;
  font-family: 'Monaco', 'Menlo', monospace;
  min-width: 80px;
  text-align: center;
}

.shortcut-item span {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

/* Health Widget */
.widget-health {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.health-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.health-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.health-status.unhealthy {
  background: #ef4444;
}

.health-name {
  font-size: 13px;
}

.health-uptime {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin-top: 8px;
}

/* Empty State */
.widget-empty-state {
  grid-column: span 2;
  text-align: center;
  padding: 40px;
  color: var(--text-muted, #94a3b8);
}

.widget-empty-state button {
  margin-top: 16px;
}

/* Widget Add Modal */
.modal.widget-add-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.widget-add-modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative;
  background: var(--bg-card, #fff);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted, #94a3b8);
  border-radius: 6px;
}

.modal-close:hover {
  background: var(--bg-hover, #f1f5f9);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.widget-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.widget-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  transition: all 0.2s;
}

.widget-item:hover {
  border-color: var(--primary-color, #6366f1);
}

.widget-item.added {
  opacity: 0.6;
}

.widget-item-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #f8fafc);
  border-radius: 8px;
  font-size: 20px;
}

.widget-item-info {
  flex: 1;
}

.widget-item-name {
  font-weight: 600;
  font-size: 14px;
}

.widget-item-desc {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.widget-item-btn {
  padding: 6px 12px;
  border: 1px solid var(--primary-color, #6366f1);
  background: var(--primary-color, #6366f1);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.widget-item-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.widget-item-btn:disabled {
  background: var(--text-muted, #94a3b8);
  border-color: var(--text-muted, #94a3b8);
  cursor: not-allowed;
}

.widget-item-btn.remove {
  background: transparent;
  color: #ef4444;
  border-color: #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
  #widget-container {
    grid-template-columns: 1fr;
  }
  
  .dashboard-widget.widget-full,
  .dashboard-widget.widget-half {
    grid-column: span 1;
  }
  
  .widget-stats {
    grid-template-columns: 1fr;
  }
}

/* Widgets Section */
.widgets-section {
  margin-top: 24px;
  padding: 0 24px 24px;
}

.widgets-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.widgets-section .section-header h3 {
  margin: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widgets-section .section-header h3 i {
  color: var(--primary-color, #6366f1);
}

/* ============================================
   移动端响应式布局优化 - 2026-03-06
   ============================================ */

/* 移动端基础重置 */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
    --sidebar-width: 0px;
    --padding-xs: 8px;
    --padding-sm: 12px;
    --padding-md: 16px;
  }
  
  html {
    font-size: 14px;
  }
  
  body {
    overflow-x: hidden;
  }
}

/* 小屏幕设备 */
@media (max-width: 480px) {
  :root {
    --header-height: 50px;
    --padding-xs: 6px;
    --padding-sm: 10px;
    --padding-md: 12px;
  }
  
  html {
    font-size: 13px;
  }
}

/* 平板横屏 */
@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --sidebar-width: 200px;
  }
}

/* ============================================
   移动端Header优化
   ============================================ */
@media (max-width: 768px) {
  .header {
    height: var(--header-height, 56px);
    padding: 0 var(--padding-sm, 12px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-color, #fff);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .header-left h1 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .header-left h1 i {
    font-size: 1.2rem;
  }
  
  .header-right {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  
  .header-right .theme-btn,
  .header-right .btn-alert {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .header-right .btn-alert .badge-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
  }
}

/* ============================================
   移动端侧边栏优化
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: var(--header-height, 56px);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--header-height, 56px));
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 99;
    overflow-y: auto;
    background: var(--bg-color, #fff);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .sidebar-toggle {
    display: flex !important;
  }
  
  /* 侧边栏打开时遮罩 */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 98;
  }
  
  .sidebar-overlay.active {
    display: block;
  }
  
  .sidebar-menu {
    padding: var(--padding-sm, 12px);
  }
  
  .sidebar-menu a {
    padding: 12px var(--padding-md, 16px);
    font-size: 0.95rem;
  }
  
  .sidebar-menu a i {
    width: 24px;
    text-align: center;
    margin-right: 12px;
  }
  
  .submenu {
    position: static;
    box-shadow: none;
    padding-left: 20px;
  }
  
  .submenu.active {
    display: block;
  }
  
  .menu-item.has-submenu::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 16px;
  }
  
  .menu-item.has-submenu.active::after {
    content: '\f106';
  }
}

/* ============================================
   移动端主内容区
   ============================================ */
@media (max-width: 768px) {
  .main-content {
    margin-top: var(--header-height, 56px);
    padding: var(--padding-sm, 12px);
    min-height: calc(100vh - var(--header-height, 56px));
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: var(--padding-md, 16px);
  }
  
  .page-header h2 {
    font-size: 1.4rem;
  }
  
  .page-header .header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .page-header .btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    font-size: 0.9rem;
  }
  
  .filter-bar {
    flex-direction: column;
    gap: 10px;
    padding: var(--padding-sm, 12px);
  }
  
  .filter-bar select,
  .filter-bar input {
    width: 100%;
  }
}

/* ============================================
   移动端Widgets优化
   ============================================ */
@media (max-width: 768px) {
  #widget-container {
    display: flex;
    flex-direction: column;
    gap: var(--padding-sm, 12px);
    padding: var(--padding-xs, 8px);
  }
  
  .dashboard-widget {
    width: 100%;
    margin: 0;
    padding: var(--padding-sm, 12px);
    border-radius: 8px;
  }
  
  .dashboard-widget.widget-full,
  .dashboard-widget.widget-half,
  .dashboard-widget.widget-third {
    grid-column: span 1;
    width: 100%;
  }
  
  .widget-header {
    flex-direction: row;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 10px;
  }
  
  .widget-title {
    font-size: 1rem;
  }
  
  .widget-actions {
    display: flex;
    gap: 4px;
  }
  
  .widget-actions button {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
  
  .widget-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .stat-item {
    padding: 10px;
  }
  
  .stat-value {
    font-size: 1.4rem;
  }
  
  .stat-label {
    font-size: 0.8rem;
  }
}

/* ============================================
   移动端表格优化
   ============================================ */
@media (max-width: 768px) {
  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table table {
    min-width: 600px;
    font-size: 0.85rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 8px 10px;
    white-space: nowrap;
  }
  
  .data-table .actions {
    display: flex;
    gap: 4px;
  }
  
  .data-table .btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
}

/* ============================================
   移动端模态框优化
   ============================================ */
@media (max-width: 768px) {
  .modal {
    padding: var(--padding-md, 16px);
    width: 95% !important;
    max-width: none !important;
    margin: var(--padding-md, 16px) !important;
  }
  
  .modal-header {
    padding: var(--padding-sm, 12px);
    flex-direction: column;
    gap: 10px;
  }
  
  .modal-header h3 {
    font-size: 1.1rem;
  }
  
  .modal-body {
    padding: var(--padding-sm, 12px);
    max-height: 60vh;
    overflow-y: auto;
  }
  
  .modal-footer {
    padding: var(--padding-sm, 12px);
    flex-direction: column;
    gap: 8px;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
  
  .form-row {
    flex-direction: column;
  }
  
  .form-group {
    width: 100%;
  }
}

/* ============================================
   移动端图表优化
   ============================================ */
@media (max-width: 768px) {
  .chart-container {
    height: 250px;
    padding: var(--padding-sm, 12px);
  }
  
  .chart-echarts {
    height: 200px;
  }
}

/* ============================================
   移动端Widgets section
   ============================================ */
@media (max-width: 768px) {
  .widgets-section {
    padding: 0 var(--padding-sm, 12px) var(--padding-md, 16px);
    margin-top: var(--padding-md, 16px);
  }
  
  .widgets-section .section-header {
    flex-direction: row;
    align-items: center;
    margin-bottom: 12px;
  }
  
  .widgets-section .section-header h3 {
    font-size: 1rem;
  }
  
  .widgets-section .section-header .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  
  .widget-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--padding-sm, 12px);
  }
  
  .widget-item {
    padding: var(--padding-sm, 12px);
  }
  
  .widget-item-header {
    margin-bottom: 8px;
  }
  
  .widget-item-title {
    font-size: 0.95rem;
  }
  
  .widget-item-content {
    font-size: 0.9rem;
  }
}

/* ============================================
   触摸交互优化
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  /* 触摸设备 */
  button,
  a,
  .clickable {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
  }
  
  a:hover,
  button:hover {
    /* 触摸设备不需要hover效果 */
  }
  
  /* 增大触摸目标 */
  .sidebar-menu a {
    min-height: 48px;
  }
  
  .data-table .actions button {
    min-height: 32px;
    min-width: 32px;
  }
  
  /* 移除hover动画延迟 */
  * {
    transition: none !important;
  }
  
  /* 激活时显示效果 */
  button:active,
  a:active {
    transform: scale(0.97);
    opacity: 0.9;
  }
}

/* ============================================
   安全区域适配 (iPhone notch)
   ============================================ */
@supports (padding-top: env(safe-area-inset-top)) {
  @media (max-width: 768px) {
    .header {
      padding-top: calc(env(safe-area-inset-top) + 8px);
      padding-left: calc(env(safe-area-inset-left) + 12px);
      padding-right: calc(env(safe-area-inset-right) + 12px);
    }
    
    .main-content {
      padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
    }
    
    .sidebar {
      height: calc(100vh - var(--header-height, 56px) - env(safe-area-inset-bottom));
    }
  }
}

/* ============================================
   横向滚动提示
   ============================================ */
.scroll-hint {
  display: none;
}

@media (max-width: 768px) {
  .scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    color: var(--text-muted, #64748b);
    font-size: 0.8rem;
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 4px;
    margin-bottom: 8px;
  }
  
  .scroll-hint i {
    animation: scroll-hint-pulse 1.5s ease-in-out infinite;
  }
  
  @keyframes scroll-hint-pulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
  }
}

/* ============================================
   移动端加载状态
   ============================================ */
@media (max-width: 768px) {
  .loading-spinner {
    width: 32px;
    height: 32px;
    border-width: 3px;
  }
  
  .skeleton {
    height: 40px;
    margin-bottom: 8px;
  }
}

/* ============================================
   设置中心样式
   ============================================ */
.settings-container {
  display: flex;
  min-height: 400px;
  gap: 24px;
}

.settings-nav {
  width: 180px;
  flex-shrink: 0;
  border-right: 1px solid var(--color-border, #e2e8f0);
  padding-right: 16px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary, #64748b);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  margin-bottom: 4px;
}

.settings-nav-item:hover {
  background: var(--color-bg-secondary, #f1f5f9);
  color: var(--color-text-primary, #1e293b);
}

.settings-nav-item.active {
  background: var(--color-primary, #3b82f6);
  color: white;
}

.settings-nav-item i {
  width: 20px;
  text-align: center;
}

.settings-content {
  flex: 1;
  min-width: 0;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

.settings-section h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--color-text-primary, #1e293b);
}

.settings-group {
  margin-bottom: 20px;
}

.settings-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--color-text-primary, #1e293b);
}

.settings-hint {
  font-size: 12px;
  color: var(--color-text-muted, #94a3b8);
  margin-top: 4px;
}

.settings-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--color-bg-primary, #ffffff);
}

.settings-option:hover {
  border-color: var(--color-primary, #3b82f6);
}

.settings-option input:checked + .option-label {
  color: var(--color-primary, #3b82f6);
}

.settings-option input[type="radio"] {
  accent-color: var(--color-primary, #3b82f6);
}

.option-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text-primary, #1e293b);
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.settings-toggle input[type="checkbox"] {
  width: 44px;
  height: 24px;
  appearance: none;
  background: var(--color-bg-tertiary, #cbd5e1);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.settings-toggle input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.settings-toggle input[type="checkbox"]:checked {
  background: var(--color-primary, #3b82f6);
}

.settings-toggle input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 14px;
  color: var(--color-text-primary, #1e293b);
}

.settings-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.color-picker-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.color-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s ease;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option input:checked + .color-preview {
  box-shadow: 0 0 0 2px var(--color-bg-primary, #fff), 0 0 0 4px var(--color-primary, #3b82f6);
}

.color-preview {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: box-shadow 0.2s ease;
}

.shortcuts-list {
  background: var(--color-bg-secondary, #f1f5f9);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.shortcut-item:last-child {
  border-bottom: none;
}

.shortcut-desc {
  font-size: 14px;
  color: var(--color-text-primary, #1e293b);
}

.shortcut-item kbd {
  background: var(--color-bg-primary, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-family: inherit;
  color: var(--color-text-secondary, #64748b);
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-bg-secondary, #f1f5f9);
  border-radius: 0 0 12px 12px;
}

/* Toast 通知样式 */
.settings-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 8px;
  color: white;
  z-index: 10000;
  animation: settingsToastIn 0.3s ease;
}

.settings-toast-success {
  background: #10b981;
}

.settings-toast-error {
  background: #ef4444;
}

.settings-toast-info {
  background: #3b82f6;
}

@keyframes settingsToastIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* 紧凑模式样式 */
.compact-mode {
  --font-size-base: 14px;
}

.compact-mode .settings-group {
  margin-bottom: 12px;
}

.compact-mode .settings-nav-item {
  padding: 8px 12px;
  font-size: 13px;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .settings-container {
    flex-direction: column;
  }
  
  .settings-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    padding-right: 0;
    padding-bottom: 16px;
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }
  
  .settings-nav-item {
    flex-shrink: 0;
    padding: 8px 12px;
  }
  
  .modal-footer {
    flex-wrap: wrap;
  }
  
  .modal-footer .btn {
    flex: 1;
    min-width: 100px;
  }
}

/* 大字体模式 */
html[style*="18px"] .settings-nav-item,
[data-font-size="large"] .settings-nav-item {
  padding: 14px 18px;
  font-size: 15px;
}

/* 主题适配 */
[data-theme="dark"] .settings-nav-item {
  color: var(--color-text-muted);
}

[data-theme="dark"] .settings-nav-item:hover {
  background: var(--color-bg-tertiary);
}

[data-theme="dark"] .settings-option {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
}

[data-theme="dark"] .shortcuts-list {
  background: var(--color-bg-tertiary);
}

[data-theme="dark"] .modal-footer {
  background: var(--color-bg-secondary);
}

/* ========== AI智能分析模块 ========== */
.ai-analysis-panel {
  padding: 20px;
  background: var(--color-bg-primary);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ai-analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--color-border);
}

.ai-analysis-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--color-text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.update-time {
  color: var(--color-text-tertiary);
  font-size: 0.85rem;
}

.refresh-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.refresh-btn:hover {
  background: var(--color-primary-hover);
}

.ai-analysis-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ai-analysis-content > div {
  background: var(--color-bg-secondary);
  border-radius: 10px;
  padding: 15px;
}

.ai-analysis-content h3 {
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  color: var(--color-text-primary);
}

/* 健康度评分 */
.health-score-card {
  display: flex;
  justify-content: center;
}

.health-score {
  text-align: center;
  padding: 20px 40px;
}

.health-score.good {
  color: var(--color-success);
}

.health-score.warning {
  color: var(--color-warning);
}

.health-score.critical {
  color: var(--color-danger);
}

.score-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-value {
  font-size: 3rem;
  font-weight: 700;
}

.score-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.health-emoji {
  font-size: 2rem;
  margin: 10px 0;
}

.health-status {
  font-size: 1rem;
  font-weight: 500;
}

/* 趋势网格 */
.trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
}

.trend-item {
  text-align: center;
  padding: 15px 10px;
  background: var(--color-bg-primary);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.trend-item.up .trend-value {
  color: var(--color-success);
}

.trend-item.down .trend-value {
  color: var(--color-danger);
}

.trend-item.stable .trend-value {
  color: var(--color-info);
}

.trend-item.warning .trend-value {
  color: var(--color-warning);
}

.trend-item.good .trend-value {
  color: var(--color-success);
}

.trend-label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 5px;
}

.trend-value {
  font-size: 1.5rem;
  font-weight: 600;
}

.trend-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  margin-top: 5px;
}

/* 迷你图表 */
.mini-chart {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--color-border);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 70px;
}

.chart-bar {
  width: 20px;
  background: var(--color-primary);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 0.3s;
}

.chart-label {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
  margin-top: 10px;
}

/* 洞察列表 */
.insights-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insight-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
}

.insight-item.positive {
  border-left: 3px solid var(--color-success);
}

.insight-item.warning {
  border-left: 3px solid var(--color-warning);
}

.insight-item.critical {
  border-left: 3px solid var(--color-danger);
}

.insight-item.info {
  border-left: 3px solid var(--color-info);
}

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

.insight-content {
  flex: 1;
}

.insight-content strong {
  display: block;
  margin-bottom: 5px;
  color: var(--color-text-primary);
}

.insight-content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.insight-action {
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 0.8rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.insight-action:hover {
  background: var(--color-primary-hover);
}

/* 异常列表 */
.anomalies-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.anomaly-item {
  padding: 15px;
  border-radius: 8px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
}

.anomaly-item.critical {
  border-left: 4px solid var(--color-danger);
  background: #fef2f2;
}

.anomaly-item.high {
  border-left: 4px solid var(--color-warning);
  background: #fffbeb;
}

.anomaly-item.medium {
  border-left: 4px solid var(--color-info);
}

.anomaly-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.severity-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.severity-badge.critical {
  background: var(--color-danger);
  color: white;
}

.severity-badge.high {
  background: var(--color-warning);
  color: white;
}

.severity-badge.medium {
  background: var(--color-info);
  color: white;
}

.anomaly-message {
  margin: 0 0 10px 0;
  color: var(--color-text-secondary);
}

.anomaly-recommendations {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
}

.anomaly-recommendations ul {
  margin: 5px 0 0 0;
  padding-left: 20px;
}

.anomaly-recommendations li {
  margin: 3px 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* 预测列表 */
.predictions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prediction-item {
  padding: 12px;
  border-radius: 8px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
}

.prediction-item.high {
  border-left: 3px solid var(--color-danger);
}

.prediction-item.medium {
  border-left: 3px solid var(--color-warning);
}

.prediction-item.low {
  border-left: 3px solid var(--color-success);
}

.prediction-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.prediction-icon {
  font-size: 1.2rem;
}

.prediction-text {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.prediction-meta {
  margin-top: 8px;
  font-size: 0.8rem;
}

.confidence {
  color: var(--color-text-tertiary);
}

/* 数据摘要网格 */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}

.summary-item {
  text-align: center;
  padding: 15px 10px;
  background: var(--color-bg-primary);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.summary-item.active {
  border-color: var(--color-primary);
}

.summary-item.success {
  border-color: var(--color-success);
}

.summary-item.warning {
  border-color: var(--color-warning);
}

.summary-item.danger {
  border-color: var(--color-danger);
}

.summary-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.summary-label {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
  margin-top: 5px;
}

/* 加载状态 */
.ai-analysis-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--color-text-tertiary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 错误状态 */
.ai-analysis-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--color-danger);
}

.error-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.ai-analysis-error button {
  margin-top: 15px;
  padding: 8px 16px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* 空状态 */
.no-data, .no-insights, .no-predictions {
  text-align: center;
  padding: 30px;
  color: var(--color-text-tertiary);
}

/* 暗色模式 */
[data-theme="dark"] .ai-analysis-panel {
  background: var(--color-bg-secondary);
}

[data-theme="dark"] .ai-analysis-content > div {
  background: var(--color-bg-tertiary);
}

[data-theme="dark"] .trend-item,
[data-theme="dark"] .insight-item,
[data-theme="dark"] .anomaly-item,
[data-theme="dark"] .prediction-item,
[data-theme="dark"] .summary-item {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
}

[data-theme="dark"] .anomaly-item.critical {
  background: #450a0a;
}

[data-theme="dark"] .anomaly-item.high {
  background: #451a03;
}

/* ========== 仪表板模板系统样式 ========== */

/* 模板卡片增强 */
.template-card {
  position: relative;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--color-primary, #6366f1);
}

.template-thumbnail {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px 8px 0 0;
}

.template-icon {
  font-size: 48px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.template-icon-large {
  font-size: 64px;
  margin-right: 16px;
}

.template-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.9);
  color: var(--color-primary, #6366f1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.template-preset-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 8px;
}

.template-category-badge {
  display: inline-block;
  background: var(--color-primary, #6366f1);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
}

/* 模板操作按钮行 */
.template-actions-row {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.template-actions-row .btn {
  flex: 1;
  min-width: 60px;
  font-size: 12px;
}

/* 模板详情模态框 */
.template-detail {
  padding: 20px;
}

.template-detail-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.template-detail-header h2 {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
}

.template-preview-section {
  margin-bottom: 24px;
}

.template-preview-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--color-text-secondary, #64748b);
}

/* 模板组件预览网格 */
.template-widget-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 16px;
  background: var(--color-bg-secondary, #f8fafc);
  border-radius: 8px;
  min-height: 150px;
}

.template-widget-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px dashed var(--color-border, #e2e8f0);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-secondary, #64748b);
  min-height: 60px;
}

.template-widget-preview i {
  font-size: 24px;
  margin-bottom: 6px;
  color: var(--color-primary, #6366f1);
}

.template-empty {
  grid-column: span 4;
  text-align: center;
  color: var(--color-text-tertiary, #94a3b8);
  padding: 40px;
}

/* 模板设置网格 */
.template-settings-section {
  margin-bottom: 24px;
}

.template-settings-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--color-text-secondary, #64748b);
}

.template-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.setting-item {
  background: var(--color-bg-secondary, #f8fafc);
  padding: 12px 16px;
  border-radius: 8px;
}

.setting-item label {
  display: block;
  font-size: 12px;
  color: var(--color-text-tertiary, #94a3b8);
  margin-bottom: 4px;
}

.setting-item span {
  font-weight: 500;
  color: var(--color-text-primary, #1e293b);
}

/* 模板操作区 */
.template-actions-section {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border, #e2e8f0);
}

/* 创建模板表单 */
.template-create-form {
  padding: 20px;
}

.template-create-form h2 {
  margin-bottom: 24px;
  color: var(--color-text-primary, #1e293b);
}

.template-create-form .form-group {
  margin-bottom: 16px;
}

.template-create-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--color-text-secondary, #64748b);
}

.template-create-form .required {
  color: var(--color-danger, #ef4444);
}

.template-create-form input,
.template-create-form textarea,
.template-create-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  font-size: 14px;
  background: var(--color-bg-primary, white);
  color: var(--color-text-primary, #1e293b);
}

.template-create-form textarea {
  min-height: 80px;
  resize: vertical;
}

.template-create-form .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Toast 提示样式 */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  background: var(--color-bg-primary, white);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  border-left: 4px solid #10b981;
  color: #10b981;
}

.toast-error {
  border-left: 4px solid #ef4444;
  color: #ef4444;
}

/* 暗色模式适配 */
[data-theme="dark"] .template-widget-preview {
  background: var(--color-bg-tertiary, #1e293b);
}

[data-theme="dark"] .setting-item {
  background: var(--color-bg-tertiary, #1e293b);
}

[data-theme="dark"] .template-create-form input,
[data-theme="dark"] .template-create-form textarea,
[data-theme="dark"] .template-create-form select {
  background: var(--color-bg-secondary, #1e293b);
  border-color: var(--color-border, #334155);
}

[data-theme="dark"] .toast {
  background: var(--color-bg-secondary, #1e293b);
}

/* 模板筛选区优化 */
.template-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.template-filters .filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.template-filters label {
  font-size: 12px;
  color: var(--color-text-secondary, #64748b);
  font-weight: 500;
}

.template-filters .filter-select,
.template-filters .filter-input {
  padding: 8px 12px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 6px;
  background: var(--color-bg-primary, white);
  color: var(--color-text-primary, #1e293b);
  font-size: 14px;
  min-width: 150px;
}

.template-filters .search-group {
  flex: 1;
  min-width: 200px;
  display: flex;
  gap: 8px;
}

.template-filters .search-group .filter-input {
  flex: 1;
  min-width: auto;
}

/* 页面头部 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.page-header .template-actions {
  display: flex;
  gap: 12px;
}

/* 加载状态优化 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--color-text-secondary, #64748b);
}

.loading i {
  font-size: 20px;
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  padding: 8px 14px;
  border: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-bg-primary, white);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover,
.pagination button.active {
  background: var(--color-primary, #6366f1);
  color: white;
  border-color: var(--color-primary, #6366f1);
}
