/* ============================================================
   法小和 · 统一设计系统 (design.css)
   浅色专业风 · 清爽干净 · 符合大众审美
   通过 <body class="theme-dark"> 挂载（保留类名以兼容现有页面）
   ============================================================ */

:root {
  --fx-bg: #f4f6fa;
  --fx-bg-2: #eef1f6;
  --fx-card: #ffffff;
  --fx-card-solid: #ffffff;
  --fx-border: #e2e8f0;
  --fx-border-strong: #bfd4f0;
  --fx-text: #1f2937;
  --fx-text-dim: #4b5563;
  --fx-text-faint: #7c8aa0;
  --fx-cyan: #2563eb;
  --fx-violet: #7c3aed;
  --fx-green: #16a34a;
  --fx-amber: #d97706;
  --fx-red: #dc2626;
  --fx-grad: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --fx-radius: 14px;
  --fx-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --fx-glow: 0 0 0 1px rgba(37, 99, 235, 0.08), 0 6px 18px rgba(15, 23, 42, 0.05);
  --fx-font: 'Inter', 'Segoe UI', 'Microsoft YaHei', system-ui, sans-serif;
}

/* ---------- 页面基底（浅色） ---------- */
body.theme-dark {
  margin: 0;
  background: linear-gradient(180deg, #f6f8fb 0%, #eef1f6 100%);
  background-attachment: fixed;
  color: var(--fx-text);
  font-family: var(--fx-font);
  min-height: 100vh;
}

body.theme-dark ::selection { background: rgba(37, 99, 235, 0.18); }

/* 滚动条 */
body.theme-dark ::-webkit-scrollbar { width: 9px; height: 9px; }
body.theme-dark ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
body.theme-dark ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
body.theme-dark ::-webkit-scrollbar-track { background: transparent; }

/* ---------- 动画（克制、自然） ---------- */
@keyframes fxFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fxPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes fxSpin { to { transform: rotate(360deg); } }
@keyframes fxShimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes fxFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes fxGradShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* ---------- 通用卡片 ---------- */
body.theme-dark .card,
body.theme-dark .kb-card,
body.theme-dark .fusion-module,
body.theme-dark .list,
body.theme-dark .modal-card {
  background: var(--fx-card);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius);
  box-shadow: var(--fx-shadow);
}

/* ---------- 导航侧栏（叠加在 nav-modern.css 之上） ---------- */
body.theme-dark #app-global-nav {
  background: #ffffff;
  border-right: 1px solid var(--fx-border);
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.05);
}
body.theme-dark .brand i { color: var(--fx-cyan); }
body.theme-dark .nav-link.active {
  background: #e8f0fe;
  border: 1px solid transparent;
  color: #1d4ed8;
  font-weight: 700;
}
body.theme-dark .nav-link:hover { background: #f1f5f9; }
body.theme-dark .fav-badge { background: #e8f0fe; color: #1d4ed8; }
body.theme-dark .cta {
  background: var(--fx-cyan);
  color: #ffffff !important;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
body.theme-dark .cta:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32); }

/* ---------- 按钮 ---------- */
body.theme-dark button { font-family: inherit; }
body.theme-dark .search-btn,
body.theme-dark .form-btn,
body.theme-dark .primary,
body.theme-dark .kb-search-box button,
body.theme-dark .kb-more button,
body.theme-dark .kb-empty button {
  background: var(--fx-cyan);
  color: #ffffff;
  border: none;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
body.theme-dark .search-btn:hover,
body.theme-dark .form-btn:hover,
body.theme-dark .primary:hover,
body.theme-dark .kb-search-box button:hover,
body.theme-dark .kb-more button:hover,
body.theme-dark .kb-empty button:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* ---------- 输入框 ---------- */
body.theme-dark .search-input,
body.theme-dark .form-input,
body.theme-dark textarea,
body.theme-dark input,
body.theme-dark select {
  background: #ffffff;
  border: 1px solid var(--fx-border);
  color: var(--fx-text);
  border-radius: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
body.theme-dark .search-input:focus,
body.theme-dark .form-input:focus,
body.theme-dark textarea:focus,
body.theme-dark input:focus,
body.theme-dark select:focus {
  border-color: var(--fx-cyan);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
body.theme-dark select option { background: #ffffff; color: var(--fx-text); }

/* ---------- 区块标签（section-label） ---------- */
body.theme-dark .section-label {
  color: var(--fx-text);
  border-left: 3px solid var(--fx-cyan);
  background: #eef4ff;
  padding: 8px 14px;
  border-radius: 8px;
}
body.theme-dark .section-label span { color: var(--fx-text-faint); }

/* ---------- 检索区（index/fusion） ---------- */
body.theme-dark .search-section { background: transparent; }
body.theme-dark .search-bar-container {
  background: var(--fx-card);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius);
  box-shadow: var(--fx-glow);
}
body.theme-dark .status-bar { color: var(--fx-text-dim); }
body.theme-dark .status-dot.active { background: var(--fx-green); }
body.theme-dark .status-dot.error { background: var(--fx-red); }

/* ---------- 融合模块（index.html 双路检索） ---------- */
body.theme-dark .fusion-header { border-bottom: 1px solid var(--fx-border); }
body.theme-dark .fusion-title { color: var(--fx-text); }
body.theme-dark .fusion-title i { color: var(--fx-cyan); }
body.theme-dark .retrieval-pane {
  background: #f8fafc;
  border: 1px solid var(--fx-border);
  border-radius: 12px;
}
body.theme-dark .pane-header { border-bottom: 1px solid var(--fx-border); color: var(--fx-text); }

/* ---------- 法条卡片 ---------- */
body.theme-dark .law-item {
  background: #ffffff;
  border: 1px solid var(--fx-border);
  border-radius: 12px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  animation: fxFadeUp .4s ease both;
}
body.theme-dark .law-item:hover {
  border-color: var(--fx-border-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
body.theme-dark .law-title { color: var(--fx-text); }
body.theme-dark .law-snippet { color: var(--fx-text-dim); }
body.theme-dark .law-item .tag { background: #e8f0fe; color: #1d4ed8; }

/* ---------- 聊天（调解） ---------- */
body.theme-dark .chat-container {
  background: #f8fafc;
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius);
}
body.theme-dark .chat-message { animation: fxFadeUp .35s ease both; }
body.theme-dark .msg-bubble {
  background: #ffffff;
  border: 1px solid var(--fx-border);
  color: var(--fx-text);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
body.theme-dark .msg-bubble.role-mediator { border-color: #fcd34d; background: #fffbeb; }
body.theme-dark .msg-bubble.role-plaintiff { border-color: #bfdbfe; background: #eff6ff; }
body.theme-dark .msg-bubble.role-defendant { border-color: #fecaca; background: #fef2f2; }
body.theme-dark .ai-content { color: var(--fx-text); }
body.theme-dark .ai-summ { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #7c5e10; line-height: 1.8; margin-bottom: 12px; }
body.theme-dark .ai-summ b { color: #b45309; }
body.theme-dark .ai-over { border-left: 3px solid #2563eb; background: #eff6ff; border-radius: 8px; padding: 8px 12px; margin-top: 12px; font-size: 13px; color: #1e3a5f; line-height: 1.8; }
body.theme-dark .ai-cit { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #eef2f7; border-radius: 10px; margin-bottom: 8px; cursor: pointer; font-size: 13px; color: var(--fx-text); transition: all .15s ease; background: #fff; }
body.theme-dark .ai-cit:hover { border-color: #bfdbfe; background: #eff6ff; }
body.theme-dark .ai-cit .no { color: #2563eb; font-weight: 800; flex-shrink: 0; }
body.theme-dark .ai-next { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 16px; margin-top: 12px; }
body.theme-dark .ai-next ol { margin: 0; padding-left: 20px; }
body.theme-dark .ai-next li { font-size: 13px; color: #334155; line-height: 1.8; margin-bottom: 2px; }

/* ---------- 弹窗 ---------- */
body.theme-dark .modal-overlay { background: rgba(15, 23, 42, 0.35); backdrop-filter: blur(4px); }
body.theme-dark .modal-header-bar { border-bottom: 1px solid var(--fx-border); }
body.theme-dark .modal-title { color: var(--fx-text); }
body.theme-dark .modal-body-scroll { color: var(--fx-text); }
body.theme-dark .modal-close { color: var(--fx-text-faint); }
body.theme-dark .modal-close:hover { color: var(--fx-text); }

/* ---------- 融合/收藏/调解等 Vue 页面通用 ---------- */
body.theme-dark .badge { background: #e8f0fe; color: #1d4ed8; }
body.theme-dark .tag { background: #f1ebfb; color: #7c3aed; }
body.theme-dark .title { color: var(--fx-text); }
body.theme-dark .row { color: var(--fx-text); }
body.theme-dark .item { border-bottom: 1px solid var(--fx-border); color: var(--fx-text); }
body.theme-dark .item b { color: var(--fx-text); }
body.theme-dark .status { color: var(--fx-text-dim); }
body.theme-dark .ttl { color: var(--fx-text); }
body.theme-dark .remove:hover { color: var(--fx-red); }
body.theme-dark .empty { color: var(--fx-text-dim); }
body.theme-dark .empty div { color: var(--fx-text-dim); }
body.theme-dark .toast { background: #1f2937; border: none; color: #ffffff; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18); }

/* ---------- 知识库页面组件（kb-*） ---------- */
.kb-hero {
  position: relative;
  padding: 42px 20px 26px;
  text-align: center;
  animation: fxFadeUp .5s ease both;
}
.kb-hero-inner { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; }
.kb-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  background: #e8f0fe; border: 1px solid #d4e2fa;
  color: #1d4ed8; font-size: 13px; font-weight: 700; letter-spacing: .5px;
}
.kb-hero-title { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; margin: 16px 0 8px; color: #1e3a5f; line-height: 1.3; }
.kb-hero-title .grad { color: #1d4ed8; }
.kb-hero-sub { color: var(--fx-text-dim); font-size: 15px; margin: 0 0 24px; }
.kb-search-box {
  display: flex; align-items: center; gap: 10px;
  max-width: 680px; margin: 0 auto;
  background: #ffffff; border: 1px solid var(--fx-border);
  border-radius: 999px; padding: 6px 6px 6px 20px;
  box-shadow: var(--fx-glow);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.kb-search-box:focus-within { border-color: var(--fx-border-strong); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.kb-search-box i { color: var(--fx-cyan); }
.kb-search-box input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--fx-text); font-size: 15px; padding: 10px 0; min-width: 0;
}
.kb-search-box button {
  padding: 10px 26px; border-radius: 999px; white-space: nowrap;
}
.kb-stats { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.kb-stat {
  min-width: 108px; padding: 12px 18px; border-radius: 14px;
  background: #ffffff; border: 1px solid var(--fx-border);
  text-align: center;
  transition: transform .18s ease, border-color .18s ease;
}
.kb-stat:hover { transform: translateY(-3px); border-color: var(--fx-border-strong); }
.kb-stat b { display: block; font-size: 24px; font-weight: 800; color: #1d4ed8; }
.kb-stat span { font-size: 12px; color: var(--fx-text-dim); }
.kb-orbs { position: absolute; inset: 0; pointer-events: none; display: none; }
.kb-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; }
.kb-orb.o1 { width: 300px; height: 300px; left: -80px; top: -80px; background: rgba(37, 99, 235, 0.12); }
.kb-orb.o2 { width: 260px; height: 260px; right: -60px; top: 20px; background: rgba(124, 58, 237, 0.10); }
.kb-orb.o3 { width: 180px; height: 180px; left: 40%; bottom: -80px; background: rgba(22, 163, 74, 0.08); }

.kb-body { display: grid; grid-template-columns: 240px 1fr; gap: 20px; max-width: 1200px; margin: 8px auto 60px; padding: 0 20px; }
.kb-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 18px; align-self: start; }
.kb-filter-card { background: #ffffff; border: 1px solid var(--fx-border); border-radius: 14px; padding: 14px; }
.kb-filter-title { font-size: 13px; font-weight: 800; color: var(--fx-text); margin-bottom: 10px; letter-spacing: .3px; }
.kb-chip {
  display: inline-block; margin: 3px 5px 3px 0; padding: 5px 12px;
  border-radius: 999px; background: #f1f5f9;
  border: 1px solid transparent; color: var(--fx-text-dim);
  font-size: 12.5px; cursor: pointer; transition: all .16s ease; user-select: none;
}
.kb-chip:hover { color: #1e3a5f; background: #e8f0fe; }
.kb-chip.on { background: #2563eb; color: #ffffff; font-weight: 700; border-color: transparent; }
.kb-select { width: 100%; background: #ffffff; border: 1px solid var(--fx-border); color: var(--fx-text); border-radius: 10px; padding: 9px 10px; font-size: 13px; outline: none; }

.kb-main { min-width: 0; }
.kb-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--fx-text-dim); font-size: 13px; flex-wrap: wrap; }
.kb-toolbar .kb-clear { margin-left: auto; background: none; border: 1px solid var(--fx-border); color: var(--fx-text-dim); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; cursor: pointer; }
.kb-toolbar .kb-clear:hover { color: var(--fx-text); border-color: var(--fx-border-strong); }

.kb-results { display: flex; flex-direction: column; gap: 12px; }
.kb-card {
  position: relative; padding: 16px 18px; cursor: pointer;
  animation: fxFadeUp .4s ease both;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.kb-card:hover { transform: translateY(-2px); border-color: var(--fx-border-strong); box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08); }
.kb-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kb-type { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; letter-spacing: .3px; }
.kb-type.t-law { background: #e8f0fe; color: #1d4ed8; }
.kb-type.t-case { background: #e6f7ee; color: #15803d; }
.kb-type.t-judicial { background: #f1ebfb; color: #7c3aed; }
.kb-card-title { margin: 0; font-size: 16px; font-weight: 800; color: var(--fx-text); flex: 1; min-width: 0; line-height: 1.4; }
.kb-score { font-size: 12px; color: var(--fx-amber); font-weight: 700; white-space: nowrap; }
.kb-card-snippet { margin: 10px 0 8px; color: var(--fx-text-dim); font-size: 13.5px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-card-snippet mark { background: #fff3bf; color: #92400e; border-radius: 3px; padding: 0 2px; }
.kb-card-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--fx-text-faint); }
.kb-card-meta .spacer { flex: 1; }
.kb-fav { background: #f8fafc; border: 1px solid var(--fx-border); color: var(--fx-text-faint); border-radius: 999px; width: 34px; height: 30px; cursor: pointer; transition: all .16s ease; }
.kb-fav:hover { color: var(--fx-red); border-color: rgba(220, 38, 38, 0.4); }
.kb-fav.on { color: var(--fx-red); background: #fef2f2; border-color: rgba(220, 38, 38, 0.4); }

.kb-skeleton { display: flex; flex-direction: column; gap: 12px; }
.kb-skel { height: 118px; border-radius: 14px; background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 50%, #eef2f7 75%); background-size: 800px 100%; animation: fxShimmer 1.4s linear infinite; }

.kb-empty, .kb-hint { text-align: center; padding: 70px 20px; color: var(--fx-text-faint); }
.kb-empty i { font-size: 44px; margin-bottom: 14px; color: #c3cbd8; display: block; }
.kb-empty button { margin-top: 16px; padding: 9px 22px; border-radius: 999px; }

.kb-more { text-align: center; margin-top: 18px; }
.kb-more button { padding: 10px 30px; border-radius: 999px; }

/* 详情抽屉 */
.kb-drawer-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(3px); z-index: 11000; display: flex; justify-content: flex-end; animation: fxFadeUp .2s ease both; }
.kb-drawer {
  width: min(720px, 94vw); height: 100%; overflow-y: auto;
  background: #ffffff;
  border-left: 1px solid var(--fx-border);
  box-shadow: -20px 0 60px rgba(15, 23, 42, 0.15);
  animation: fxFadeUp .28s ease both;
  padding: 0;
}
.kb-drawer-head { position: sticky; top: 0; display: flex; align-items: center; gap: 12px; padding: 18px 22px; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--fx-border); z-index: 2; }
.kb-drawer-head h2 { margin: 0; font-size: 17px; font-weight: 800; flex: 1; color: var(--fx-text); line-height: 1.45; }
.kb-drawer-close { background: none; border: none; color: var(--fx-text-faint); font-size: 24px; cursor: pointer; line-height: 1; }
.kb-drawer-close:hover { color: var(--fx-text); }
.kb-drawer-body { padding: 20px 22px 40px; }
.kb-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kb-meta-item { background: #f8fafc; border: 1px solid var(--fx-border); border-radius: 10px; padding: 10px 12px; }
.kb-meta-item b { display: block; font-size: 11px; color: var(--fx-text-faint); margin-bottom: 4px; font-weight: 600; }
.kb-meta-item span { font-size: 13px; color: var(--fx-text); word-break: break-all; }
.kb-drawer-content { background: #f8fafc; border: 1px solid var(--fx-border); border-radius: 12px; padding: 18px; color: var(--fx-text); font-size: 14.5px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.kb-drawer-content mark { background: #fff3bf; color: #92400e; border-radius: 3px; padding: 0 2px; }
.kb-related { margin-top: 22px; }
.kb-related-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--fx-border); margin-bottom: 8px; cursor: pointer; transition: border-color .15s ease; }
.kb-related-item:hover { border-color: var(--fx-border-strong); }
.kb-related-item .kb-type { flex-shrink: 0; }
.kb-related-item span:last-child { color: var(--fx-text); font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .kb-body { grid-template-columns: 1fr; }
  .kb-side { position: static; flex-direction: row; overflow-x: auto; }
  .kb-filter-card { min-width: 200px; }
}
@media (max-width: 640px) {
  .kb-stats { gap: 8px; }
  .kb-stat { min-width: 84px; padding: 10px 12px; }
  .kb-stat b { font-size: 19px; }
}

/* ---------- 调解工作台补充（index.html） ---------- */
body.theme-dark .chat-msg { animation: fxFadeUp .35s ease both; }
body.theme-dark .msg-bubble { position: relative; }
body.theme-dark .msg-bubble::after {
  content: '▍'; color: var(--fx-cyan); animation: fxPulse 1s infinite;
  display: none;
}
body.theme-dark .msg-bubble.typing::after { display: inline; }
body.theme-dark .system-msg {
  text-align: center; color: var(--fx-text-faint); font-size: 12.5px;
  margin: 10px 0; letter-spacing: .3px;
  display: flex; align-items: center; gap: 8px; justify-content: center;
}
body.theme-dark .system-msg::before, body.theme-dark .system-msg::after {
  content: ''; height: 1px; width: 40px; background: linear-gradient(90deg, transparent, #d3dce8);
}
body.theme-dark .system-msg::after { background: linear-gradient(270deg, transparent, #d3dce8); }
body.theme-dark .round-divider {
  display: flex; align-items: center; justify-content: center; margin: 14px 0;
}
body.theme-dark .round-divider span {
  background: #f1f5f9;
  border: 1px solid var(--fx-border);
  color: var(--fx-text-dim); font-size: 12px; font-weight: 700;
  padding: 5px 16px; border-radius: 999px; letter-spacing: .3px;
}
body.theme-dark .msg-avatar {
  background: #e8f0fe;
  border: 1px solid #d4e2fa;
  color: #1d4ed8;
}
body.theme-dark .msg-avatar.mediator,
body.theme-dark .role-mediator .msg-avatar {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  border: 2px solid #fff;
  color: #fff;
}
body.theme-dark .msg-avatar.plaintiff,
body.theme-dark .role-plaintiff .msg-avatar {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  border: 2px solid #fff;
  color: #fff;
}
body.theme-dark .msg-avatar.defendant,
body.theme-dark .role-defendant .msg-avatar {
  background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
  border: 2px solid #fff;
  color: #fff;
}
body.theme-dark .med-header { border-bottom: 1px solid var(--fx-border); }
body.theme-dark .med-title { color: var(--fx-text); }
body.theme-dark .med-title i { color: var(--fx-cyan); }
body.theme-dark .med-chat-area {
  background: #f8fafc;
  border: 1px solid var(--fx-border);
  border-radius: 14px;
}
body.theme-dark .tag.match { background: #e6f7ee; color: var(--fx-green); }

/* 依据标签页（AI 解读 / 知识库结果） */
body.theme-dark .evtabs {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin: 16px 0 0; padding: 10px 14px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
body.theme-dark .evtab {
  border: 1px solid #d8e0ea; background: #fff; color: #475569;
  padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: all .16s ease;
}
body.theme-dark .evtab:hover { border-color: #93c5fd; }
body.theme-dark .evtab.on.ai { background: #f1ebfb; border-color: #a78bfa; color: #7c3aed; }
body.theme-dark .evtab.on.kb { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
body.theme-dark .evtab .n { font-size: 11.5px; opacity: .75; font-weight: 800; }
body.theme-dark .evtab-label { margin-left: auto; font-size: 12px; color: #94a3b8; }

/* ---------- 主工作台头部/进度 ---------- */
body.theme-dark .main-container { color: var(--fx-text); }
body.theme-dark .nav-menu .nav-item { color: var(--fx-text-dim); }
body.theme-dark .nav-menu .nav-item:hover { color: var(--fx-text); }

/* ---------- 融合/调解事件流 ---------- */
body.theme-dark .msg { border-bottom: 1px solid var(--fx-border); color: var(--fx-text); }
body.theme-dark .msg b { color: var(--fx-cyan); }

/* ---------- 全流程步骤条（index.html） ---------- */
.fx-progress {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin: 2px 0 22px;
  background: #ffffff;
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius);
  padding: 16px 18px 12px;
  box-shadow: var(--fx-shadow);
}
.fx-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}
.fx-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e8eef5;
  color: #7c8aa0;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
  position: relative;
  z-index: 1;
}
.fx-step-txt { font-size: 12px; color: #7c8aa0; font-weight: 600; }
.fx-step::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e2e8f0;
  z-index: 0;
}
.fx-step:last-child::after { display: none; }
.fx-step.on .fx-step-num { background: #2563eb; color: #fff; box-shadow: 0 4px 10px rgba(37,99,235,.25); }
.fx-step.on .fx-step-txt { color: #1d4ed8; }
.fx-step.done .fx-step-num { background: #e6f7ee; color: #15803d; border: 1px solid #86efac; }
.fx-step.done .fx-step-txt { color: #15803d; }
.fx-step.on::after, .fx-step.done::after { background: #93c5fd; }
.fx-progress .fx-step { background: transparent; border: none; font-family: inherit; text-align: center; cursor: pointer; transition: transform .2s ease; }
.fx-progress .fx-step:hover { transform: translateY(-2px); }
.fx-step.done .fx-step-num::after { content: '✓'; position: absolute; right: -5px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; background: #16a34a; color: #fff; font-size: 9px; line-height: 15px; text-align: center; box-shadow: 0 1px 4px rgba(22,163,74,.4); }
.fx-step-num { overflow: visible; }

/* —— 向导科技化步骤条（覆盖升级） —— */
.fx-progress { position: relative; overflow: hidden; }
.fx-progress::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--fxw, 0%); background: linear-gradient(90deg, #2563eb, #7c3aed, #16a34a); background-size: 200% 100%; border-radius: 0 4px 4px 0; transition: width .5s cubic-bezier(.22,.61,.36,1); box-shadow: 0 0 10px rgba(124,58,237,.55); }
.fx-step .fx-step-num { border: 2px solid #dbe4f0; background: linear-gradient(135deg, #ffffff, #eef2f7); color: #475569; }
.fx-step.on .fx-step-num { border-color: transparent; background: linear-gradient(135deg, #3b82f6, #7c3aed); color: #fff; box-shadow: 0 0 0 4px rgba(124,58,237,.14), 0 6px 18px rgba(59,130,246,.35); animation: fxStepPulse 2s ease-in-out infinite; }
.fx-step.done .fx-step-num { border-color: transparent; background: linear-gradient(135deg, #34d399, #16a34a); color: #fff; box-shadow: 0 0 0 4px rgba(22,163,74,.12); }
.fx-step.done::after { background: linear-gradient(90deg, #34d399, #2563eb, #34d399); background-size: 200% 100%; animation: fxFlow 2.4s linear infinite; }
.fx-step.on::after { background: linear-gradient(90deg, #93c5fd, #c4b5fd, #93c5fd); background-size: 200% 100%; animation: fxFlow 2s linear infinite; }
@keyframes fxStepPulse { 0%,100% { box-shadow: 0 0 0 4px rgba(124,58,237,.14), 0 6px 18px rgba(59,130,246,.35); } 50% { box-shadow: 0 0 0 7px rgba(124,58,237,.06), 0 8px 26px rgba(124,58,237,.45); } }
@keyframes fxFlow { from { background-position: 0% 0; } to { background-position: 200% 0; } }

/* —— 分屏编排动画（leave/enter） —— */
.fx-scr { will-change: opacity, transform; }
.fx-leave { animation: fxScrOut .24s ease both; }
@keyframes fxScrOut { to { opacity: 0; transform: translateY(-12px); } }
.fx-enter { animation: fxScrIn .42s cubic-bezier(.22,.61,.36,1) both; }
@keyframes fxScrIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* —— 骨架屏 shimmer —— */
.skl { position: relative; overflow: hidden; background: #e8eef5; border-radius: 8px; }
.skl::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: fxShimmer 1.4s infinite; }
@keyframes fxShimmer { 100% { transform: translateX(100%); } }

/* —— 主题程序向导氛围（仅 index） —— */
.fxw-ambient { position: absolute; inset: 0; pointer-events: none; z-index: 0; border-radius: inherit; background:
  radial-gradient(640px 340px at 12% 4%, rgba(37,99,235,.09), transparent 62%),
  radial-gradient(760px 420px at 92% 8%, rgba(124,58,237,.08), transparent 62%),
  radial-gradient(520px 300px at 70% 96%, rgba(16,185,129,.05), transparent 60%),
  linear-gradient(rgba(30,58,95,.028) 1px, transparent 1px),
  linear-gradient(90deg, rgba(30,58,95,.028) 1px, transparent 1px);
  background-size: auto, auto, auto, 36px 36px, 36px 36px; }
.main-container { position: relative; }
.main-container > *:not(.fxw-ambient) { position: relative; z-index: 1; }

/* 联动高亮闪光（数字溯源 / 引用定位） */
.oc-hit, .kb-hit { animation: fxHit 1.7s ease 2; }
@keyframes fxHit {
  0%, 55% { box-shadow: 0 0 0 3px rgba(124,58,237,.45); border-color: #7c3aed; background: #f5f3ff; }
  100% { box-shadow: none; }
}
.kb-mini-card.kb-hit { border-color: #7c3aed !important; }

/* 调解与预期对照条（主题程序 屏5） */
.fx-contrast { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 16px; }
.fx-contrast .ct { border-radius: 12px; padding: 12px 14px; background: #fff; border: 1px solid #e2e8f0; }
.fx-contrast .ct.med { border-color: #fde68a; background: #fffbeb; }
.fx-contrast .ct.law { border-color: #bfdbfe; background: #eff6ff; }
.fx-contrast .ct .hd { font-size: 12px; font-weight: 800; color: #64748b; margin-bottom: 4px; }
.fx-contrast .ct .bd { font-size: 14.5px; font-weight: 800; color: #1e3a5f; line-height: 1.5; }
.fx-contrast .ct .sd { font-size: 11.5px; color: #94a3b8; margin-top: 3px; }
@media (max-width: 640px) { .fx-contrast { grid-template-columns: 1fr; } }

/* 分屏向导动画与底部导航 */
.fx-scr[data-scr] { border-radius: 14px; }
.fx-anim { animation: fxScrIn .45s cubic-bezier(.22,.61,.36,1) both; }
@keyframes fxScrIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
/* 向导提示行：独立一行，不与按钮争空间 */
.fx-wiztip { margin: 20px 0 0; text-align: center; font-size: 13px; line-height: 1.8; color: #526078; min-height: 24px; padding: 0 6px; }

/* 翻页栏：仅放置对称按钮与步骤指示 */
.fx-wizbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 30px; padding: 12px 14px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 8px 24px rgba(30,58,95,.06); }
.fx-wizbar .wb-side { flex: 0 0 112px; }
.fx-wizbar .wb-btn { flex: 0 0 112px; height: 40px; padding: 0 10px; border-radius: 999px; border: 1px solid #cbd8ea; background: #fff; color: #334155; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: all .18s ease; font-size: 13.5px; }
.fx-wizbar .wb-btn:hover { border-color: #93c5fd; color: #1d4ed8; }
.fx-wizbar .wb-btn.primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); border-color: transparent; color: #fff; box-shadow: 0 6px 14px rgba(37,99,235,.3); }
.fx-wizbar .wb-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(37,99,235,.38); }
.fx-wizbar .wb-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.fx-wizbar .fx-wizstep { flex: 1; text-align: center; font-size: 12.5px; font-weight: 600; color: #7c8aa0; letter-spacing: .3px; white-space: nowrap; }
.fx-wizbar .fx-wizstep i { color: #93c5fd; margin: 0 6px; font-style: normal; }
@media (max-width: 640px) {
  .fx-wizbar .wb-side { display: none; }
  .fx-wizbar .wb-btn { flex-basis: 104px; }
  .fx-wizbar .fx-wizstep { font-size: 12px; }
}

/* 屏内空态引导（未分析时的占位） */
.fx-idle { border: 1px dashed #cbd8ea; border-radius: 14px; background: rgba(248,250,252,.7); padding: 34px 20px; text-align: center; color: #7c8aa0; }
.fx-idle i { font-size: 30px; color: #b6c5da; display: block; margin-bottom: 12px; }
.fx-idle b { color: #475569; font-size: 15px; display: block; margin-bottom: 6px; }
.fx-idle span { font-size: 13px; }
.fx-idle .go { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 8px 18px; border-radius: 999px; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; border: none; box-shadow: 0 6px 16px rgba(37,99,235,.28); }
@media (max-width: 640px) {
  .fx-step-txt { font-size: 11px; }
  .fx-progress { padding: 12px 10px 8px; }
}

/* ---------- 智能法律检索（fusion.html） ---------- */
.fx-fusion-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fx-chip {
  padding: 7px 16px; border-radius: 999px; background: #ffffff;
  border: 1px solid var(--fx-border); color: var(--fx-text-dim);
  font-size: 13px; font-weight: 600; cursor: pointer; user-select: none;
  transition: all .16s ease;
}
.fx-chip:hover { border-color: var(--fx-border-strong); color: var(--fx-text); }
.fx-chip.on { background: #2563eb; color: #fff; border-color: #2563eb; }
.fx-example-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fx-example {
  padding: 6px 14px; border-radius: 999px; background: #f1f5f9;
  border: 1px solid var(--fx-border); color: var(--fx-text-dim);
  font-size: 12.5px; cursor: pointer; transition: all .16s ease;
}
.fx-example:hover { background: #e8f0fe; color: #1d4ed8; border-color: #d4e2fa; }
.fx-law-body { margin-top: 8px; font-size: 13.5px; line-height: 1.8; color: var(--fx-text-dim); white-space: pre-wrap; display: none; }
.fx-law-item.open .fx-law-body { display: block; }
.fx-ai-box { background: #f8fafc; border: 1px solid var(--fx-border); border-radius: 12px; padding: 16px; margin-top: 14px; }
.fx-ai-box h4 { margin: 0 0 10px; font-size: 14px; font-weight: 800; color: var(--fx-text); }
.fx-ai-box .ai-content { font-size: 14px; line-height: 1.85; color: var(--fx-text); }

/* ---------- 模拟调解室（mediation.html） ---------- */
.fx-room-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fx-room-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fx-text-dim); padding: 8px 14px; border-radius: 999px; background: #f1f5f9; border: 1px solid var(--fx-border); }
.fx-room-status i.live { color: #16a34a; }
.fx-room-status i.busy { color: #2563eb; }
.fx-report-card { background: #ffffff; border: 1px solid #d4e2fa; border-radius: 16px; padding: 20px; box-shadow: var(--fx-shadow); }
.fx-report-card h3 { margin: 0 0 12px; font-size: 17px; font-weight: 800; color: #1e3a5f; }
.fx-analy-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.fx-analy-box h4 { margin: 0 0 8px; font-size: 13px; font-weight: 800; color: #92400e; }
.fx-analy-box p { margin: 4px 0; font-size: 13px; color: #78350f; line-height: 1.7; }

/* ===== 主题程序 · 五大板块精修排版 ===== */
/* 屏1：快捷示例句 */
.fxw-examples { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.fxw-ex-label { font-size: 12.5px; color: #7c8aa0; font-weight: 600; }
.fxw-chip { border: 1px solid #dbe4f0; background: #fff; color: #4b5563; font-size: 12.5px; font-weight: 600; line-height: 1.5; padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: all .16s ease; max-width: 100%; }
.fxw-chip:hover { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }

/* 屏1：快速选择（立场 / 权利 / 目标） */
.fxw-quick { margin-top: 12px; padding: 12px 14px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 14px; display: flex; flex-direction: column; gap: 9px; }
.fxw-qrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fxw-qlabel { flex: 0 0 auto; width: 74px; font-size: 12px; font-weight: 800; color: #64748b; }
.fxw-qopt { border: 1px solid #dbe4f0; background: #fff; color: #4b5563; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: all .16s ease; }
.fxw-qopt:hover { border-color: #a78bfa; color: #6d28d9; }
.fxw-qopt.on { background: linear-gradient(135deg, #2563eb, #7c3aed); border-color: transparent; color: #fff; box-shadow: 0 4px 10px rgba(99,102,241,.28); }

/* 补录缺口点击后的字段高亮 */
.fx-hit { animation: fxHit 1.8s ease 2; }

/* 屏1：案件档案折叠入口 */
.fxp-arch { border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(30,58,95,.05); margin-top: 18px; overflow: hidden; }
.fxp-arch-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 13px 16px; cursor: pointer; user-select: none; }
.fxp-arch-head > i { color: #7c3aed; }
.fxp-arch-head b { font-size: 14.5px; color: #1e3a5f; }
.fxp-arch-note { font-size: 12px; color: #94a3b8; }
.fxp-arch-toggle { font-size: 12px; font-weight: 800; color: #7c3aed; }
.fxp-arch-body { border-top: 1px dashed #e9eef5; padding: 12px; }
.fxp-arch-body .fxcp { border: none; box-shadow: none; }

/* 屏2-5：卡片与文字的统一呼吸感 */
body.theme-dark .section-label { margin: 8px 2px 10px; }
.fx-scr[data-scr] .ai-pane .ai-content, .fx-scr[data-scr] .report-text { line-height: 1.9; }
.fx-scr[data-scr] .fx-ai-box h4, .fx-scr[data-scr] .ai-rec { font-weight: 800; }
.kb-mini-empty { line-height: 1.8; }

/* 通用选中与键盘焦点 */
.fx-scr button:focus-visible, .fxw-chip:focus-visible { outline: 2px solid #7c3aed; outline-offset: 2px; }
::selection { background: rgba(124,58,237,.18); }
