/* ==================== CSS Variables ==================== */
:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #ec4899;
  --secondary-light: #f472b6;
  --accent: #8b5cf6;
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-accent: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.04), 0 1px 2px rgba(15,23,42,0.06);
  --shadow: 0 4px 6px -1px rgba(15,23,42,0.05), 0 2px 4px -1px rgba(15,23,42,0.04);
  --shadow-lg: 0 10px 25px -3px rgba(15,23,42,0.08), 0 4px 10px -2px rgba(99,102,241,0.08);
  --shadow-xl: 0 20px 40px -8px rgba(15,23,42,0.12), 0 8px 16px -4px rgba(99,102,241,0.10);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --sidebar-w: 240px;
  --type-manual: #6366f1;
  --type-ai: #ec4899;
  --type-hybrid: #f59e0b;
  --status-pending: #9ca3af;
  --status-in-progress: #6366f1;
  --status-completed: #10b981;
  --status-skipped: #9ca3af;
  --status-review-pending: #f59e0b;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, textarea, select { font-family: inherit; outline: none; }

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ==================== Layout ==================== */
.app { display: flex; min-height: 100vh; }

/* ==================== Sidebar ==================== */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

.logo-icon svg { width: 22px; height: 22px; color: #fff; }

.logo-text { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }
.logo-text span { display: block; font-size: 11px; font-weight: 400; color: rgba(255,255,255,0.5); margin-top: 2px; }

.nav-menu { flex: 1; padding: 16px 12px; overflow-y: auto; overflow-x: hidden; }

.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  padding: 8px 12px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }

.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: linear-gradient(180deg, var(--primary-light), var(--secondary));
  border-radius: 0 3px 3px 0;
}

.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.1); }

.btn-new-project {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(99,102,241,0.3);
}

.btn-new-project:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

.btn-new-project:active { transform: translateY(0); }

.btn-new-project svg { width: 18px; height: 18px; }

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 101;
  width: 40px; height: 40px;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  align-items: center;
  justify-content: center;
}

.sidebar-toggle svg { width: 22px; height: 22px; color: var(--text); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* ==================== Main Content ==================== */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ==================== Care iframe Embed ==================== */
.care-embed-container {
  width: 100%;
  height: calc(100vh - 0px);
  overflow: hidden;
  position: relative;
}
.care-embed-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.dc-embed-container {
  width: 100%;
  height: calc(100vh - 0px);
  overflow: hidden;
  position: relative;
}
.dc-embed-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 36px 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title { font-size: 24px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

.content { padding: 0 36px 48px; }

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn svg { width: 16px; height: 16px; }

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(99,102,241,0.4); filter: brightness(1.06); }

.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: var(--primary-light); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-success { background: var(--status-completed); color: #fff; }
.btn-success:hover { background: #059669; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,0.35); }

.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,0.35); }

.btn-warning { background: var(--status-review-pending); color: #fff; }
.btn-warning:hover { background: #d97706; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,0.35); }

.btn-ghost { background: transparent; color: var(--text-secondary); padding: 7px 12px; }
.btn-ghost:hover { background: var(--bg); color: var(--primary); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ==================== Stat Cards ==================== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 14px; bottom: 14px; left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle at center, rgba(99,102,241,0.07) 0%, transparent 70%);
  transform: translate(35%, -35%);
  pointer-events: none;
  transition: var(--transition);
}

.stat-card.total::before { background: linear-gradient(180deg, var(--primary), var(--primary-light)); }
.stat-card.active::before { background: linear-gradient(180deg, var(--status-in-progress), var(--primary-light)); }
.stat-card.completed::before { background: linear-gradient(180deg, var(--status-completed), #34d399); }
.stat-card[style*="--card-accent"]::before { background: var(--card-accent); }

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card:hover::after { transform: translate(30%, -30%) scale(1.1); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card.total .stat-icon { background: #eef2ff; color: var(--primary); }
.stat-card.active .stat-icon { background: #eef2ff; color: var(--status-in-progress); }
.stat-card.completed .stat-icon { background: #ecfdf5; color: var(--status-completed); }

.stat-icon svg { width: 26px; height: 26px; }

.stat-info { flex: 1; }
.stat-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* 通用卡片容器（用户管理等表格用） */
.card {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: 20px;
  box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.06));
  overflow-x: auto;
}

/* ==================== Project Grid ==================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  background: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, rgba(236,72,153,0.04) 100%);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.project-card:hover::after { opacity: 1; }

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}

.project-name { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.4; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-hospital { background: #fee2e2; color: #dc2626; }
.tag-residential { background: #dbeafe; color: #2563eb; }
.tag-office { background: #d1fae5; color: #059669; }
.tag-factory { background: #fef3c7; color: #d97706; }
.tag-default { background: #f3f4f6; color: #6b7280; }

.project-meta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.project-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.project-meta-label { color: var(--text-secondary); }
.project-meta-value { color: var(--text); font-weight: 600; }

.progress-section { margin-top: 4px; }

.progress-bar-container {
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ==================== Empty State ==================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state svg { width: 64px; height: 64px; color: var(--text-light); margin-bottom: 16px; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-desc { font-size: 14px; color: var(--text-light); max-width: 320px; }

/* ==================== Project Detail ==================== */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 4px;
}
.detail-back:hover { color: var(--primary); }
.detail-back svg { width: 18px; height: 18px; }

.detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.detail-title { font-size: 26px; font-weight: 800; color: var(--text); }

.detail-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 12px;
  padding: 16px 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.info-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.info-item svg { width: 16px; height: 16px; color: var(--text-light); }
.info-label { color: var(--text-secondary); }
.info-value { color: var(--text); font-weight: 600; }

/* ==================== Workflow Progress Bar ==================== */
.workflow-progress {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  margin: 24px 0;
}

.workflow-progress-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.workflow-progress-title svg { width: 18px; height: 18px; color: var(--primary); }

.progress-nodes {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  overflow-x: auto;
  padding-bottom: 8px;
  min-width: 0;
}

.progress-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  min-width: 70px;
}

.progress-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  border: 3px solid var(--card-bg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: var(--transition);
  position: relative;
}

.progress-circle.current {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(99,102,241,0); }
}

.progress-node-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 8px;
  text-align: center;
  white-space: nowrap;
  font-weight: 500;
}

.progress-node.current .progress-node-label { color: var(--primary); font-weight: 700; }

.progress-connector {
  position: absolute;
  top: 20px;
  height: 3px;
  z-index: 0;
}

/* ==================== Node Cards ==================== */
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title svg { width: 20px; height: 20px; color: var(--primary); }

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

.node-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  overflow: hidden;
}

.node-card:hover { box-shadow: var(--shadow); border-color: var(--border); }

.node-card.current {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow);
}

.node-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  gap: 12px;
}

.node-card-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }

.node-index {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.node-info { flex: 1; min-width: 0; }
.node-name { font-size: 15px; font-weight: 600; color: var(--text); }
.node-type-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }

.node-card-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.node-actions { display: flex; gap: 6px; }

.node-expand-icon {
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-light);
  transition: var(--transition);
}
.node-expand-icon svg { width: 18px; height: 18px; }
.node-card.expanded .node-expand-icon { transform: rotate(180deg); background: var(--bg); }

.node-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.node-card.expanded .node-card-body { max-height: 800px; }

.node-data-section { padding: 0 20px 20px; }

.node-data-block { margin-top: 12px; }

.node-data-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.node-data-label svg { width: 14px; height: 14px; }

.json-viewer {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: "SF Mono", "Consolas", "Monaco", monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.json-empty { color: var(--text-light); font-style: italic; font-size: 13px; padding: 8px 0; }

.node-meta-row {
  display: flex;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

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

/* ==================== Tabs ==================== */
.detail-tabs {
  display: flex;
  gap: 4px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow-sm);
  margin: 24px 0 16px;
  width: fit-content;
}

.tab-btn {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover { color: var(--text); background: var(--bg); }
.tab-btn.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,0.3); }
.tab-btn svg { width: 16px; height: 16px; }

.tab-content { min-height: 200px; }

/* ==================== File List ==================== */
.file-list { display: flex; flex-direction: column; gap: 8px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.file-item:hover { box-shadow: var(--shadow); transform: translateX(2px); }

.file-icon {
  width: 40px; height: 40px;
  background: #eef2ff;
  color: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.file-icon svg { width: 22px; height: 22px; }

.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ==================== Meeting List ==================== */
.meeting-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}

.meeting-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.meeting-title { font-size: 15px; font-weight: 600; color: var(--text); }
.meeting-date { font-size: 12px; color: var(--text-secondary); }
.meeting-content { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.meeting-participants { font-size: 12px; color: var(--text-light); margin-top: 8px; }

/* ==================== Audit Log ==================== */
.audit-list { display: flex; flex-direction: column; gap: 0; position: relative; }

.audit-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  position: relative;
}

.audit-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 28px;
  bottom: -12px;
  width: 2px;
  background: var(--border);
}

.audit-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  border: 3px solid var(--card-bg);
  box-shadow: 0 0 0 1px var(--border);
}

.audit-content { flex: 1; }
.audit-action { font-size: 14px; font-weight: 600; color: var(--text); }
.audit-detail { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.audit-time { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ==================== Modal ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.modal-overlay.show .modal { transform: scale(1) translateY(0); }

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title { font-size: 18px; font-weight: 700; color: var(--text); }

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-close svg { width: 20px; height: 20px; }

.modal-body { padding: 24px 28px; }

.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==================== Form ==================== */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.form-label .required { color: #ef4444; margin-left: 2px; }

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--card-bg);
  transition: var(--transition);
}

.form-input:hover, .form-textarea:hover, .form-select:hover { border-color: #cbd5e1; }

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background: #fff;
}

.form-textarea { resize: vertical; min-height: 120px; font-family: "SF Mono","Consolas","Monaco",monospace; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Business type selector */
.biz-type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.biz-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  background: var(--card-bg);
}

.biz-type-card:hover { border-color: var(--primary-light); background: #f5f3ff; }

.biz-type-card.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, #eef2ff 0%, #fce7f3 100%);
  box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}

.biz-type-card.selected .biz-type-icon { transform: scale(1.1); }

.biz-type-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.biz-type-card.hospital .biz-type-icon { background: #fee2e2; color: #dc2626; }
.biz-type-card.residential .biz-type-icon { background: #dbeafe; color: #2563eb; }
.biz-type-card.office .biz-type-icon { background: #d1fae5; color: #059669; }
.biz-type-card.factory .biz-type-icon { background: #fef3c7; color: #d97706; }
.biz-type-card.other .biz-type-icon { background: #f3f4f6; color: #6b7280; }
.biz-type-icon svg { width: 24px; height: 24px; }

.biz-type-name { font-size: 14px; font-weight: 600; color: var(--text); }
.biz-type-desc { font-size: 11px; color: var(--text-secondary); text-align: center; }

/* ==================== Toast ==================== */
.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  min-width: 260px;
  max-width: 400px;
  background: var(--card-bg);
  animation: toastIn 0.3s cubic-bezier(0.4,0,0.2,1);
}

.toast.fade-out { animation: toastOut 0.3s cubic-bezier(0.4,0,0.2,1) forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

.toast svg { width: 20px; height: 20px; flex-shrink: 0; }
.toast.success { border-left: 4px solid var(--status-completed); }
.toast.success svg { color: var(--status-completed); }
.toast.error { border-left: 4px solid #ef4444; }
.toast.error svg { color: #ef4444; }
.toast.info { border-left: 4px solid var(--primary); }
.toast.info svg { color: var(--primary); }

/* ==================== Loading ==================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248,250,252,0.7);
  backdrop-filter: blur(2px);
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.loading-overlay.show { display: flex; pointer-events: auto; }

.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.loading-inline .spinner { width: 36px; height: 36px; border-width: 3px; }

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay.show { display: block; }
  .main { margin-left: 0; }
  .page-header { padding: 28px 16px 16px; }
  .content { padding: 0 16px 32px; }
  .form-row { grid-template-columns: 1fr; }
  .biz-type-grid { grid-template-columns: 1fr 1fr; }
  .detail-info-bar { gap: 8px 16px; }
  .progress-nodes { min-width: 720px; }
  .node-card-header { flex-wrap: wrap; }
  .node-actions { flex-wrap: wrap; }
  .content table, .modal table { display: block; overflow-x: auto; white-space: nowrap; }
  .stat-card { padding: 16px; gap: 12px; }
  .page-title { font-size: 20px; }
}

/* ==================== Login Page ==================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 2rem;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: var(--primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.login-logo svg { width: 28px; height: 28px; }
.login-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.login-header p {
  font-size: 0.875rem;
  color: var(--text-light);
}
.login-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.login-tab {
  flex: 1;
  padding: 0.75rem;
  text-align: center;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.login-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.login-form .form-field {
  margin-bottom: 1rem;
}
.login-form .form-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.login-form .form-field input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.login-form .form-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.login-submit {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}
.login-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-lighter);
  margin-top: 1rem;
  padding: 0.5rem;
  background: var(--bg);
  border-radius: 6px;
}

/* ==================== QR Login ==================== */
.login-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0;
}
.login-qr-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.login-qr-tip {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}
.qr-box {
  width: 240px;
  height: 240px;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.qr-box img {
  width: 220px;
  height: 220px;
  display: block;
}
.qr-mask {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  padding: 1rem;
}
.qr-mask .qr-mask-text {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
}
.qr-mask .qr-refresh-btn {
  margin-top: 0.25rem;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.qr-mask .qr-refresh-btn:hover { opacity: 0.9; }
.qr-status-text {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--primary);
  min-height: 1.2em;
  text-align: center;
}
.qr-status-text.scanned { color: var(--success, #10b981); }
.qr-status-text.expired { color: #ef4444; }

/* QR 手机确认页 */
.qr-confirm-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 2rem;
}
.qr-confirm-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}
.qr-confirm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.qr-confirm-icon svg { width: 32px; height: 32px; }
.qr-confirm-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.qr-confirm-card p {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}
.qr-confirm-card .btn { width: 100%; }

/* 用户状态标签 */
.user-status-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.user-status-tag.active { background: #d1fae5; color: #059669; }
.user-status-tag.disabled { background: #fee2e2; color: #dc2626; }

/* ==================== User Info ==================== */
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  transition: background 0.2s;
}
.user-info:hover { background: var(--border); }
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.user-detail { min-width: 0; }
.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 0.72rem;
  color: var(--text-light);
}

/* ==================== AI Button ==================== */
.btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
}
.btn-accent:hover { background: #db2777; }

/* ==================== Export Buttons ==================== */
.export-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ==================== Quantity Table ==================== */
.qty-meta {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 8px;
}
.qty-meta div { display: flex; gap: 8px; align-items: center; }
.qty-meta span { font-size: 0.82rem; color: var(--text-light); }
.qty-meta strong { font-size: 0.9rem; }
.qty-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.qty-table th, .qty-table td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  text-align: left;
}
.qty-table th {
  background: var(--bg);
  font-weight: 600;
  font-size: 0.78rem;
}
.qty-table tfoot td {
  background: var(--bg);
  font-size: 0.88rem;
}
.qty-table tbody tr:hover { background: #f9fafb; }
.qty-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.qty-summary-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.qty-summary-item.total {
  background: var(--primary);
  color: #fff;
}
.qty-summary-label {
  font-size: 0.72rem;
  margin-bottom: 4px;
  opacity: 0.8;
}
.qty-summary-value {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ==================== Knowledge Base ==================== */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.knowledge-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.knowledge-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.knowledge-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.knowledge-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.knowledge-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.knowledge-card-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.knowledge-chunks {
  font-size: 0.75rem;
  color: var(--text-lighter);
}
.knowledge-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.knowledge-date {
  font-size: 0.75rem;
  color: var(--text-lighter);
}
.knowledge-actions {
  display: flex;
  gap: 6px;
}
.btn-danger {
  background: #fee2e2;
  color: #ef4444;
  border: none;
}
.btn-danger:hover { background: #fecaca; }
.kb-detail-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--text-light);
}
.kb-chunks-list {
  max-height: 500px;
  overflow-y: auto;
}
.kb-chunk {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}
.kb-chunk-idx {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
  margin-bottom: 4px;
}
.kb-chunk pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 0;
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-slideUp { animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-slideDown { animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-scaleIn { animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* ==================== Dashboard ==================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 8px;
}
.dashboard-col { display: flex; flex-direction: column; gap: 20px; }
.dash-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}
.dash-card:hover { box-shadow: var(--shadow-lg); }
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--border-light);
}
.dash-card-header h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.dash-card-body { padding: 20px 24px; }

/* Bar Chart */
.bar-chart-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.bar-chart-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  width: 70px;
  flex-shrink: 0;
  font-weight: 500;
}
.bar-chart-track {
  flex: 1;
  height: 24px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}
.bar-chart-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.85;
}
.bar-chart-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

/* Recent Projects */
.recent-project-list { display: flex; flex-direction: column; gap: 4px; }
.recent-project-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.recent-project-item:hover { background: var(--bg); }

/* ==================== 项目看板 ==================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.kanban-col {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 120px;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 12px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 12px;
}
.kanban-col-dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban-col-title { font-weight: 700; font-size: 0.9rem; color: var(--text); flex: 1; }
.kanban-col-count {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.kanban-col-body { display: flex; flex-direction: column; gap: 10px; }
.kanban-empty {
  text-align: center;
  padding: 24px 8px;
  font-size: 0.8rem;
  color: var(--text-light);
}
.kanban-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}
.kanban-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kanban-biz-dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 4px;
}
.kanban-card-amount {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.kanban-card-node {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.kanban-card-progress {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 4px;
}
@media (max-width: 900px) {
  .kanban-board { grid-template-columns: 1fr; }
}
.recent-project-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.recent-project-info { flex: 1; min-width: 0; }
.recent-project-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-project-meta { font-size: 0.72rem; color: var(--text-light); }

/* KB Stats */
.kb-stats-row {
  display: flex;
  gap: 16px;
  justify-content: space-around;
}
.kb-stat-item { text-align: center; }
.kb-stat-num {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.kb-stat-label { font-size: 0.72rem; color: var(--text-light); margin-top: 2px; }

/* Donut Chart */
.donut-chart-container {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: center;
}
.donut-chart {
  width: 140px; height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.donut-chart-center {
  width: 90px; height: 90px;
  background: var(--card-bg);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut-chart-num { font-size: 24px; font-weight: 800; color: var(--text); }
.donut-chart-label { font-size: 0.72rem; color: var(--text-light); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.donut-legend-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.donut-legend-item strong { color: var(--text); font-weight: 700; }

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

/* ==================== Collaboration Modules ==================== */
.comm-list { display: flex; flex-direction: column; gap: 12px; }
.member-list { display: flex; flex-direction: column; gap: 8px; }
.member-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.member-item:hover { background: var(--card-bg); box-shadow: var(--shadow-sm); }
.member-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.member-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.member-name { font-size: 0.92rem; font-weight: 600; color: var(--text); }

/* ==================== Tier Badges ==================== */
.tier-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 6px;
}
.tier-badge-free { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.tier-badge-paid { background: linear-gradient(135deg, #eef2ff, #fce7f3); color: #6366f1; border: 1px solid #c7d2fe; }

/* ==================== Tier Selector (Registration) ==================== */
.tier-selector {
  display: flex;
  gap: 12px;
}
.tier-option {
  flex: 1;
  display: block;
  cursor: pointer;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative;
}
.tier-option:hover { border-color: var(--primary-light); background: #fafaff; }
.tier-option.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, #eef2ff 0%, #fce7f3 100%);
  box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}
.tier-option input[type="radio"] { display: none; }
.tier-option-content { text-align: center; }
.tier-option-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.tier-option-desc { font-size: 12px; color: var(--text-secondary); }

/* ==================== Knowledge Outline Card ==================== */
.knowledge-card.outline-only {
  border-left: 3px solid #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
}
.knowledge-outline {
  padding: 12px 16px;
  margin: 8px 0;
  background: rgba(245,158,11,0.06);
  border-radius: var(--radius-sm);
}
.outline-label, .summary-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.outline-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.outline-list li {
  font-size: 13px;
  color: var(--text);
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}
.outline-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d1d5db;
}
.outline-list .outline-more {
  color: var(--text-light);
  font-style: italic;
  padding-left: 0;
}
.outline-list .outline-more::before { display: none; }

/* ==================== Knowledge Summary ==================== */
.knowledge-summary {
  padding: 10px 16px;
  margin: 4px 0;
}
.knowledge-summary p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ==================== Upgrade Prompt ==================== */
.upgrade-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #92400e;
  background: linear-gradient(135deg, #fef3c7, #fffbeb);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #fcd34d;
}

/* ==================== Navigation Reorganization ==================== */
.nav-section-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 8px 12px;
}

.onboard-banner{display:flex;align-items:center;gap:18px;background:linear-gradient(135deg,#6366f1 0%,#8b5cf6 100%);color:#fff;border-radius:16px;padding:20px 22px;margin-bottom:18px;box-shadow:0 10px 25px -3px rgba(99,102,241,.25)}
    .onboard-ic{font-size:30px}
    .onboard-body{flex:1}
    .onboard-title{font-size:16px;font-weight:700}
    .onboard-desc{font-size:13px;opacity:.92;margin:2px 0 8px}
    .onboard-steps{display:flex;gap:10px;flex-wrap:wrap}
    .onboard-steps .os{background:rgba(255,255,255,.15);border-radius:9px;padding:5px 11px;font-size:12px}
    .onboard-steps .os b{display:inline-block;width:18px;height:18px;line-height:18px;text-align:center;background:rgba(255,255,255,.25);border-radius:50%;margin-right:5px;font-size:11px}
    .onboard-actions{display:flex;flex-direction:column;gap:8px;align-items:flex-end}
    .onboard-skip{background:none;border:none;color:rgba(255,255,255,.85);font-size:12px;cursor:pointer;text-decoration:underline}
    .nav-badge{margin-left:auto;background:#ec4899;color:#fff;font-size:11px;padding:1px 7px;border-radius:9px}
    .nav-sub{font-size:10px;color:#c7d2fe;font-weight:400;text-transform:none;letter-spacing:0}
    .nav-sub-inline{margin-left:auto;font-size:10px;color:#c7d2fe;background:rgba(255,255,255,.12);padding:1px 6px;border-radius:6px}

/* ==================== 子模块插件框架：通用嵌入容器 ==================== */
.module-embed {
  width: 100%;
  height: calc(100vh - 0px);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.module-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #fff);
  flex: none;
}
.module-bar-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.module-bar-info svg { width: 22px; height: 22px; color: #34D399; flex: none; }
.module-bar-title { font-weight: 600; font-size: 15px; color: #0f172a; line-height: 1.2; }
.module-bar-sub { font-size: 12px; color: #64748b; line-height: 1.3; }
.module-bar-actions { flex: none; }
.module-frame { flex: 1 1 auto; width: 100%; border: 0; min-height: 0; background: #fff; display: block; }

/* ===== 全局搜索 (P2F-04) ===== */
.global-search { position: relative; padding: 0 12px 12px; }
.gs-icon { position: absolute; left: 24px; top: 11px; width: 16px; height: 16px; color: rgba(255,255,255,0.5); pointer-events: none; }
.gs-input {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px 8px 34px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08); color: #fff;
  font-size: 13px; outline: none;
}
.gs-input::placeholder { color: rgba(255,255,255,0.45); }
.gs-input:focus { border-color: #34D399; background: rgba(255,255,255,0.14); }
.gs-results {
  display: none; position: absolute; left: 12px; right: 12px; top: 42px; z-index: 50;
  background: #fff; border-radius: 10px; box-shadow: 0 8px 28px rgba(15,23,42,0.22);
  max-height: 340px; overflow-y: auto; padding: 6px;
}
.gs-group { font-size: 11px; color: #94a3b8; padding: 6px 10px 3px; font-weight: 600; letter-spacing: 0.3px; }
.gs-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer; color: #0f172a; }
.gs-item:hover { background: #f1f5f9; }
.gs-type { flex: none; width: 20px; height: 20px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; }
.gs-type.proj { background: #6366f1; }
.gs-type.doc { background: #10b981; }
.gs-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-empty { padding: 14px 10px; font-size: 13px; color: #94a3b8; text-align: center; }

/* ===== 站内通知铃铛 ===== */
.notif-bell {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin: 0 auto 8px;
  border-radius: 9px; cursor: pointer; color: #e2e8f0;
  transition: background .15s;
}
.notif-bell:hover { background: rgba(255,255,255,0.1); }
.notif-bell svg { width: 21px; height: 21px; }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #1e293b;
}
.notif-panel {
  position: absolute; bottom: 46px; left: 8px; width: 320px;
  background: #fff; color: #0f172a; border-radius: 12px;
  box-shadow: 0 12px 34px rgba(15,23,42,0.28);
  display: none; z-index: 1200; overflow: hidden;
}
.notif-panel.show { display: block; animation: notifIn .14s ease; }
@keyframes notifIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid #eef2f7; font-weight: 600; font-size: 14px;
}
.notif-panel-header a { font-size: 12px; color: #6366f1; cursor: pointer; font-weight: 500; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #eef2ff; }
.notif-item.unread .notif-item-title::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #6366f1; margin-right: 7px; vertical-align: middle;
}
.notif-item-title { font-size: 13.5px; font-weight: 600; color: #1e293b; }
.notif-item-body { font-size: 12.5px; color: #64748b; margin-top: 3px; line-height: 1.45; }
.notif-item-time { font-size: 11px; color: #94a3b8; margin-top: 5px; }
.notif-empty, .notif-loading { padding: 26px 14px; text-align: center; color: #94a3b8; font-size: 13px; }

/* ===== 导入差异预览 ===== */
.diff-col-title { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.diff-box {
  border: 1px solid var(--border-light, #e2e8f0); border-radius: 8px;
  background: var(--bg, #f8fafc); max-height: 360px; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.6;
  padding: 6px 0; white-space: pre-wrap; word-break: break-all;
}
.diff-line { padding: 0 10px; }
.diff-line.diff-add { background: #dcfce7; color: #166534; }
.diff-line.diff-del { background: #fee2e2; color: #991b1b; }

/* ===== 知识库联动设备清单（编制依据） ===== */
.qty-ref-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--border-light, #e2e8f0);
  background: var(--bg, #f8fafc);
}
.qty-ref-bar label { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.qty-ref-hint { font-size: 11.5px; color: var(--text-muted, #94a3b8); }
.qty-ref-box {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 10px;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff); border: 1px solid #c7d2fe;
}
.qty-ref-box-title { font-size: 11.5px; font-weight: 700; color: #4f46e5; letter-spacing: .3px; margin-bottom: 5px; }
.qty-ref-doc { font-size: 13px; color: #334155; line-height: 1.5; }
