/* ============================================================
   P6 Project Planner — Global Styles
   ============================================================ */

/* CSS Variables — 工业风设计系统 (design-style.txt v2.1) */
:root {
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #e0f2fe;
  --accent: #f97316;
  --accent-dark: #c2410c;
  --accent-orange: #f97316;
  --accent-orange-light: #ffedd5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --surface-dark: #0f172a;
  --border-subtle: #e2e8f0;
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --sidebar-width: 220px;
  --toolbar-height: 56px;
  --font-xs: 11px;
  --font-sm: 12px;
  --font-md: 13px;
  --font-lg: 15px;
  --font-xl: 18px;
  --font-2xl: 24px;
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-glow-orange: 0 0 12px rgba(249, 115, 22, 0.35);
  /* 霓虹赛博 token (v2.2.0) */
  --neon: #00f3ff;
  --neon-purple: #bc13fe;
  --cyber-bg: #050a14;
  --cyber-bg-2: #0a192f;
  --neon-glow: 0 0 14px rgba(0, 243, 255, 0.35);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius: 16px;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  /* v2.4.0: 紫粉渐变背景（浅色基调，紫/粉放射 wash） */
  background:
    radial-gradient(1200px 800px at 85% -10%, rgba(216,180,254,0.38), transparent 60%),
    radial-gradient(1000px 700px at -10% 110%, rgba(249,168,212,0.32), transparent 55%),
    linear-gradient(160deg, #faf5ff 0%, #fff7fb 50%, #eef4fb 100%);
  background-attachment: fixed;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app { height: 100vh; display: flex; flex-direction: column; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }
.muted { color: var(--gray-500); font-style: italic; }
.loading { color: var(--gray-500); padding: 20px; text-align: center; }
.error { color: var(--danger); }
.error-state { text-align: center; padding: 60px 20px; }
.error-state h2 { color: var(--danger); margin-bottom: 10px; }
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { color: var(--gray-700); margin-bottom: 8px; }
.empty-state p { color: var(--gray-500); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); white-space: nowrap;
  letter-spacing: 0.2px; box-shadow: var(--shadow-xs);
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn-accent {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}
.btn-accent:hover:not(:disabled) { box-shadow: var(--shadow-glow-orange); filter: brightness(1.05); }
.btn-danger { background: #dc2626; color: #fff; border: none; box-shadow: 0 2px 8px rgba(220, 38, 38, 0.28); }
.btn-danger:hover:not(:disabled) { background: #b91c1c; box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4); }
.btn-outline-danger { background: var(--bg-surface); color: #dc2626; border: 1px solid #fecaca; }
.btn-outline-danger:hover:not(:disabled) { background: #fef2f2; border-color: #f87171; color: #b91c1c; }
.btn-outline { background: var(--bg-surface); color: var(--primary); border: 1px solid var(--gray-300); }
.btn-outline:hover:not(:disabled) { background: var(--primary-light); border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--gray-700); }
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); }
.btn-icon { background: transparent; border: none; cursor: pointer; padding: 2px 6px; font-size: 14px; color: var(--gray-600); border-radius: 3px; }
.btn-icon:hover { background: var(--gray-200); color: var(--gray-900); }
.btn-icon-danger:hover { background: var(--accent-orange-light); color: var(--danger); }
.btn-icon-sm { background: transparent; border: none; cursor: pointer; font-size: 12px; padding: 1px 4px; color: var(--gray-500); }
.btn-icon-sm:hover { color: var(--danger); }
.btn-icon-sm-reorder { color: var(--gray-600); }
.btn-icon-sm-reorder:hover { color: var(--primary); }
.btn-close { background: transparent; border: none; font-size: 20px; cursor: pointer; color: var(--gray-500); padding: 4px 8px; line-height: 1; }
.btn-close:hover { color: var(--gray-900); }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 4px; }
.form-input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: 14px; transition: border-color 0.15s; background: white;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(2,132,199,0.15); }
.form-input-sm { padding: 4px 8px; font-size: 12px; }
textarea.form-input { resize: vertical; font-family: inherit; }
select.form-input { cursor: pointer; }
.required { color: var(--danger); }
.form-error { background: #fce8e6; color: var(--danger); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .half { flex: 1; min-width: 220px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.section-divider { border-top: 1px solid var(--gray-200); margin: 16px 0; }

/* ============================================================
   Auth Pages
   ============================================================ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative; overflow: hidden;
  /* v2.4.0: 紫粉渐变背景（浅色基调，紫/粉放射 wash，保留青→蓝强调色于卡片） */
  background:
    radial-gradient(900px 500px at 88% -12%, rgba(216,180,254,0.34), transparent 62%),
    radial-gradient(820px 560px at -12% 112%, rgba(249,168,212,0.28), transparent 62%),
    linear-gradient(160deg, #faf5ff 0%, #fff7fb 50%, #eef4fb 100%);
}
.auth-card {
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-top: 3px solid #3b82f6;
  border-radius: var(--radius-lg); padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 14px 40px rgba(15,23,42,0.08), 0 2px 8px rgba(15,23,42,0.04);
  position: relative; z-index: 1;
}
.auth-header { text-align: center; margin-bottom: 30px; position: relative; z-index: 1; }
.auth-logo {
  width: 62px; height: 62px; margin: 0 auto 14px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #00f3ff, #3b82f6);
  color: #fff; box-shadow: 0 6px 18px rgba(59,130,246,0.28);
}
.auth-header h1 {
  font-size: 27px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px;
  background: linear-gradient(90deg, #0891b2, #3b82f6);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.auth-header .auth-en {
  color: var(--gray-500); font-size: 12.5px; letter-spacing: 1.5px;
  font-family: 'SF Mono', 'Consolas', 'Roboto Mono', monospace;
}
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label {
  display: block; margin-bottom: 6px;
  color: var(--gray-700); font-size: 13px; font-weight: 500;
}
.auth-form input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--gray-300); border-radius: var(--radius-md);
  background: #fff; color: var(--gray-900);
  font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-form input::placeholder { color: var(--gray-400); }
.auth-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(2,132,199,0.14); }
.auth-form .btn-primary {
  padding: 12px; font-size: 15px; font-weight: 700; border-radius: var(--radius-md);
  background: linear-gradient(90deg, #0891b2, #3b82f6); color: #fff;
  box-shadow: 0 6px 16px rgba(59,130,246,0.30);
  transition: transform 0.2s, box-shadow 0.2s;
}
.auth-form .btn-primary:hover:not(:disabled) { transform: scale(1.02); box-shadow: 0 8px 22px rgba(59,130,246,0.4); }
.auth-footer { text-align: center; margin-top: 20px; color: var(--gray-500); font-size: 13px; }
.auth-footer a { color: var(--primary); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ============================================================
   App Layout (Sidebar + Main)
   ============================================================ */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar（v2.3.0 起为各功能页子侧栏） */
.sidebar {
  width: var(--sidebar-width); min-width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid var(--gray-200);
  display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar-header { padding: 24px 20px 16px; border-bottom: 1px solid var(--gray-200); }
.sidebar-header h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.5px; display: flex; align-items: center; gap: 8px; color: var(--gray-900); }
.sidebar-subtitle { font-size: 11px; color: var(--gray-400); display: block; margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  margin: 2px 8px; padding: 9px 12px 9px 15px; color: var(--gray-700); font-size: 13px;
  cursor: pointer; text-decoration: none; border-left: none; border-radius: var(--radius-sm);
  overflow: hidden;
  transition: background-color 0.22s ease, color 0.22s ease, transform 0.2s ease, box-shadow 0.22s ease;
}
.nav-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--primary); border-radius: 0 3px 3px 0;
  transition: width 0.22s ease;
}
.nav-item:hover { background: var(--gray-100); color: var(--gray-900); text-decoration: none; }
.nav-item:hover::before, .nav-item.active::before { width: 3px; }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary); font-weight: 600;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; display: inline-flex; justify-content: center; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--gray-200); }
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 500; color: var(--gray-900); }
.user-role { font-size: 11px; color: var(--gray-500); }

/* v2.6.0: 侧边栏操作按钮组（导航与用户区之间；如 /ai 页的新对话/切换悬浮球） */
.sidebar-actions { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 12px; border-top: 1px solid var(--gray-100); }
.sidebar-action {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; background: transparent; border: 1px solid var(--gray-200);
  color: var(--gray-700); border-radius: var(--radius-sm); cursor: pointer;
  font-size: 12.5px; font-weight: 600; text-align: left;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.sidebar-action:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* v2.13.5: /ai 页历史会话列表（侧边栏 extra 区） */
.sidebar-extra { border-top: 1px solid var(--gray-100); padding: 8px 12px 12px; }
.ai-history-panel { display: flex; flex-direction: column; max-height: 260px; }
.ai-history-head { font-size: 11px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.4px; padding: 4px 2px 8px; display: flex; align-items: center; gap: 6px; }
.ai-history-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.ai-history-item { padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: background-color .15s ease; border-left: 3px solid transparent; }
.ai-history-item:hover { background: var(--gray-100); }
.ai-history-item.active { background: var(--primary-light); border-left-color: var(--primary); }
.ai-history-title { font-size: 12px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-history-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.ai-history-meta span { font-size: 10.5px; color: var(--gray-400); }
.ai-history-del { border: none; background: transparent; color: var(--gray-400); font-size: 13px; line-height: 1; padding: 0 2px; cursor: pointer; border-radius: 3px; }
.ai-history-del:hover { color: var(--danger); background: var(--gray-100); }
.ai-history-empty { font-size: 11.5px; padding: 4px 2px; }

/* Main Content */
.app-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.main-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
/* v2.3.0: 正式 footer */
.app-footer {
  flex-shrink: 0; text-align: center; padding: 12px 16px;
  font-size: 12px; color: var(--gray-500);
  background: #fff; border-top: 1px solid var(--gray-200);
}
.page-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; row-gap: 8px;
  padding: 20px 24px; background: white; border-bottom: 1px solid var(--gray-200);
}
.page-header h1 { font-size: 22px; font-weight: 600; }

/* ============================================================
   Dashboard — Project Grid
   ============================================================ */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px; padding: 24px;
}
.project-card {
  background: white; border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: all 0.2s; border: 1px solid var(--gray-200);
}
.project-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-1px); }
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.project-card-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.project-card-desc { color: var(--gray-600); font-size: 13px; margin-bottom: 12px; }
.project-card-meta { display: flex; gap: 16px; font-size: 12px; color: var(--gray-500); }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.badge-admin { background: var(--primary-light); color: var(--primary); }
.badge-member { background: var(--gray-100); color: var(--gray-600); }
.badge-editor { background: #d1fae5; color: #047857; }   /* 文档成员「编辑」角色徽章（绿），与 管理员蓝/只读灰 区分 */
.badge-sm { padding: 1px 6px; border-radius: 8px; font-size: 10px; }   /* 缩小版徽章（资源日历等） */
.badge-level { background: var(--gray-100); color: var(--gray-700); font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.badge-new { position: absolute; top: 10px; left: 10px; background: #e53e3e; color: #fff; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; z-index: 2; }
.project-card { position: relative; }
.project-card-source { display: flex; gap: 12px; font-size: 11px; color: var(--gray-500); margin-bottom: 8px; }

/* ============================================================
   Project View
   ============================================================ */
.project-content { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.project-toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; row-gap: 8px;
  padding: 12px 20px; background: white; border-bottom: 1px solid var(--gray-200);
  min-height: var(--toolbar-height); flex-shrink: 0;
}
.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; row-gap: 6px; }
.project-title { font-size: 18px; font-weight: 600; }
.project-desc { font-size: 13px; color: var(--gray-500); }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 6px; }

/* Workspace Layout */
.workspace { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.workspace-top, .workspace-full { flex: 1; display: flex; overflow: hidden; min-height: 0; }
.workspace-bottom { flex-shrink: 0; max-height: 40%; overflow-y: auto; border-top: 2px solid var(--gray-300); display: flex; }
.wbs-panel { flex: 3; overflow: hidden; min-width: 200px; display: flex; flex-direction: column; }
.gantt-panel { flex: 2; overflow: hidden; min-width: 300px; display: flex; flex-direction: column; background:#fff; }

/* ============================================================
   Gantt Chart
   ============================================================ */
.gantt-container { height: 100%; display: flex; flex-direction: column; }
.gantt-toolbar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); flex-shrink: 0; flex-wrap: wrap; row-gap: 4px; }
.gantt-legend { display: flex; gap: 10px; margin-left: auto; font-size: 11px; align-items: center; }
.gantt-lg { display: flex; align-items: center; gap: 4px; }
.gantt-lb { width: 14px; height: 9px; border-radius: 2px; display: inline-block; }
.gantt-header-wrap { flex-shrink: 0; overflow: hidden; border-bottom: 2px solid #ffffff; box-shadow: 0 1px 0 rgba(148, 163, 184, 0.4); }
.gantt-header-svg { display: block; }
.gantt-body-wrap { flex: 1; overflow: auto; }
.gantt-body-svg { display: block; min-width: 100%; }
.gantt-bar { cursor: pointer; }
.gantt-bar:hover > rect:first-of-type { filter: brightness(1.1); }
.gantt-bar.gantt-selected > rect:first-of-type { filter: brightness(1.2) drop-shadow(0 0 3px rgba(2,132,199,0.4)); }
.gantt-bar-critical { filter: drop-shadow(0 0 4px rgba(239,68,68,0.5)); }
.gantt-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--gray-500); font-size: 13px; }

.wbs-panel {
  flex: 3; overflow: hidden; border-right: 2px solid var(--gray-300); background: white;
  min-width: 400px; display: flex; flex-direction: column;
}
.editor-panel { flex: 3; border-right: 1px solid var(--gray-200); background: white; }
.audit-panel { flex: 2; background: white; }

/* ============================================================
   WBS Table
   ============================================================ */
.wbs-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0; position: sticky; top: 0; z-index: 15;
}
.wbs-stats { font-size: 12px; color: var(--gray-500); margin-left: auto; }
.wbs-table-wrap { flex: 1; overflow: auto; }
.wbs-table { min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.wbs-table thead { position: sticky; top: 0; z-index: 10; }
.wbs-table thead th {
  /* v2.4.0: 表头浅蓝灰微渐变 + 白色分隔线，与内容区分更清晰 */
  background: linear-gradient(180deg, #fbfdff 0%, #eef4fb 100%);
  padding: 8px 10px; text-align: center; font-size: 11px;
  font-weight: 600; color: var(--gray-600);
  border-bottom: 2px solid #ffffff;
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.4);
  white-space: nowrap;
  position: sticky; top: 0;
  border-right: 1px solid var(--gray-200);
  text-transform: uppercase; letter-spacing: 0.5px;
  user-select: none;
}
.wbs-table thead th[data-sort-key] {
  cursor: pointer; transition: background 0.15s;
}
.wbs-table thead th[data-sort-key]:hover {
  background: #e6eef9;
}
.sort-arrow {
  color: var(--primary); font-size: 11px; margin-left: 2px;
}
.wbs-table thead th:last-child { border-right: none; }
.wbs-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--gray-200); white-space: nowrap;
  border-right: 1px solid var(--gray-200);
  overflow: hidden; text-overflow: ellipsis;
}
.wbs-table td:last-child { border-right: none; }
.wbs-row { cursor: pointer; transition: background-color 0.15s ease; }
.wbs-row:hover { background-color: var(--primary-light) !important; }
.wbs-row.selected { background: var(--accent-orange-light) !important; outline: 3px solid var(--warning); outline-offset: -3px; z-index: 1; position: relative; }
.wbs-row.remote-selection { background: var(--primary-light) !important; outline: 2px dashed var(--primary); outline-offset: -2px; animation: remote-pulse 1.2s ease-in-out infinite; }
@keyframes remote-pulse { 0%,100% { outline-color: var(--primary); } 50% { outline-color: #7dd3fc; } }
.wbs-row.critical { border-left: 4px solid var(--danger); }

.expand-toggle { cursor: pointer; display: inline-block; width: 16px; text-align: center; font-size: 10px; color: var(--gray-600); user-select: none; }
.expand-placeholder { display: inline-block; width: 16px; }
.child-count { font-size: 11px; color: var(--gray-500); margin-left: 4px; }
.task-name-text { overflow: hidden; text-overflow: ellipsis; }
.col-actions { text-align: center; }
.col-dur { text-align: center; }
.col-status { text-align: center; }
.empty-cell { text-align: center; color: var(--gray-500); padding: 30px !important; }

.wbs-legend { display: flex; gap: 16px; padding: 8px 12px; font-size: 12px; background: var(--gray-50); border-top: 1px solid var(--gray-200); }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-color { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

/* ============================================================
   Task Editor Panel
   ============================================================ */
.task-editor-panel { display: flex; flex-direction: column; height: 100%; }
.panel-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
}
.panel-header h3 { font-size: 15px; font-weight: 600; }
.panel-body { padding: 16px; overflow-y: auto; flex: 1; }
.panel-body h4 { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--gray-700); }

/* Dependencies mini list */
.deps-mini-list { margin-bottom: 12px; }
.deps-group { margin-bottom: 10px; }
.deps-group strong { font-size: 12px; color: var(--gray-600); display: block; margin-bottom: 4px; }
.dep-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; margin: 2px 4px 2px 0; border-radius: 12px;
  font-size: 12px; background: var(--gray-100); border: 1px solid var(--gray-200);
}
.dep-chip .dep-type { color: var(--gray-600); font-size: 11px; font-weight: 500; }

/* ============================================================
   Audit Timeline
   ============================================================ */
.audit-filters { margin-bottom: 12px; }
.audit-timeline { position: relative; padding-left: 20px; }
.audit-timeline::before {
  content: ''; position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px; background: var(--gray-200);
}
.audit-entry { position: relative; margin-bottom: 12px; }
.audit-dot {
  position: absolute; left: -17px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%; border: 2px solid white;
}
.audit-content { padding-left: 4px; }
.audit-header { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.audit-action { font-weight: 600; }
.audit-entity { font-size: 11px; color: var(--gray-500); }
.audit-name { font-size: 12px; color: var(--gray-700); }
.audit-time { font-size: 11px; color: var(--gray-500); margin-left: auto; }
.audit-detail { font-size: 12px; color: var(--gray-600); display: block; margin-top: 2px; }
.old-val { color: var(--gray-500); text-decoration: line-through; }
.new-val { color: var(--gray-900); font-weight: 500; }

/* ============================================================
   Members
   ============================================================ */
.member-list { display: flex; flex-direction: column; gap: 6px; }
.member-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--gray-50); border-radius: var(--radius-sm);
}
.member-name { flex: 1; font-size: 14px; }

/* ============================================================
   Modal
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
/* App 级弹窗助手（confirm/prompt/alert）始终压在其他 .modal 之上：
   #app-modal-root 可能早于直挂 body 的 .dn-modal 创建（共享管理弹窗等），
   同 z-index 下 DOM 靠后者覆盖前者，导致确认弹窗被下层表格拦截点击。 */
#app-modal-root .modal { z-index: 10001; }
.modal-content {
  position: relative; background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); max-width: 560px; width: 90%; max-height: 80vh;
  display: flex; flex-direction: column;
  /* Ensure content sits ABOVE the .modal-overlay (line ~1343 sets z-index:9999)
     so clicks on the modal body don't hit the overlay and close it. */
  z-index: 10000;
}
.modal-content.modal-sm { max-width: 500px; }
.modal-content.modal-wide { max-width: 720px; }

/* v2.13.5 文档取号弹窗：卡片仿登录卡样式（白卡 + 顶部蓝条） */
.dn-modal .modal-content { border-top: 3px solid #3b82f6; border-radius: var(--radius-lg); }
.dn-modal .modal-content .modal-body { font-size: 14px; color: var(--text-primary); }
.dn-modal .modal-content .form-control { padding: 8px 12px; font-size: 14px; border: 1px solid var(--gray-300); border-radius: var(--radius-md); }
.dn-modal .modal-content .form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.14); }

/* v2.13.5 全局成功/错误提示 toast（底部居中，自动消失） */
#app-toast-container { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 99999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.app-toast { pointer-events: auto; padding: 9px 20px; border-radius: 24px; font-size: 13px; font-weight: 600; color: #fff; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25); animation: app-toast-in 0.25s cubic-bezier(0.4, 0, 0.2, 1); max-width: 80vw; }
.app-toast.app-toast-success { background: #10b981; }
.app-toast.app-toast-error { background: #ef4444; }
.app-toast.app-toast-info { background: #3b82f6; }
.app-toast.app-toast-out { opacity: 0; transform: translateY(6px); transition: opacity 0.3s ease, transform 0.3s ease; }
@keyframes app-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── v2.23.0: 全局后台任务浮层（左下角，路由切换不销毁） ── */
.app-task-overlay { position: fixed; left: 16px; bottom: 16px; z-index: 9995; display: flex; flex-direction: column; gap: 8px; max-width: 320px; }
.app-task-item { background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; box-shadow: 0 6px 20px rgba(15,23,42,0.12); padding: 10px 12px; font-size: 12px; animation: app-task-in 0.25s ease; }
.app-task-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.app-task-type { font-size: 14px; line-height: 1; }
.app-task-label { font-weight: 600; color: var(--gray-800); }
.app-task-stage { margin-left: auto; color: var(--primary); font-weight: 600; font-size: 11px; white-space: nowrap; }
.app-task-bar { height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.app-task-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #0ea5e9); border-radius: 3px; transition: width 0.3s; }
.app-task-msg { margin-top: 5px; color: var(--gray-500); line-height: 1.4; word-break: break-all; }
@keyframes app-task-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }

/* Task Detail Modal (F1) */
.task-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 12px; }
.detail-item { display: flex; flex-direction: column; padding: 6px 0; }
.detail-item label { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-item span { font-size: 14px; font-weight: 500; }
.dep-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dep-table th { text-align: left; padding: 6px 8px; border-bottom: 2px solid var(--gray-200); font-size: 11px; color: var(--gray-500); text-transform: uppercase; }
.dep-table td { padding: 6px 8px; border-bottom: 1px solid var(--gray-100); }
/* v2.13.5 表头固定在顶层：取号页（页面滚动时贴视口顶）与完整表/审计页（.wbs-table-wrap 滚动容器内贴容器顶） */
.dep-table thead th { position: sticky; top: 0; z-index: 10; background: var(--bg-surface); box-shadow: 0 1px 0 var(--gray-200); }
.dep-table thead { position: sticky; top: 0; z-index: 10; }
.badge-danger { background: #fce8e6; color: #c5221f; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.section-divider { border-top: 1px solid var(--gray-200); margin: 16px 0; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--gray-200); }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
/* v2.14.0 显示适配：弹窗内宽表（依赖表/资源表等）横向溢出可滚动，不再被裁切 */
.modal-body { overflow-x: auto; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 8px; }

/* 文档取号系统（v2.13.2）双标签 + 完整表查看 */
.dn-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 2px solid var(--gray-200); }
.dn-tab { background: none; border: none; padding: 9px 18px; font-size: 14px; font-weight: 500; color: var(--gray-600); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 6px 6px 0 0; }
.dn-tab:hover { color: var(--primary); background: var(--gray-50); }
.dn-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.dn-pane.hidden { display: none !important; }
.dn-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.dn-toolbar input.form-control { padding: 6px 10px; font-size: 13px; border: 1px solid var(--gray-300); border-radius: 6px; background: #fff; }
.dn-toolbar input.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12); }

/* v2.14.0 完整表筛选条 / 操作条：筛选条卡片式浅底 + 成组 label+select + 只看缺漏 chip */
.dn-filter-bar {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px;
}
.dn-filter-item { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--gray-600); font-weight: 500; }
.dn-filter-item select.dn-filter-sel, .dn-filter-item input.form-control {
  padding: 6px 10px; font-size: 13px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff;
  min-width: 150px; max-width: 170px; height: 34px;
}
.dn-filter-item select.dn-filter-sel:focus, .dn-filter-item input.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12); }
.dn-filter-item.dn-filter-search input.form-control { min-width: 200px; }
.dn-issues-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-700);
  background: #fff; border: 1px solid #cbd5e1; border-radius: 999px; padding: 6px 12px; cursor: pointer;
  user-select: none; height: 34px; white-space: nowrap;
}
.dn-issues-chip:hover { border-color: var(--primary); }
.dn-issues-chip input { accent-color: var(--primary); cursor: pointer; }
.dn-issues-chip.active { background: #e0f2fe; border-color: var(--primary); color: #0369a1; font-weight: 600; }
.dn-action-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.dn-full-table th, .dn-full-table td { white-space: nowrap; }
.dn-full-table td { cursor: cell; }
.dn-full-table td.dn-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.dn-full-table td.dn-cell-empty { color: var(--gray-400); font-style: italic; }
.dn-cell-input { width: 100%; box-sizing: border-box; border: 1px solid var(--primary); border-radius: 4px; padding: 2px 6px; font: inherit; background: #fff; }

/* 文档取号系统（v2.13.3）异常标亮：重复/格式→编码列红底，残缺→琥珀底，重复行→整行浅红 */
.dn-full-table td.dn-anom-dup-f { background: #fbd5d5; color: #8f1d1d; font-weight: 600; }
.dn-full-table td.dn-anom-format-f { background: #fde8e8; color: #a51818; font-weight: 600; }
.dn-full-table td.dn-anom-orphan-e, .dn-full-table td.dn-anom-orphan-f { background: #fff7e0; color: #7a5a00; }
.dn-full-table tr.dn-anom-dup-row { background: #fff1f1; }

/* 文档取号系统（v2.13.4）：缺漏标亮 / 待保存暂存 / 筛选下拉 / 右键作废菜单 */
.dn-full-table td.dn-anom-missing { background: #e0f2fe; color: #0369a1; }
.dn-full-table td.dn-pending { box-shadow: inset 0 0 0 2px #facc15; }
.dn-toolbar select.dn-filter-sel { max-width: 170px; }
.dn-context-menu { position: fixed; z-index: 9999; min-width: 230px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); padding: 6px 0; font-size: 13px; }
.dn-context-menu .dn-ctx-title { padding: 4px 12px; font-size: 12px; color: var(--gray-500); border-bottom: 1px solid #f1f5f9; margin-bottom: 4px; }
.dn-context-menu .dn-ctx-item { padding: 8px 12px; cursor: pointer; user-select: none; }
.dn-context-menu .dn-ctx-item:hover { background: #f1f5f9; }
.dn-context-menu .dn-ctx-danger { color: #dc2626; font-weight: 600; }
.dn-context-menu .dn-ctx-danger:hover { background: #fef2f2; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .workspace-top { flex-direction: column; }
  .wbs-panel { flex: 1; border-right: none; border-bottom: 2px solid var(--gray-300); min-width: 0; }
  .gantt-panel { flex: 1; min-width: 0; }
  .workspace-bottom { flex-direction: column; }
}

@media (max-width: 600px) {
  .sidebar { display: none; }
  .auth-card { padding: 24px; margin: 10px; }
  .project-grid { grid-template-columns: 1fr; padding: 12px; }
}

/* ============================================================
   NEW: Project Share Code
   ============================================================ */
.project-card-share-code {
  margin-top: 8px; padding: 4px 8px;
  background: #fef3c7; border: 1px dashed #f9ab00; border-radius: 4px;
  font-size: 11px; font-family: monospace; color: var(--gray-700);
  cursor: pointer; display: inline-block;
}
.project-card-share-code:hover { background: #feefc3; }

.share-code-display {
  background: var(--gray-900); color: #10b981; padding: 16px 24px;
  border-radius: var(--radius-md); display: inline-block; margin: 8px 0;
}
.share-code-text {
  font-family: 'Courier New', monospace; font-size: 28px;
  font-weight: 700; letter-spacing: 6px;
}

.share-code-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--gray-900); padding: 12px 20px; border-radius: var(--radius-md);
}
.share-code-big {
  font-family: 'Courier New', monospace; font-size: 26px; font-weight: 700;
  letter-spacing: 5px; color: #10b981;
}
.share-code-box .btn { color: white !important; }
.share-code-box .btn:hover { background: rgba(255,255,255,0.15) !important; }

.join-success, .join-info, .join-request {
  background: var(--gray-50); padding: 12px; border-radius: var(--radius-md);
}

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

/* ============================================================
   NEW: Tab Navigation in Sidebar
   ============================================================ */
.nav-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  color: var(--gray-600); padding: 12px 16px 4px; letter-spacing: 1px;
}
.nav-badge {
  background: var(--accent); color: white; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; margin-left: auto;
}

.tab-content { display: flex; flex-direction: column; height: 100%; }
.tab-content.hidden { display: none !important; }
#tab-ai { overflow: hidden; }
#tab-ai .ai-workspace { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#tab-ai #ai-panel-container { flex: 1; min-height: 0; overflow: hidden; }

/* ============================================================
   NEW: WBS Management Panel
   ============================================================ */
.wbs-workspace {
  display: flex; flex: 1; overflow: hidden;
}
.wbs-management-panel {
  flex: 3; overflow: auto; border-right: 1px solid var(--gray-200); background: white;
}
.wbs-detail-panel {
  flex: 2; overflow-y: auto; background: white;
}

.wbs-tree-list { padding: 4px 0; }
.wbs-node-row {
  display: flex; align-items: center; gap: 0;
  padding: 8px 12px; cursor: pointer; transition: all 0.12s;
  border-bottom: 1px solid var(--gray-100);
  min-width: max-content;
}
/* All WBS cells (both header and row) — consistent box model */
.wbs-node-row > span,
.wbs-list-header > span {
  box-sizing: border-box; overflow: hidden;
  display: flex; align-items: center;
}
.wbs-node-row:hover { filter: brightness(0.94); }
.wbs-node-row.wbs-selected { box-shadow: inset 0 0 0 3px #f59e0b; background: #fffbeb !important; }

/* WBS drag handle */
.wbs-drag-handle { cursor: grab; color: var(--gray-400); font-size: 14px; user-select: none; display: flex; align-items: center; justify-content: center; }
.wbs-drag-handle:active { cursor: grabbing; }
.wbs-drag-handle:hover { color: var(--primary); }
.wbs-dragging { opacity: 0.4; }
.wbs-drag-over { border-top: 2px solid var(--primary) !important; background: var(--primary-light, #e8f0fe) !important; }

/* WBS column resize guide */
.wbs-resize-guide { box-shadow: 0 0 4px rgba(2,132,199,0.3); }

/* Drag header placeholder */
.wbs-col-drag-header { cursor: default; }

.wbs-node-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.wbs-node-code { font-family: monospace; font-size: 13px; min-width: 40px; }
.wbs-node-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wbs-node-children { font-size: 11px; color: var(--gray-500); white-space: nowrap; }
.wbs-node-dur { font-size: 12px; color: var(--gray-600); white-space: nowrap; }
.wbs-node-actions { display: flex; gap: 2px; opacity: 0.4; transition: opacity 0.15s; flex-shrink: 0; }
.wbs-node-row:hover .wbs-node-actions { opacity: 1; }

.wbs-children-list { display: flex; flex-wrap: wrap; gap: 6px; }
.wbs-child-chip {
  background: var(--gray-100); padding: 4px 10px; border-radius: 12px;
  font-size: 12px; border: 1px solid var(--gray-200);
}

/* ============================================================
   NEW: Members & Sharing Tab
   ============================================================ */
.members-workspace {
  display: flex; flex: 1; overflow: hidden; gap: 16px; padding: 16px;
}
.members-left { flex: 2; overflow-y: auto; }
.members-right { flex: 1; overflow-y: auto; }

.card {
  background: white; border-radius: var(--radius-md);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 12px 16px; border-bottom: 1px solid var(--gray-200); background: var(--gray-50);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; row-gap: 6px;
}
.card-header h3 { font-size: 14px; font-weight: 600; }
.card-body { padding: 16px; }

.member-list-detailed { display: flex; flex-direction: column; gap: 6px; }
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--gray-50); border-radius: var(--radius-sm);
}
.member-avatar {
  width: 32px; height: 32px; border-radius: 50%; color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.member-info { flex: 1; display: flex; flex-direction: column; }

.request-row {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px;
  padding: 10px 12px; border-bottom: 1px solid var(--gray-100);
}
.request-info { display: flex; flex-direction: column; gap: 2px; }
.request-actions { display: flex; gap: 4px; }

/* ============================================================
   NEW: Audit Workspace
   ============================================================ */
.audit-workspace {
  flex: 1; overflow-y: auto; padding: 16px; background: white;
}

/* ============================================================
   NEW: Extended WBS Table (baseline, actual, float columns)
   ============================================================ */
.wbs-table-extended { font-size: 12px; }
.wbs-table-extended th { font-size: 11px; padding: 6px 8px; white-space: nowrap; text-align: center; }
.wbs-table-extended .col-wbs_code { text-align: left; }
.wbs-table-extended .col-name { text-align: left; }
.col-date { text-align: center; font-size: 12px; white-space: nowrap; }
.col-dur { text-align: center; }
.col-pct { text-align: center; }
.col-num { text-align: center; font-size: 12px; }
.actual-date { color: var(--accent); font-weight: 500; }

/* Progress bar in table */
.pct-bar { width: 40px; height: 6px; background: var(--gray-200); border-radius: 3px; display: inline-block; vertical-align: middle; margin-right: 4px; }
.pct-fill { height: 100%; background: var(--success); border-radius: 3px; transition: width 0.3s; }

/* Toolbar separator */
.toolbar-sep { width: 1px; height: 24px; background: var(--gray-300); margin: 0 4px; display: inline-block; }

/* Section labels in forms */
.section-label { font-size: 12px; font-weight: 600; color: var(--gray-700); padding: 10px 0 6px; border-top: 1px solid var(--gray-200); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.section-label:first-child { border-top: none; margin-top: 0; }

/* Task context breadcrumb in creation modal */
.task-context-breadcrumb {
  background: var(--primary-light); border: 1px solid #a8c8fa; border-radius: var(--radius-sm);
  padding: 8px 12px; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.breadcrumb-label { font-size: 12px; color: var(--gray-600); }
.breadcrumb-wbs { font-size: 13px; font-weight: 600; color: var(--primary); font-family: monospace; }
.breadcrumb-hint { font-size: 11px; color: var(--gray-500); }

/* Gantt legend vertical alignment */
.gantt-legend-bar { display: inline-block; vertical-align: middle; width: 16px; height: 12px; border-radius: 2px; }

/* ============================================================
   NEW: WBS Inline Controls (indent/outdent arrows, drag, context menu)
   ============================================================ */
.wbs-drag-handle {
  cursor: grab; color: var(--gray-400); font-size: 14px; padding: 0 4px;
  user-select: none; letter-spacing: -2px; flex-shrink: 0;
}
.wbs-drag-handle:hover { color: var(--gray-600); }
.wbs-drag-handle:active { cursor: grabbing; }

.wbs-inline-arrows {
  display: inline-flex; gap: 0; flex-shrink: 0; margin-right: 4px;
}
.wbs-arrow-btn {
  background: none; border: none; cursor: pointer; font-size: 13px;
  padding: 1px 4px; color: var(--gray-500); border-radius: 3px; line-height: 1;
  transition: all 0.1s; font-weight: 600;
}
.wbs-arrow-btn:hover:not(:disabled) {
  background: var(--primary-light); color: var(--primary);
}
.wbs-arrow-btn:disabled { cursor: not-allowed; opacity: 0.2; }

.wbs-inline-actions {
  display: inline-flex; gap: 1px; flex-shrink: 0;
  opacity: 0.15; transition: opacity 0.12s; margin-left: auto;
}
.wbs-node-row:hover .wbs-inline-actions { opacity: 1; }
.wbs-node-row.wbs-selected .wbs-inline-actions { opacity: 1; }

/* WBS right-click context menu */
.wbs-context-menu {
  position: fixed; z-index: 2000; background: white; border: 1px solid var(--gray-300);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); min-width: 220px;
  padding: 4px 0; font-size: 13px;
}
.wbs-context-item {
  padding: 8px 16px; cursor: pointer; color: var(--gray-800); transition: background 0.1s; white-space: nowrap;
}
.wbs-context-item:hover { background: var(--gray-100); }
.wbs-context-sep { height: 1px; background: var(--gray-200); margin: 4px 0; }
.wbs-context-danger { color: var(--danger); }
.wbs-context-danger:hover { background: #fce8e6; }

/* ============================================================
   NEW: Responsive for extended table
   ============================================================ */
@media (max-width: 900px) {
  .wbs-table-extended { font-size: 11px; }
  .wbs-table-extended th, .wbs-table-extended td { padding: 4px 4px; }
  .toolbar-sep { display: none; }
}

/* ============================================================
   NEW: Join/Create Improvements
   ============================================================ */
.form-input:disabled { background: var(--gray-50); cursor: not-allowed; }
small { font-size: 11px; color: var(--gray-500); display: block; margin-top: 2px; }
.form-input::placeholder { color: var(--gray-400); }

/* ============================================================
   NEW: Responsive for WBS workspace
   ============================================================ */
@media (max-width: 900px) {
  .wbs-workspace { flex-direction: column; }
  .wbs-management-panel { flex: 1; border-right: none; border-bottom: 1px solid var(--gray-200); max-height: 50%; }
  .wbs-detail-panel { flex: 1; }
  .members-workspace { flex-direction: column; }
  .wbs-node-actions { opacity: 1 !important; }
}

/* ============================================================
   NEW: Column Resize Handles
   ============================================================ */
.col-resize-handle {
  /* v2.4.0: 拖柄可见化（10px 宽 + 左侧边线），用户可发现列宽可拖 */
  width: 10px; min-width: 10px; height: 100%; cursor: col-resize; z-index: 10;
  background: transparent; flex-shrink: 0;
  border-left: 1px solid rgba(148, 163, 184, 0.45);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
  margin-left: 2px;
}
.col-resize-handle:hover {
  border-left: 2px solid var(--primary);
  background: rgba(2,132,199,0.10);
  box-shadow: 0 0 4px rgba(2,132,199,0.25);
}

/* ============================================================
   NEW: Column Config Dropdown
   ============================================================ */
.wbs-toolbar {
  position: relative;
}
.column-config-btn {
  margin-left: auto;
}
.column-config-dropdown {
  position: absolute; right: 8px; top: 38px; z-index: 100;
  background: white; border: 1px solid var(--gray-300);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  min-width: 300px; max-height: 420px; overflow-y: auto;
}
.column-config-header {
  padding: 10px 14px; font-size: 13px; font-weight: 600;
  color: var(--gray-700); border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.column-config-list {
  padding: 8px 0;
}
.column-config-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-bottom: 1px solid var(--gray-100);
}
.column-config-checkbox {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 12px; flex: 1; min-width: 0;
}
.column-config-checkbox input[type="checkbox"] {
  cursor: pointer; width: 15px; height: 15px;
}
.column-config-key {
  font-size: 11px; color: var(--gray-500); font-family: monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.column-config-nickname {
  width: 140px; padding: 4px 8px; border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm); font-size: 12px; flex-shrink: 0;
}
.column-config-nickname:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(2,132,199,0.12);
}
.column-config-footer {
  padding: 8px 14px; border-top: 1px solid var(--gray-200);
  text-align: right;
}

/* ============================================================
   NEW: WBS Inline Edit Input
   ============================================================ */
.wbs-inline-edit-input {
  font-size: 14px; padding: 2px 6px; border: 2px solid var(--primary);
  border-radius: var(--radius-sm); outline: none; width: 200px;
  background: white; font-family: inherit;
}

/* ============================================================
   NEW: WBS Node Classification Code & Task Count
   ============================================================ */
.wbs-node-classification {
  font-size: 11px; color: var(--gray-500); white-space: nowrap;
  margin-right: 6px; padding: 1px 6px;
  background: var(--gray-100); border-radius: 10px;
}
.wbs-node-classification-empty {
  opacity: 0.3;
}
.wbs-node-task-count {
  font-size: 11px; color: var(--primary); white-space: nowrap;
  font-weight: 500; margin-left: auto;
}
.wbs-node-task-count-zero {
  color: var(--gray-400);
}

/* ============================================================
   NEW: WBS List Header (management panel)
   ============================================================ */
.wbs-list-header {
  display: flex; align-items: center; gap: 0;
  /* v2.4.0: 表头浅蓝灰微渐变 + 白色分隔线 */
  padding: 8px 12px; background: linear-gradient(180deg, #fbfdff 0%, #eef4fb 100%);
  border-bottom: 2px solid #ffffff;
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.4);
  font-size: 11px; font-weight: 600; color: var(--gray-600);
  text-transform: uppercase; letter-spacing: 0.3px;
  position: sticky; top: 0; z-index: 10;
  min-width: max-content;
}
.wbs-hdr-item {
  display: flex; align-items: center;
  box-sizing: border-box; overflow: hidden;
}
.wbs-hdr-cb { text-align: center; }
.wbs-hdr-cb input { cursor: pointer; width: 14px; height: 14px; }
.wbs-col-cb { display: flex; align-items: center; justify-content: center; }
.wbs-col-cb input { cursor: pointer; width: 14px; height: 14px; }

/* Batch action bar */
.wbs-batch-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; background: var(--primary-light);
  border-bottom: 1px solid #a8c8fa; font-size: 13px;
}
.wbs-batch-bar span { color: var(--primary); font-weight: 600; }
.wbs-hdr-arrows { width: 44px; flex-shrink: 0; }
.wbs-hdr-code { width: 60px; flex-shrink: 0; text-align: left; }
.wbs-hdr-class { width: 80px; flex-shrink: 0; text-align: left; }
.wbs-hdr-name { flex: 1; min-width: 0; text-align: left; }
.wbs-hdr-children { width: 60px; flex-shrink: 0; text-align: center; }
.wbs-hdr-taskcount { width: 80px; flex-shrink: 0; text-align: center; }
.wbs-hdr-actions { width: 150px; flex-shrink: 0; text-align: right; padding-right: 8px; }

/* WBS node row flex adjustments to align with header */
.wbs-node-row {
  display: flex; align-items: center; gap: 0;
  padding: 8px 12px; cursor: pointer; transition: all 0.12s;
  border-bottom: 1px solid var(--gray-200);
}
.wbs-node-row:hover { filter: brightness(0.94); }
/* WBS column cells — generic */
.wbs-col-cb { display: flex; align-items: center; justify-content: center; }
.wbs-col-drag { cursor: grab; color: var(--gray-400); font-size: 14px; letter-spacing: -2px; user-select: none; display: flex; align-items: center; }
.wbs-col-drag:hover { color: var(--gray-600); }
.wbs-col-arrows { display: flex; align-items: center; }
.wbs-col-code { font-family: monospace; font-size: 13px; white-space: nowrap; }
.wbs-col-class { font-size: 11px; color: var(--gray-500); white-space: nowrap; cursor: pointer; }
.wbs-col-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.wbs-col-children { font-size: 11px; color: var(--gray-500); white-space: nowrap; }
.wbs-col-taskcount { font-size: 11px; white-space: nowrap; }
.wbs-col-actions { display: flex; gap: 1px; justify-content: flex-end; }
.wbs-col-actions .btn-icon { opacity: 0; transition: opacity 0.12s; }
.wbs-node-row:hover .wbs-col-actions .btn-icon { opacity: 1; }
.wbs-node-row.wbs-selected .wbs-col-actions .btn-icon { opacity: 1; }

/* WBS header items */
.wbs-hdr-item {
  display: flex; align-items: center; font-size: 11px; font-weight: 600;
  color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.3px;
  white-space: nowrap; overflow: hidden;
}
.wbs-hdr-item .col-resize-handle {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 5px; cursor: col-resize; z-index: 10;
}

/* Keep old classes for backward compat */
.wbs-drag-handle { width: 20px; flex-shrink: 0; }
.wbs-inline-arrows { width: 44px; flex-shrink: 0; }
.wbs-node-code { width: 60px; flex-shrink: 0; font-family: monospace; font-size: 13px; }
.wbs-node-classification { font-size: 11px; color: var(--gray-500); white-space: nowrap; margin-right: 6px; padding: 1px 6px; background: var(--gray-100); border-radius: 10px; }
.wbs-node-classification-empty { opacity: 0.3; }
.wbs-node-name { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wbs-node-children { width: 60px; flex-shrink: 0; text-align: center; }
.wbs-node-task-count { width: 80px; flex-shrink: 0; text-align: center; font-size: 11px; white-space: nowrap; }
.wbs-inline-actions { width: 150px; flex-shrink: 0; display: flex; gap: 1px; justify-content: flex-end; }

/* ============================================================
   NEW: Registration Success Overlay
   ============================================================ */
.reg-success-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5);
  animation: fadeIn 0.3s ease;
}
.reg-success-card {
  background: white; border-radius: var(--radius-lg);
  padding: 40px 48px; text-align: center;
  box-shadow: var(--shadow-lg); animation: scaleIn 0.3s ease;
  max-width: 380px; width: 90%;
}
.reg-success-icon {
  font-size: 56px; margin-bottom: 16px;
}
.reg-success-card h2 {
  font-size: 22px; color: var(--success); margin-bottom: 8px;
}
.reg-success-card p {
  font-size: 15px; color: var(--gray-600); margin-bottom: 20px;
}
.reg-success-progress {
  height: 4px; background: var(--gray-200);
  border-radius: 2px; overflow: hidden;
}
.reg-success-bar {
  height: 100%; width: 100%; background: var(--success);
  border-radius: 2px;
  animation: regProgress 2s linear forwards;
}

@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes scaleIn {
  from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; }
}
@keyframes regProgress {
  from { width: 0%; } to { width: 100%; }
}

/* ============================================================
   NEW: Column TD alignment helpers
   ============================================================ */
.col-wbs_code { text-align: left; white-space: nowrap; }
.col-name { text-align: left; white-space: nowrap; }
.col-baseline_start_date { text-align: center; white-space: nowrap; font-size: 12px; }
.col-baseline_end_date { text-align: center; white-space: nowrap; font-size: 12px; }
.col-planned_start_date { text-align: center; white-space: nowrap; font-size: 12px; }
.col-planned_end_date { text-align: center; white-space: nowrap; font-size: 12px; }
.col-actual_start_date { text-align: center; white-space: nowrap; font-size: 12px; }
.col-actual_end_date { text-align: center; white-space: nowrap; font-size: 12px; }
.col-duration { text-align: center; }
.col-baseline_variance { text-align: center; white-space: nowrap; font-size: 12px; }
.col-percent_complete { text-align: center; }
.col-total_float { text-align: center; }
.actual-date { color: var(--accent); font-weight: 500; }

/* ============================================================
   NEW: Panel Dividers (resizable workspace panels)
   ============================================================ */
.panel-divider {
  flex-shrink: 0; z-index: 20;
  background: var(--gray-300);
  transition: background 0.15s;
}
.panel-divider:hover { background: var(--primary); }
.panel-divider-v {
  width: 5px; cursor: col-resize;
}
.panel-divider-h {
  height: 5px; cursor: row-resize;
}

/* ============================================================
   NEW: Server Update Notification Overlay
   ============================================================ */
.update-notification-overlay {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6);
  animation: fadeIn 0.3s ease;
}
.update-notification-card {
  background: white; border-radius: var(--radius-lg);
  padding: 40px 48px; text-align: center;
  box-shadow: var(--shadow-lg); animation: scaleIn 0.3s ease;
  max-width: 420px; width: 90%;
}
.update-notification-icon {
  font-size: 56px; margin-bottom: 16px;
}
.update-notification-card h2 {
  font-size: 22px; color: var(--primary); margin-bottom: 12px;
}
.update-notification-card p {
  font-size: 15px; color: var(--gray-600); margin-bottom: 12px;
}

/* ============================================================
   NEW: Actions column for task table
   ============================================================ */
.col-actions { text-align: center; white-space: nowrap; }
.col-actions .btn-icon { padding: 2px 4px; font-size: 12px; }

/* Task type icons (WBS vs 作业) */
.task-type-icon { font-size: 13px; margin-right: 4px; flex-shrink: 0; }
.task-type-badge { font-size: 10px; padding: 0 5px; border-radius: 8px; margin-left: 4px; white-space: nowrap; flex-shrink: 0; }

/* ============================================================
   NEW: Collaborator indicator (other users editing)
   ============================================================ */
.collaborator-indicator {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; color: var(--primary); background: var(--primary-light);
  padding: 1px 8px; border-radius: 10px; margin-left: 8px;
  white-space: nowrap; animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================
   NEW: Remote change notification (别人修改作业时的通知)
   ============================================================ */
#change-toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 10000;
  display: flex; flex-direction: column; gap: 8px; max-width: 360px;
}
.change-toast {
  background: #fff; border: 1px solid var(--gray-200);
  border-left: 4px solid var(--primary); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  padding: 10px 14px; font-size: 13px; cursor: pointer;
  position: relative; animation: toast-in 0.25s ease;
}
.change-toast:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.change-toast.toast-out { opacity: 0; transform: translateX(30px); transition: all 0.3s ease; }
.change-toast .toast-title { font-weight: 600; margin-bottom: 2px; padding-right: 18px; }
.change-toast .toast-detail { color: var(--gray-600); font-size: 12px; line-height: 1.5; word-break: break-all; }
.change-toast .toast-hint { color: var(--primary); font-size: 11px; margin-top: 4px; }
.change-toast .toast-close {
  position: absolute; top: 6px; right: 8px;
  background: none; border: none; cursor: pointer;
  font-size: 16px; line-height: 1; color: var(--gray-600); padding: 2px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: none; }
}

/* Flash highlight on rows changed by other users — hold 5s, then fade back to original color */
@keyframes remote-flash {
  0% { background-color: #fff3cd; }
  91% { background-color: #fff3cd; }   /* hold highlight for ~5s */
  100% { background-color: transparent; }
}
tr.remote-changed, .wbs-node-row.remote-changed {
  animation: remote-flash 5.5s ease;
}

/* ============================================================
   NEW: Gantt sync highlight — flash when clicked from Gantt
   ============================================================ */
.gantt-synced-highlight {
  animation: ganttSyncPulse 0.5s ease-in-out 4;
  outline: 3px solid #f9ab00 !important;
  outline-offset: -2px;
}
@keyframes ganttSyncPulse {
  0%, 100% { background-color: var(--primary-light); }
  50% { background-color: #fff3cd; }
}

/* ============================================================
   NEW: Gantt zoom slider styling
   ============================================================ */
#gantt-zs {
  vertical-align: middle;
  accent-color: var(--primary);
}

/* ============================================================
   NEW: WBS project row in task table
   ============================================================ */
.wbs-project-row {
  cursor: default !important;
  border-bottom: 2px solid #0d47a1 !important;
}
.wbs-project-row:hover {
  filter: none !important;
}

/* ============================================================
   v1.6.1 NEW: Quality analysis & EVM dashboard
   ============================================================ */
.quality-workspace { flex: 1; overflow-y: auto; min-height: 0; padding: 20px; }
.quality-cards { display: flex; gap: 16px; flex-wrap: wrap; }
.quality-cards .card { flex: 1; min-width: 300px; }
.quality-placeholder { opacity: 0.6; }

.quality-summary-row {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.quality-stat {
  flex: 1; min-width: 100px; text-align: center;
  padding: 16px; border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}
.quality-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.quality-stat-warn { border-left: 4px solid var(--warning); }
.quality-stat-ok { border-left: 4px solid var(--success); }
.quality-stat-icon { font-size: 20px; margin-bottom: 4px; }
.quality-stat-num { font-size: 28px; font-weight: 700; font-family: 'JetBrains Mono', Consolas, monospace; }
.quality-stat-label { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

.quality-details { margin-top: 12px; }
.quality-issue-group { margin: 8px 0; }
.quality-issue-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.quality-issue-chip {
  background: var(--gray-100); padding: 2px 8px;
  border-radius: 12px; font-size: 11px;
  border: 1px solid var(--gray-200);
}

/* Baseline comparison */
.baseline-delayed { color: var(--danger); }
.baseline-ahead { color: var(--success); }

/* Project card KPI tags */
.project-card-kpi { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--gray-200); }
.kpi-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; margin-right: 4px;
}
.kpi-tag-critical { background: var(--accent-orange-light); color: var(--danger); }
.kpi-tag-ok { background: #d1fae5; color: var(--success); }
.kpi-tag-warn { background: #fef3c7; color: var(--warning); }

/* WBS health indicator */
.wbs-health-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}

/* CPM spinner */
.cpm-spinning { animation: cpm-spin 1s linear infinite; }
@keyframes cpm-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   CPM Loading Overlay & Result Modal
   ═══════════════════════════════════════════════════════════════════════════ */

.cpm-loading-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  animation: cpm-fade-in 0.2s ease;
}
.cpm-loading-card {
  background: #fff; border-radius: 16px; padding: 40px 48px;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-width: 400px;
}
.cpm-loading-card h3 { margin: 16px 0 8px; font-size: 18px; color: #1e293b; }
.cpm-loading-card p { font-size: 14px; color: #64748b; margin: 0; }
.cpm-spinner {
  width: 40px; height: 40px; border: 4px solid #e2e8f0;
  border-top-color: #3b82f6; border-radius: 50%;
  animation: cpm-spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes cpm-spin { to { transform: rotate(360deg); } }
@keyframes cpm-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* CPM Result Modal */
.cpm-result-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  animation: cpm-fade-in 0.2s ease;
}
.cpm-result-card {
  background: #fff; border-radius: 16px; width: 440px; max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25); overflow: hidden;
}
.cpm-result-header {
  display: flex; align-items: center; padding: 20px 24px;
  background: #f0fdf4; border-bottom: 1px solid #dcfce7;
}
.cpm-result-header .cpm-result-icon { font-size: 28px; margin-right: 12px; }
.cpm-result-header h2 { flex: 1; margin: 0; font-size: 18px; color: #166534; }
.cpm-result-close {
  background: none; border: none; font-size: 24px; color: #94a3b8;
  cursor: pointer; padding: 0 4px; line-height: 1;
}
.cpm-result-close:hover { color: #475569; }
.cpm-result-body { padding: 24px; }
.cpm-result-stats {
  display: flex; gap: 16px; justify-content: center;
}
.cpm-stat {
  text-align: center; padding: 16px 20px; background: #f8fafc;
  border-radius: 12px; min-width: 100px;
}
.cpm-stat-critical { background: #fef2f2; border-left: 4px solid var(--danger); }
.cpm-stat-num { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.cpm-stat-critical .cpm-stat-num { color: var(--danger); }
.cpm-stat-label { font-size: 12px; color: #64748b; margin-top: 4px; }
.cpm-result-footer {
  padding: 16px 24px; border-top: 1px solid #e2e8f0;
  display: flex; justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Progress Forecast Panel (inline in task editor)
   ═══════════════════════════════════════════════════════════════════════════ */

.forecast-inline {
  border: 1px solid #e2e8f0; border-radius: 8px;
  margin-bottom: 12px; overflow: hidden;
}
.forecast-result {
  border-color: #93c5fd; background: #fff;
}
.forecast-summary {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  padding: 12px 16px;
}
.forecast-summary-header {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 14px; color: #1e40af;
}
.forecast-close {
  background: none; border: none; font-size: 18px; color: #94a3b8;
  cursor: pointer; padding: 0;
}
.forecast-modified-info {
  margin-top: 8px; font-size: 12px; color: #475569;
  background: rgba(255,255,255,0.6); padding: 6px 10px; border-radius: 4px;
}
.forecast-stats {
  display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap;
}
.forecast-stat {
  font-size: 12px; padding: 4px 10px; background: rgba(255,255,255,0.7);
  border-radius: 4px; color: #475569;
}
.forecast-stat-warn { background: #fef2f2; color: var(--danger); }
.forecast-rows { padding: 8px 16px; max-height: 260px; overflow-y: auto; }
.forecast-row {
  padding: 10px 0; border-bottom: 1px solid #f1f5f9;
}
.forecast-row:last-child { border-bottom: none; }
.forecast-row-modified {
  background: #fffbeb; margin: 0 -16px; padding: 10px 16px;
  border-left: 3px solid #f59e0b;
}
.forecast-row-header {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.forecast-code {
  font-family: monospace; font-size: 12px; font-weight: 600;
  color: #3b82f6; background: #eff6ff; padding: 1px 6px; border-radius: 3px;
}
.forecast-name { font-size: 13px; font-weight: 500; color: #1e293b; flex: 1; }
.forecast-badge {
  font-size: 10px; padding: 2px 6px; border-radius: 3px;
  background: #fef3c7; color: #ea580c; font-weight: 500;
}
.forecast-row-detail {
  display: flex; gap: 16px; margin-top: 4px; font-size: 12px;
  color: #64748b; flex-wrap: wrap;
}
.forecast-row-detail strong { color: #334155; }
.forecast-better { color: #10b981 !important; }
.forecast-worse { color: var(--danger) !important; }
.forecast-actions {
  display: flex; gap: 8px; padding: 10px 16px;
  border-top: 1px solid #e2e8f0; background: #f8fafc;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .quality-summary-row { flex-direction: column; }
}


/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #fff; border-radius: 14px; box-shadow: 0 8px 40px rgba(0,0,0,.15); width: 90%; max-width: 480px; max-height: 85vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--gray-200); }
.modal-header h3 { margin: 0; font-size: 16px; }
.btn-close-modal { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--gray-400); line-height: 1; padding: 0 4px; }
.btn-close-modal:hover { color: var(--gray-600); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--gray-200); }

/* Form helpers */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--gray-700); }
.form-input { width: 100%; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 14px; box-sizing: border-box; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(2,132,199,0.1); }
select.form-input { appearance: auto; }

/* ── AI Panel ────────────────────────────────────────────────────────────────── */

.ai-panel {
  padding: 8px 0;
}

.ai-presets {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}

.ai-custom {
  display: flex; gap: 8px; margin-bottom: 16px;
}

.ai-input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--gray-300); border-radius: 8px;
  font-size: 14px; font-family: inherit; resize: vertical;
}

.ai-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.ai-result {
  border: 1px solid var(--gray-200); border-radius: 8px; overflow: hidden;
  margin-top: 16px;
}

.ai-result-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
}

.ai-result-header h3, .ai-result-header h4 {
  margin: 0; font-size: 15px;
}

.ai-result-content {
  padding: 16px; max-height: 500px; overflow-y: auto; font-size: 14px; line-height: 1.7;
}

.ai-result-content h1, .ai-result-content h2, .ai-result-content h3, .ai-result-content h4 {
  margin-top: 16px; margin-bottom: 8px; color: var(--primary);
}

.ai-result-content ul, .ai-result-content ol {
  padding-left: 24px; margin-bottom: 12px;
}

.ai-result-content pre {
  background: var(--gray-50); padding: 12px; border-radius: 6px;
  overflow-x: auto; font-size: 13px;
}

.ai-result-content code {
  background: var(--gray-50); padding: 2px 6px; border-radius: 4px; font-size: 13px;
}

.ai-loading {
  display: flex; align-items: center; gap: 12px; padding: 20px;
  background: var(--primary-light); border-radius: 8px; margin-top: 12px;
}

.ai-loading .spinner {
  width: 24px; height: 24px; border: 3px solid var(--gray-200);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── AI Editor ───────────────────────────────────────────────────────────────── */

.ai-editor {
  border: 1px solid var(--gray-200); border-radius: 8px; overflow: hidden;
}

.ai-editor-header {
  display: flex; align-items: center; padding: 10px 16px;
  background: linear-gradient(135deg, var(--surface-dark), var(--gray-800));
  border-bottom: 2px solid var(--accent-orange);
  color: #fff; font-weight: 600; font-size: 14px;
}

.ai-editor-header .muted { color: rgba(255,255,255,0.7); }

.ai-editor-icon { font-size: 18px; margin-right: 8px; }

.ai-editor-body { padding: 16px; }

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

.ai-edit-actions {
  display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px;
  background: var(--gray-50); border-top: 1px solid var(--gray-200);
}

.ai-explanation {
  padding: 8px 12px; background: var(--primary-light); border-radius: 6px;
  margin-bottom: 12px; font-size: 13px;
}

/* ── Badges ──────────────────────────────────────────────────────────────────── */

.badge-labor { background: #dbeafe; color: #1e40af; }
.badge-mat { background: #fef3c7; color: #92400e; }
.badge-equip { background: #d1fae5; color: #065f46; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

/* XER Info Panel (F3) */
.xer-stats-row { display: flex; gap: 12px; flex-wrap: wrap; }
.xer-stat { flex: 1; min-width: 80px; text-align: center; padding: 12px 8px; background: var(--gray-50); border-radius: var(--radius); }
.xer-stat-num { font-size: 24px; font-weight: 700; color: var(--primary); }
.xer-stat-label { font-size: 11px; color: var(--gray-500); margin-top: 2px; text-transform: uppercase; }
.xer-status-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* AI Task Widget (task editor inline) */
.ai-task-widget { margin-top: 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.ai-task-toggle { padding: 8px 12px; background: linear-gradient(135deg, var(--surface-dark), var(--gray-800)); color: #fff; cursor: pointer; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; user-select: none; }
.ai-task-toggle:hover { opacity: 0.92; }
.ai-task-toggle-arrow { font-size: 10px; transition: transform 0.2s; }
.ai-task-body { padding: 10px; background: var(--gray-50); }
.ai-task-body.hidden { display: none; }
.ai-task-input-row { display: flex; gap: 6px; }
.ai-task-input-row input { flex: 1; font-size: 12px; }
.ai-task-input-row button { flex-shrink: 0; }
.ai-task-result { margin-top: 8px; padding: 8px 10px; background: #fff; border-radius: 4px; border: 1px solid var(--gray-200); font-size: 12px; }
.ai-task-result.hidden { display: none; }

/* AI Chat Panel */
.ai-workspace, #ai-panel-container { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.ai-chat { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--gray-200); }
.ai-chat-header { padding: 14px 18px; background: linear-gradient(135deg, var(--surface-dark) 0%, var(--gray-800) 100%); color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--accent-orange); border-radius: 0; }
.ai-chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; background: var(--bg-main); }
.ai-chat-msg { display: flex; max-width: 90%; }
.ai-chat-msg-user { align-self: flex-end; }
.ai-chat-msg-ai { align-self: flex-start; }
.ai-chat-bubble { padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.6; box-shadow: var(--shadow-xs); }
.ai-chat-msg-user .ai-chat-bubble { background: var(--primary); color: #fff; border-radius: 12px 12px 2px 12px; }
.ai-chat-msg-ai .ai-chat-bubble { background: var(--bg-surface); border: 1px solid var(--gray-200); color: var(--text-primary); border-radius: 12px 12px 12px 2px; }
.ai-chat-bubble p { margin: 4px 0; }
.ai-chat-bubble ul { margin: 4px 0; padding-left: 18px; }
.ai-chat-bubble li { margin: 2px 0; }
.ai-chat-bubble strong { color: inherit; }
.ai-chat-msg-ai .ai-chat-bubble strong { color: var(--primary); }
.ai-chat-presets { display: flex; gap: 6px; padding: 8px 12px; flex-wrap: wrap; background: var(--bg-surface); border-top: 1px solid var(--gray-100); }
.ai-chat-presets button { font-size: 11px; }
/* v2.24.0: 模式/项目选择工具栏（计划问答/计划修改/计划更新） */
.ai-chat-toolbar { background: var(--bg-surface); border-top: 1px solid var(--gray-100); }
.ai-chat-mode-row { display: flex; gap: 8px; padding: 8px 12px 0; align-items: center; }
.ai-chat-mode-label { font-size: 12px; color: var(--gray-500); font-weight: 700; flex-shrink: 0; }
.ai-chat-mode-row .ai-input { padding: 6px 8px; font-size: 12px; }
.ai-chat-update-row { align-items: center; }
.ai-chat-update-row .btn { font-size: 11px; }
.ai-chat-input-row { display: flex; gap: 8px; padding: 10px 12px; background: var(--bg-surface); border-top: 1px solid var(--gray-200); border-radius: 0; }
.ai-chat-input-row textarea { flex: 1; font-size: 13px; resize: none; }
.ai-chat-input-row button { flex-shrink: 0; align-self: flex-end; }

/* AI Editor Steps (F2) */
.ai-steps { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; font-size: 12px; color: var(--gray-400); }
.ai-step { padding: 3px 8px; border-radius: 10px; background: var(--gray-100); }
.ai-step.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.ai-step.done { background: #d1fae5; color: var(--success); }
.ai-step-arrow { color: var(--gray-300); }
.ai-op-card { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 4px 0; background: var(--gray-50); border-radius: 6px; border-left: 3px solid var(--primary); }
.ai-op-icon { font-size: 16px; min-width: 24px; }
.ai-op-code { font-family: monospace; font-weight: 600; font-size: 13px; color: var(--primary); min-width: 80px; }

/* ── AI Bottom Chat Bar ──────────────────────────────────────────── */
.ai-bottom-bar { position: fixed; bottom: 0; right: 0; left: 260px; z-index: 1000; }
.ai-bottom-toggle { background: linear-gradient(135deg, var(--surface-dark), var(--gray-800)); border-top: 2px solid var(--accent-orange); color: #fff; padding: 8px 16px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; border-radius: 8px 8px 0 0; font-size: 13px; user-select: none; }
.ai-bottom-body { background: #fff; border: 1px solid var(--gray-200); border-bottom: none; max-height: 420px; display: flex; flex-direction: column; }
.ai-bottom-body.hidden { display: none; }
.ai-bottom-presets { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--gray-100); flex-wrap: wrap; }
.ai-bottom-messages { flex: 1; overflow-y: auto; padding: 12px; max-height: 300px; background: var(--gray-50); }
.ai-bottom-input-row { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--gray-200); }
.ai-bottom-input-row textarea { flex: 1; border: 1px solid var(--gray-200); border-radius: 6px; padding: 8px; font-size: 13px; resize: none; }
.ai-bottom-input-row .btn { flex-shrink: 0; }

/* ── Task highlight animation ────────────────────────────────────── */
.task-highlight { animation: taskPulse 1s ease-in-out 3; background: #fef3c7 !important; }
@keyframes taskPulse { 0%, 100% { background: #fef3c7; } 50% { background: #f9ab00; } }

/* ── Profile Page v2 ────────────────────────────────────────────── */
.profile-page-v2 { padding: 24px; max-width: 1000px; margin: 0 auto; }
.profile-topbar { margin-bottom: 20px; display: flex; align-items: center; gap: 16px; }
.profile-topbar h2 { font-size: 20px; margin: 0; }
.profile-grid { display: grid; grid-template-columns: 360px 1fr; gap: 20px; }
.profile-left { display: flex; flex-direction: column; gap: 16px; }
.profile-right { display: flex; flex-direction: column; }
.profile-card { background: #fff; border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-sm); }
.profile-card h3 { font-size: 16px; margin: 8px 0 4px; }
.profile-card h4 { font-size: 13px; color: var(--gray-700); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--gray-100); }
.profile-card-avatar { text-align: center; margin-bottom: 8px; }
.profile-card-avatar img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.avatar-initial { width: 80px; height: 80px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; margin: 0 auto; }

/* ── Profile Inline (v1.13.10) ─────────────────────────────────── */
.profile-inline { max-width: none; }
.profile-inline-title { font-size: 20px; margin-bottom: 20px; }
.profile-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.profile-stat-card { background: #fff; border-radius: var(--radius-md); padding: 18px 16px; text-align: center; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.profile-stat-icon { font-size: 24px; margin-bottom: 4px; }
.profile-stat-num { font-size: 28px; font-weight: 700; color: var(--primary); }
.profile-stat-label { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.profile-inline-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
.profile-inline-left { display: flex; flex-direction: column; gap: 16px; }
.profile-inline-right { display: flex; flex-direction: column; gap: 16px; }
.profile-project-list { display: flex; flex-direction: column; gap: 2px; }
.profile-project-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; transition: background 0.15s; }
.profile-project-item:hover { background: var(--primary-light); }
.profile-project-code { font-family: monospace; font-weight: 600; color: var(--primary); font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-project-date { font-size: 11px; color: var(--gray-400); white-space: nowrap; }
.profile-activity-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.profile-activity-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; font-size: 13px; }
.profile-activity-item:hover { background: var(--gray-50); }
.profile-activity-icon { font-size: 14px; flex-shrink: 0; }
.profile-activity-text { flex: 1; color: var(--gray-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-activity-time { font-size: 11px; color: var(--gray-400); white-space: nowrap; }

@media (max-width: 768px) {
  .profile-stats-row { grid-template-columns: repeat(2, 1fr); }
  .profile-inline-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .profile-stats-row { grid-template-columns: 1fr; }
}

/* ── Friends ─────────────────────────────────────────────────────── */
.friends-section h3 { margin-bottom: 12px; }
.friends-badge-row { display: flex; gap: 8px; margin-bottom: 12px; }
.badge-request { background: #fef3c7; color: #b06000; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-unread { background: #e53e3e; color: #fff; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.friend-search { display: flex; gap: 6px; margin-bottom: 12px; }
.friend-search .form-input { flex: 1; }
.friend-request-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; border-bottom: 1px solid var(--gray-100); }
.friend-list { margin-top: 12px; }
.friend-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--gray-50); flex-wrap: wrap; }
.friend-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.friend-name { font-weight: 500; flex: 1; }
.friend-username { font-size: 11px; color: var(--gray-500); }
.friend-search-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }

/* ── Chat Windows ────────────────────────────────────────────────── */
.chat-window { position: fixed; bottom: 80px; right: 20px; width: 340px; max-width: calc(100vw - 40px); max-height: 450px; background: #fff; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.15); display: flex; flex-direction: column; z-index: 2000; }
.chat-window-header { background: linear-gradient(135deg, var(--surface-dark), var(--gray-800)); border-bottom: 2px solid var(--accent-orange); color: #fff; padding: 10px 14px; border-radius: 12px 12px 0 0; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; }
.chat-window-messages { flex: 1; overflow-y: auto; padding: 12px; background: var(--gray-50); max-height: 300px; }
.chat-window-input { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--gray-200); }
.chat-msg { margin-bottom: 8px; }
.chat-msg-me { text-align: right; }
.chat-msg-me .chat-msg-bubble { background: var(--primary); color: #fff; display: inline-block; }
.chat-msg-them .chat-msg-bubble { background: #fff; border: 1px solid var(--gray-200); display: inline-block; }
.chat-msg-bubble { padding: 6px 12px; border-radius: 14px; font-size: 13px; max-width: 80%; word-wrap: break-word; }
.chat-msg-time { font-size: 10px; color: var(--gray-400); margin-top: 2px; }

/* ── Chat message avatars ──────────────────────────────── */
.chat-msg-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.chat-msg-avatar-text { width: 28px; height: 28px; border-radius: 50%; background: var(--gray-300);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
  color: var(--gray-700); flex-shrink: 0; font-weight: 600; }
.chat-msg-them { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.chat-msg-me { display: flex; flex-direction: column; align-items: flex-end; margin-bottom: 10px; }
.chat-msg-body { display: flex; flex-direction: column; }
.chat-msg-sender { font-size: 11px; color: var(--gray-500); margin-bottom: 2px; }

/* ── Chat notification toast ───────────────────────────────── */
.chat-notification-toast {
  position: fixed; bottom: 20px; right: 20px;
  background: linear-gradient(135deg, var(--surface-dark), var(--gray-800)); border-left: 3px solid var(--accent-orange); color: #fff;
  padding: 12px 20px; border-radius: 12px;
  cursor: pointer; z-index: 10000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  display: flex; align-items: center; gap: 12px;
  animation: slideInRight 0.3s ease;
  font-size: 14px; min-width: 200px; max-width: 360px;
}
.chat-notification-toast:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Online badge ────────────────────────────────────────────────── */
.online-badge { font-size: 11px; color: #16a34a; font-weight: 500; margin-bottom: 6px; text-align: center; }

/* ── Miscellaneous ───────────────────────────────────────────────── */
.ai-op-detail { font-size: 12px; color: var(--gray-600); }
.ai-explanation { font-size: 13px; color: var(--primary); }

/* ── Version Panel ─────────────────────────────────────────────── */
.version-card { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); overflow: hidden; }
.version-card-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-weight: 600; }
.version-card-header:hover { background: var(--gray-100); }
.version-card-body { padding: 0 18px 14px; }
.changelog-entry { padding: 8px 0; border-bottom: 1px solid var(--gray-200); }
.changelog-entry:last-child { border-bottom: none; }
.changelog-version { font-weight: 600; color: var(--primary); font-size: 14px; }
.changelog-date { font-size: 11px; color: var(--gray-400); }
.changelog-desc { font-size: 13px; color: var(--gray-600); margin-top: 2px; }

/* ── Nav unread badge ──────────────────────────────────────────── */
.nav-unread-badge { display: inline-block; background: #e53e3e; color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700; margin-left: 6px; vertical-align: middle; }
/* v2.3.0: 首页好友卡未读徽标（角标定位） */
.home-module[data-nav="friends"] .nav-unread-badge {
  position: absolute; top: 14px; right: 14px; margin-left: 0;
  box-shadow: 0 2px 8px rgba(229,62,62,0.35);
  z-index: 2;
}

/* ── Version Log Page (v1.18.2) ────────────────────────────────── */
.ver-page { width: 100%; }
.ver-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 18px; }
.ver-eyebrow { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--gray-500); margin-bottom: 10px; width: 100%; }
.ver-version {
  font-family: 'SF Mono', 'Consolas', 'Roboto Mono', monospace;
  font-size: 22px; font-weight: 700; color: var(--primary);
  background: var(--primary-light); border: 1px solid rgba(2,132,199,0.2);
  border-radius: 8px; padding: 2px 10px; line-height: 1.4;
}
.ver-title { font-size: 17px; font-weight: 600; color: var(--gray-900); }
.ver-date { font-size: 13px; color: var(--gray-500); }
.ver-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  box-shadow: var(--shadow-sm); padding: 22px 26px;
}
.ver-section { margin-bottom: 22px; padding-left: 16px; border-left: 3px solid var(--gray-300); }
.ver-section:last-child { margin-bottom: 0; }
.ver-section.ver-new  { border-left-color: var(--success); }
.ver-section.ver-fix  { border-left-color: var(--danger); }
.ver-section.ver-refactor { border-left-color: var(--primary); }
.ver-section-head { font-size: 14px; font-weight: 700; color: var(--gray-800); margin-bottom: 7px; }
.ver-list { list-style: none; margin: 0; padding: 0; }
.ver-list li { position: relative; padding: 3px 0 3px 16px; font-size: 14px; line-height: 1.65; color: var(--gray-700); }
.ver-list li::before {
  content: ''; position: absolute; left: 2px; top: 11px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}
.ver-section.ver-new .ver-list li::before { background: var(--success); }
.ver-section.ver-fix .ver-list li::before { background: var(--danger); }
.ver-strong { font-weight: 600; color: var(--gray-900); }

/* ── v1.23.8: AI 思考过程（deepseek 网页版风格）── */
.ai-thinking { margin: 6px 0; border: 1px solid var(--gray-200); border-radius: 8px; background: var(--gray-50); overflow: hidden; }
.ai-thinking-title { font-size: 12px; font-weight: 700; color: var(--gray-600); padding: 6px 10px; border-bottom: 1px solid var(--gray-200); background: #fff; }
.ai-thinking-body { font-size: 12px; color: var(--gray-700); padding: 6px 10px; line-height: 1.5; }
.ai-thinking.working .ai-thinking-body::after { content: ' ⏳'; animation: ai-blink 1s steps(2) infinite; }
@keyframes ai-blink { 50% { opacity: 0.3; } }
/* v2.23.0 (Phase E): 结构化思考步骤列表 —— 每步 工具名/note/状态（运行中→✓/✗） */
.ai-think-steps { padding: 4px 10px 0; display: flex; flex-direction: column; gap: 3px; }
.ai-step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-700); padding: 3px 6px; border-radius: 5px; background: #fff; border: 1px solid var(--gray-100); }
.ai-step .ai-step-ico { width: 14px; text-align: center; }
.ai-step .ai-step-name { font-weight: 600; color: var(--gray-800); }
.ai-step .ai-step-note { flex: 1; color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ai-step.running { border-color: var(--primary); }
.ai-step.running .ai-step-note::after { content: ' ⏳'; animation: ai-blink 1s steps(2) infinite; }
.ai-step.done { border-color: var(--gray-200); }
.ai-step.done .ai-step-note { color: var(--success); }
.ai-step.error { border-color: var(--danger); }
.ai-step.error .ai-step-note { color: var(--danger); }
.ai-think-stream { font-size: 12px; color: var(--gray-700); padding: 6px 10px 8px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* ── v2.0.0: 首页枢纽 + 会议记录 ── */
.home-wrap {
  min-height:100vh; color:var(--gray-900); padding:48px 24px 24px;
  display:flex; flex-direction:column; align-items:center;
  position:relative; overflow:hidden;
  /* v2.4.0: 紫粉渐变背景（浅色基调，紫/粉放射 wash） */
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(216,180,254,0.34), transparent 62%),
    radial-gradient(820px 560px at -10% 108%, rgba(249,168,212,0.28), transparent 62%),
    linear-gradient(160deg, #faf5ff 0%, #fff7fb 50%, #eef4fb 100%);
}
.home-hero { text-align:center; margin-bottom:40px; animation:home-fade .6s ease; position:relative; }
.home-hero-badge {
  display:inline-flex; align-items:center; gap:8px;
  background:#fff; border:1px solid rgba(2,132,199,0.35);
  padding:5px 14px; border-radius:999px; font-size:12px; letter-spacing:1.5px;
  margin-bottom:14px; color:var(--primary);
}
.home-badge-dot {
  width:8px; height:8px; border-radius:50%; background:var(--neon);
  animation:homeBlink 1.5s ease-in-out infinite;
}
@keyframes homeBlink { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.45; transform:scale(0.8); } }
.home-title {
  font-size:42px; font-weight:800; margin:0 0 8px;
  background:linear-gradient(90deg, #0891b2, #3b82f6);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; color:transparent;
}
.home-sub { font-size:15px; color:var(--gray-500); margin:0 0 20px; letter-spacing:0.5px; }
.home-user {
  font-size:14px; color:var(--gray-700);
  display:inline-flex; align-items:center; gap:8px;
  background:#fff; border:1px solid var(--gray-200);
  padding:6px 8px 6px 14px; border-radius:999px;
  box-shadow: var(--shadow-xs);
}
.home-user .btn-ghost {
  background:transparent; color:var(--primary);
  border:1px solid rgba(2,132,199,0.4); border-radius:999px;
  padding:4px 12px; font-size:12.5px; font-weight:600;
  transition:background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.home-user .btn-ghost:hover { background:var(--primary); color:#fff; box-shadow:0 4px 12px rgba(2,132,199,0.35); }
.home-modules { display:grid; grid-template-columns:repeat(4,1fr); gap:18px; max-width:1080px; width:100%; position:relative; }
@media (max-width:960px){ .home-modules{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:600px){ .home-modules{ grid-template-columns:1fr; } }
.home-module {
  background:#fff; color:var(--gray-900); border-radius:16px; padding:26px 22px; cursor:pointer;
  border-top:4px solid var(--mc);
  border-right:1px solid var(--gray-200); border-bottom:1px solid var(--gray-200); border-left:1px solid var(--gray-200);
  box-shadow:0 6px 20px rgba(15,23,42,0.06);
  opacity:0; transform:translateY(18px); animation:home-up .5s ease forwards;
  transition:transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  position:relative; overflow:hidden;
}
.home-module::before {
  content:''; position:absolute; right:-20px; top:-20px; width:96px; height:96px; border-radius:50%;
  background:radial-gradient(circle, color-mix(in srgb, var(--mc) 12%, transparent), transparent 70%);
  opacity:0.6; transition:opacity .25s ease, transform .25s ease; pointer-events:none;
}
.home-module:hover { transform:translateY(-6px); box-shadow:0 14px 32px rgba(15,23,42,0.12); border-color:var(--gray-300); }
.home-module:hover::before { opacity:1; transform:scale(1.15); }
.home-module-icon { margin-bottom:10px; color:var(--mc); display:inline-flex; }
.home-module-title { font-size:20px; font-weight:700; margin:0 0 6px; color:var(--gray-900); }
.home-module-desc { font-size:13px; color:var(--gray-500); line-height:1.6; margin:0 0 12px; }
.home-module-go { font-size:13px; font-weight:600; color:var(--mc); }
@keyframes home-fade { from{opacity:0} to{opacity:1} }
@keyframes home-up { to{opacity:1; transform:translateY(0)} }

/* ── v2.4.0: AI 助手大面板（项目页内 in-flow 全宽面板） ─────────── */
#tab-ai {
  position: static;
  width: auto; max-width: none; height: 100%;
  z-index: auto; margin: 0;
  background: transparent;
  border: none; border-radius: 0; box-shadow: none;
  display: flex; flex-direction: column; overflow: hidden;
}
#tab-ai.hidden { display: none !important; }
#tab-ai .ai-workspace { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 20px 24px; }
#tab-ai #ai-panel-container { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#tab-ai .ai-chat { flex: 1 1 auto; min-height: 0; height: auto; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); background: var(--bg-surface); }
#tab-ai .ai-chat-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
/* v2.7.1: 消息双侧对齐（用户右/AI 左）——auto margin 会把每行消息居中、覆盖 align-self，已删除；只限宽 860px */
#tab-ai .ai-chat-messages { padding: 16px 24px; align-items: center; }
#tab-ai .ai-chat-msg { max-width: 860px; }
#tab-ai .ai-chat-msg-user { justify-content: flex-end; }
#tab-ai .ai-chat-msg-ai { justify-content: flex-start; }
@media (max-width: 768px) {
  #tab-ai .ai-workspace { padding: 12px; }
}

/* ── v2.4.0: AI 浮动窗（全局常驻：可拖 / 可缩放 / 跨页面） ───────── */
.ai-float-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 9990;
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 22px; line-height: 1;
  box-shadow: 0 6px 20px rgba(2,132,199,0.4);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex; align-items: center; justify-content: center;
}
.ai-float-launcher:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 10px 26px rgba(2,132,199,0.5); }
.ai-float-window {
  position: fixed; left: calc(100vw - 470px); top: 90px;
  width: 420px; height: 560px; min-width: 320px; min-height: 240px;
  z-index: 9990;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(15,23,42,0.25);
  display: flex; flex-direction: column; overflow: hidden;
}
.ai-float-header {
  padding: 10px 14px; background: linear-gradient(135deg, var(--surface-dark) 0%, var(--gray-800) 100%);
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 8px; cursor: move; user-select: none;
  border-bottom: 2px solid var(--accent-orange); flex-shrink: 0;
}
.ai-float-ctx { font-size: 11px; color: rgba(255,255,255,.75); font-weight: 400; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-float-actions { display: flex; gap: 2px; flex-shrink: 0; }
.ai-float-actions button {
  background: transparent; border: none; color: #fff; cursor: pointer;
  width: 26px; height: 26px; border-radius: 6px; font-size: 13px; line-height: 1;
}
.ai-float-actions button:hover { background: rgba(255,255,255,.18); }
.ai-float-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-main); min-height: 0; }
.ai-float-messages .ai-chat-msg { max-width: 95%; }
.ai-float-input-row { display: flex; gap: 8px; padding: 10px 12px; background: var(--bg-surface); border-top: 1px solid var(--gray-200); flex-shrink: 0; }
.ai-float-input-row textarea { flex: 1; font-size: 13px; resize: none; }
.ai-float-input-row button { flex-shrink: 0; align-self: flex-end; }
.ai-float-resize { position: absolute; right: 0; bottom: 0; width: 20px; height: 20px; cursor: nwse-resize; z-index: 5; }
.ai-float-resize::after { content: ''; position: absolute; right: 5px; bottom: 5px; width: 10px; height: 10px; border-right: 2px solid var(--gray-400); border-bottom: 2px solid var(--gray-400); border-bottom-right-radius: 3px; }
.ai-float-window.ai-float-minimized { width: 280px !important; height: auto !important; }
.ai-float-window.ai-float-minimized .ai-float-messages,
.ai-float-window.ai-float-minimized .ai-float-input-row,
.ai-float-window.ai-float-minimized .ai-float-resize { display: none; }
.ai-float-window.hidden { display: none !important; }

/* v2.14.0 显示适配：窄屏下 AI 悬浮窗不超出视口（初始 left 按 470px 计算，<470px 时为负值出屏） */
@media (max-width: 480px) {
  .ai-float-window { left: 8px !important; width: calc(100vw - 16px) !important; max-width: calc(100vw - 16px); min-width: 0 !important; }
}

/* ── v2.6.0: 全局AI助手页（shell + 侧边栏布局；chat 居主内容区） ── */
.ai-page-chat { width: 100%; display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); background: var(--bg-surface); }
.ai-page-chat .ai-chat-messages { flex: 1; overflow-y: auto; padding: 16px 24px; }
.ai-page-chat .ai-chat-msg { max-width: 860px; width: auto; }

/* v2.25.0: 计划工程师Agent 独立全页 —— #plan-agent-chat 为 flex 宿主，内层 AIPanel #ai-chat 撑满 */
#plan-agent-chat { border-radius: var(--radius-lg); overflow: hidden; }
#plan-agent-chat > .ai-chat { flex: 1 1 auto; min-height: 0; height: auto; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); background: var(--bg-surface); }
#plan-agent-chat .ai-chat-messages { padding: 16px 24px; align-items: center; }
#plan-agent-chat .ai-chat-msg { max-width: 860px; width: auto; }

/* ── v2.3.0: 会议功能（实时/离线/声纹/历史） ─────────────────────── */
.meeting-main { display: flex; flex-direction: column; gap: 14px; }
.meeting-banner {
  padding: 10px 14px; border-radius: 8px; font-size: 13px; line-height: 1.6;
  display: flex; align-items: center; gap: 8px;
}
.meeting-banner code { background: rgba(255,255,255,.6); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.meeting-banner.error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.meeting-banner.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.meeting-banner.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

.live-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--gray-600); font-weight: 500; }
.live-status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-300); display: inline-block; flex-shrink: 0; }
.live-status-dot.on { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,0.18); animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

#live-caption { max-height: 320px; overflow-y: auto; overflow-x: auto; padding: 10px 14px; }
#live-caption table { border-collapse: collapse; width: 100%; }
#live-caption th { text-align: left; font-size: 12px; color: var(--gray-500); padding: 4px 8px; border-bottom: 1px solid var(--gray-200); }
#live-caption td { padding: 6px 8px; font-size: 13px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }

.vp-card { transition: box-shadow .2s ease, transform .2s ease; }
.vp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* v2.11.0: 声纹提取进度阶段清单 + 说话人试听 + 匹配提示 */
.vp-stage-list { display: flex; flex-wrap: wrap; gap: 6px; }
.vp-stage-item { font-size: 12px; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--gray-200); color: var(--gray-500); }
.vp-stage-item.done { border-color: var(--success, #22a06b); color: var(--success, #22a06b); background: rgba(34,160,107,.08); }
.vp-stage-item.active { border-color: var(--primary); color: var(--primary); background: rgba(var(--primary-rgb, 37,99,235),.08); font-weight: 600; }
.vp-stage-item.pending { opacity: .65; }
.vp-match-hint { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.vp-seg-list summary { cursor: pointer; font-size: 12px; color: var(--gray-600); }
.vp-seg-list summary:hover { color: var(--primary); }

/* v2.19.0: 文档共享面板好友选择下拉（搜索 + 头像） */
.fp { position: relative; flex: 1; min-width: 190px; }
.fp-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-md);
  background: #fff; font-size: 14px; color: var(--gray-700); cursor: pointer;
  transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
}
.fp-trigger:hover { border-color: var(--gray-400); }
.fp.open .fp-trigger { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(2,132,199,.12); }
.fp-value { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-value .fp-avatar { flex-shrink: 0; }
.fp-caret { color: var(--gray-400); font-size: 12px; transition: transform .15s; flex-shrink: 0; }
.fp.open .fp-caret { transform: rotate(180deg); }
.fp-panel {
  position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(15,23,42,.12); overflow: hidden;
}
.fp-search {
  width: 100%; padding: 8px 12px; border: none; border-bottom: 1px solid var(--gray-200);
  font-size: 13px; outline: none; box-sizing: border-box; background: #fff;
}
.fp-search:focus { box-shadow: inset 0 -2px 0 var(--primary); }
.fp-list { max-height: 220px; overflow-y: auto; padding: 4px; }
.fp-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.fp-item:hover { background: var(--gray-100); }
.fp-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary-light);
  color: var(--primary); font-size: 13px; font-weight: 600; display: flex; align-items: center;
  justify-content: center; overflow: hidden; flex-shrink: 0;
}
.fp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.fp-name { font-size: 13px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-uname { font-size: 12px; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-empty { display: flex; align-items: center; padding: 8px 12px; border: 1px dashed var(--gray-300); border-radius: var(--radius-md); background: var(--gray-50); }
.fp-empty-text { font-size: 13px; color: var(--gray-500); }
