/* ===== 字体 ===== */
@font-face { font-family: 'WorkSans'; src: url('../fonts/WorkSans-Regular.YUu9NsMl.ttf'); font-weight: 400; }
@font-face { font-family: 'WorkSans'; src: url('../fonts/WorkSans-Bold.BSBsqEbU.ttf'); font-weight: 700; }
@font-face { font-family: 'IBMPlexSerif'; src: url('../fonts/IBMPlexSerif-Regular.rmq2ddEA.ttf'); font-weight: 400; }

/* ===== 变量 ===== */
:root {
  --bg: #F0F2F5;
  --bg2: #FFFFFF;
  --card-bg: var(--bg2);
  --ink: #1A1D23;
  --text: var(--ink);
  --muted: #6B7280;
  --rule: #E5E7EB;
  --accent: #2563EB;
  --accent2: #059669;
  --accent-light: #EFF6FF;
  --danger: #EF4444;
  --warning: #F59E0B;
  --success: #10B981;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg: #0F172A;
  --bg2: #1E293B;
  --card-bg: var(--bg2);
  --ink: #F1F5F9;
  --text: var(--ink);
  --muted: #94A3B8;
  --rule: #475569;
  /* 增强卡片边框对比度 */
  --accent: #3B82F6;
  --accent-light: rgba(59,130,246,0.15);
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
}

/* ===== 预设主题 ===== */
/* 翡翠绿主题 */
[data-theme="emerald"] {
    --primary: #059669;
    --primary-light: #6ee7b7;
    --primary-dark: #047857;
    --accent: #14b8a6;
    --accent-light: rgba(20,184,166,0.12);
}

/* 暮光紫主题 */
[data-theme="twilight"] {
    --primary: #7c3aed;
    --primary-light: #c4b5fd;
    --primary-dark: #6d28d9;
    --accent: #ec4899;
    --accent-light: rgba(236,72,153,0.12);
}

/* 海洋蓝主题 */
[data-theme="ocean"] {
    --primary: #0891b2;
    --primary-light: #67e8f9;
    --primary-dark: #0e7490;
    --accent: #3b82f6;
    --accent-light: rgba(59,130,246,0.12);
}

/* 日落橙主题 */
[data-theme="sunset"] {
    --primary: #ea580c;
    --primary-light: #fdba74;
    --primary-dark: #c2410c;
    --accent: #f59e0b;
    --accent-light: rgba(245,158,11,0.12);
}

/* 玫瑰红主题 */
[data-theme="rose"] {
    --primary: #e11d48;
    --primary-light: #fda4af;
    --primary-dark: #be123c;
    --accent: #f43f5e;
    --accent-light: rgba(244,63,94,0.12);
}

/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'WorkSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* 移动端安全区域适配 */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* 屏幕阅读器专用：仅对辅助技术可见 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Focus Visible ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* ===== 按钮 ===== */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); }
.btn-secondary { background: var(--bg2); color: var(--ink); border: 1px solid var(--rule); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-large { padding: 12px 24px; font-size: 15px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--bg2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}
.icon-btn:hover { background: var(--accent-light); border-color: var(--accent); }
.icon-btn.small { width: 28px; height: 28px; font-size: 13px; }

/* ===== 按钮系统 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--bg2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { background: var(--accent-light); border-color: var(--accent); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover, var(--accent)); opacity: 0.9; }
.btn-danger { background: #EF4444; color: #fff; border-color: #EF4444; }
.btn-danger:hover { background: #DC2626; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--accent-light); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 6px; font-size: 11px; border-radius: 4px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }
.btn:disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--bg2);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
  color: var(--text);
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--accent-light); border-color: var(--accent); }
.btn-icon.sm { width: 28px; height: 28px; font-size: 13px; }
.btn-icon.lg { width: 44px; height: 44px; font-size: 20px; }
.btn-icon.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== 导航栏 ===== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--rule);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.nav-menu { display: flex; gap: 4px; }
.nav-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.2s;
}
.nav-btn:hover, .nav-btn.active { background: var(--accent-light); color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.version-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 4px;
  font-weight: 600;
}

/* ===== 欢迎页 ===== */
.welcome-hero {
  position: relative;
  overflow: hidden;
  padding: 60px 20px;
  text-align: center;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 50%, #f0f9ff 100%);
  z-index: -1;
}
.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.hero-content h1 { font-size: 42px; font-weight: 700; margin-bottom: 12px; line-height: 1.2; }
.hero-subtitle { font-size: 16px; color: var(--muted); margin-bottom: 32px; }
.hero-stats { display: flex; justify-content: center; gap: 40px; margin-bottom: 32px; }
.hero-stats .stat { text-align: center; }
.hero-stats .stat-val { font-size: 32px; font-weight: 700; color: var(--accent); }
.hero-stats .stat-label { font-size: 13px; color: var(--muted); }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted);
}

/* ===== 场景区域 ===== */
.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}
.start-card {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.start-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37,99,235,0.03), rgba(139,92,246,0.03));
  opacity: 0;
  transition: opacity 0.3s;
}
.start-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(37,99,235,0.12), 0 2px 8px rgba(0,0,0,0.04);
  transform: translateY(-6px);
}
.start-card:hover::after { opacity: 1; }
.start-card.primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-color: transparent;
  color: #fff;
}
.start-card.primary h3 { color: #fff; }
.start-card.primary p { color: rgba(255,255,255,0.8); }
.start-card.primary::after { display: none; }
.start-icon { font-size: 40px; margin-bottom: 12px; position: relative; z-index: 1; }
.start-card h3 { position: relative; z-index: 1; }
.start-card p { position: relative; z-index: 1; }

/* ===== 工作区布局 ===== */
.workspace-layout {
  display: flex;
  height: calc(100vh - 57px);
  overflow: hidden;
}
.sidebar-left, .sidebar-right {
  width: 260px;
  background: var(--bg2);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-right { border-right: none; border-left: 1px solid var(--rule); }
.sidebar-header { padding: 16px; border-bottom: 1px solid var(--rule); }
.sidebar-section { padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.section-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}
.channel-item:hover { background: var(--bg); }
.channel-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.channel-icon { font-size: 16px; }
.channel-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.quick-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.quick-btn:hover { background: var(--bg); color: var(--accent); }
.main-panel { flex: 1; overflow-y: auto; padding: 16px; }

/* ===== 主面板 ===== */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.panel-title { font-size: 18px; font-weight: 700; }
.panel-actions { display: flex; gap: 8px; align-items: center; }
.panel-btn { padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--rule); background: var(--bg2); cursor: pointer; font-size: 13px; }

/* ===== 聊天面板 ===== */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: auto;
}
/* ===== 消息虚拟滚动 ===== */
.msg-sentinel-top, .msg-sentinel-bottom {
  width: 100%;
  height: 1px;
  background: transparent;
}
.msg-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  background: var(--bg2);
}
.input-toolbar { display: flex; gap: 4px; margin-bottom: 8px; }
.tool-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.tool-btn:hover { background: var(--accent-light); }
.input-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--ink);
  font-size: 14px;
  resize: vertical;
  min-height: 40px;
  max-height: 120px;
  font-family: inherit;
}
.send-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.send-btn:hover { background: #1d4ed8; }

.msg-item { display: flex; gap: 10px; animation: msgIn 0.3s ease; }
.msg-item.self { flex-direction: row-reverse; }
.msg-item.self .msg-body { align-items: flex-end; }
.msg-item.self .msg-bubble { background: var(--accent); color: #fff; border-radius: var(--radius) var(--radius-sm) var(--radius) var(--radius); }
.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.msg-body { display: flex; flex-direction: column; max-width: 70%; }
.msg-author { font-size: 12px; color: var(--muted); margin-bottom: 2px; display: flex; align-items: center; gap: 4px; }
.msg-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  position: relative;
  animation: msgSlideIn 0.3s ease;
}
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-item.self .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}
.msg-bubble.received {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-bottom-left-radius: 4px;
}
.msg-bubble.ai {
  background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(37,99,235,0.08));
  border: 1px solid rgba(139,92,246,0.15);
  border-bottom-left-radius: 4px;
}
.msg-author {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.msg-time {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  text-align: right;
}
.msg-bubble.recalled { opacity: 0.5; font-style: italic; }
.msg-long-content {
  transition: max-height 0.3s ease;
}
.msg-expand-btn:hover {
  opacity: 0.8;
}
.msg-reactions { display: flex; gap: 4px; margin-top: 4px; }
.msg-reaction {
  font-size: 12px;
  padding: 2px 6px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  cursor: pointer;
}
.msg-quote-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.2s;
}
.msg-item:hover .msg-quote-btn { opacity: 1; }
.msg-quote-btn:hover { color: var(--accent); }
.msg-date-divider {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0;
}
.system-msg {
  display: flex;
  justify-content: center;
  margin: 8px 0;
}
.system-content {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg2);
  border: 1px solid var(--rule);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}
.mention-highlight {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 4px;
  cursor: pointer;
}

/* ===== 任务列表 ===== */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.task-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.task-item.done { opacity: 0.7; }
.task-item.overdue-task { border-left: 3px solid var(--danger); }
.task-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.task-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.task-checkbox.checked { background: var(--success); border-color: var(--success); color: #fff; }
.task-checkbox.disabled { border-color: var(--danger); cursor: not-allowed; }
.task-title { flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-priority { font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 600; flex-shrink: 0; }
.task-priority.high { background: #fee2e2; color: #dc2626; }
.task-priority.medium { background: #fef3c7; color: #d97706; }
.task-priority.low { background: #d1fae5; color: #059669; }
.task-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; align-items: center; }
.task-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.task-tag-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
}

/* ===== 看板视图 ===== */
.kanban-view { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-column {
  flex: 1;
  min-width: 240px;
  max-width: 100%;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.kanban-card {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: grab;
  transition: all 0.2s;
}
.kanban-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.kanban-card-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.kanban-card-meta { font-size: 11px; color: var(--muted); display: flex; gap: 8px; }
.kanban-card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

/* ===== 仪表盘 ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.dash-card {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px;
}
.dash-card.wide { grid-column: 1 / -1; }
.dash-card h3 { font-size: 15px; margin-bottom: 12px; }
.stat-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.stat-item:last-child { border-bottom: none; }

.export-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.export-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: var(--bg2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--rule); display: flex; gap: 8px; justify-content: flex-end; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; display: none; }
.form-hint.show { display: block; }
.form-hint.error { color: var(--danger); display: block; }

/* ===== 表单验证增强 ===== */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
  border-color: var(--danger);
  background: #FFF5F5;
}
.form-error-msg {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}
.form-group.error .form-error-msg {
  display: block;
}
.form-group.success input,
.form-group.success textarea {
  border-color: var(--success);
}

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty-state-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; max-width: 300px; line-height: 1.5; }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; max-width: 300px; line-height: 1.5; }
.empty-action { padding: 8px 20px; border-radius: var(--radius-sm); background: var(--accent); color: #fff; border: none; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.empty-action:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===== 标签 ===== */
.tag-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ===== 成员列表 ===== */
.member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.member-item:hover { background: var(--bg); }
.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.member-info { flex: 1; }
.member-name { font-size: 13px; font-weight: 600; }
.member-role { font-size: 11px; color: var(--muted); }
.sidebar-add-member-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.sidebar-add-member-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ===== 进度条 ===== */
.progress-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ===== 日历视图 ===== */
.calendar-view { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--rule); border-radius: var(--radius-sm); overflow: hidden; }
.calendar-weekday { padding: 8px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg2); }
.calendar-cell { min-height: 80px; padding: 4px; background: var(--bg2); position: relative; }
.calendar-cell.today { background: var(--accent-light); }
.calendar-day-num { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.cal-task-chip { font-size: 10px; padding: 2px 4px; border-radius: 4px; background: var(--accent-light); color: var(--accent); margin-bottom: 2px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 时间线视图 ===== */
.timeline-view { display: flex; flex-direction: column; gap: 8px; }
.timeline-row { display: flex; gap: 12px; padding: 12px; background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.timeline-header { min-width: 100px; }
.timeline-track { flex: 1; position: relative; }
.timeline-bar { height: 24px; background: var(--accent); border-radius: 4px; }

/* ===== 甘特图视图 ===== */
.gantt-view { overflow-x: auto; }
.gantt-container { min-width: 600px; }
.gantt-header { display: flex; border-bottom: 1px solid var(--rule); }
.gantt-sidebar { width: 200px; padding: 8px; font-weight: 600; }
.gantt-timeline { flex: 1; display: flex; }
.gantt-scale-cell { flex: 1; padding: 8px; text-align: center; font-size: 12px; border-left: 1px solid var(--rule); }
.gantt-row { display: flex; border-bottom: 1px solid var(--rule); }
.gantt-task-name { width: 200px; padding: 8px; font-size: 13px; }
.gantt-bar { height: 20px; background: var(--accent); border-radius: 4px; margin: 6px 0; }

/* ===== 右键菜单 ===== */
.context-menu {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  min-width: 160px;
  padding: 4px 0;
}
.context-menu-item {
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.context-menu-item:hover { background: var(--accent-light); }
.context-menu-divider { height: 1px; background: var(--rule); margin: 4px 8px; }

/* ===== 通知中心 ===== */
.notif-modal { position: fixed; top: 56px; right: 16px; width: 360px; max-height: 500px; background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 400; overflow-y: auto; }
/* ===== 通知中心增强 ===== */
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--rule); cursor: pointer; transition: background 0.15s; border-radius: var(--radius-sm); }
.notif-item:hover { background: var(--accent-light); }
.notif-item.unread { border-left: 3px solid var(--accent); padding-left: 9px; }
.notif-item.read { opacity: 0.7; }
.notif-group-header { font-size: 11px; font-weight: 600; color: var(--muted); padding: 8px 12px 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.notif-empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; }
.notif-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-text { font-size: 12px; color: var(--muted); }
.notif-time { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ===== Onboarding ===== */
.onboarding-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.onboarding-card { background: var(--bg2); border-radius: var(--radius); padding: 32px; max-width: 480px; width: 90%; text-align: center; box-shadow: var(--shadow-lg); }
.onboarding-icon { font-size: 48px; margin-bottom: 16px; }
.onboarding-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.onboarding-desc { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.onboarding-actions { display: flex; gap: 12px; justify-content: center; }

/* ===== 快捷指令 ===== */
.cmd-hint {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-top: 4px;
  box-shadow: var(--shadow);
}
.cmd-hint-title { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.cmd-hint-list { display: flex; flex-direction: column; gap: 2px; }
.cmd-item { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.cmd-item:hover { background: var(--accent-light); }
.cmd-name { font-weight: 600; color: var(--accent); min-width: 60px; }
.cmd-desc { color: var(--muted); font-size: 12px; }

/* ===== 命令面板 ===== */
.command-palette-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 3000; display: flex; align-items: flex-start; justify-content: center; padding-top: 15vh; }
.command-palette-box { background: var(--bg2); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 520px; max-height: 400px; overflow: hidden; }
.command-palette-input-wrap { padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.command-palette-input-wrap input { width: 100%; border: none; background: transparent; font-size: 16px; outline: none; color: var(--ink); }
.command-palette-list { max-height: 320px; overflow-y: auto; }
.command-palette-group { padding: 8px 0; }
.command-palette-icon { width: 24px; text-align: center; }

/* ===== 排行榜 ===== */
.leaderboard { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; }
.leader-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-sm); transition: all 0.2s; }
.leader-item:hover { background: var(--bg); }
.leader-rank { font-size: 18px; font-weight: 700; color: var(--accent); width: 28px; text-align: center; }
.leader-name { flex: 1; font-weight: 600; }
.leader-score { font-weight: 700; color: var(--accent); }
.leader-bar-wrap { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.leader-bar { height: 100%; background: var(--accent); border-radius: 4px; }

/* ===== 搜索 ===== */
.search-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 600; display: flex; align-items: flex-start; justify-content: center; padding-top: 10vh; }
.search-input-wrap { background: var(--bg2); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 560px; max-height: 70vh; overflow: hidden; }
.search-input { width: 100%; padding: 16px 20px; border: none; border-bottom: 1px solid var(--rule); font-size: 16px; outline: none; background: transparent; color: var(--ink); }
.search-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--rule); }
.search-tab { padding: 4px 10px; border-radius: 4px; border: none; background: transparent; cursor: pointer; font-size: 12px; color: var(--muted); }
.search-tab.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.search-results { max-height: 400px; overflow-y: auto; padding: 8px; }
.search-result-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
.search-result-item:hover { background: var(--bg); }
.search-result-icon { font-size: 20px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--accent-light); border-radius: 8px; }
.search-result-title { font-weight: 600; font-size: 13px; }
.search-result-subtitle { font-size: 12px; color: var(--muted); }

/* ===== 隐藏/显示 ===== */
.hidden { display: none !important; }

/* ===== 动画 ===== */
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== 任务完成撒花动画 ===== */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  border-radius: 2px;
  z-index: 9999;
  pointer-events: none;
  animation: confetti-fall 2.5s ease-out forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.checkmark-pop {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 9998;
  pointer-events: none;
  animation: checkmark-pop-in 0.6s ease-out forwards;
}
@keyframes checkmark-pop-in {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ===== 任务历史记录 ===== */
.task-history {
  margin-top: 16px;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}
.history-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.history-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: all 0.2s;
}
.history-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.history-time {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.history-action {
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}
.history-detail {
  color: var(--ink);
  line-height: 1.5;
  word-break: break-word;
}
.history-detail .change-field {
  color: var(--muted);
  font-size: 11px;
  display: inline-block;
  margin-right: 6px;
}
.history-detail .change-arrow {
  color: var(--accent);
  margin: 0 4px;
}

/* ===== 逾期横幅增强 ===== */
.overdue-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #FEF2F2;
  border-bottom: 1px solid #FECACA;
  animation: slideDown 0.3s ease;
}
.overdue-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.overdue-action {
  padding: 2px 8px;
  border: 1px solid #F87171;
  border-radius: 4px;
  background: #fff;
  color: #DC2626;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.overdue-action:hover {
  background: #FEE2E2;
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== 任务详情折叠面板 ===== */
.detail-section {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
  transition: background 0.2s;
}
.detail-section-header:hover {
  background: var(--accent-light);
}
.detail-section-arrow {
  transition: transform 0.2s;
  font-size: 11px;
  color: var(--muted);
}
.detail-section.collapsed .detail-section-arrow {
  transform: rotate(-90deg);
}
.detail-section-body {
  padding: 12px;
  transition: max-height 0.3s ease;
}
.detail-section.collapsed .detail-section-body {
  display: none;
}
.detail-section-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  margin-left: 6px;
}

/* ===== 侧边栏分组 ===== */
.sidebar-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--rule);
  user-select: none;
  transition: color 0.2s;
}
.sidebar-group-toggle:hover {
  color: var(--accent);
}
.sidebar-group-toggle .toggle-arrow {
  transition: transform 0.2s;
  font-size: 10px;
}
.sidebar-group.collapsed .toggle-arrow {
  transform: rotate(-90deg);
}
.sidebar-group-content {
  padding: 4px 0;
  transition: max-height 0.3s ease;
}
.sidebar-group.collapsed .sidebar-group-content {
  display: none;
}
@media (max-width: 768px) {
  .sidebar-group-toggle {
    display: flex;
  }
}
@media (min-width: 769px) {
  .sidebar-group-toggle {
    display: none;
  }
  .sidebar-group-content {
    display: block !important;
  }
}

/* ===== 过渡动画 ===== */
.fade-in { animation: fadeIn 0.25s ease; }
.slide-up { animation: slideUp 0.3s ease; }
.slide-down { animation: slideDown 0.3s ease; }
.scale-in { animation: scaleIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* 任务卡片过渡 */
.task-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.task-card:hover {
  transform: translateY(-1px);
}

/* 面板切换过渡 */
.panel-page {
  animation: fadeIn 0.2s ease;
}

/* Toast 动画增强 */
.toast {
  animation: slideDown 0.3s ease;
}
.toast.hiding {
  animation: fadeOut 0.3s ease forwards;
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-12px); }
}

/* 筛选栏/标签云过渡 */
.filter-btn, .tag-filter-btn {
  transition: all 0.15s ease;
}
.filter-btn:hover, .tag-filter-btn:hover {
  transform: translateY(-1px);
}

/* 批量选择 checkbox 动画 */
.task-checkbox {
  transition: all 0.15s ease;
}
.task-checkbox:hover {
  transform: scale(1.1);
}

/* 侧边栏项悬停 */
.sidebar-item, .nav-tab {
  transition: all 0.15s ease;
}

/* 列表项添加/移除动画 */
.task-card.entering {
  animation: slideUp 0.3s ease;
}
.task-card.removing {
  animation: fadeOut 0.25s ease forwards;
}

/* 模态框动画 */
.modal {
  animation: scaleIn 0.2s ease;
}
.modal-overlay {
  animation: fadeIn 0.2s ease;
}
.modal.closing, .modal-overlay.closing {
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.15s ease;
}

/* 看板列卡片拖拽反馈 */
.task-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}
.task-card.drag-over {
  border-top: 2px solid var(--accent);
}

/* ===== 图片预览 Lightbox ===== */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  cursor: zoom-out;
}
.img-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  cursor: default;
  animation: scaleIn 0.3s ease;
}
.img-lightbox .close-hint {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 13px;
  opacity: 0.7;
  background: rgba(0,0,0,0.5);
  padding: 6px 12px;
  border-radius: 20px;
}

/* ===== 通用工具类（可选） ===== */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: 4px; }
.gap-md { gap: 8px; }
.gap-lg { gap: 12px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.cursor-pointer { cursor: pointer; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.border-bottom { border-bottom: 1px solid var(--rule); }
.mt-sm { margin-top: 4px; }
.mb-sm { margin-bottom: 4px; }
.p-sm { padding: 4px; }
.p-md { padding: 8px; }
.rounded { border-radius: var(--radius-sm); }
.bg2 { background: var(--bg2); }
.hidden-important { display: none !important; }

/* ===== 组件专用类（替代高频内联样式） ===== */
.impact-badge-high { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #fef3c7; color: #d97706; font-weight: 600; }
.impact-badge-low { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #d1fae5; color: #059669; font-weight: 600; }
.status-badge { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--bg2); color: var(--muted); cursor: pointer; border: 1px solid var(--rule); user-select: none; }
.countdown-badge { font-size: 11px; font-weight: 600; }
.blocked-hint { color: var(--danger); font-size: 11px; }
.dep-link { font-size: 11px; cursor: pointer; color: var(--accent); }
.guide-hint { color: var(--accent); }
.comment-badge { position: absolute; top: 8px; right: 8px; background: var(--accent); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 600; }

/* ===== 帮助浮动按钮 ===== */
.help-fab {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--rule);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  font-size: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.help-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* ===== 消息输入区域 ===== */
.msg-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-top: 1px solid var(--rule);
}
.msg-input-wrap input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.msg-input-wrap input:focus {
  border-color: var(--accent);
}
.input-toolbar {
  display: flex;
  gap: 4px;
  align-items: center;
}
.input-toolbar button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s;
  color: var(--text);
}
.input-toolbar button:hover {
  background: var(--accent-light);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .workspace-layout { flex-direction: column; }
  .sidebar-left, .sidebar-right { width: 100%; height: auto; max-height: 40vh; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .scenarios-grid { grid-template-columns: 1fr; }
  .hero-content h1 { font-size: 28px; }
  .hero-stats { gap: 20px; }
  .modal-content { width: 95%; margin: 16px; }
  /* 看板：保留横向滚动，配合 scroll-snap */
  .kanban-view {
    flex-direction: row !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    gap: 12px;
  }
  .kanban-column {
    min-width: 280px;
    max-width: 280px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }
  /* 横向滚动指示器 */
  .kanban-view::after {
    content: '← 滑动查看更多 →';
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 8px;
  }
  .task-filter-row { flex-direction: column; gap: 8px; }

    /* 移动端筛选栏优化 */
    .filter-row {
      flex-wrap: wrap;
      gap: 6px;
    }
    .filter-row .filter-btn {
      font-size: 11px;
      padding: 3px 8px;
    }
    
    /* 移动端任务卡片紧凑模式 */
    .task-card {
      padding: 10px !important;
    }
    .task-card .task-title {
      font-size: 13px;
    }
    
    /* 移动端仪表盘网格 */
    .dash-grid {
      grid-template-columns: 1fr 1fr !important;
      gap: 8px !important;
    }
    .dash-card {
      padding: 10px !important;
    }
    .dash-card h3 {
      font-size: 12px;
    }
    
    /* 移动端颜色筛选按钮缩小 */
    .color-filter-btn {
      width: 20px;
      height: 20px;
    }

    /* 移动端触摸目标最小44px */
    .icon-btn {
      min-width: 44px !important;
      min-height: 44px !important;
      padding: 8px !important;
    }
    .btn-sm, .btn-xs {
      min-height: 36px;
      padding: 6px 12px !important;
      font-size: 13px;
    }
    .input-toolbar button {
      min-width: 40px;
      min-height: 40px;
      padding: 6px !important;
    }
    .msg-action-btn {
      min-width: 36px;
      min-height: 36px;
      padding: 4px 8px;
      font-size: 12px;
    }
    .color-filter-btn {
      width: 32px !important;
      height: 32px !important;
    }
    .nav-btn, .filter-btn, .quick-btn {
      min-height: 40px;
      padding: 8px 12px;
    }
    
    /* 移动端模态框全屏 */
    .modal {
      max-width: 100vw !important;
      max-height: 100vh !important;
      border-radius: 0 !important;
    }
    .modal-content {
      max-height: 100vh !important;
      border-radius: 0 !important;
      overflow-y: auto !important;
      -webkit-overflow-scrolling: touch;
      max-height: 85vh !important;
      padding: 20px 16px !important;
    }
    .modal-overlay {
      padding: 10px;
    }
    /* 模态框底部操作栏固定 */
    .modal-actions {
      position: sticky;
      bottom: 0;
      background: var(--card);
      padding: 16px 0 0;
      border-top: 1px solid var(--border);
      margin-top: 16px;
    }
    
    /* 移动端 toast 居中 */
    .toast {
      left: 50% !important;
      transform: translateX(-50%);
      right: auto !important;
      bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    }
    
    /* 移动端底部导航安全区域 */
    .mobile-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      display: flex;
      justify-content: space-around;
      align-items: center;
      background: var(--bg2);
      border-top: 1px solid var(--rule);
      padding-bottom: env(safe-area-inset-bottom);
      z-index: 500;
      height: calc(56px + env(safe-area-inset-bottom));
    }
    .mobile-nav-item {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      padding: 6px 0;
      border: none;
      background: transparent;
      color: var(--muted);
      font-size: 10px;
      cursor: pointer;
      transition: color 0.15s;
    }
    .mobile-nav-item.active { color: var(--accent); }
    .mobile-nav-icon { font-size: 20px; }

    /* 表单元素移动端放大防iOS缩放 */
    .form-group input,
    .form-group select,
    .form-group textarea {
      font-size: 16px !important;
      padding: 12px 14px !important;
      min-height: 48px;
    }

    /* 确保内容不被底部导航遮挡 */
    .workspace-content,
    main,
    .view.active {
      padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .mobile-bottom-nav {
      padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* 侧边栏移动端过渡动画 v=88 */
    .sidebar-left,
    .sidebar-right {
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      -webkit-overflow-scrolling: touch;
    }
    .sidebar-left.mobile-open {
      transform: translateX(0) !important;
    }
    /* 侧边栏遮罩过渡 */
    .mobile-overlay {
      transition: opacity 0.3s ease;
      opacity: 1;
      pointer-events: auto;
    }
    .mobile-overlay.hidden {
      opacity: 0;
      pointer-events: none;
    }

    /* 消息操作按钮收折 - 移动端 v=88 */
    .msg-quote-btn {
      display: none;
    }
    .msg-item:hover .msg-quote-btn,
    .msg-actions.show .msg-quote-btn {
      display: inline;
    }
    .msg-more-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border: none;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      border-radius: 50%;
      font-size: 16px;
    }
    .msg-more-btn:hover {
      background: var(--bg-secondary);
    }
}

/* ===== AI 设置面板 ===== */
.ai-settings {
  padding: 16px;
}
.ai-settings h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 12px;
}
.ai-status.connected {
  background: #d1fae5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.ai-status.mock {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}
.ai-status.disconnected {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.ai-form-group {
  margin-bottom: 12px;
}
.ai-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.ai-form-group input,
.ai-form-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--text);
  font-size: 13px;
}
.ai-form-group input:focus,
.ai-form-group select:focus {
  border-color: var(--accent);
  outline: none;
}
.ai-form-group .hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.ai-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.ai-provider-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.ai-provider-card {
  padding: 10px;
  border: 2px solid var(--rule);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
}
.ai-provider-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.ai-provider-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.ai-provider-card .provider-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

/* ===== 演示模式 ===== */
.demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(90deg, #DC2626, #EF4444);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(220,38,38,0.3);
  animation: demoBannerSlide 0.4s ease;
}
.demo-banner button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.demo-banner button:hover {
  background: rgba(255,255,255,0.35);
}
@keyframes demoBannerSlide {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* 演示入口卡片 */
.start-card.demo {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 2px solid #F59E0B;
  position: relative;
  overflow: hidden;
}
.start-card.demo::before {
  content: '▶';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 40px;
  height: 40px;
  background: #F59E0B;
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(245,158,11,0.4);
}
.start-card.demo .start-icon {
  font-size: 32px;
}
.start-card.demo h3 {
  color: #92400E;
}
.start-card.demo p {
  color: #A16207;
}
[data-theme="dark"] .start-card.demo {
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.08));
  border-color: #F59E0B;
}
[data-theme="dark"] .start-card.demo h3 {
  color: #FCD34D;
}
[data-theme="dark"] .start-card.demo p {
  color: #FDE68A;
}

/* ===== v87: 命令面板增强样式 ===== */
.command-palette {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 560px;
    max-width: 90vw;
    background: var(--card-bg, var(--bg2));
    border: 1px solid var(--border, var(--rule));
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-xl, 0 20px 60px rgba(0,0,0,0.2));
    z-index: 2000;
    overflow: hidden;
}
.command-palette input {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-bottom: 1px solid var(--border, var(--rule));
    background: transparent;
    font-size: 16px;
    color: var(--text, var(--ink));
    outline: none;
}
.command-palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border, var(--rule));
}
.command-palette-item:hover,
.command-palette-item.selected {
    background: var(--bg-secondary, var(--bg));
}
.command-palette-item .cmd-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
}
.command-palette-item .cmd-label {
    flex: 1;
    font-size: 14px;
    color: var(--text, var(--ink));
}
.command-palette-item .cmd-key {
    font-size: 12px;
    color: var(--text-muted, var(--muted));
    background: var(--bg-secondary, var(--bg));
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border, var(--rule));
}

/* 确保命令面板列表区域可滚动 */
.command-palette-list {
    max-height: 320px;
    overflow-y: auto;
}

/* 命令面板遮罩层层级调整 */
#commandPalette .command-palette-overlay {
    z-index: 1999;
}
#commandPalette .command-palette-box {
    position: relative;
    z-index: 2001;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-height: none;
    overflow: visible;
}

/* ===== v=89 功能增强样式 ===== */

/* 任务列表增量加载 - 加载更多栏 */
.load-more-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--border, var(--rule));
}
.load-more-bar button {
    padding: 6px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.15s;
}
.load-more-bar button:hover {
    opacity: 0.85;
}

/* 任务列表拖拽排序视觉反馈 */
.task-item {
    cursor: grab;
    transition: opacity 0.2s, transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.task-item:active {
    cursor: grabbing;
}
.task-item.dragging {
    opacity: 0.4;
    transform: scale(0.98);
}
.task-item.drag-over {
    border-top: 3px solid var(--accent);
    margin-top: -3px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

/* 通知分类标签 */
.notif-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 6px;
    line-height: 16px;
}

/* 通知分类筛选按钮 */
.notif-cat-btn {
    font-size: 14px !important;
    padding: 2px 6px !important;
    min-width: 28px;
    text-align: center;
}

/* ===== 主题选择器 v=89 ===== */
.theme-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 16px 12px;
}
.theme-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--rule);
    cursor: pointer;
    padding: 3px;
    background: var(--bg2);
    transition: all 0.2s ease;
    position: relative;
}
.theme-swatch span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
.theme-swatch:hover {
    transform: scale(1.15);
    border-color: var(--accent);
}
.theme-swatch.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}
.theme-swatch.active::after {
    content: '\2713';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* ===== v=90: 自动化规则面板 ===== */
.automation-panel {
    padding: 0 0 8px;
}
.automation-rule {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary, var(--bg));
    border-radius: var(--radius-sm, 8px);
    margin-bottom: 8px;
    transition: opacity var(--ease-fast, 0.15s);
    border: 1px solid var(--border, var(--rule));
}
.automation-rule.disabled {
    opacity: 0.5;
}
.automation-rule-icon {
    font-size: 20px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}
.automation-rule-info {
    flex: 1;
    min-width: 0;
}
.automation-rule-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.automation-rule-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 自动化规则 Toggle 开关 */
.automation-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
}
.automation-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--rule);
    border-radius: 20px;
    transition: all 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.automation-toggle input:checked + .toggle-slider {
    background: var(--accent);
}
.automation-toggle input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

/* ===== v=90: @提及标签样式 ===== */
.mention-tag {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary, var(--accent));
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.mention-tag:hover {
    background: rgba(37, 99, 235, 0.2);
}

/* @提及下拉选择器 */
.mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--card, var(--bg2));
    border: 1px solid var(--border, var(--rule));
    border-radius: var(--radius-md, var(--radius-sm));
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    min-width: 180px;
    animation: fadeIn 0.15s ease;
}
.mention-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background var(--ease-fast, 0.15s);
}
.mention-item:hover {
    background: var(--bg-secondary, var(--bg));
}
.mention-item-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    flex-shrink: 0;
}

/* ===== v=90: 快捷回复栏 ===== */
.quick-replies-bar {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid var(--border, var(--rule));
    background: var(--bg-secondary, var(--bg));
}
.quick-replies-bar.show {
    display: flex;
}
.quick-reply-btn {
    padding: 4px 12px;
    background: var(--card, var(--bg2));
    border: 1px solid var(--border, var(--rule));
    border-radius: 16px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: all var(--ease-fast, 0.15s);
}
.quick-reply-btn:hover {
    background: var(--primary, var(--accent));
    color: #fff;
    border-color: var(--primary, var(--accent));
}

/* ===== v=90: 工作负载热力图面板 ===== */
#workloadPanel {
    background: var(--card, var(--bg2));
    border: 1px solid var(--border, var(--rule));
    border-radius: var(--radius, 12px);
    padding: 20px;
    margin-top: 16px;
}
#workloadPanel .panel-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text, var(--ink));
}
#workloadPanel .chart-box {
    min-height: 250px;
    position: relative;
}

/* ===== v=90: PWA 自定义安装横幅 ===== */
.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary, var(--accent)), var(--accent2, #059669));
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 9999;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideDown 0.4s ease-out;
}
.install-banner-actions {
    display: flex;
    gap: 8px;
}
.install-btn-primary {
    padding: 6px 16px;
    background: #fff;
    color: var(--primary, var(--accent));
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.15s;
}
.install-btn-primary:hover {
    opacity: 0.85;
}
.install-btn-dismiss {
    padding: 6px 12px;
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}
.install-btn-dismiss:hover {
    background: rgba(255,255,255,0.1);
}

/* ===== v=90: 图片懒加载 ===== */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}
img.loaded {
    opacity: 1;
}

/* ===== v=91: 节点网络拓扑视图 ===== */
#topologyView {
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.topology-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.topology-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.topology-actions {
    display: flex;
    gap: 8px;
}
.topology-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}
.topology-stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    text-align: center;
    min-width: 100px;
}
.topology-stat .num { font-size: 24px; font-weight: 800; color: var(--primary); }
.topology-stat .label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.topology-canvas-wrap {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    min-height: 400px;
}
.topology-svg {
    width: 100%;
    height: 100%;
}
/* 拓扑节点 */
.topo-node {
    cursor: pointer;
    transition: transform 0.2s;
}
.topo-node:hover { transform: scale(1.05); }
.topo-node circle {
    stroke-width: 3;
    transition: stroke 0.3s, fill 0.3s;
}
.topo-node:active circle { stroke-width: 4; }
.topo-node .drag-hint { font-size: 9px; fill: var(--text-muted); opacity: 0; transition: opacity 0.2s; text-anchor: middle; }
.topo-node:hover .drag-hint { opacity: 1; }
.topo-node rect {
    rx: 12; ry: 12;
    stroke-width: 2;
    transition: all 0.3s;
}
.topo-node text {
    font-size: 13px;
    font-weight: 600;
    fill: var(--text);
    text-anchor: middle;
    pointer-events: none;
}
.topo-node .node-capacity {
    font-size: 11px;
    fill: var(--text-muted);
}
.topo-link {
    stroke-width: 2;
    fill: none;
    transition: stroke-width 0.2s;
}
.topo-link:hover { stroke-width: 4; }
.topo-link-label {
    font-size: 11px;
    fill: var(--text-muted);
    text-anchor: middle;
}
.node-detail-panel {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 280px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-xl);
    z-index: 10;
}
.node-detail-panel.hidden { display: none; }
.node-detail-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}
.node-detail-capacity {
    margin-bottom: 12px;
}
.node-detail-tasks {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* ===== v=91: 跨节点协作看板 ===== */
.cross-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
}
.cross-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.cross-kanban {
    padding: 0 24px 24px;
    height: calc(100% - 60px);
    overflow: hidden;
}
.cross-kanban-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    height: 100%;
    overflow-x: auto;
}
.cross-kanban-col {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 12px;
    min-height: 300px;
}
.cross-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    background: var(--card);
}
.cross-col-title { font-size: 14px; font-weight: 600; }
.cross-col-count { font-size: 12px; color: var(--text-muted); }
.cross-task-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--ease-fast);
}
.cross-task-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.cross-task-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cross-task-nodes { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.cross-task-progress { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.cross-task-progress .progress-bar { flex: 1; }
.cross-task-segments { display: flex; gap: 4px; }
.segment-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* ===== v=91: 对话框中的类型选择器 ===== */
.type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.type-btn {
    padding: 8px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--ease-fast);
}
.type-btn:hover {
    border-color: var(--primary);
}
.type-btn.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

/* ===== v=91: 跨节点任务节点选择 ===== */
.node-sequence {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.node-check {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--ease-fast);
}
.node-check:has(input:checked) {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .cross-kanban-grid {
        grid-template-columns: repeat(4, 260px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== v=91: 资源调度面板 ===== */
.scheduling-header h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.scheduling-suggestions { margin-bottom: 20px; }
.suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--card, var(--bg2));
    border: 1px solid var(--border, var(--rule));
    border-radius: var(--radius-md, var(--radius-sm));
    margin-bottom: 8px;
    font-size: 14px;
}
.suggestion-item.urgent { border-left: 4px solid #ef4444; background: rgba(239,68,68,0.05); }
.suggestion-item.warning { border-left: 4px solid #f59e0b; background: rgba(245,158,11,0.05); }
.suggestion-item.success { border-left: 4px solid #10b981; background: rgba(16,185,129,0.05); }
.suggestion-icon { font-size: 18px; }
.scheduling-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.scheduling-card { background: var(--card, var(--bg2)); border: 1px solid var(--border, var(--rule)); border-radius: var(--radius-lg, var(--radius)); padding: 20px; }
.scheduling-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.load-bar-item { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.load-bar-label { width: 80px; font-size: 13px; font-weight: 500; flex-shrink: 0; }
.load-bar-track { flex: 1; height: 12px; background: var(--bg-secondary, var(--bg)); border-radius: 6px; overflow: hidden; }
.load-bar-fill { height: 100%; border-radius: 6px; transition: width 0.5s ease; }
.load-bar-value { width: 40px; font-size: 12px; color: var(--text-muted, var(--muted)); text-align: right; }
.conflict-item { padding: 12px; border: 1px solid var(--border, var(--rule)); border-radius: var(--radius-md, var(--radius-sm)); margin-bottom: 8px; }
.conflict-item.critical { border-left: 4px solid #ef4444; }
.conflict-item.warning { border-left: 4px solid #f59e0b; }
.conflict-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.conflict-detail { font-size: 12px; color: var(--text-muted, var(--muted)); }
.conflict-overflow { font-size: 12px; color: #ef4444; margin-top: 4px; font-weight: 600; }

/* ===== 成员在线状态指示器 v=92 ===== */
.member-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    flex-shrink: 0;
}
.member-status-dot.online { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.member-status-dot.away { background: #f59e0b; box-shadow: 0 0 4px rgba(245,158,11,0.3); }
.member-status-dot.offline { background: #d1d5db; }

/* 成员活动气泡 */
.member-activity {
    font-size: 11px;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* 协作活动时间线 */
.collab-timeline {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}
.collab-timeline-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}
.collab-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}
.collab-timeline-dot.task { background: var(--primary); }
.collab-timeline-dot.message { background: #10b981; }
.collab-timeline-dot.node { background: #8b5cf6; }
.collab-timeline-dot.status { background: #f59e0b; }
.collab-timeline-text { flex: 1; color: var(--text); line-height: 1.4; }
.collab-timeline-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* ===== What-if 模拟器 v=92 ===== */
.simulator-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-top: 16px; }
.sim-form { margin-bottom: 16px; }
.form-range { width: 100%; accent-color: var(--primary); cursor: pointer; }
.sim-range-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.sim-result { margin-top: 16px; }
.sim-result-card { background: var(--bg-secondary); border-radius: var(--radius-md); padding: 16px; }
.sim-result-header { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.sim-result-rows { margin-bottom: 16px; }
.sim-result-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sim-result-label { font-size: 13px; color: var(--text-muted); }
.sim-result-value { font-size: 13px; font-weight: 600; }
.sim-result-bar { position: relative; height: 12px; background: var(--border); border-radius: 6px; margin: 12px 0; overflow: hidden; }
.sim-result-bar-fill { height: 100%; border-radius: 6px; transition: width 0.3s ease; opacity: 0.3; }
.sim-result-bar-current { position: absolute; top: -3px; width: 3px; height: 18px; background: #fff; border-radius: 2px; transition: left 0.3s ease; }
.sim-result-suggestion { font-size: 13px; color: var(--text-muted); padding: 8px; background: rgba(59,130,246,0.05); border-radius: var(--radius-sm); }

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

/* ===== v=92: 组织架构视图 ===== */
#orgView { padding: 24px; display: flex; flex-direction: column; height: 100%; }
.org-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.org-header h2 { font-size: 20px; font-weight: 700; }
.org-actions { display: flex; gap: 8px; }
.org-summary { display: flex; gap: 16px; margin-bottom: 20px; }
.org-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; flex: 1; overflow: hidden; }
.org-tree-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; overflow-y: auto; }
.org-detail-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; overflow-y: auto; }
.dept-tree-item { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--ease-fast); font-size: 14px; }
.dept-tree-item:hover { background: var(--bg-secondary); }
.dept-toggle { width: 16px; color: var(--text-muted); font-size: 10px; }
.dept-icon { font-size: 16px; }
.dept-name { flex: 1; font-weight: 500; }
.dept-count { font-size: 12px; color: var(--text-muted); background: var(--bg-secondary); padding: 2px 8px; border-radius: 10px; }
.org-detail-header h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.org-detail-section { margin-bottom: 12px; }
.org-detail-label { font-size: 12px; color: var(--text-muted); }
.org-detail-value { font-size: 16px; font-weight: 600; margin-top: 2px; }
.org-node-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-secondary); border-radius: var(--radius-sm); margin-bottom: 6px; font-size: 13px; }
.org-node-icon { font-size: 16px; }
.org-node-load { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.org-detail-actions { margin-top: 16px; display: flex; gap: 8px; }
@media (max-width: 768px) { .org-layout { grid-template-columns: 1fr; } }

/* ===== v=92: 协作网络概况统计面板 ===== */
.collab-stats-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.collab-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.collab-stat-card { text-align: center; padding: 12px; background: var(--bg-secondary); border-radius: var(--radius-md); }
.collab-stat-num { font-size: 28px; font-weight: 800; color: var(--primary); }
.collab-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.collab-charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.collab-chart-card { background: var(--bg-secondary); border-radius: var(--radius-md); padding: 16px; }
.collab-chart-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.collab-bar-item { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.collab-bar-label { width: 60px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.collab-bar-track { flex: 1; height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.collab-bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; min-width: 4px; }
.collab-bar-value { width: 24px; font-size: 12px; color: var(--text); font-weight: 600; text-align: right; }
.bottleneck-alert { margin-top: 16px; border: 1px solid var(--danger); border-radius: var(--radius-md); padding: 12px 16px; background: rgba(239,68,68,0.05); }
.bottleneck-alert-header { font-size: 14px; font-weight: 600; color: var(--danger); margin-bottom: 8px; }
.bottleneck-item { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 13px; border-bottom: 1px solid rgba(239,68,68,0.1); }
.bn-name { font-weight: 600; min-width: 80px; }
.bn-load { color: var(--danger); font-weight: 600; }
.bn-suggest { color: var(--text-muted); font-size: 12px; margin-left: auto; }
@media (max-width: 768px) { .collab-stats-grid { grid-template-columns: repeat(2, 1fr); } .collab-charts-row { grid-template-columns: 1fr; } }

/* ==================== v93 移动端筛选栏优化 ==================== */
@media (max-width: 768px) {
  .filter-bar {
    position: relative;
  }
  
  .filter-bar:not(.filter-expanded) .filter-controls {
    display: none;
  }
  
  .filter-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s;
  }
  
  .filter-toggle-btn:active {
    transform: scale(0.98);
  }
  
  .filter-bar.filter-expanded .filter-toggle-btn .filter-arrow {
    transform: rotate(180deg);
  }
  
  .filter-bar.filter-expanded .filter-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideDown 0.2s ease;
  }
  
  .filter-bar.filter-expanded .filter-controls .form-group,
  .filter-bar.filter-expanded .filter-controls .filter-row {
    width: 100%;
  }
  
  /* 任务详情模态分段 */
  .modal-content.has-tabs {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
  }
  
  .modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
  }
  
  .modal-tab {
    padding: 10px 16px;
    white-space: nowrap;
    font-size: 13px;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .modal-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
  }
  
  .modal-tab-content {
    overflow-y: auto;
    flex: 1;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
  }
  
  .modal-tab-panel {
    display: none;
  }
  
  .modal-tab-panel.active {
    display: block;
  }
  
  /* 看板滚动指示器 */
  .kanban-scroll-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--card-bg);
    border-radius: 20px;
    margin-top: 8px;
  }
  
  .kanban-scroll-indicator .scroll-progress {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
  }
  
  .kanban-scroll-indicator .scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.1s;
  }
  
  .kanban-nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
  }
  
  .kanban-nav-btn:active {
    background: var(--primary);
    color: #fff;
  }
  
  /* 权限相关样式 */
  .permission-denied {
    opacity: 0.4;
    pointer-events: none;
    position: relative;
  }
  
  .permission-denied::after {
    content: '\1F512';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 12px;
  }
  
  .role-switcher {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface);
    border-radius: 8px;
  }
  
  .role-switcher button {
    padding: 4px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .role-switcher button.active {
    background: var(--primary);
    color: #fff;
  }
  
  /* 审计日志视图样式 */
  .audit-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
  }
  
  .audit-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 16px 0;
  }
  
  .audit-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
  }
  
  .audit-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
  }
  
  .audit-stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
  }
  
  .audit-log-list {
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .audit-log-entry {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
  }
  
  .audit-log-entry:hover {
    background: var(--surface);
  }
  
  .audit-log-entry.warning {
    border-left: 3px solid #f59e0b;
  }
  
  .audit-log-entry.critical {
    border-left: 3px solid #ef4444;
  }
  
  .audit-log-entry.info {
    border-left: 3px solid #3b82f6;
  }
  
  .audit-log-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .audit-log-action {
    font-weight: 600;
    font-size: 14px;
    font-family: monospace;
    color: var(--text);
  }
  
  .audit-log-level {
    font-size: 11px;
    padding: 2px 6px;
  }
  
  .badge-info { background: #dbeafe; color: #1d4ed8; }
  .badge-warning { background: #fef3c7; color: #92400e; }
  .badge-critical { background: #fee2e2; color: #991b1b; }
  
  .audit-log-time {
    margin-left: auto;
    font-size: 12px;
    color: var(--muted);
  }
  
  .audit-log-details {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
  }
  
  /* 在线指示器样式 */
  .online-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
  }
  
  .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s infinite;
  }
  
  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
  }
  
  .editing-indicator {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 11px;
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
    padding: 2px 8px;
    border-radius: 0 0 0 6px;
    z-index: 5;
    white-space: nowrap;
  }
  
  /* 桌面端隐藏筛选折叠按钮 */
}
@media (min-width: 769px) {
  .filter-toggle-btn {
    display: none !important;
  }
  .filter-controls {
    display: flex !important;
  }
}

/* ==================== v94 Agent工作台样式 ==================== */

.agent-container {
  padding: var(--spacer-16, 16px);
  max-width: 1200px;
  margin: 0 auto;
}

.agent-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.agent-stat-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.1));
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.agent-stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary, #4B3FE3);
  font-family: 'Inter', system-ui, sans-serif;
}

.agent-stat-label {
  font-size: 13px;
  color: var(--muted, #64748b);
  margin-top: 4px;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.agent-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.1));
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
  position: relative;
}

.agent-card:hover {
  border-color: var(--primary, #4B3FE3);
  box-shadow: 0 4px 12px rgba(75, 63, 227, 0.1);
}

.agent-card.state-working {
  border-left: 3px solid #27D2BF;
}

.agent-card.state-idle {
  border-left: 3px solid #94A3B8;
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.agent-avatar {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface, #f8fafc);
  border-radius: 10px;
}

.agent-info {
  flex: 1;
}

.agent-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text, #1e293b);
}

.agent-role {
  font-size: 12px;
  color: var(--muted, #64748b);
  margin-top: 2px;
}

.agent-state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-state-dot.idle {
  background: #94A3B8;
}

.agent-state-dot.working {
  background: #27D2BF;
  animation: pulse 2s infinite;
}

.agent-state-dot.waiting {
  background: #F59E0B;
}

.agent-state-dot.error {
  background: #EF4444;
}

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

.agent-desc {
  font-size: 13px;
  color: var(--muted, #64748b);
  margin-bottom: 10px;
}

.agent-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.agent-cap-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--surface, #f1f5f9);
  border-radius: 4px;
  color: var(--muted, #64748b);
}

.agent-goal-progress {
  margin: 12px 0;
  padding: 10px;
  background: var(--surface, #f8fafc);
  border-radius: 8px;
}

.agent-goal-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #1e293b);
  margin-bottom: 8px;
}

.agent-progress-bar {
  height: 6px;
  background: var(--border, rgba(0,0,0,.1));
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.agent-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4B3FE3, #27D2BF);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.agent-progress-text {
  font-size: 11px;
  color: var(--muted, #64748b);
  text-align: right;
}

.agent-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* 洞察卡片 */
.insight-card {
  padding: 12px 16px;
  border: 1px solid var(--border, rgba(0,0,0,.1));
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--card-bg, #fff);
  transition: all 0.2s;
}

.insight-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.insight-card.insight-high {
  border-left: 3px solid #EF4444;
}

.insight-card.insight-medium {
  border-left: 3px solid #F59E0B;
}

.insight-card.insight-low {
  border-left: 3px solid #3B82F6;
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.insight-severity {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.insight-severity.high { background: #FEE2E2; color: #DC2626; }
.insight-severity.medium { background: #FEF3C7; color: #D97706; }
.insight-severity.low { background: #DBEAFE; color: #2563EB; }

.insight-category {
  font-size: 11px;
  color: var(--muted, #64748b);
}

.insight-time {
  font-size: 11px;
  color: var(--muted, #64748b);
  margin-left: auto;
}

.insight-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #1e293b);
}

.insight-detail {
  font-size: 13px;
  color: var(--muted, #64748b);
  margin-top: 4px;
}

.insight-action {
  font-size: 12px;
  color: var(--primary, #4B3FE3);
  margin-top: 6px;
  font-style: italic;
}

/* 目标列表 */
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goal-item {
  padding: 14px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.1));
  border-radius: 10px;
}

.goal-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.goal-agent {
  font-size: 12px;
  color: var(--muted, #64748b);
  white-space: nowrap;
}

.goal-title {
  font-weight: 500;
  font-size: 14px;
  color: var(--text, #1e293b);
}

.goal-progress-bar {
  height: 4px;
  background: var(--border, rgba(0,0,0,.1));
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.goal-progress-fill {
  height: 100%;
  background: var(--primary, #4B3FE3);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.goal-subtasks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.subtask-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface, #f1f5f9);
  color: var(--muted, #64748b);
}

.subtask-tag.completed {
  background: #DCFCE7;
  color: #16A34A;
}

.subtask-tag.executing {
  background: #FEF3C7;
  color: #D97706;
}

/* Agent记忆 */
.agent-memory-list {
  max-height: 400px;
  overflow-y: auto;
}

.memory-entry {
  padding: 10px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,.06));
}

.memory-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.memory-type {
  font-size: 11px;
  padding: 1px 6px;
  background: #F2F7FF;
  color: #4B3FE3;
  border-radius: 4px;
  font-family: monospace;
}

.memory-time {
  font-size: 11px;
  color: var(--muted, #64748b);
  margin-left: auto;
}

.memory-content {
  font-size: 12px;
  color: var(--text, #1e293b);
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}

/* ==================== v94 Work Chart样式 ==================== */

.workchart-container {
  width: 100%;
  height: 500px;
  position: relative;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.1));
  border-radius: 12px;
  overflow: hidden;
}

.workchart-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.workchart-hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted, #64748b);
  margin-top: 8px;
}

/* ==================== v94 暗色主题适配 ==================== */

@media (prefers-color-scheme: dark) {
  .agent-stat-card,
  .agent-card,
  .insight-card,
  .goal-item {
    background: var(--card-bg, #1e293b);
    border-color: var(--border, rgba(255,255,255,.1));
  }
  
  .insight-severity.high { background: rgba(239,68,68,.15); color: #FCA5A5; }
  .insight-severity.medium { background: rgba(245,158,11,.15); color: #FCD34D; }
  .insight-severity.low { background: rgba(59,130,246,.15); color: #93C5FD; }
  
  .subtask-tag { background: rgba(255,255,255,.06); }
  .subtask-tag.completed { background: rgba(34,197,94,.15); color: #86EFAC; }
  .subtask-tag.executing { background: rgba(245,158,11,.15); color: #FCD34D; }
  
  .memory-type { background: rgba(75,63,227,.2); color: #A5B4FC; }
  
  .workchart-container {
    background: var(--card-bg, #1e293b);
    border-color: var(--border, rgba(255,255,255,.1));
  }
}

/* ==================== v94 移动端适配 ==================== */

@media (max-width: 768px) {
  .agent-grid {
    grid-template-columns: 1fr;
  }
  
  .agent-overview {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .workchart-container {
    height: 350px;
  }
  
  .agent-card-actions {
    flex-direction: column;
  }
}

/* ==================== v95 Agent对话系统样式 ==================== */

.agent-chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
}

.agent-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border, rgba(0,0,0,.1));
  flex-shrink: 0;
}

.agent-chat-agent {
  font-weight: 600;
  font-size: 16px;
  color: var(--text, #1e293b);
}

.agent-chat-role {
  font-weight: 400;
  font-size: 13px;
  color: var(--muted, #64748b);
  margin-left: 4px;
}

.agent-chat-status {
  font-size: 12px;
  color: var(--muted, #64748b);
  margin-left: auto;
  padding: 2px 8px;
  background: var(--surface, #f1f5f9);
  border-radius: 10px;
}

.agent-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  -webkit-overflow-scrolling: touch;
}

.chat-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted, #64748b);
}

.chat-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.chat-empty p {
  font-size: 16px;
  margin-bottom: 4px;
}

.chat-empty-hint {
  font-size: 13px !important;
  color: var(--muted, #94a3b8) !important;
}

.chat-msg {
  display: flex;
  margin-bottom: 16px;
  gap: 8px;
}

.chat-msg-user {
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.chat-msg-body {
  max-width: 70%;
}

.chat-msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.chat-msg-user .chat-msg-bubble {
  background: var(--primary, #4B3FE3);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-agent .chat-msg-bubble {
  background: var(--surface, #f1f5f9);
  color: var(--text, #1e293b);
  border-bottom-left-radius: 4px;
}

.chat-msg-agent.chat-msg-agent_push .chat-msg-bubble {
  background: #F0FDF4;
  border-left: 3px solid #22C55E;
}

.chat-msg-time {
  font-size: 11px;
  color: var(--muted, #94a3b8);
  margin-top: 4px;
}

.chat-msg-user .chat-msg-time {
  text-align: right;
}

.agent-chat-input {
  flex-shrink: 0;
  border-top: 1px solid var(--border, rgba(0,0,0,.1));
  padding-top: 12px;
}

.chat-quick-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input-row .form-input {
  flex: 1;
}

/* ==================== v95 智能调度面板 ==================== */

.smart-dispatch-panel {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px 16px;
}

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

.dispatch-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #1e293b);
  margin: 0;
}

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

.dispatch-section {
  margin-bottom: 20px;
}

.section-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted, #64748b);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dispatch-agent-loads {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dispatch-load-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.1));
  border-radius: 10px;
  transition: all 0.2s;
}

.dispatch-load-item.active {
  border-left: 3px solid #27D2BF;
}

.dispatch-load-avatar {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface, #f8fafc);
  border-radius: 8px;
}

.dispatch-load-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #1e293b);
  min-width: 60px;
}

.dispatch-load-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dispatch-load-bar {
  flex: 1;
  height: 6px;
  background: var(--border, rgba(0,0,0,.08));
  border-radius: 3px;
  overflow: hidden;
}

.dispatch-load-fill {
  height: 100%;
  background: var(--primary, #4B3FE3);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.dispatch-load-fill.overload {
  background: #EF4444;
}

.dispatch-load-text {
  font-size: 12px;
  color: var(--muted, #64748b);
  min-width: 30px;
  text-align: right;
  font-family: monospace;
}

.dispatch-load-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 40px;
  text-align: center;
}

.dispatch-load-status.idle { background: #f1f5f9; color: #64748b; }
.dispatch-load-status.working { background: #CCFBF1; color: #0F766E; }
.dispatch-load-status.waiting { background: #FEF3C7; color: #92400e; }

.dispatch-chat-stats {
  display: flex;
  gap: 16px;
}

.dispatch-stat {
  text-align: center;
}

.dispatch-stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary, #4B3FE3);
  font-family: 'Inter', system-ui, sans-serif;
}

.dispatch-stat-label {
  font-size: 12px;
  color: var(--muted, #64748b);
  margin-top: 2px;
}

.smart-assign-hint {
  font-size: 13px;
  color: var(--muted, #64748b);
  padding: 10px;
  background: var(--brand-soft, #F2F7FF);
  border-radius: 8px;
  margin-top: 8px;
}

/* ==================== v95 暗色主题适配 ==================== */

@media (prefers-color-scheme: dark) {
  .chat-msg-user .chat-msg-bubble {
    background: #4B3FE3;
    color: #fff;
  }
  
  .chat-msg-agent .chat-msg-bubble {
    background: rgba(255,255,255,.08);
    color: var(--text, #e2e8f0);
  }
  
  .chat-msg-agent.chat-msg-agent_push .chat-msg-bubble {
    background: rgba(34,197,94,.1);
  }
  
  .dispatch-load-item {
    background: var(--card-bg, #1e293b);
    border-color: rgba(255,255,255,.1);
  }
  
  .dispatch-load-status.idle { background: rgba(255,255,255,.06); }
  .dispatch-load-status.working { background: rgba(39,210,191,.15); }
  .dispatch-load-status.waiting { background: rgba(245,158,11,.15); }
  
  .smart-assign-hint {
    background: rgba(75,63,227,.15);
  }
}

/* ==================== v95 移动端适配 ==================== */

@media (max-width: 768px) {
  .agent-chat-container {
    height: calc(100vh - 160px);
    padding: 0 12px;
  }
  
  .chat-msg-body {
    max-width: 85%;
  }
  
  .dispatch-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .dispatch-actions {
    width: 100%;
  }
  
  .dispatch-actions .btn {
    flex: 1;
  }
}

/* ==================== v96 知识检索系统样式 ==================== */

.knowledge-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

.knowledge-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.knowledge-stat-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.1));
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.knowledge-stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary, #4B3FE3);
  font-family: 'Inter', system-ui, sans-serif;
}

.knowledge-stat-label {
  font-size: 12px;
  color: var(--muted, #64748b);
  margin-top: 4px;
}

.knowledge-search {
  margin-bottom: 20px;
}

.knowledge-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.knowledge-search-row .form-input {
  flex: 1;
}

.knowledge-search-hint {
  font-size: 12px;
  color: var(--muted, #94a3b8);
  padding: 8px 12px;
  background: var(--surface, #f8fafc);
  border-radius: 6px;
}

.knowledge-results {
  min-height: 200px;
}

.knowledge-results-header {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted, #64748b);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,.06));
}

.knowledge-result-item {
  padding: 14px 16px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.1));
  border-radius: 10px;
  margin-bottom: 8px;
  transition: all 0.2s;
  animation: fadeIn 0.3s ease both;
}

.knowledge-result-item:hover {
  border-color: var(--primary, #4B3FE3);
  box-shadow: 0 2px 8px rgba(75, 63, 227, 0.08);
}

.knowledge-result-item.high {
  border-left: 3px solid var(--primary, #4B3FE3);
}

.knowledge-result-item.medium {
  border-left: 3px solid #6F6FFF;
}

.knowledge-result-item.low {
  border-left: 3px solid var(--border, rgba(0,0,0,.15));
}

.knowledge-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.knowledge-result-cat {
  font-size: 11px;
  padding: 1px 8px;
  background: var(--surface, #f1f5f9);
  border-radius: 4px;
  color: var(--muted, #64748b);
  font-weight: 500;
}

.knowledge-result-score {
  font-size: 11px;
  color: var(--muted, #94a3b8);
  margin-left: auto;
  font-family: monospace;
}

.knowledge-result-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text, #1e293b);
}

.knowledge-result-text mark {
  background: rgba(75, 63, 227, 0.15);
  color: var(--primary, #4B3FE3);
  padding: 0 2px;
  border-radius: 2px;
}

.knowledge-result-meta {
  font-size: 12px;
  color: var(--muted, #94a3b8);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border, rgba(0,0,0,.04));
}

.knowledge-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.knowledge-last-built {
  font-size: 12px;
  color: var(--muted, #94a3b8);
}

/* ==================== v96 暗色主题适配 ==================== */

@media (prefers-color-scheme: dark) {
  .knowledge-stat-card,
  .knowledge-result-item {
    background: var(--card-bg, #1e293b);
    border-color: rgba(255,255,255,.1);
  }
  
  .knowledge-result-cat {
    background: rgba(255,255,255,.06);
  }
  
  .knowledge-search-hint {
    background: rgba(255,255,255,.04);
  }
  
  .knowledge-result-text mark {
    background: rgba(75, 63, 227, 0.3);
    color: #A5B4FC;
  }
}

/* ==================== v96 移动端适配 ==================== */

@media (max-width: 768px) {
  .knowledge-search-row {
    flex-direction: column;
  }
  
  .knowledge-search-row .form-select {
    width: 100% !important;
  }
  
  .knowledge-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== v97 自动化规则样式 ==================== */

.automation-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
}

.automation-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.automation-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text, #1e293b);
  margin: 0 0 4px 0;
}

.automation-desc {
  font-size: 13px;
  color: var(--muted, #64748b);
  margin: 0;
}

.automation-stats {
  display: flex;
  gap: 8px;
}

.automation-stat-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--surface, #f1f5f9);
  color: var(--muted, #64748b);
}

.automation-stat-badge.active {
  background: #DCFCE7;
  color: #16A34A;
}

.automation-rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.automation-rule-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.1));
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

.automation-rule-card.enabled {
  border-left: 3px solid #22C55E;
}

.automation-rule-card.disabled {
  border-left: 3px solid var(--border, rgba(0,0,0,.15));
  opacity: 0.6;
}

.rule-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
}

.rule-body {
  padding: 0 16px 12px;
  display: none;
}

.automation-rule-card.enabled .rule-body {
  display: block;
}

.rule-toggle {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--border, rgba(0,0,0,.15));
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.rule-toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.rule-toggle.on {
  background: #22C55E;
}

.rule-toggle.on::after {
  left: 18px;
}

.rule-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1e293b);
  flex: 1;
}

.rule-event {
  font-size: 12px;
  padding: 2px 8px;
  background: var(--surface, #f1f5f9);
  border-radius: 4px;
  color: var(--muted, #64748b);
}

.rule-desc {
  font-size: 13px;
  color: var(--muted, #64748b);
  margin-bottom: 8px;
  line-height: 1.5;
}

.rule-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rule-agent {
  font-size: 12px;
  color: var(--text, #1e293b);
}

.rule-status {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 8px;
  margin-left: auto;
}

.automation-rule-card.enabled .rule-status {
  background: #DCFCE7;
  color: #16A34A;
}

.automation-rule-card.disabled .rule-status {
  background: var(--surface, #f1f5f9);
  color: var(--muted, #64748b);
}

/* ==================== v97 @Agent提及下拉 ==================== */

.agent-mention-dropdown {
  position: absolute;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.12));
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  max-height: 240px;
  overflow-y: auto;
  z-index: 10000;
  display: none;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.mention-item:hover,
.mention-item.active {
  background: var(--surface, #f8fafc);
}

.mention-item.active {
  background: var(--brand-soft, #F2F7FF);
}

.mention-avatar {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface, #f1f5f9);
  border-radius: 8px;
  flex-shrink: 0;
}

.mention-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mention-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1e293b);
}

.mention-role {
  font-size: 11px;
  color: var(--muted, #64748b);
}

.mention-state {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mention-state.idle { background: #94A3B8; }
.mention-state.working { background: #27D2BF; animation: pulse 2s infinite; }
.mention-state.waiting { background: #F59E0B; }

/* ==================== v97 暗色主题适配 ==================== */

@media (prefers-color-scheme: dark) {
  .automation-rule-card {
    background: var(--card-bg, #1e293b);
    border-color: rgba(255,255,255,.1);
  }
  
  .automation-rule-card.enabled {
    border-left-color: #22C55E;
  }
  
  .rule-event {
    background: rgba(255,255,255,.06);
  }
  
  .agent-mention-dropdown {
    background: var(--card-bg, #1e293b);
    border-color: rgba(255,255,255,.15);
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
  }
  
  .mention-item:hover,
  .mention-item.active {
    background: rgba(255,255,255,.06);
  }
  
  .mention-item.active {
    background: rgba(75,63,227,.15);
  }
  
  .mention-avatar {
    background: rgba(255,255,255,.06);
  }
}

/* ==================== v97 移动端适配 ==================== */

@media (max-width: 768px) {
  .automation-header {
    flex-direction: column;
  }
  
  .automation-stats {
    width: 100%;
    justify-content: flex-start;
  }
}
