/* =============================================
   翠湖 AI · 法律辅助系统 · 全局样式
   ============================================= */

:root {
  --brand: #1a4a8a;
  --brand-light: #2563eb;
  --brand-dark: #0f2d5c;
  --brand-bg: #eff4ff;
  --green: #16a34a;
  --green-light: #dcfce7;
  --orange: #ea580c;
  --orange-light: #fff7ed;
  --red: #dc2626;
  --red-light: #fef2f2;
  --yellow: #d97706;
  --yellow-light: #fffbeb;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-lg: 14px;
  --transition: 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Noto Sans SC', -apple-system, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* =============================================
   顶部导航栏
   ============================================= */
.topbar {
  height: 56px;
  background: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.topbar-left { display: flex; align-items: center; gap: 32px; }

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo-icon {
  width: 32px; height: 32px;
  background: var(--brand-light);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 16px;
}
.logo-text { color: white; font-size: 16px; font-weight: 700; }
.logo-tag {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.main-nav { display: flex; gap: 4px; }
.nav-item {
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  display: flex; align-items: center; gap: 6px;
  transition: var(--transition);
  cursor: pointer;
}
.nav-item:hover { color: white; background: rgba(255,255,255,0.12); }
.nav-item.active { color: white; background: var(--brand-light); }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.weixin-status, .model-status {
  display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.75);
  font-size: 12px;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
}
.status-dot.online { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.status-dot.offline { background: #ef4444; }

.user-avatar {
  width: 30px; height: 30px;
  background: var(--brand-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 600;
}

/* =============================================
   主容器 & 页面
   ============================================= */
.main-container {
  flex: 1;
  padding: 24px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.page { display: none; animation: fadeIn 0.25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 10px; }
.page-header h1 i { color: var(--brand-light); }
.subtitle { color: var(--gray-500); margin-top: 4px; font-size: 13px; }
.subtitle strong, .subtitle em { color: var(--brand-light); font-style: normal; }

/* =============================================
   工作台统计卡片
   ============================================= */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.blue { background: var(--brand-bg); color: var(--brand-light); }
.stat-icon.orange { background: var(--orange-light); color: var(--orange); }
.stat-icon.green { background: var(--green-light); color: var(--green); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }

.stat-info { flex: 1; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

.stat-trend { font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 3px; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }

/* =============================================
   工作台网格
   ============================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.dashboard-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-header h3 { font-size: 14px; font-weight: 600; color: var(--gray-800); display: flex; align-items: center; gap: 7px; }
.card-header h3 i { color: var(--brand-light); }
.card-action { font-size: 12px; color: var(--brand-light); cursor: pointer; }
.card-action:hover { text-decoration: underline; }
.card-header-right { display: flex; align-items: center; gap: 8px; }

/* 快捷操作 */
.quick-action-list { padding: 12px; }
.quick-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: var(--transition);
  text-align: left;
}
.quick-btn:hover { background: var(--gray-50); }
.quick-btn:last-child { margin-bottom: 0; }
.qbtn-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.qbtn-icon.blue { background: var(--brand-bg); color: var(--brand-light); }
.qbtn-icon.green { background: var(--green-light); color: var(--green); }
.qbtn-icon.purple { background: var(--purple-light); color: var(--purple); }
.qbtn-text { flex: 1; }
.qbtn-text strong { display: block; font-size: 13px; color: var(--gray-800); }
.qbtn-text span { display: block; font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.quick-btn > .fa-chevron-right { color: var(--gray-300); font-size: 12px; }

/* 任务列表 */
.task-list { padding: 0 12px 12px; }
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 8px;
  transition: var(--transition);
}
.task-item:hover { background: var(--gray-50); }
.task-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}
.task-icon.contract { background: var(--brand-bg); color: var(--brand-light); }
.task-icon.case { background: var(--orange-light); color: var(--orange); }
.task-icon.rag { background: var(--purple-light); color: var(--purple); }
.task-info { flex: 1; }
.task-info strong { display: block; font-size: 12px; color: var(--gray-800); margin-bottom: 3px; }
.task-info span { font-size: 11px; color: var(--gray-500); }
.risk-high { color: var(--red); font-weight: 600; font-style: normal; }
.risk-mid { color: var(--orange); font-weight: 600; font-style: normal; }
.risk-low { color: var(--yellow); font-weight: 600; font-style: normal; }
.risk-ok { color: var(--green); font-weight: 600; font-style: normal; }
.task-time { font-size: 11px; color: var(--gray-400); flex-shrink: 0; }

/* 企业微信消息 */
.weixin-msg-list { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.weixin-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.wx-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-light);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.wx-avatar.sys { background: var(--gray-600); font-size: 13px; }
.wx-content { flex: 1; }
.wx-meta { display: flex; gap: 6px; align-items: baseline; margin-bottom: 3px; }
.wx-meta strong { font-size: 12px; color: var(--gray-700); }
.wx-meta span { font-size: 10px; color: var(--gray-400); }
.wx-bubble {
  background: var(--gray-100);
  border-radius: 0 8px 8px 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.5;
}
.wx-bubble i { color: var(--brand-light); margin-right: 4px; }
.wx-bubble small { display: block; margin-top: 3px; color: var(--gray-500); }
.sys-bubble { background: #e0f2fe; color: #0c4a6e; border-radius: 8px 8px 8px 0; }
.badge-count {
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

/* =============================================
   合同审查页面
   ============================================= */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  background: white;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 16px;
}
.upload-zone:hover { border-color: var(--brand-light); background: var(--brand-bg); }
.upload-inner {
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.upload-icon { font-size: 40px; color: var(--gray-400); }
.upload-zone:hover .upload-icon { color: var(--brand-light); }
.upload-inner h3 { font-size: 15px; color: var(--gray-700); }
.upload-inner p { font-size: 12px; color: var(--gray-400); }

.demo-files {
  background: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.demo-files p { font-size: 12px; color: var(--gray-500); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.demo-files p i { color: var(--yellow); }
.demo-file-list { display: flex; gap: 10px; }
.demo-file-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  color: var(--gray-700);
  transition: var(--transition);
}
.demo-file-btn:hover { border-color: var(--brand-light); color: var(--brand-light); background: var(--brand-bg); }
.demo-file-btn .fa-file-word { color: #2b6cb0; }
.demo-file-btn .fa-file-pdf { color: #c53030; }
.demo-file-btn span {
  background: var(--brand-light);
  color: white;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
}

/* 分析进度 */
.analysis-progress { margin-top: 16px; }
.progress-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
.progress-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.analyzing-icon { font-size: 28px; color: var(--brand-light); }
.progress-header h3 { font-size: 16px; font-weight: 600; }
.progress-header p { font-size: 12px; color: var(--gray-500); margin-top: 3px; }

.progress-steps {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  position: relative;
}
.progress-steps::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}
.prog-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.step-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--gray-400);
}
.prog-step.active .step-icon { background: var(--green); border-color: var(--green); color: white; }
.prog-step.running .step-icon { background: var(--brand-bg); border-color: var(--brand-light); color: var(--brand-light); }
.prog-step span { font-size: 11px; color: var(--gray-500); text-align: center; }
.prog-step.active span { color: var(--green); font-weight: 600; }
.prog-step.running span { color: var(--brand-light); font-weight: 600; }

.progress-bar-wrap { background: var(--gray-100); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-light), #60a5fa);
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* 审查结果 */
.review-result { margin-top: 16px; }
.result-header {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.result-title { display: flex; align-items: center; gap: 14px; }
.result-title i { font-size: 28px; color: var(--green); }
.result-title h2 { font-size: 16px; font-weight: 700; }
.result-title p { font-size: 12px; color: var(--gray-500); margin-top: 3px; }
.result-actions { display: flex; gap: 10px; }

.risk-overview {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.risk-badge {
  flex: 1;
  background: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid;
  display: flex;
  flex-direction: column;
}
.risk-badge.high { border-color: var(--red); }
.risk-badge.mid { border-color: var(--orange); }
.risk-badge.low { border-color: var(--yellow); }
.risk-badge.ok { border-color: var(--green); }
.risk-num { font-size: 28px; font-weight: 700; }
.risk-badge.high .risk-num { color: var(--red); }
.risk-badge.mid .risk-num { color: var(--orange); }
.risk-badge.low .risk-num { color: var(--yellow); }
.risk-badge.ok .risk-num { color: var(--green); }
.risk-lbl { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

/* 合同视图 */
.contract-view {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.contract-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 20px;
}
.ctab {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.ctab:hover { color: var(--brand-light); }
.ctab.active { color: var(--brand-light); border-bottom-color: var(--brand-light); font-weight: 600; }

.ctab-content { display: none; padding: 24px; }
.ctab-content.active { display: block; }

.contract-doc { line-height: 2; font-size: 13px; }
.contract-doc h4 { font-size: 14px; color: var(--gray-800); margin: 16px 0 8px; }
.contract-doc p { color: var(--gray-700); margin-bottom: 8px; }
.contract-doc .clause { margin-bottom: 16px; }

.annotation {
  display: inline;
  position: relative;
}
.annotation.high { background: #fecaca; border-bottom: 2px solid var(--red); cursor: pointer; }
.annotation.mid { background: #fed7aa; border-bottom: 2px solid var(--orange); cursor: pointer; }
.annotation.low { background: #fef3c7; border-bottom: 2px solid var(--yellow); cursor: pointer; }
.annotation-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--gray-900);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  width: 220px;
  z-index: 10;
  line-height: 1.5;
}
.annotation:hover .annotation-tooltip { display: block; }

/* 风险摘要 */
.risk-summary-list { display: flex; flex-direction: column; gap: 12px; }
.risk-summary-item {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.rsi-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
}
.rsi-header:hover { background: var(--gray-50); }
.risk-level-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.risk-level-tag.high { background: var(--red-light); color: var(--red); }
.risk-level-tag.mid { background: var(--orange-light); color: var(--orange); }
.risk-level-tag.low { background: var(--yellow-light); color: var(--yellow); }
.rsi-title { flex: 1; font-size: 13px; font-weight: 500; }
.rsi-body { padding: 12px 16px; background: var(--gray-50); border-top: 1px solid var(--gray-200); font-size: 12px; color: var(--gray-600); line-height: 1.7; }
.rsi-body strong { color: var(--gray-800); }

/* 修改建议 */
.suggest-list { display: flex; flex-direction: column; gap: 14px; }
.suggest-item {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.sug-header { padding: 12px 16px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.sug-header span { font-size: 12px; font-weight: 600; color: var(--gray-600); }
.sug-header strong { display: block; font-size: 13px; color: var(--gray-800); margin-top: 2px; }
.sug-body { padding: 12px 16px; }
.sug-before, .sug-after {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 8px;
}
.sug-before { background: #fef2f2; border-left: 3px solid var(--red); color: var(--gray-700); }
.sug-after { background: #f0fdf4; border-left: 3px solid var(--green); color: var(--gray-700); }
.sug-before::before { content: '⚠ 原文：'; font-weight: 600; color: var(--red); display: block; margin-bottom: 4px; }
.sug-after::before { content: '✓ 建议改为：'; font-weight: 600; color: var(--green); display: block; margin-bottom: 4px; }

/* =============================================
   案例检索页面
   ============================================= */
.search-panel {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.search-bar-wrap { margin-bottom: 12px; }
.search-bar {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  transition: var(--transition);
}
.search-bar:focus-within { border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.search-icon { padding: 0 12px; color: var(--gray-400); font-size: 15px; }
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--gray-800);
  padding: 11px 0;
  background: transparent;
}
.btn-search {
  background: var(--brand-light);
  color: white;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.btn-search:hover { background: var(--brand); }

.search-filters { display: flex; gap: 10px; align-items: center; }
.search-filters select {
  padding: 7px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 12px;
  color: var(--gray-600);
  background: white;
  cursor: pointer;
}
.filter-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-600); cursor: pointer; }
.filter-check input { accent-color: var(--brand-light); }

.quick-terms { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.terms-label { font-size: 12px; color: var(--gray-400); }
.term-tag {
  padding: 5px 12px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 99px;
  font-size: 12px;
  color: var(--gray-600);
  transition: var(--transition);
}
.term-tag:hover { background: var(--brand-bg); border-color: var(--brand-light); color: var(--brand-light); }

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.results-meta p { font-size: 13px; color: var(--gray-600); }
.results-meta p strong { color: var(--brand-light); }
.sort-options { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-500); }
.sort-btn {
  padding: 4px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 12px;
  color: var(--gray-500);
  transition: var(--transition);
}
.sort-btn.active { background: var(--brand-bg); border-color: var(--brand-light); color: var(--brand-light); }

.case-list { display: flex; flex-direction: column; gap: 12px; }
.case-item {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: var(--transition);
}
.case-item:hover { border-color: var(--brand-light); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.case-item-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.case-title { font-size: 14px; font-weight: 600; color: var(--gray-800); line-height: 1.4; }
.case-meta-tags { display: flex; gap: 6px; flex-shrink: 0; }
.case-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.case-tag.court-level-1 { background: #fef3c7; color: var(--yellow); }
.case-tag.court-level-2 { background: #dbeafe; color: #1d4ed8; }
.case-tag.court-level-3 { background: #f3f4f6; color: var(--gray-600); }
.case-tag.civil { background: var(--green-light); color: var(--green); }
.case-tag.commercial { background: var(--brand-bg); color: var(--brand-light); }
.case-tag.labor { background: var(--orange-light); color: var(--orange); }

.case-item-info { display: flex; gap: 16px; margin-bottom: 10px; font-size: 11px; color: var(--gray-500); }
.case-item-info span { display: flex; align-items: center; gap: 4px; }

.case-ruling {
  background: var(--gray-50);
  border-left: 3px solid var(--brand-light);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.6;
}
.case-ruling strong { color: var(--gray-800); }

.case-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.case-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
}
.case-modal-content {
  position: relative;
  z-index: 1;
  background: white;
  border-radius: var(--radius-lg);
  width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.2s ease;
}

/* =============================================
   RAG 知识库页面
   ============================================= */
.rag-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
}
.rag-process-card, .rag-docs-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.badge-info {
  background: var(--orange-light);
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.process-steps-flow {
  display: flex;
  align-items: center;
  padding: 24px 32px;
  gap: 0;
}
.flow-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.flow-step-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.flow-step-icon.upload { background: var(--brand-bg); color: var(--brand-light); }
.flow-step-icon.scan { background: var(--orange-light); color: var(--orange); }
.flow-step-icon.review { background: var(--yellow-light); color: var(--yellow); }
.flow-step-icon.store { background: var(--green-light); color: var(--green); }
.flow-step-label { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.flow-step-sub { font-size: 11px; color: var(--gray-400); }
.flow-arrow { padding: 0 8px; color: var(--gray-300); font-size: 16px; flex-shrink: 0; }

/* 脱敏演示 */
.desensitize-demo { padding: 0 24px 24px; }
.demod-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.demod-header h4 { font-size: 13px; font-weight: 600; }
.demod-compare {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.demod-panel { flex: 1; }
.demod-panel-title {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px 6px 0 0;
  text-align: center;
}
.demod-panel-title.original { background: var(--red-light); color: var(--red); }
.demod-panel-title.masked { background: var(--green-light); color: var(--green); }
.demod-text {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 14px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--gray-700);
  min-height: 120px;
}
.sensitive { background: #fecaca; border-radius: 3px; padding: 0 2px; }
.masked-text { background: #bbf7d0; border-radius: 3px; padding: 0 2px; font-weight: 600; color: var(--green); }
.demod-arrow { display: flex; align-items: center; color: var(--gray-300); font-size: 20px; padding: 30px 4px 0; }
.demod-placeholder { color: var(--gray-400); font-style: italic; }

/* 文档表格 */
.rag-docs-card { overflow: visible; }
.doc-table-wrap { overflow-x: auto; }
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.doc-table th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 600;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}
.doc-table td { padding: 10px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.doc-table tr:hover td { background: var(--gray-50); }
.doc-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 4px;
}
.doc-status.done { background: var(--green-light); color: var(--green); }
.doc-status.pending-s { background: var(--yellow-light); color: var(--yellow); }

/* RAG 统计 */
.rag-stats { display: flex; flex-direction: column; gap: 12px; }
.rag-stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.rs-icon { font-size: 22px; color: var(--brand-light); margin-bottom: 6px; }
.rs-val { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.rs-label { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.rag-type-dist {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.rag-type-dist h4 { font-size: 12px; color: var(--gray-600); margin-bottom: 10px; }
.type-bars { display: flex; flex-direction: column; gap: 8px; }
.type-bar-item { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.type-bar-label { width: 60px; color: var(--gray-600); }
.type-bar-track { flex: 1; background: var(--gray-100); border-radius: 99px; height: 6px; }
.type-bar-fill { height: 100%; border-radius: 99px; background: var(--brand-light); }
.type-bar-val { width: 20px; text-align: right; color: var(--gray-500); }

/* =============================================
   系统状态页面
   ============================================= */
.system-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.sys-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.sys-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sys-card-header h3 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.sys-card-header h3 i { color: var(--brand-light); }
.sys-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
}
.sys-status-badge.running { background: var(--green-light); color: var(--green); }
.sys-status-badge.warning { background: var(--yellow-light); color: var(--yellow); }
.sys-status-badge.error { background: var(--red-light); color: var(--red); }

.sys-metrics { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sys-metric { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.sm-label { color: var(--gray-500); }
.sm-val { font-weight: 600; color: var(--gray-800); }

.usage-bar-wrap { margin-top: 4px; }
.usage-label { font-size: 11px; color: var(--gray-400); margin-bottom: 5px; display: flex; justify-content: space-between; }
.usage-bar { background: var(--gray-100); border-radius: 99px; height: 6px; overflow: hidden; }
.usage-fill { height: 100%; border-radius: 99px; transition: width 1s ease; }

/* 操作日志 */
.log-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.log-list {
  padding: 8px 0;
  max-height: 340px;
  overflow-y: auto;
}
.log-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  font-size: 12px;
  transition: var(--transition);
}
.log-item:hover { background: var(--gray-50); }
.log-time { color: var(--gray-400); width: 70px; flex-shrink: 0; }
.log-type {
  width: 56px; flex-shrink: 0;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  text-align: center;
}
.log-type.info { background: var(--brand-bg); color: var(--brand-light); }
.log-type.success { background: var(--green-light); color: var(--green); }
.log-type.warn { background: var(--yellow-light); color: var(--yellow); }
.log-msg { color: var(--gray-600); flex: 1; }
.log-user { color: var(--gray-400); width: 60px; flex-shrink: 0; }

/* =============================================
   通用按钮
   ============================================= */
.btn-primary {
  background: var(--brand-light);
  color: white;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  transition: var(--transition);
}
.btn-primary:hover { background: var(--brand); }

.btn-outline {
  background: white;
  color: var(--brand-light);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--brand-light);
  display: inline-flex; align-items: center; gap: 7px;
  transition: var(--transition);
}
.btn-outline:hover { background: var(--brand-bg); }

.btn-sm-primary {
  background: var(--brand-light);
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
  transition: var(--transition);
}
.btn-sm-primary:hover { background: var(--brand); }

.btn-sm-outline {
  background: white;
  color: var(--brand-light);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--brand-light);
  display: inline-flex; align-items: center; gap: 5px;
  transition: var(--transition);
}
.btn-sm-outline:hover { background: var(--brand-bg); }

.btn-danger-sm {
  color: var(--red);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 5px;
  transition: var(--transition);
}
.btn-danger-sm:hover { background: var(--red-light); }

/* =============================================
   Toast 通知
   ============================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--gray-900);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  min-width: 240px;
}
.toast.success { border-left: 4px solid var(--green); }
.toast.info { border-left: 4px solid var(--brand-light); }
.toast.warn { border-left: 4px solid var(--yellow); }
@keyframes slideUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }

/* =============================================
   工具类
   ============================================= */
.hidden { display: none !important; }

/* =============================================
   手机端底部导航栏（默认隐藏，手机断点内显示）
   ============================================= */
.mobile-tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: white;
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  z-index: 500;
  display: none;           /* 桌面隐藏 */
  flex-direction: row;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 500;
  padding: 6px 2px 4px;
  transition: color 0.15s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-tab i { font-size: 19px; line-height: 1; }
.mobile-tab span { line-height: 1; }
.mobile-tab.active { color: var(--brand-light); }
.mobile-tab.active i { color: var(--brand-light); }

/* =============================================
   响应式 — 平板 (≤1100px)
   ============================================= */
@media (max-width: 1100px) {
  .stat-cards      { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid  { grid-template-columns: 1fr 1fr; }
  .system-grid     { grid-template-columns: 1fr; }
  .chart-row       { grid-template-columns: 1fr; }
  .team-members    { grid-template-columns: repeat(2, 1fr); }
  .health-report-bar { flex-wrap: wrap; gap: 12px; }
  .contract-layout { grid-template-columns: 260px 1fr; }
  .case-layout     { grid-template-columns: 220px 1fr; }
}

/* =============================================
   响应式 — 手机 (≤768px)
   完全重写，保证真机可用
   ============================================= */
@media (max-width: 768px) {

  /* ── 底部导航：核心，用 !important 防止被覆盖 ── */
  .mobile-tabbar {
    display: -webkit-flex !important;
    display: flex !important;
    flex-direction: row !important;
  }

  /* ── 顶栏瘦身 ── */
  .topbar { padding: 0 14px; height: 50px; }
  .main-nav { display: none !important; }
  .weixin-status span:last-child { display: none; }
  .model-status span:last-child  { display: none; }
  .topbar-right { gap: 10px; }

  /* ── 主容器：底部留出 Tab 栏高度 ── */
  .main-container {
    padding: 14px 12px 80px;
  }

  /* ── 全局字体与间距收紧 ── */
  .page-header { margin-bottom: 14px; }
  .page-header h1 { font-size: 17px; gap: 7px; }
  .subtitle { font-size: 12px; }

  /* ── 卡片通用 ── */
  .dashboard-card { border-radius: 10px; }
  .card-header { padding: 11px 14px; }
  .card-header h3 { font-size: 13px; }

  /* ────────────────────────────────────────────
     工作台
  ──────────────────────────────────────────── */

  /* 统计卡片 2×2 */
  .stat-cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }
  .stat-card { padding: 12px; gap: 10px; border-radius: 10px; }
  .stat-icon { width: 38px; height: 38px; font-size: 15px; border-radius: 9px; }
  .stat-value { font-size: 17px; }
  .stat-label { font-size: 11px; }
  .stat-trend { font-size: 10px; display: none; }

  /* 图表行单列 */
  .chart-row { grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
  .chart-wrap { padding: 0 12px 12px; }

  /* 工作台三列→单列 */
  .dashboard-grid { grid-template-columns: 1fr; gap: 10px; }

  /* 团队面板 2列，隐藏详细任务 */
  .team-card { margin-top: 10px; }
  .team-members { grid-template-columns: 1fr 1fr; }
  .team-member-item {
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid var(--gray-100);
  }
  .team-member-item:nth-child(odd)  { border-right: 1px solid var(--gray-100); }
  .team-member-item:last-child      { border-bottom: none; }
  .team-member-item:nth-last-child(2) { border-bottom: none; }
  .tm-today { display: none; }
  .tm-stats { gap: 10px; }
  .tm-stat-val { font-size: 16px; }

  /* 任务列表 */
  .task-list { padding: 0 8px 8px; }
  .task-item { padding: 8px 6px; gap: 8px; }
  .task-icon { width: 28px; height: 28px; font-size: 12px; }
  .task-info strong { font-size: 12px; }
  .task-info span   { font-size: 11px; }
  .task-time { font-size: 10px; }

  /* 企微消息 */
  .weixin-msg-list { padding: 8px; gap: 6px; }
  .wx-avatar { width: 28px; height: 28px; font-size: 12px; }
  .wx-bubble { font-size: 12px; padding: 7px 10px; }
  .wx-meta strong { font-size: 11px; }
  .wx-meta span   { font-size: 10px; }

  /* 快捷按钮 */
  .quick-action-list { padding: 8px; }
  .quick-btn { padding: 10px; margin-bottom: 6px; }
  .qbtn-icon { width: 34px; height: 34px; font-size: 14px; }
  .qbtn-text strong { font-size: 12px; }
  .qbtn-text span   { font-size: 11px; }

  /* ────────────────────────────────────────────
     合同审查
  ──────────────────────────────────────────── */

  /* 双栏→单列：历史在上，主区在下 */
  .contract-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .contract-history-panel {
    position: static;
    max-height: none;
  }
  .contract-history-panel .dashboard-card {
    max-height: 260px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .history-filter { padding: 8px 10px; }
  .history-list   { max-height: 150px; overflow-y: auto; }
  .history-item   { padding: 8px 12px; }
  .hi-name        { font-size: 12px; }

  /* 上传区 */
  .upload-inner { padding: 28px 16px; gap: 8px; }
  .upload-icon  { font-size: 28px; }
  .upload-inner h3 { font-size: 13px; }
  .upload-inner p  { font-size: 11px; }
  .demo-file-list { flex-direction: column; gap: 8px; }
  .demo-file-btn  { font-size: 12px; padding: 9px 14px; }

  /* 进度卡 */
  .progress-card { padding: 18px 16px; }
  .progress-steps { flex-direction: column; gap: 10px; }
  .progress-steps::before { display: none; }
  .prog-step { flex-direction: row; gap: 10px; align-items: center; justify-content: flex-start; }
  .step-icon { width: 26px; height: 26px; font-size: 11px; flex-shrink: 0; }

  /* 审查结果 */
  .result-header { flex-direction: column; gap: 10px; align-items: flex-start; padding: 14px; }
  .result-actions { width: 100%; gap: 8px; }
  .result-actions button { flex: 1; justify-content: center; font-size: 12px; padding: 8px 6px; }
  .result-title i { font-size: 22px; }
  .result-title h2 { font-size: 14px; }
  .result-title p  { font-size: 11px; }

  /* 风险概览 */
  .risk-overview { gap: 8px; margin-bottom: 12px; }
  .risk-badge { padding: 10px 12px; border-radius: 8px; }
  .risk-num { font-size: 20px; }
  .risk-lbl { font-size: 11px; }

  /* 合同内容 tabs */
  .contract-tabs { padding: 0 10px; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .ctab { padding: 11px 14px; font-size: 12px; }
  .ctab-content { padding: 14px; }

  /* 风险摘要条目 */
  .rsi-header { padding: 10px 12px; }
  .risk-level-tag { font-size: 10px; }
  .rsi-title { font-size: 12px; }
  .rsi-body { padding: 10px 12px; font-size: 12px; }

  /* 修改建议 */
  .sug-header { padding: 10px 12px; }
  .sug-header strong { font-size: 12px; }
  .sug-body { padding: 10px 12px; }
  .sug-before, .sug-after { font-size: 12px; }

  /* ────────────────────────────────────────────
     案例检索
  ──────────────────────────────────────────── */

  /* 双栏→单列 */
  .case-layout { grid-template-columns: 1fr; gap: 10px; }

  /* 侧边栏改为横排两列 */
  .case-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .sidebar-card { max-height: 220px; overflow: hidden; display: flex; flex-direction: column; }
  .search-history-list { max-height: 140px; overflow-y: auto; flex: 1; }
  .favorites-list      { max-height: 140px; overflow-y: auto; flex: 1; }
  .sh-item  { padding: 6px 12px; }
  .sh-kw    { font-size: 11px; }
  .sh-count { font-size: 10px; }
  .sh-time  { display: none; }
  .fav-item { padding: 6px 10px; }
  .fav-title { font-size: 11px; }
  .fav-meta  { font-size: 10px; }

  /* 搜索面板 */
  .search-panel { padding: 12px; }
  .search-bar input { font-size: 13px; padding: 10px 0; }
  .btn-search { padding: 10px 16px; font-size: 13px; }
  .search-filters { flex-wrap: wrap; gap: 6px; }
  .search-filters select { font-size: 11px; padding: 5px 6px; flex: 1; min-width: 0; }
  .filter-check { font-size: 11px; }
  .quick-terms { flex-wrap: wrap; gap: 6px; margin-top: 4px; }
  .term-tag { font-size: 11px; padding: 4px 10px; }

  /* 结果列表 */
  .results-meta { flex-direction: column; gap: 6px; align-items: flex-start; }
  .results-meta p { font-size: 12px; }
  .sort-options { font-size: 11px; }
  .sort-btn { font-size: 11px; padding: 3px 8px; }
  .case-item { padding: 12px; border-radius: 8px; }
  .case-item-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .case-title { font-size: 13px; line-height: 1.4; }
  .case-meta-tags { flex-wrap: wrap; gap: 4px; }
  .case-tag { font-size: 10px; }
  .case-item-info { flex-wrap: wrap; gap: 5px; font-size: 10px; }
  .case-item-info span:last-child { margin-left: 0; width: 100%; }
  .case-ruling { font-size: 11px; padding: 8px 10px; }

  /* 弹窗全屏化 */
  .case-modal { align-items: flex-end; }
  .case-modal-content {
    width: 100vw;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    margin: 0;
  }

  /* ────────────────────────────────────────────
     知识库
  ──────────────────────────────────────────── */

  /* 健康度条 → 2×2 网格 */
  .health-report-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
  }
  .health-divider { display: none; }
  .health-item { padding: 0; }
  .health-item:last-of-type { grid-column: 1 / -1; }
  .health-report-bar > .btn-sm-primary { grid-column: 1 / -1; width: 100%; justify-content: center; margin-top: 2px; }
  .health-val { font-size: 16px; }
  .health-lbl { font-size: 11px; }
  .health-icon { width: 30px; height: 30px; font-size: 14px; }

  /* 知识库主体单列 */
  .rag-layout { grid-template-columns: 1fr; gap: 10px; }

  /* 统计数字改为横向滚动 */
  .rag-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .rag-stat-card { padding: 12px; border-radius: 8px; }
  .rs-val   { font-size: 18px; }
  .rs-label { font-size: 11px; }
  .rs-icon  { font-size: 18px; }
  .rag-type-dist { grid-column: 1 / -1; }

  /* 步骤流程垂直堆叠 */
  .process-steps-flow { flex-direction: column; padding: 14px; gap: 10px; align-items: flex-start; }
  .flow-step { flex-direction: row; gap: 12px; align-items: center; width: 100%; }
  .flow-step-icon { width: 40px; height: 40px; font-size: 17px; flex-shrink: 0; }
  .flow-step-label { font-size: 13px; }
  .flow-step-sub   { font-size: 11px; }
  .flow-arrow { transform: rotate(90deg); margin: 0 auto; color: var(--gray-300); font-size: 13px; }

  /* 脱敏对比上下布局 */
  .desensitize-demo { padding: 0 12px 16px; }
  .demod-compare { flex-direction: column; gap: 10px; }
  .demod-arrow { display: none; }
  .demod-text { font-size: 11px; line-height: 1.8; min-height: 80px; }

  /* 批量上传 */
  .batch-upload-demo { padding: 0 12px 14px; }
  .batch-file-item { flex-wrap: wrap; padding: 7px 10px; gap: 5px; }
  .bfi-name { font-size: 11px; }
  .bfi-size { font-size: 10px; }
  .bfi-progress-wrap { width: 100%; order: 10; }

  /* 文档表格横向滚动 */
  .rag-docs-card { overflow: visible; }
  .doc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .doc-table { min-width: 520px; font-size: 11px; }

  /* ────────────────────────────────────────────
     系统状态
  ──────────────────────────────────────────── */
  .system-grid { grid-template-columns: 1fr; gap: 10px; }
  .sys-card { padding: 14px; border-radius: 10px; }
  .sys-card-header { margin-bottom: 12px; }
  .sys-card-header h3 { font-size: 13px; }
  .sys-metrics { gap: 6px; margin-bottom: 10px; }
  .sys-metric { font-size: 12px; }
  .sm-label { font-size: 11px; }
  .sm-val   { font-size: 11px; }

  .log-card .card-header { flex-wrap: wrap; gap: 8px; }
  .log-list { max-height: 240px; }
  .log-item { padding: 7px 12px; gap: 6px; font-size: 11px; }
  .log-time { width: 60px; font-size: 10px; }
  .log-user { display: none; }
  .log-msg  { font-size: 11px; }

  /* ────────────────────────────────────────────
     通用
  ──────────────────────────────────────────── */
  .btn-primary  { font-size: 12px; padding: 8px 14px; }
  .btn-outline  { font-size: 12px; padding: 8px 14px; }
  .btn-sm-primary { font-size: 11px; padding: 5px 10px; }
  .btn-sm-outline { font-size: 11px; padding: 5px 10px; }

  /* Toast 贴底部 Tab 上方 */
  .toast-container { bottom: 70px; left: 12px; right: 12px; }
  .toast { min-width: unset; width: 100%; font-size: 12px; }
}

/* =============================================
   响应式 — 超小屏 iPhone SE 等 (≤375px)
   ============================================= */
@media (max-width: 375px) {
  .main-container { padding: 12px 10px 80px; }
  .stat-cards { gap: 8px; }
  .stat-card  { padding: 10px; }
  .stat-value { font-size: 15px; }
  .case-sidebar { grid-template-columns: 1fr; }
  .team-members { grid-template-columns: 1fr; }
  .team-member-item { border-right: none !important; }
  .rag-stats { grid-template-columns: repeat(2, 1fr); }
  .health-report-bar { grid-template-columns: 1fr 1fr; }
  .mobile-tab span { font-size: 9px; }
  .mobile-tab i { font-size: 17px; }
}

/* =============================================
   图表行
   ============================================= */
.chart-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-bottom: 24px;
}
.chart-card { overflow: hidden; }
.chart-wrap { padding: 0 16px 16px; position: relative; }
.chart-legend {
  display: flex;
  gap: 12px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--gray-500);
}
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.card-sub-text { font-size: 12px; color: var(--gray-400); }

/* =============================================
   实时数据动画 — Realtime Engine v2.0
   ============================================= */

/* 数字跳动：scale + 颜色短暂高亮 */
@keyframes rt-pulse-kf {
  0%   { transform: scale(1);    color: inherit; }
  30%  { transform: scale(1.12); color: #2563eb; }
  60%  { transform: scale(1.05); color: #1d4ed8; }
  100% { transform: scale(1);    color: inherit; }
}
.rt-pulse {
  animation: rt-pulse-kf 0.5s ease forwards;
  display: inline-block;
}

/* 新消息 / 新任务滑入（JS 直接操控 style，无需额外 class） */

/* 徽标脉冲 */
@keyframes badge-pulse-kf {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); background: #ef4444; }
  100% { transform: scale(1); }
}
.rt-badge-pulse {
  animation: badge-pulse-kf 0.5s ease;
}

/* 状态点心跳 */
@keyframes heartbeat {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%      { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
.status-dot.online {
  animation: heartbeat 2.5s infinite;
}

/* 进度条平滑过渡 */
.usage-fill {
  transition: width 1s ease, background 0.5s;
}

/* 日志项彩色左边框 */
.log-item.info    { border-left-color: var(--blue); }
.log-item.success { border-left-color: var(--green); }
.log-item.warn    { border-left-color: var(--orange); }

/* 统计卡数字加粗加大，更显眼 */
.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* 任务列表新推入条目高亮边框 */
.task-item.rt-new {
  border-left: 3px solid var(--blue);
  background: linear-gradient(to right, #eff6ff 0%, transparent 40%);
  animation: new-task-fade 4s ease forwards;
}
@keyframes new-task-fade {
  0%   { border-left-color: var(--blue); background: linear-gradient(to right, #eff6ff 0%, transparent 40%); }
  100% { border-left-color: transparent; background: transparent; }
}

/* 企业微信新消息气泡入场 */
.weixin-msg.sys-bubble-glow .wx-bubble {
  box-shadow: 0 0 0 2px rgba(37,99,235,0.3);
  animation: bubble-glow 2s ease forwards;
}
@keyframes bubble-glow {
  0%   { box-shadow: 0 0 0 2px rgba(37,99,235,0.4); }
  100% { box-shadow: none; }
}

/* LIVE 实时指示圆点 */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #22c55e;
  letter-spacing: 0.5px;
}
.live-dot::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: live-dot-blink 1.2s ease-in-out infinite;
}
@keyframes live-dot-blink {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: 0.4; transform: scale(0.8); }
}

/* 健康报告数值变动高亮 */
.hr-val.rt-pulse {
  color: #2563eb;
}

/* 系统卡指标值变动高亮 */
.sm-val.rt-pulse {
  color: #2563eb;
  font-weight: 700;
}

/* RAG 统计卡变动高亮 */
.rs-val.rt-pulse {
  color: #2563eb;
}

/* 滚动平滑 */
.weixin-msg-list,
.task-list,
.log-list {
  scroll-behavior: smooth;
}

/* 消息队列新增徽标呼吸效果 */
.badge-count {
  transition: transform 0.2s, background 0.2s;
}

/* 新条目进入动画兜底 */
@keyframes slideInTop {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rt-slide-in {
  animation: slideInTop 0.4s ease forwards;
}

/* =============================================
   团队成员面板
   ============================================= */
.team-card { margin-top: 16px; }
.team-members {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.team-member-item {
  padding: 16px 20px;
  border-right: 1px solid var(--gray-100);
  transition: var(--transition);
}
.team-member-item:last-child { border-right: none; }
.team-member-item:hover { background: var(--gray-50); }
.tm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.tm-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.tm-info strong { display: block; font-size: 13px; color: var(--gray-800); }
.tm-info span { font-size: 11px; color: var(--gray-400); }
.tm-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
}
.tm-stat { text-align: center; }
.tm-stat-val { font-size: 18px; font-weight: 700; color: var(--gray-800); }
.tm-stat-lbl { font-size: 10px; color: var(--gray-400); }
.tm-bar-wrap { margin-bottom: 10px; }
.tm-bar-label { font-size: 10px; color: var(--gray-400); margin-bottom: 3px; display: flex; justify-content: space-between; }
.tm-bar { background: var(--gray-100); border-radius: 99px; height: 4px; }
.tm-bar-fill { height: 100%; border-radius: 99px; transition: width 0.8s ease; }
.tm-today { font-size: 11px; color: var(--gray-500); }
.tm-today-title { font-weight: 600; color: var(--gray-600); margin-bottom: 4px; }
.tm-today-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  color: var(--gray-500);
}
.tm-today-item::before { content:'·'; color: var(--gray-300); }

/* =============================================
   合同审查双栏布局
   ============================================= */
.contract-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: flex-start;
}
.contract-history-panel { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow: hidden; display: flex; flex-direction: column; }
.contract-history-panel .dashboard-card { display: flex; flex-direction: column; overflow: hidden; }
.contract-main-panel { min-width: 0; }

/* 历史筛选 */
.history-filter {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-search {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 6px 10px;
}
.history-search i { color: var(--gray-400); font-size: 12px; }
.history-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 12px;
  color: var(--gray-700);
}
.history-filter select {
  padding: 5px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  font-size: 11px;
  color: var(--gray-600);
  background: white;
}
.history-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}
.history-item {
  padding: 9px 14px;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.history-item:hover { background: var(--gray-50); border-left-color: var(--brand-light); }
.history-item.active { background: var(--brand-bg); border-left-color: var(--brand-light); }
.hi-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.hi-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.hi-type {
  font-size: 10px;
  background: var(--gray-100);
  color: var(--gray-500);
  padding: 1px 6px;
  border-radius: 3px;
}
.hi-risk {
  font-size: 10px;
  font-weight: 700;
}
.hi-risk.has-high { color: var(--red); }
.hi-risk.no-high { color: var(--green); }
.hi-date { font-size: 10px; color: var(--gray-400); margin-left: auto; }

/* =============================================
   案例检索双栏布局
   ============================================= */
.case-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: flex-start;
}
.case-sidebar {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.case-main { min-width: 0; }
.sidebar-card { overflow: hidden; }

/* 检索历史 */
.search-history-list { padding: 6px 0; max-height: 220px; overflow-y: auto; }
.sh-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: var(--transition);
}
.sh-item:hover { background: var(--gray-50); }
.sh-kw {
  flex: 1;
  font-size: 12px;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sh-count { font-size: 10px; color: var(--brand-light); font-weight: 600; flex-shrink: 0; }
.sh-time { font-size: 10px; color: var(--gray-400); flex-shrink: 0; }
.sh-icon { color: var(--gray-300); font-size: 11px; }

/* 收藏夹 */
.favorites-list { padding: 6px 0; max-height: 260px; overflow-y: auto; }
.fav-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: var(--transition);
}
.fav-item:hover { background: var(--gray-50); }
.fav-icon { color: var(--yellow); font-size: 12px; margin-top: 1px; flex-shrink: 0; }
.fav-info { flex: 1; min-width: 0; }
.fav-title {
  font-size: 11px;
  color: var(--gray-700);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fav-meta { font-size: 10px; color: var(--gray-400); margin-top: 2px; }
.fav-remove {
  color: var(--gray-300);
  font-size: 11px;
  padding: 2px;
  flex-shrink: 0;
  transition: var(--transition);
}
.fav-remove:hover { color: var(--red); }

/* =============================================
   知识库健康度报告条
   ============================================= */
.health-report-bar {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.health-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
}
.health-item:first-child { padding-left: 0; }
.health-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.health-icon.green  { background: var(--green-light);  color: var(--green); }
.health-icon.blue   { background: var(--brand-bg);     color: var(--brand-light); }
.health-icon.purple { background: var(--purple-light); color: var(--purple); }
.health-icon.orange { background: var(--orange-light); color: var(--orange); }
.health-val { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.health-lbl { font-size: 11px; color: var(--gray-400); margin-top: 1px; }
.health-divider {
  width: 1px;
  height: 36px;
  background: var(--gray-200);
  flex-shrink: 0;
}

/* =============================================
   批量上传进度演示
   ============================================= */
.batch-upload-demo {
  padding: 0 24px 20px;
  border-top: 1px solid var(--gray-100);
  margin-top: 4px;
}
.batch-upload-demo .demod-header { padding-top: 16px; }
.batch-file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.batch-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: 7px;
  font-size: 12px;
}
.bfi-icon { font-size: 16px; flex-shrink: 0; }
.bfi-name { flex: 1; color: var(--gray-700); font-weight: 500; }
.bfi-size { color: var(--gray-400); flex-shrink: 0; }
.bfi-status { flex-shrink: 0; }
.bfi-progress-wrap { flex: 1; }
.bfi-progress-bar {
  height: 4px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
}
.bfi-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--brand-light);
  width: 0%;
  transition: width 0.3s ease;
}
