/* ===== 字体 ===== */
@font-face { font-family: 'WorkSans'; src: url('../fonts/WorkSans-Regular.ttf'); font-weight: 400; }
@font-face { font-family: 'WorkSans'; src: url('../fonts/WorkSans-Bold.ttf'); font-weight: 700; }
@font-face { font-family: 'IBMPlexSerif'; src: url('../fonts/IBMPlexSerif-Regular.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);
}

/* ===== 基础 ===== */
* { 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;
}

/* ===== 按钮 ===== */
/* icon-btn (before .btn section) */
.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; margin-top: 6px; flex-wrap: wrap; }
.kanban-card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.kanban-card.high {
  border-left: 3px solid #ef4444;
}
.kanban-card.medium {
  border-left: 3px solid #f59e0b;
}
.kanban-card.low {
  border-left: 3px solid #10b981;
}

/* ===== 仪表盘 ===== */
.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; }

/* ===== 表单验证增强 ===== */
.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-view-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--rule); }
.timeline-view-header h3 { font-size: 14px; font-weight: 600; }
.timeline-zoom-btns { display: flex; gap: 4px; }
.timeline-zoom-btn { padding: 4px 10px; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg2); color: var(--muted); font-size: 11px; cursor: pointer; transition: all 0.15s; }
.timeline-zoom-btn:hover, .timeline-zoom-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.timeline-row { display: grid; grid-template-columns: 140px 1fr 80px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); cursor: pointer; transition: background 0.15s; }
.timeline-row:hover { background: rgba(59,130,246,0.03); }
.timeline-header { min-width: 100px; }
.timeline-label { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-track { position: relative; height: 24px; background: var(--bg); border-radius: 12px; overflow: hidden; }
.timeline-bar { position: absolute; top: 2px; height: 20px; border-radius: 10px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #fff; }
.timeline-bar.done { background: linear-gradient(135deg, #10b981, #059669); }
.timeline-bar.doing { background: linear-gradient(135deg, #3b82f6, #2563eb); animation: tlPulse 2s infinite; }
.timeline-bar.pending { background: linear-gradient(135deg, #94a3b8, #64748b); }
.timeline-bar.blocked { background: linear-gradient(135deg, #f59e0b, #d97706); opacity: 0.7; }
.timeline-bar.overdue { background: linear-gradient(135deg, #ef4444, #dc2626); }
@keyframes tlPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}
.timeline-meta { font-size: 11px; color: var(--muted); text-align: right; }
.timeline-dep-chain { grid-column: 1 / -1; font-size: 11px; color: var(--accent); padding: 2px 0 4px 148px; display: flex; align-items: center; gap: 4px; }
.timeline-dep-arrow { color: var(--accent); font-weight: 700; }
.timeline-progress-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--rule); border-radius: 100px; padding: 2px 8px; font-size: 11px; color: var(--muted); }

/* ===== 甘特图视图 ===== */
.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-row { display: flex; align-items: center; height: 40px; border-bottom: 1px solid var(--rule); position: relative; }
.gantt-row:hover { background: rgba(59,130,246,0.03); }
.gantt-task-name { width: 200px; font-size: 12px; padding: 0 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 40px; display: flex; align-items: center; transition: color 0.15s; }
.gantt-task-name:hover { color: var(--accent); }
.gantt-sidebar-header { font-size: 11px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 2px solid var(--rule); height: 36px; display: flex; align-items: center; }
.gantt-scale { display: flex; border-bottom: 2px solid var(--rule); height: 36px; align-items: center; }
.gantt-scale-cell { flex: 1; font-size: 10px; color: var(--muted); text-align: center; border-right: 1px solid var(--rule); height: 36px; display: flex; align-items: center; justify-content: center; }
.gantt-scale-cell.weekend { background: rgba(0,0,0,0.02); color: rgba(0,0,0,0.2); }
.gantt-scale-cell.today { background: rgba(239,68,68,0.08); color: var(--danger, #ef4444); font-weight: 700; }

/* 甘特图增强样式 */
.gantt-bar {
  height: 28px;
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  min-width: 20px;
}
.gantt-bar:hover {
  transform: scaleY(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 5;
}
.gantt-bar.done {
  background: linear-gradient(135deg, #10b981, #059669);
  opacity: 0.85;
}
.gantt-bar.doing {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  animation: ganttPulse 2s ease-in-out infinite;
}
.gantt-bar.pending {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}
.gantt-bar.blocked {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  opacity: 0.7;
  border: 1px dashed rgba(255,255,255,0.3);
}
.gantt-bar.overdue {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}
@keyframes ganttPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.3); }
  50% { box-shadow: 0 0 0 4px rgba(59,130,246,0.1); }
}
.gantt-bar-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 6px 0 0 6px;
  transition: width 0.3s;
}
.gantt-bar-label {
  position: relative;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-dependency-line {
  position: absolute;
  border-left: 2px dashed rgba(59,130,246,0.3);
  pointer-events: none;
}
.gantt-today-line {
  background: var(--danger, #ef4444);
  width: 2px;
  position: absolute;
  top: 0; bottom: 0;
  z-index: 10;
  box-shadow: 0 0 6px rgba(239,68,68,0.3);
}
.gantt-milestone {
  position: absolute;
  top: 8px;
  width: 14px;
  height: 14px;
  background: #8b5cf6;
  transform: rotate(45deg);
  z-index: 8;
  box-shadow: 0 2px 4px rgba(139,92,246,0.4);
}
.gantt-milestone-label {
  position: absolute;
  top: -2px;
  font-size: 10px;
  color: #8b5cf6;
  font-weight: 600;
  white-space: nowrap;
  transform: translateX(-50%);
}

/* ===== 子任务增强 ===== */
.subtask-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); transition: background 0.15s; }
.subtask-item:hover { background: rgba(59,130,246,0.02); }
.subtask-checkbox { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--rule); background: var(--bg); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.subtask-checkbox.checked { background: var(--accent); border-color: var(--accent); color: #fff; }
.subtask-checkbox.checked::after { content: '\2713'; font-size: 12px; font-weight: 700; }
.subtask-title { flex: 1; font-size: 13px; transition: all 0.2s; }
.subtask-title.done { text-decoration: line-through; color: var(--muted); }
.subtask-delete { opacity: 0; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 4px; transition: all 0.15s; }
.subtask-item:hover .subtask-delete { opacity: 1; }
.subtask-delete:hover { color: var(--danger, #ef4444); background: rgba(239,68,68,0.1); }
.subtask-progress-bar { width: 100%; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.subtask-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #8b5cf6); border-radius: 3px; transition: width 0.3s; }
.subtask-stats { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ===== 右键菜单 ===== */
.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;
  z-index: 9999;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: onboardingFadeIn 0.3s ease;
}
@keyframes onboardingFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.onboarding-card {
  background: var(--bg2);
  border-radius: 20px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
}
.onboarding-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.onboarding-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}
.onboarding-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.onboarding-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
}
.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule);
  transition: all 0.2s;
}
.onboarding-dot.active {
  background: var(--accent);
  width: 20px;
  border-radius: 4px;
}
.onboarding-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.onboarding-btn {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.onboarding-btn.primary {
  background: var(--accent);
  color: #fff;
}
.onboarding-btn.primary:hover {
  opacity: 0.9;
}
.onboarding-btn.secondary {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--rule);
}
.onboarding-skip {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.onboarding-skip:hover {
  color: var(--accent);
}
.onboarding-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.onboarding-desc { font-size: 14px; color: var(--muted); margin-bottom: 24px; }

/* ===== 快捷指令 ===== */
.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; }
  .kanban-view { flex-direction: column; }
  .kanban-column { max-width: 100%; }
  .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;
    }
    
    /* 移动端仪表盘网格 */
    .dashboard-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;
    }
    
    /* 移动端模态框全屏 */
    .modal {
      max-width: 100vw !important;
      max-height: 100vh !important;
      border-radius: 0 !important;
    }
    .modal-content {
      max-height: 100vh !important;
      border-radius: 0 !important;
    }
    
    /* 移动端 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; }
}

/* ===== 移动端底栏导航 ===== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg2);
  border-top: 1px solid var(--rule);
  padding: 6px 0;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
}
.mobile-nav-items {
  display: flex;
  justify-content: space-around;
}
.mobile-bottom-nav .mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  transition: color 0.15s;
}
.mobile-bottom-nav .mobile-nav-item.active {
  color: var(--accent);
}
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: block;
  }
  .main-panel {
    padding-bottom: 60px !important;
  }
}

/* ===== 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;
}

/* ===== 暗色模式补充覆盖 ===== */
[data-theme="dark"] .hero-bg {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
}
[data-theme="dark"] .ai-status {
  background: rgba(139,92,246,0.1);
  border-color: rgba(139,92,246,0.2);
  color: #c4b5fd;
}
[data-theme="dark"] .context-menu {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
[data-theme="dark"] .context-menu-item:hover {
  background: #334155;
}
[data-theme="dark"] .modal-overlay {
  background: rgba(0,0,0,0.6);
}
[data-theme="dark"] .modal-content {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] .toast {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
[data-theme="dark"] .demo-banner {
  background: linear-gradient(90deg, #991b1b, #b91c1c);
}

/* ===== 480px 以下小屏适配 ===== */
@media (max-width: 480px) {
  .start-card {
    padding: 20px 16px;
  }
  .start-card h3 {
    font-size: 14px;
  }
  .start-card p {
    font-size: 12px;
  }
  .start-card .start-icon {
    font-size: 28px;
  }
  .hero-stats {
    gap: 8px !important;
  }
  .hero-stats .stat {
    padding: 12px 8px !important;
  }
  .hero-stats .stat-value {
    font-size: 20px !important;
  }
  .scenario-grid {
    grid-template-columns: 1fr !important;
  }
  .sidebar-left,
  .sidebar-right {
    width: 100% !important;
    min-width: 0 !important;
  }
  .workspace-layout {
    flex-direction: column !important;
  }
  .main-panel {
    min-width: 0 !important;
  }
  .gantt-sidebar {
    min-width: 80px !important;
    width: 80px !important;
  }
  .gantt-task-name {
    font-size: 10px;
    padding: 0 4px;
  }
  .timeline-row {
    grid-template-columns: 100px 1fr 60px !important;
    gap: 4px !important;
  }
  .timeline-label {
    font-size: 11px;
  }
  .kanban-column {
    min-width: 200px !important;
  }
  .chat-input-area {
    padding: 8px !important;
  }
  .chat-input-area textarea {
    font-size: 14px;
  }
}

/* 制造业 KPI 面板 */
.factory-kpi-panel {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.factory-kpi-header h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}
.factory-kpi-subtitle {
  font-size: 12px;
  color: var(--muted);
}
.factory-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.factory-kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--rule);
}
.factory-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.factory-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}
.factory-kpi-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.factory-kpi-detail {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kpi-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.kpi-detail-label {
  color: var(--muted);
  min-width: 70px;
}
.kpi-detail-bar {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.kpi-detail-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 4px;
  transition: width 0.5s ease;
}
.kpi-detail-fill.blocked {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}
.kpi-detail-value {
  font-weight: 600;
  color: var(--ink);
  min-width: 40px;
  text-align: right;
}

/* 打印样式 */
@media print {
  .sidebar-left, .sidebar-right, .chat-input-area, .demo-banner,
  .mobile-nav, .channel-tabs, .listFilterRow, .viewToggleBtn,
  .toolbar, .fab-btn, .network-indicator, .toast-container {
    display: none !important;
  }
  .main-panel {
    position: static !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .workspace-layout {
    flex-direction: column !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .task-item, .kanban-card, .gantt-row {
    break-inside: avoid;
  }
  .gantt-bar { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .timeline-bar { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  a { text-decoration: none; }
  @page { margin: 10mm; }
}

@media (max-width: 768px) {
  .factory-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .factory-kpi-grid {
    grid-template-columns: 1fr;
  }
  .factory-kpi-card {
    padding: 10px;
  }
}

/* ===== 活动时间线 ===== */
.activity-timeline {
  position: relative;
  padding-left: 24px;
}
.activity-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--rule);
}
.activity-item {
  position: relative;
  padding: 8px 0 8px 16px;
  font-size: 13px;
  line-height: 1.5;
  animation: activitySlideIn 0.3s ease;
}
@keyframes activitySlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.activity-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg2);
}
.activity-item.create::before { background: #3b82f6; }
.activity-item.status::before { background: #f59e0b; }
.activity-item.complete::before { background: #10b981; }
.activity-item.delete::before { background: #ef4444; }
.activity-item.ai::before { background: #8b5cf6; }
.activity-item.subtask::before { background: #6366f1; }
.activity-item.default::before { background: var(--accent); }
.activity-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
