/* ============================================================
   客户商机中心 · 对话驱动模块
   视觉规范沿用原型：国金蓝 #1a54e6 / 背景 #f5f7fa / 白卡片
   ============================================================ */

:root {
  --gj-50: #eef5ff;
  --gj-100: #d9e8ff;
  --gj-500: #2e6ef7;
  --gj-600: #1a54e6;
  --gj-700: #1343c4;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e2e8f0;
  --text-1: #1f2937;
  --text-2: #475569;
  --text-3: #64748b;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 30px -10px rgba(26, 84, 230, 0.25);
  --radius: 12px;
  /* 商机类型标签色（原型规范） */
  --tag-incentive-bg: #dbeafe; --tag-incentive-fg: #1d4ed8;
  --tag-buyback-bg: #ede9fe;   --tag-buyback-fg: #6d28d9;
  --tag-unlock-bg: #ffedd5;    --tag-unlock-fg: #c2410c;
  --tag-reduce-bg: #ffe4e6;    --tag-reduce-fg: #be123c;
  --tag-wealth-bg: #ccfbf1;    --tag-wealth-fg: #0f766e;
  --tag-disclosure-bg: #fef3c7;--tag-disclosure-fg: #b45309;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Noto Sans SC", -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-1);
  overflow: hidden;
}

.app { display: flex; flex-direction: column; height: 100vh; }

/* ================= Header ================= */

.header {
  height: 60px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.header-brand { display: flex; align-items: center; gap: 12px; }

.logo-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--gj-500), var(--gj-700));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 1px;
}

.header-titles h1 { font-size: 16px; font-weight: 700; }
.header-titles p { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.header-actions { display: flex; align-items: center; gap: 18px; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border-radius: 999px;
  padding: 7px 14px;
  width: 280px;
}
.search-box input {
  border: none; outline: none; background: transparent;
  font-size: 13px; color: var(--text-2); width: 100%;
}
.search-icon { font-size: 13px; opacity: 0.6; }

.bell { position: relative; cursor: pointer; font-size: 17px; }
.bell-dot {
  position: absolute; top: -3px; right: -5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444;
}

.user { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gj-500), var(--gj-700));
  color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* ================= Layout ================= */

.layout { display: flex; flex: 1; min-height: 0; }

/* ================= Sidebar ================= */

.sidebar {
  width: 232px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.btn-new-task {
  margin: 14px 14px 10px;
  background: var(--gj-600);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-new-task:hover { background: var(--gj-700); }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px; }

.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.nav-item:hover { background: var(--gj-50); color: var(--gj-600); }
.nav-item.active {
  background: var(--gj-50);
  color: var(--gj-600);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gj-600);
}

.nav-soon {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg);
  border-radius: 999px;
  padding: 1px 6px;
}
.nav-new {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: #c2410c;
  background: var(--tag-unlock-bg);
  border-radius: 999px;
  padding: 1px 6px;
}

.nav-group {
  margin: 14px 4px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 1px;
}

.sidebar-foot { padding: 12px; }
.status-card {
  background: linear-gradient(135deg, var(--gj-50), #f0f9ff);
  border: 1px solid var(--gj-100);
  border-radius: 10px;
  padding: 10px 12px;
}
.status-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--gj-700);
}
.status-card p { font-size: 11px; color: var(--text-2); margin-top: 4px; }
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ================= Main · 欢迎态 ================= */

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.welcome { padding: 36px 44px; overflow-y: auto; }

.welcome-hero h2 { font-size: 24px; font-weight: 700; }
.welcome-hero p { color: var(--text-2); font-size: 13px; margin-top: 6px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0 30px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 12px; color: var(--text-2); }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat-value small { font-size: 13px; font-weight: 400; color: var(--text-3); }
.stat-trend { font-size: 11px; margin-top: 8px; }
.stat-trend.up { color: #16a34a; }
.stat-trend.info { color: var(--gj-600); }
.stat-trend.warn { color: #ea580c; }

.section-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.section-sub { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 8px; }

.cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.scene-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.18s;
}
.scene-card:hover {
  transform: translateY(-3px);
  border-color: var(--gj-100);
  box-shadow: var(--shadow-lg);
}
.scene-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.scene-icon.blue { background: var(--tag-incentive-bg); }
.scene-icon.purple { background: var(--tag-buyback-bg); }
.scene-icon.teal { background: var(--tag-wealth-bg); }
.scene-icon.orange { background: var(--tag-unlock-bg); }
.scene-name { font-size: 14px; font-weight: 600; }
.scene-desc { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ================= Main · 对话态 ================= */

.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 44px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 关键：禁止 flex 子项被压缩（否则表格组件会被压扁且无法滚动） */
.messages > * { flex-shrink: 0; }

.msg-user {
  align-self: flex-end;
  max-width: 72%;
  background: var(--gj-600);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  box-shadow: var(--shadow-lg);
}

.msg-assistant {
  align-self: stretch;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.75;
  box-shadow: var(--shadow);
  animation: fade-in 0.25s ease;
}
.msg-assistant p { margin: 4px 0; }
/* M18：助手消息身份头（当前对话专家可见：头像 + 名 + 分类） */
.msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px; /* #16：短回复时减小头部间距避免比例失调 */
  flex-wrap: wrap;
}
.msg-head .mh-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg,#2e6ef7,#1343c4);
}
.msg-head .mh-avatar.mh-bot { border-radius: 50%; }
.msg-head .mh-name { font-size: 12.5px; font-weight: 600; color: var(--text-1); }
.msg-head .mh-cat {
  font-size: 11px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}
/* #19：长回复折叠按钮移入 contentEl 内部，避免组件卡收起后按钮消失 */
.msg-fold-toggle {
  display: block;
  width: fit-content;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--gj-600);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.msg-fold-toggle:hover { color: var(--gj-700); }
.msg-assistant.collapsed .msg-fold-toggle { display: none; } /* 收起时隐藏展开按钮（卡头有展开按钮） */
.msg-head .mh-copy { margin-left: auto; font-size: 11px; opacity: 0; transition: opacity 0.15s; }
.msg-assistant:hover .mh-copy,
.msg-assistant .mh-copy:focus-visible { opacity: 1; }
/* #18：触屏设备无 hover，用 @media (hover: none) 强制显示交互按钮 */
@media (hover: none) {
  .expert-card .expert-export,
  .expert-card .expert-print,
  .msg-head .mh-copy { opacity: 1 !important; }
}
.msg-assistant ul { margin: 6px 0 6px 20px; }
.msg-assistant li { margin: 3px 0; }
.msg-assistant h1 { font-size: 18px; font-weight: 700; margin: 14px 0 8px; }
.msg-assistant h2 { font-size: 16px; font-weight: 700; margin: 12px 0 6px; }
.msg-assistant h3 { font-size: 15px; font-weight: 700; margin: 10px 0 6px; }
.msg-assistant h4, .msg-assistant h5, .msg-assistant h6 { font-size: 14px; font-weight: 700; margin: 8px 0 4px; }
.msg-assistant blockquote {
  margin: 6px 0;
  padding: 2px 12px;
  border-left: 3px solid var(--border);
  color: var(--text-3);
}
.msg-assistant blockquote p { margin: 2px 0; }
.msg-assistant hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
/* Markdown 管道表格（renderMarkdown 输出；不套 .table-wrap 避免双重滚动容器） */
.msg-assistant table.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin: 8px 0;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.msg-assistant table.md-table th,
.msg-assistant table.md-table td {
  border: 1px solid var(--border);
  padding: 5px 10px;
  text-align: left;
}
.msg-assistant table.md-table th {
  background: var(--bg);
  color: var(--text-2);
  font-weight: 600;
}
.msg-assistant table.md-table td:hover { white-space: normal; }
.msg-assistant code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12.5px;
  font-family: Consolas, Menlo, monospace;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-error {
  align-self: stretch;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
}

/* 流式光标 */
.caret::after {
  content: "▍";
  color: var(--gj-500);
  animation: pulse 1s infinite;
}

/* 思维链（reasoner） */
.reasoning {
  color: var(--text-3);
  font-size: 12.5px;
  border-left: 3px solid var(--border);
  padding: 2px 12px;
  margin: 6px 0;
  white-space: pre-wrap;
}

/* 工具调用折叠条 */
/* M18：工具调用分组（连续调用折叠为一行，ChatGPT 式降噪） */
.tool-group {
  align-self: stretch;
  border: 1px solid var(--gj-100);
  border-radius: 10px;
  background: var(--gj-50);
  overflow: hidden;
  animation: fade-in 0.25s ease;
}
.tool-group .tg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--gj-700);
  cursor: pointer;
  text-align: left;
}
.tool-group .tg-icon { flex-shrink: 0; }
.tool-group .tg-label { font-weight: 600; }
.tool-group .tg-count { color: var(--text-3); font-size: 11.5px; }
.tool-group .tg-arrow {
  margin-left: auto;
  transition: transform 0.15s;
  color: var(--text-3);
  font-size: 11px;
}
.tool-group.open .tg-arrow { transform: rotate(180deg); }
.tool-group .tg-body {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 0 10px 10px;
}
.tool-group.open .tg-body { display: flex; }
.tool-group .tool-strip { animation: none; }
.tool-strip {
  background: #fff;
  border: 1px solid var(--gj-100);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--gj-700);
  font-family: Consolas, Menlo, monospace;
  overflow-wrap: anywhere;
}
.tool-strip .tool-ok { color: #16a34a; }

/* ================= 业务组件（原型样式） ================= */

.component {
  align-self: stretch;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fade-in 0.25s ease;
}
.component-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: #fafbfd;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}
.component-head .sub { font-size: 11px; font-weight: 400; color: var(--text-3); }

.table-wrap { overflow-x: auto; }
table.biz-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.biz-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  background: #fafbfd;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.biz-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-2);
  vertical-align: top;
}
.biz-table tr:last-child td { border-bottom: none; }
.biz-table tr:hover td { background: #fafbff; }
.biz-table .strong { color: var(--text-1); font-weight: 600; }
.biz-table .code { color: var(--text-3); font-family: Consolas, Menlo, monospace; font-size: 11.5px; }

/* 彩色标签 */
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-incentive  { background: var(--tag-incentive-bg);  color: var(--tag-incentive-fg); }
.tag-buyback    { background: var(--tag-buyback-bg);    color: var(--tag-buyback-fg); }
.tag-unlock     { background: var(--tag-unlock-bg);     color: var(--tag-unlock-fg); }
.tag-reduce     { background: var(--tag-reduce-bg);     color: var(--tag-reduce-fg); }
.tag-wealth     { background: var(--tag-wealth-bg);     color: var(--tag-wealth-fg); }
.tag-disclosure { background: var(--tag-disclosure-bg); color: var(--tag-disclosure-fg); }
.tag-high   { background: #fee2e2; color: #b91c1c; }
.tag-medium { background: var(--tag-unlock-bg); color: var(--tag-unlock-fg); }
.tag-low    { background: var(--bg); color: var(--text-3); }

/* 客户画像卡 */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 14px 16px;
}
.profile-item {
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
}
.profile-item .k { font-size: 11px; color: var(--text-3); }
.profile-item .v { font-size: 13px; font-weight: 600; margin-top: 3px; color: var(--text-1); }
.profile-item .v .hl { color: var(--gj-600); }

.profile-rows { padding: 4px 16px 14px; }
.profile-row {
  display: flex; gap: 14px; align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed #eef2f7;
  font-size: 12.5px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row .k { color: var(--text-3); flex-shrink: 0; }
.profile-row .v { color: var(--text-2); }

/* 详情卡字段 */
.detail-list { padding: 6px 16px 14px; }
.detail-list .profile-row .v { white-space: pre-wrap; }

/* 状态标签（任务/推送） */
.tag-done { background: #dcfce7; color: #15803d; }

/* 部门徽章 */
.dept-badge {
  display: inline-block;
  background: var(--gj-50);
  border: 1px solid var(--gj-100);
  color: var(--gj-700);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* 话术卡三段式（开场白/利益呈现/异议处理） */
.script-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
}
.script-section {
  border-left: 3px solid;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fafbfd;
}
.script-section.s-open { border-color: var(--gj-500); }
.script-section.s-value { border-color: #a855f7; }
.script-section.s-obj { border-color: #f97316; }
.s-label { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.s-open .s-label { color: var(--gj-600); }
.s-value .s-label { color: #7c3aed; }
.s-obj .s-label { color: #c2410c; }
.s-body { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }

/* 一页通四宫格 */
.onepage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 14px 16px;
}
.onepage-cell {
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.op-title { font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: var(--text-1); }
.op-body { font-size: 12px; color: var(--text-2); line-height: 1.65; }

/* FAQ 折叠列表 */
.faq-list { padding: 8px 16px 14px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: 9px;
  margin: 8px 0;
  background: #fafbfd;
}
.faq-item summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "Q "; color: var(--gj-600); }
.faq-item[open] summary { color: var(--gj-700); }
.faq-item p {
  padding: 0 14px 12px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.7;
}
/* M17：已切换专家卡的完整人设折叠（WorkBuddy 式结构化提示词，保留换行限高滚动） */
.persona-detail { margin: 6px 0 10px; }
.persona-detail summary::before { content: "📄 "; }
.persona-detail p {
  white-space: pre-wrap;
  max-height: 320px;
  overflow-y: auto;
  font-size: 12px;
  color: var(--text-3);
  font-family: inherit;
}

/* 专家卡片网格（原型专家广场样式） */
.expert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 14px 16px;
}
.expert-card {
  display: flex;
  gap: 12px;
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  transition: all 0.15s;
}
.expert-card:hover {
  border-color: var(--gj-100);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.expert-avatar {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.expert-info { min-width: 0; }
/* M19-2：专家卡导出/打印按钮（不触发开对话，悬停浮现） */
.expert-card .expert-export,
.expert-card .expert-print {
  align-self: flex-start;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.expert-card .expert-export + .expert-print { margin-left: 0; }
.expert-card:hover .expert-export,
.expert-card:hover .expert-print,
.expert-card .expert-export:focus-visible,
.expert-card .expert-print:focus-visible { opacity: 1; }
/* 页头动作区（导入/新建专家按钮组） */
.page-head-actions { display: flex; gap: 10px; flex-shrink: 0; }
/* M22-1：专家接力条（问题超出专长时建议切换，一键直达） */
.relay-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--gj-50);
  border: 1px dashed var(--gj-100);
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--text-2);
}
.relay-bar .rb-icon { color: var(--gj-600); font-weight: 700; }
.relay-bar .rb-text b { color: var(--gj-700); }
.relay-bar .relay-go { margin-left: auto; }
.expert-name {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.expert-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin: 3px 0 6px;
}
.expert-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* JSON 折叠兜底 */
.json-fallback {
  padding: 10px 16px;
  font-size: 12px;
  font-family: Consolas, Menlo, monospace;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 300px;
  overflow-y: auto;
}
.json-fallback summary { cursor: pointer; color: var(--gj-600); font-weight: 600; }

/* ================= 对话条 ================= */

.composer {
  flex-shrink: 0;
  padding: 8px 44px 14px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.composer-inner {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 10px 12px 8px;
  transition: border-color 0.15s;
}
.composer-inner:focus-within { border-color: var(--gj-500); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px 8px; }
/* M18：输入区当前专家身份 chip（与谁在对话一目了然） */
.expert-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 2px 4px 8px;
  padding: 3px 10px 3px 4px;
  background: #fff;
  border: 1px solid var(--gj-200, var(--gj-100));
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.expert-chip:hover { border-color: var(--gj-500); }
.expert-chip .ec-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,#2e6ef7,#1343c4);
  flex-shrink: 0;
}
.expert-chip .ec-name { font-size: 12px; font-weight: 600; color: var(--text-1); }
.expert-chip .ec-cat { font-size: 11px; color: var(--text-3); }
.expert-chip .ec-x {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.expert-chip .ec-x:hover { color: var(--text-1); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gj-50);
  border: 1px solid var(--gj-100);
  color: var(--gj-700);
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  padding: 3px 10px;
}
.chip button {
  border: none; background: transparent; color: var(--gj-500);
  cursor: pointer; font-size: 13px; line-height: 1; padding: 0;
}
.chip button:hover { color: var(--gj-700); }

.input-row { display: flex; align-items: flex-end; gap: 10px; }

.btn-plus {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-plus:hover { color: var(--gj-600); border-color: var(--gj-100); }

#input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  max-height: 140px;
  padding: 7px 2px;
  color: var(--text-1);
  background: transparent;
}
#input::placeholder { color: var(--text-3); }

#model {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 9px;
  font-size: 12px;
  color: var(--text-2);
  padding: 6px 8px;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-send {
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--gj-600);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.btn-send:hover:not(:disabled) { background: var(--gj-700); transform: scale(1.05); }
.btn-send:disabled { background: #cbd5e1; cursor: not-allowed; }
.btn-send.sending { animation: pulse 1s infinite; }

/* 语音输入按钮 */
.btn-mic {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  line-height: 1;
}
.btn-mic:hover:not(:disabled) { border-color: var(--gj-500); transform: scale(1.06); }
.btn-mic:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-mic.listening {
  background: #fee2e2;
  border-color: #ef4444;
  animation: mic-pulse 1.2s infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* 实时行情卡 */
.quote-hero {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 18px 6px;
}
.quote-name { font-size: 16px; font-weight: 700; }
.quote-name .sub-code { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 6px; }
.quote-price { font-size: 30px; font-weight: 700; margin-left: auto; }
.quote-price.up { color: #dc2626; }
.quote-price.down { color: #16a34a; }
.quote-change {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
}
.quote-change .up { color: #dc2626; font-weight: 600; }
.quote-change .down { color: #16a34a; font-weight: 600; }
.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 16px;
}
.quote-cell {
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
}
.quote-cell .k { font-size: 11px; color: var(--text-3); }
.quote-cell .v { font-size: 13px; font-weight: 600; margin-top: 2px; }

.composer-sub {
  display: flex; justify-content: space-between;
  padding: 6px 6px 0;
}
.hint { font-size: 11px; color: var(--text-3); }
.hint b { color: var(--gj-600); font-weight: 600; }

/* ================= / 与 @ 弹出面板 ================= */

.panel {
  position: absolute;
  left: 10px; right: 10px; bottom: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.18);
  max-height: 280px;
  overflow-y: auto;
  z-index: 30;
  animation: fade-in 0.15s ease;
}
.panel-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-3);
  padding: 10px 14px 4px;
  letter-spacing: 1px;
}
.panel-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.12s;
}
.panel-item:hover { background: var(--gj-50); }
.panel-item .pi-main { font-size: 13px; font-weight: 600; color: var(--gj-600); }
.panel-item .pi-desc { font-size: 12px; color: var(--text-2); }
.panel-item .pi-side { margin-left: auto; font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.panel-empty { padding: 14px; font-size: 12.5px; color: var(--text-3); }

/* ================= 侧栏任务列表（会话历史） ================= */

.task-list { padding: 2px 10px 10px; overflow-y: auto; }
.task-item {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
  border-left: 3px solid transparent;
}
.task-item:hover { background: var(--bg); }
.task-item.active {
  background: var(--gj-50);
  border-left-color: var(--gj-600);
}
.task-item .t-title {
  font-size: 12.5px; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-item.active .t-title { color: var(--gj-700); font-weight: 600; }
.task-item .t-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ================= 专家广场页面（M4） ================= */

.page-view { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 44px; }

.page-head h2 { font-size: 20px; font-weight: 700; }
.page-head p { font-size: 13px; color: var(--text-3); margin: 4px 0 18px; }

.page-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.page-tab {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.page-tab:hover { border-color: var(--gj-100); color: var(--gj-600); }
.page-tab.active {
  background: var(--gj-600);
  border-color: var(--gj-600);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px -4px rgba(26, 84, 230, 0.45);
}

.page-expert-grid { padding: 0; grid-template-columns: repeat(3, 1fr); }
.expert-card.clickable { cursor: pointer; background: var(--card); }
.expert-card.clickable:hover { border-color: var(--gj-500); box-shadow: var(--shadow-lg); }

/* ================= 新建任务弹层（M4） ================= */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fade-in 0.15s ease;
}

.modal {
  width: 460px;
  max-width: calc(100vw - 40px);
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.3);
  padding: 22px 24px;
}

.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

.modal-body { display: flex; flex-direction: column; gap: 12px; }
.modal-body label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.modal-body input, .modal-body select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #fafbfd;
}
.modal-body input:focus, .modal-body select:focus { border-color: var(--gj-500); background: #fff; }

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.link-new-chat { font-size: 12.5px; color: var(--gj-600); cursor: pointer; }
.link-new-chat:hover { color: var(--gj-700); text-decoration: underline; }
.modal-actions { display: flex; gap: 10px; }
.btn-cancel {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  border-radius: 9px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}
.btn-cancel:hover { background: var(--bg); }
.btn-primary {
  border: none;
  background: var(--gj-600);
  color: #fff;
  border-radius: 9px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-primary:hover { background: var(--gj-700); }

/* ================= 欢迎态最近任务（M4） ================= */

.recent-tasks { display: flex; flex-direction: column; gap: 10px; }
.recent-task {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.15s;
}
.recent-task:hover { border-color: var(--gj-100); transform: translateY(-1px); }
.rt-main { display: flex; align-items: center; gap: 10px; }
.rt-title { font-size: 13.5px; font-weight: 600; }
.rt-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* 任务列表行：标题 + 删除按钮 */
.t-row { display: flex; align-items: center; gap: 6px; }
.t-row .t-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-del {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  line-height: 1;
  visibility: hidden;
}
.task-item:hover .t-del { visibility: visible; }
.t-del:hover { color: #ef4444; background: #fee2e2; }

/* ================= 滚动条 ================= */

/* ================= M6：全局搜索面板 ================= */

.search-box { position: relative; }

.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.18);
  max-height: 380px;
  overflow-y: auto;
  z-index: 200;
  padding: 6px;
  animation: fade-in 0.15s ease;
}

.sp-group {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  padding: 8px 10px 4px;
  letter-spacing: 1px;
}

.sp-item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.sp-item:hover { background: var(--gj-50); }
.sp-label { font-size: 13px; font-weight: 600; color: var(--text-1); }
.sp-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.sp-empty { padding: 16px; text-align: center; font-size: 12.5px; color: var(--text-3); }

/* ================= M6：任务详情聚合页 ================= */

.task-detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.btn-back {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 9px;
  font-size: 16px;
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
}
.btn-back:hover { background: var(--bg); color: var(--gj-600); }

.td-title-wrap { flex: 1; min-width: 0; }
.td-title-wrap h2 { font-size: 20px; font-weight: 700; }
.td-title-wrap p { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.td-actions { display: flex; gap: 10px; flex-shrink: 0; }

.task-detail-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  align-items: start;
}

.td-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.td-main .component { animation: fade-in 0.2s ease; }

.td-side { display: flex; flex-direction: column; gap: 14px; }

.td-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.td-card-title { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.td-push-list { display: flex; flex-direction: column; gap: 10px; }

.td-empty {
  background: #fafbfd;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 22px;
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.7;
}
.td-empty.small { padding: 12px; }

/* ================= M6：快捷问题 / 推荐专家 / 转任务 / 导出 ================= */

/* 快捷问题已从输入框移至 get_persona 组件卡内（.qq-inline 容器） */
.qq-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.qq-chip {
  border: 1px solid var(--gj-100);
  background: var(--gj-50);
  color: var(--gj-700);
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.qq-chip:hover { background: var(--gj-100); }

.recommend-experts { display: flex; gap: 14px; flex-wrap: wrap; }
.rec-expert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.15s;
  flex: 1;
  min-width: 220px;
}
.rec-expert:hover { border-color: var(--gj-100); transform: translateY(-1px); }
.expert-avatar.sm { width: 34px; height: 34px; font-size: 14px; border-radius: 9px; }
.re-name { font-size: 13px; font-weight: 600; }
.re-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.link-btn {
  border: none;
  background: transparent;
  color: var(--gj-600);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
}
.link-btn:hover { background: var(--gj-50); color: var(--gj-700); }

.comp-ops { margin-left: auto; display: inline-flex; gap: 6px; }
.comp-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  font-size: 11px;
  border-radius: 6px;
  padding: 2px 9px;
  cursor: pointer;
  transition: all 0.15s;
}
.comp-btn:hover { border-color: var(--gj-500); color: var(--gj-600); }

.page-subtabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: -8px 0 16px;
}
.page-subtab {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.page-subtab:hover { border-color: var(--gj-100); color: var(--gj-600); }
.page-subtab.active {
  background: var(--gj-50);
  border-color: var(--gj-500);
  color: var(--gj-700);
  font-weight: 600;
}

/* ================= M6：打印样式（组件导出） ================= */

@media print {
  body.printing .header,
  body.printing .sidebar,
  body.printing .composer,
  body.printing .msg-user,
  body.printing .msg-assistant,
  body.printing .tool-strip,
  body.printing .msg-error,
  body.printing .component:not(.print-target) {
    display: none !important;
  }
  body.printing .app,
  body.printing .layout,
  body.printing .main,
  body.printing .messages,
  body.printing .task-detail-body {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
  }
  body.printing .component.print-target {
    border: none !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  body.printing .table-wrap { overflow: visible !important; }
  body.printing .biz-table { font-size: 11px; }
}

/* ================= 滚动条 ================= */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.hidden { display: none !important; }


/* ================= M7：今日待办 / 通知 / 设置 / 跟进记录 / 引导 ================= */

.today-card {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.today-head { font-size: 13.5px; font-weight: 700; color: #92400e; margin-bottom: 8px; }
.today-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.today-item:hover { background: rgba(255, 255, 255, 0.7); }
.ti-icon { flex-shrink: 0; }
.ti-text { flex: 1; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti-go { color: var(--text-3); font-size: 12px; }

.bell { position: relative; }
.notice-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: -10px;
  width: 320px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.18);
  max-height: 360px;
  overflow-y: auto;
  z-index: 200;
  padding: 6px;
  animation: fade-in 0.15s ease;
}
.notice-clear {
  display: block;
  width: calc(100% - 12px);
  margin: 6px;
  border: none;
  background: var(--bg);
  color: var(--text-2);
  border-radius: 8px;
  padding: 7px;
  font-size: 12px;
  cursor: pointer;
}
.notice-clear:hover { background: var(--gj-50); color: var(--gj-600); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  padding: 6px 0;
  cursor: pointer;
}
.audit-card { overflow: hidden; }

/* M16：MCP 连接管理（设置页） */
.mcp-card { grid-column: 1 / -1; }
.mcp-provider-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
  margin-left: 8px;
}
.mcp-status {
  font-size: 12.5px;
  color: var(--text-2);
  margin: 8px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.mcp-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
  margin: 6px 0;
}
.mcp-field input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
  font-family: Consolas, Menlo, monospace;
  background: var(--card);
}
.mcp-ops { display: flex; gap: 10px; margin-top: 10px; }
.mcp-tip { font-size: 11.5px; color: var(--text-3); margin: 10px 0 0; line-height: 1.6; }
.mcp-tools { margin-top: 12px; }
.mcp-tools summary { font-size: 12.5px; color: var(--gj-700); cursor: pointer; user-select: none; }
.mcp-tool-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg);
}
.mcp-tool-item {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
}
.mcp-tool-item:last-child { border-bottom: none; }
.mcp-tool-item .code { flex-shrink: 0; color: var(--gj-700); font-size: 11.5px; }
.mcp-tool-desc {
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* M20：后台任务结果报告（moss_agent_get_result 完成态；markdown 渲染） */
.agent-report {
  padding: 4px 2px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-1);
}
.agent-report h1 { font-size: 17px; font-weight: 700; margin: 14px 0 8px; }
.agent-report h2 { font-size: 15px; font-weight: 700; margin: 12px 0 6px; }
.agent-report h3 { font-size: 14px; font-weight: 600; margin: 10px 0 4px; }
.agent-report p { margin: 4px 0; }
.agent-report ul { margin: 6px 0 6px 20px; }
.agent-report li { margin: 3px 0; }
.agent-report blockquote {
  margin: 6px 0; padding: 2px 12px;
  border-left: 3px solid var(--border); color: var(--text-3);
}
.agent-report hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.agent-report table.md-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
  margin: 8px 0; display: block; overflow-x: auto; white-space: nowrap;
}
.agent-report table.md-table th,
.agent-report table.md-table td { border: 1px solid var(--border); padding: 5px 10px; text-align: left; }
.agent-report table.md-table th { background: var(--bg); color: var(--text-2); font-weight: 600; }
.agent-report table.md-table td:hover { white-space: normal; }
.agent-report code {
  background: var(--bg); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; font-size: 12px; font-family: Consolas, Menlo, monospace;
}

.followup-list { display: flex; flex-direction: column; gap: 10px; max-height: 280px; overflow-y: auto; }
.followup-item {
  border-left: 3px solid var(--gj-500);
  padding: 6px 0 6px 12px;
}
.fu-time { font-size: 11px; color: var(--text-3); }
.fu-content { font-size: 12.5px; color: var(--text-1); margin-top: 3px; line-height: 1.6; }
.fu-next { font-size: 11.5px; color: var(--gj-700); margin-top: 3px; }

.push-ops { margin-left: 8px; display: inline-flex; gap: 6px; }

.task-filter {
  margin: 4px 10px 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12px;
  outline: none;
  background: var(--bg);
}
.task-filter:focus { border-color: var(--gj-500); }

.err-retry { margin-left: 8px; }

.onboard-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: fade-in 0.2s ease;
}
.onboard-card {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 32px 22px;
  width: 480px;
  max-width: calc(100vw - 40px);
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.3);
}
/* 多步引导页眉 */
.onboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.onboard-page-label { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.onboard-skip {
  background: none; border: none; color: var(--text-3); font-size: 12px;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.onboard-skip:hover { color: var(--text-2); background: var(--bg); }
/* 进度点 */
.onboard-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.onboard-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: all 0.2s ease;
}
.onboard-dot.active { background: var(--gj-500); transform: scale(1.25); }
.onboard-dot.done { background: var(--gj-100); }
/* 引导内容 */
.onboard-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; line-height: 1.5; }
.onboard-desc { font-size: 13px; color: var(--text-3); margin-bottom: 16px; line-height: 1.6; }
.onboard-features {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px;
}
.onboard-feat {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; color: var(--text-2); line-height: 1.6;
}
.onboard-feat-icon {
  flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 15px;
  background: var(--gj-50); color: var(--gj-600);
}
.onboard-feat b { color: var(--text-1); }
.onboard-feat code {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 0 5px; font-size: 12px; color: var(--gj-600);
}
/* 引导页脚 */
.onboard-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
}
.onboard-prev {
  background: none; border: 1px solid var(--border); color: var(--text-2);
  border-radius: 8px; padding: 6px 16px; font-size: 12.5px; cursor: pointer;
  transition: all 0.15s;
}
.onboard-prev:hover { border-color: var(--gj-100); color: var(--gj-600); }
.onboard-prev:disabled { opacity: 0.3; cursor: default; }
.onboard-next {
  background: var(--gj-600); color: #fff; border: none;
  border-radius: 8px; padding: 7px 22px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.onboard-next:hover { background: var(--gj-700); }

/* 末页「60 秒体验完整闭环」CTA（引导收口，串起「查商机 → 转任务」主流程） */
.onboard-cta-wrap { margin-top: 14px; text-align: center; }
.onboard-cta {
  background: linear-gradient(135deg, var(--gj-500), var(--gj-700));
  color: #fff; border: none; border-radius: 10px;
  padding: 11px 26px; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(19, 67, 196, 0.25); transition: transform 0.15s, box-shadow 0.15s;
}
.onboard-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(19, 67, 196, 0.32); }
.onboard-cta-hint { margin-top: 8px; font-size: 12px; color: var(--text-3); }

/* 工作台「快速上手」引导卡 */
.guide-card {
  margin-top: 24px;
  background: linear-gradient(135deg, #eef5ff 0%, #f5f7fa 100%);
  border: 1px solid var(--gj-100);
  border-radius: var(--radius);
  overflow: hidden;
}
.guide-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--gj-50);
  border-bottom: 1px solid var(--gj-100);
}
.guide-title { font-size: 13.5px; font-weight: 700; color: var(--gj-700); }
.guide-close {
  background: none; border: none; color: var(--text-3); font-size: 14px;
  cursor: pointer; width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.guide-close:hover { background: var(--border); color: var(--text-2); }
.guide-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.guide-item {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12.5px; color: var(--text-2); line-height: 1.6;
}
.guide-num {
  flex-shrink: 0; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 11px; font-weight: 700;
  background: var(--gj-500); color: #fff;
}
.guide-text code {
  background: #fff; border: 1px solid var(--border);
  border-radius: 3px; padding: 0 4px; font-size: 11.5px; color: var(--gj-600);
}
.guide-foot {
  padding: 10px 16px; display: flex; align-items: center; justify-content: space-between;
  border-top: 1px dashed var(--gj-100);
}
.guide-hint { font-size: 11.5px; color: var(--text-3); }

/* 输入框帮助按钮 */
.btn-help {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; cursor: pointer; transition: all 0.15s;
  flex-shrink: 0;
}
.btn-help:hover { border-color: var(--gj-100); background: var(--gj-50); }

/* ================= 页面级上下文提示条（page-hint） ================= */

.page-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--gj-50);
  border: 1px solid var(--gj-100);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
  animation: fade-in 0.3s ease;
}
.page-hint-icon { flex-shrink: 0; font-size: 14px; margin-top: 1px; }
.page-hint-text { flex: 1; }
.page-hint-text code {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 11px;
  color: var(--gj-600);
}
.page-hint-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.6;
}
.page-hint-close:hover { opacity: 1; color: var(--text-1); }

/* ================= M8：插件管理 / Agent 向导 ================= */

.btn-new-agent {
  position: absolute;
  top: 30px;
  right: 44px;
  border: 1px solid var(--gj-500);
  background: var(--gj-50);
  color: var(--gj-700);
  border-radius: 9px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-new-agent:hover { background: var(--gj-100); }

.plugin-row {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  margin: 6px 0;
  background: #fafbfd;
}
.pr-main { display: flex; align-items: center; gap: 8px; }
.pr-name { font-size: 13px; font-weight: 700; }
.pr-ver { font-size: 11px; color: var(--text-3); }
.pr-desc { font-size: 11.5px; color: var(--text-3); margin: 3px 0 6px; }
.pr-ops { display: flex; gap: 6px; }

.agent-modal { width: 540px; }
.agent-step-indicator { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 10px; }
.agent-steps-bar { height: 4px; background: var(--bg); border-radius: 2px; margin-bottom: 16px; overflow: hidden; }
.agent-step-bar-fill { height: 100%; background: var(--gj-500); border-radius: 2px; transition: width 0.2s; }
.agent-step label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 500; margin-bottom: 12px; }
.agent-step input, .agent-step select, .agent-step textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #fafbfd;
}
.agent-step input:focus, .agent-step textarea:focus { border-color: var(--gj-500); background: #fff; }
.agent-step textarea { resize: vertical; }
.ag-tools { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.ag-tool {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 400;
}
.ag-tool:hover { border-color: var(--gj-100); }
.ag-tool b { font-weight: 600; }
.ag-summary { font-size: 13px; }

/* 专家广场页面容器需要相对定位以放置新建按钮 */
#experts-view { position: relative; }

/* ================= M13：插件安装/回收站 ================= */

.plugin-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.btn-install-plugin { padding: 5px 12px; font-size: 12px; }

.plugin-trash { margin-top: 14px; }
.trash-title {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.trash-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12.5px;
}
.trash-row:hover { background: var(--bg); }
.trash-name { font-weight: 600; color: var(--text-2); min-width: 120px; }
.trash-name small { color: var(--text-3); font-weight: 400; }
.trash-desc { flex: 1; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pl-remove { color: #b91c1c; border-color: #fecaca !important; }
.pl-remove:hover { background: #fef2f2 !important; }

#install-modal .modal { width: min(680px, 92vw); }
#install-modal .modal-hint { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 8px; }
.pi-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 6px;
}
#pi-code {
  width: 100%;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.6;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  outline: none;
  background: #fafbfd;
  resize: vertical;
}
#pi-code:focus { border-color: var(--gj-500); background: #fff; }
.pi-tip { font-size: 11.5px; color: var(--text-3); }

/* ================= 附件上传 ================= */

.attach-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 2px 2px;
}
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gj-50);
  border: 1px solid var(--gj-100);
  color: var(--gj-700);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  max-width: 260px;
}
.attach-size { color: var(--text-3); font-size: 11px; }
.attach-warn {
  color: #b45309;
  background: #fef3c7;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 11px;
}
.attach-x {
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
}
.attach-x:hover { color: #dc2626; }
.msg-attach {
  margin-top: 6px;
  font-size: 12px;
  color: var(--gj-100);
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 3px 8px;
  display: inline-block;
}

/* ================= 独立数据页（菜单直连） ================= */

.view-loading {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  padding: 40px 0;
}
.view-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13px;
}
#oppo-body .component,
#tasks-body .component {
  margin-bottom: 14px;
}

/* E3：新建专家按钮入 flex 行（脱离绝对定位） */
.page-head-flex { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.btn-new-agent-inline {
  border: 1px solid var(--gj-500);
  background: var(--gj-50);
  color: var(--gj-700);
  border-radius: 9px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-new-agent-inline:hover { background: var(--gj-100); }

/* ================= M9：firmbuddy 品牌化 ================= */

.logo-svg { width: 36px; height: 36px; flex-shrink: 0; }
.brand-cn { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 6px; }

/* 架构蓝图页 */
.arch-layer {
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 14px;
  color: #fff;
}
.arch-layer.app { background: linear-gradient(135deg, var(--gj-500), var(--gj-700)); }
.arch-layer.agent { background: linear-gradient(135deg, #6d28d9, #4c1d95); }
.arch-layer.data { background: linear-gradient(135deg, #0f766e, #134e4a); }
.arch-layer h3 { font-size: 15px; margin-bottom: 4px; }
.arch-layer p { font-size: 11.5px; opacity: 0.85; }
.arch-cells { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.arch-cell {
  background: rgba(255,255,255,0.15);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 11.5px;
  backdrop-filter: blur(4px);
}
.arch-arrow { text-align: center; color: var(--text-3); font-size: 18px; margin: -6px 0; }
.arch-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }

/* ================= 响应式 ================= */

@media (max-width: 1100px) {
  .stats-grid, .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-grid, .onepage-grid, .expert-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .task-detail-body { grid-template-columns: 1fr; }
}

/* ================= 前端优化批次（focus/滚动/组件强调/表格截断/空态/布局修正） ================= */

/* G5：键盘可访问性 - 统一 focus ring */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav-item:focus-visible,
.scene-card:focus-visible {
  outline: 2px solid var(--gj-500);
  outline-offset: 2px;
}

/* G6：滚动条加宽至 8px */
::-webkit-scrollbar { width: 8px; height: 8px; }

/* C3：业务组件卡左侧品牌色条（与助手文字卡区分） */
.component {
  border-left: 3px solid var(--gj-500);
}

/* C4：表格"触发事件"等长文本列截断（防行高失控） */
.biz-table td:nth-child(4),
.biz-table td:nth-child(3) {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.biz-table td:nth-child(4):hover,
.biz-table td:nth-child(3):hover {
  white-space: normal;
  overflow: visible;
}

/* D1：窄屏单列时任务详情侧区优先（信息/跟进/协同先于组件） */
@media (max-width: 1100px) {
  .task-detail-body {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }
  .task-detail-body .td-side { order: -1; }
}

/* E2：专家广场筛选空态 */
.expert-grid .expert-empty {
  grid-column: 1 / -1;
  background: #fafbfd;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.expert-grid .expert-empty button {
  margin-top: 12px;
}

/* T1：任务表空态行 */
.biz-table .empty-row td {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-3);
  font-size: 13px;
}

/* S6：插件行操作按钮加大点击目标 */
.pl-act {
  min-height: 28px;
  padding: 4px 12px;
  font-size: 12px;
}

/* A1：架构层 chip 分组小标题 */
.arch-group-label {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.5px;
  margin-top: 8px;
  display: block;
}

/* A4：架构层间箭头加强 */
.arch-arrow {
  font-size: 22px;
  font-weight: 700;
  margin: 2px 0;
}

/* A5：中间层路径相对化（隐藏服务器绝对路径） */
.arch-path-hide { display: none; }

/* C5：工具调用条参数折叠 */
.tool-strip .ts-args {
  display: none;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  word-break: break-all;
}
.tool-strip.open .ts-args { display: block; }
.tool-strip .ts-toggle { cursor: pointer; color: var(--gj-600); font-size: 11px; margin-left: 8px; }

/* G3：768px 断点 - 侧栏收起为图标轨 + 搜索框图标化 */
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .btn-new-task { padding: 10px 4px; font-size: 0; }
  .btn-new-task::before { content: "＋"; font-size: 18px; }
  .nav-item { padding: 9px 8px; font-size: 0; text-align: center; }
  .nav-item::before { font-size: 18px; }
  .nav-group { display: none; }
  .status-card p, .status-head { font-size: 0; }
  .status-card p::after { content: "运行中"; font-size: 10px; }
  .sidebar-foot { padding: 8px; }
  .search-box { width: auto; }
  .search-box input { display: none; }
  .search-box:focus-within input { display: block; width: 200px; }
  .header-titles p { display: none; }
}

/* ================= 客群监控 / 需求地图（client-watchlist / demand-map） ================= */
.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}
.watchlist-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.watchlist-card:hover {
  border-color: var(--gj-100);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.watchlist-head { margin-bottom: 10px; }
.watchlist-head.flex { display: flex; gap: 12px; align-items: flex-start; }
.wl-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gj-500), var(--gj-600));
  color: #fff;
  font-size: 17px;
  box-shadow: 0 4px 10px -4px rgba(26, 84, 230, 0.45);
}
.wl-head-main { flex: 1; min-width: 0; }
.watchlist-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.4;
}
.wl-id {
  font-family: Consolas, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
}
.watchlist-meta {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.watchlist-meta .dot { color: var(--border); }
.watchlist-companies { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text-3); align-items: center; }
.wl-co {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gj-50);
  border: 1px solid var(--gj-100);
  color: var(--gj-600);
  border-radius: 999px;
  padding: 2.5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  transition: background 0.15s ease;
}
.wl-co:hover { background: var(--gj-100); }
.wl-co .wl-co-code {
  font-family: Consolas, Menlo, monospace;
  font-size: 10px;
  font-weight: 400;
  color: var(--gj-500);
  opacity: 0.85;
}
.wl-more { font-size: 11.5px; color: var(--text-3); }

/* 名单操作按钮 / 公司点击 / 报告状态流转（互动闭环） */
.wl-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-self: center;
  margin-left: 8px;
}
.wl-act {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.wl-act:hover {
  border-color: var(--gj-100);
  color: var(--gj-600);
  background: var(--gj-50);
}
.wl-act.wl-act-primary {
  border-color: var(--gj-500);
  background: var(--gj-500);
  color: #fff;
  font-weight: 600;
}
.wl-act.wl-act-primary:hover {
  background: var(--gj-600);
  border-color: var(--gj-600);
}
.wl-co-act { cursor: pointer; }
.wl-co-act:hover { background: var(--gj-100); border-color: var(--gj-500); }
.wl-company-link {
  cursor: pointer;
  transition: color 0.15s ease;
}
.wl-company-link:hover { color: var(--gj-600); text-decoration: underline; text-underline-offset: 3px; }
.wl-report-ops {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 14px;
}
.wl-ops-label { font-size: 11.5px; color: var(--text-3); flex-shrink: 0; }
.wl-done-text { font-size: 11.5px; color: #15803d; }

/* ---- 董事长需求分析卡（analyze_demand_matches）---- */
.dm-card {
  margin: 14px 16px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.dm-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #f87171, #dc2626);
}
.dm-card:hover {
  border-color: #fecaca;
  box-shadow: 0 6px 18px -8px rgba(220, 38, 38, 0.25);
}
.dm-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.dm-code {
  flex-shrink: 0;
  font-family: Consolas, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 2px 8px;
}
.dm-title {
  flex: 1;
  min-width: 200px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.45;
}
.dm-class-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #b91c1c;
  background: #fff;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 2px 10px;
}
.dm-class-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
}
.dm-keywords {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 2px 0 10px;
}
.dm-kw-label { font-size: 11.5px; color: var(--text-3); }
.dm-kw {
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 999px;
  padding: 1.5px 9px;
  font-size: 11px;
  font-weight: 600;
}
.dm-card .script-section { margin-top: 10px; }

/* C类候选 / B类分组 */
.dm-group {
  margin: 14px 16px 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fbfcfe;
}
.dm-group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.dm-c-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dashed #eef2f7;
  font-size: 12.5px;
  flex-wrap: wrap;
}
.dm-c-row:last-child { border-bottom: none; }
.dm-c-code {
  flex-shrink: 0;
  font-family: Consolas, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #c2410c;
  background: #fff7ed;
  border-radius: 6px;
  padding: 1px 7px;
}
.dm-c-title { flex-shrink: 0; font-weight: 600; color: var(--text-1); }
.dm-c-hint { flex: 1; min-width: 240px; color: var(--text-3); }
.dm-c-row .dm-kw { background: #fff7ed; color: #c2410c; }
.dm-b-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dm-b-tag {
  border: 1px solid var(--gj-100);
  background: var(--gj-50);
  color: var(--gj-600);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 600;
}

@media (max-width: 900px) {
  .watchlist-grid { grid-template-columns: 1fr; }
  .dm-title { min-width: 100%; }
  .dm-c-hint { min-width: 100%; }
}

/* ================= 前端 UX 优化（PLAN-FRONTEND-UX 批次三/四） ================= */

/* --- 长表格 Top 8 折叠 --- */
.biz-table tr.fx-hidden { display: none; }
.fx-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 8px 14px;
  border-top: 1px dashed var(--border);
  background: #fafbfd;
  border-radius: 0 0 8px 8px;
}
.fx-bar .link-btn { font-size: 12px; }
.fx-filter.on { color: #b91c1c; font-weight: 600; }

/* --- 组件卡片一键收起 --- */
.comp-collapse {
  margin-left: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-3);
  border-radius: 6px;
  min-width: 42px;
  padding: 0 6px;
  height: 24px;
  line-height: 1;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.comp-collapse:hover { color: var(--gj-500); border-color: var(--gj-100); }
.component.collapsed > *:not(.component-head) { display: none; }
.component.collapsed { border-left-color: var(--border); opacity: 0.85; }
.component-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.component-head .comp-ops { margin-left: auto; }

/* --- AI 长回复折叠 --- */
.msg-fold.folded {
  max-height: 300px;
  overflow: hidden;
  position: relative;
}
.msg-fold.folded::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 64px;
  background: linear-gradient(transparent, #fff);
  pointer-events: none;
}
.msg-fold-toggle {
  display: inline-block;
  margin-top: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--gj-500);
  border-radius: 999px;
  padding: 3px 14px;
  font-size: 12px;
  cursor: pointer;
}
.msg-fold-toggle:hover { background: var(--gj-50); border-color: var(--gj-100); }

/* --- 回到最新悬浮钮 --- */
#chat { position: relative; }
.back-to-latest {
  position: absolute;
  right: 24px;
  bottom: 16px;
  z-index: 20;
  border: 1px solid var(--gj-100);
  background: #fff;
  color: var(--gj-500);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  box-shadow: var(--shadow-lg, 0 4px 12px rgba(15,23,42,.12));
  cursor: pointer;
  animation: fade-in 0.2s ease;
}
.back-to-latest:hover { background: var(--gj-50); }

/* --- fb-toast（替代 alert） --- */
.fb-toast {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 1000;
  background: #1e293b;
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 12.5px;
  box-shadow: 0 6px 20px rgba(15,23,42,.25);
  animation: fade-in 0.2s ease;
  max-width: 360px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.fb-toast.out { opacity: 0; transform: translateY(6px); }
.fb-toast-ok { background: #166534; }
.fb-toast-warn { background: #b45309; }
.fb-toast-error { background: #b91c1c; }

/* --- fb-modal（替代 confirm / prompt） --- */
.fb-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.15s ease;
}
.fb-modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(15,23,42,.25);
  padding: 20px 22px;
  width: min(420px, 92vw);
}
.fb-modal-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.fb-modal-body { font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.fb-modal-input {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  outline: none;
  box-sizing: border-box;
}
.fb-modal-input:focus { border-color: var(--gj-500); }
.fb-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

/* --- 服务健康状态 --- */
.status-card.down { border-color: #fecaca; background: #fef2f2; }
.status-card.down .pulse-dot { background: #dc2626; animation: none; }
.status-card.down .status-head { color: #b91c1c; }

/* --- 面板/搜索键盘选中态 --- */
.panel-item.active { background: var(--gj-50); outline: 1px solid var(--gj-100); }
.sp-item.active { background: var(--gj-50); outline: 1px solid var(--gj-100); }

/* --- 发送中停止按钮 --- */
.btn-send.sending { background: #dc2626; }

/* ================= 移动端适配增强（<768px） ================= */
@media (max-width: 768px) {
  .stats-grid, .cards-grid { grid-template-columns: 1fr 1fr; }
  .onepage-grid, .expert-grid, .page-expert-grid { grid-template-columns: 1fr; }
  .quote-grid { grid-template-columns: repeat(2, 1fr); }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .biz-table { min-width: 640px; }
  .modal, .agent-modal { width: 94vw; max-width: 94vw; }
  .task-detail-head { flex-wrap: wrap; }
  .td-actions { width: 100%; display: flex; gap: 8px; }
  .td-actions .btn-primary, .td-actions .btn-cancel { flex: 1; }
  .today-item .ti-text { font-size: 12px; }
  .composer-inner { padding: 8px; }
  .msg-user, .msg-assistant, .component { max-width: 100%; }
  .back-to-latest { right: 12px; bottom: 10px; }
  .fb-toast { right: 12px; left: 12px; max-width: none; }
}
@media (max-width: 480px) {
  .stats-grid, .cards-grid { grid-template-columns: 1fr; }
}

/* ================= 成果目录（PLAN-CHAT-LAYOUT L1） ================= */
.art-btn {
  position: absolute;
  top: 10px;
  right: 16px;
  z-index: 21;
  border: 1px solid var(--gj-100);
  background: #fff;
  color: var(--gj-500);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow);
  cursor: pointer;
  animation: fade-in 0.2s ease;
}
.art-btn:hover { background: var(--gj-50); }
.art-btn { position: relative; top: auto; right: auto; order: -1; align-self: flex-end; flex-shrink: 0; margin: 10px 16px 0; padding: 10px 18px; font-size: 14px; border: 1px solid var(--gj-500); box-shadow: 0 4px 16px #2563eb20; }
.chat-references { margin: 10px 0; border: 1px solid #dce5f0; border-radius: 12px; background: #fff; overflow: hidden; }
.chat-references > summary { padding: 12px 16px; cursor: pointer; color: #334155; font-size: 13px; font-weight: 600; }
.chat-references > summary span { color: #64748b; font-weight: 400; margin-left: 10px; }
.chat-reference-list { padding: 0 12px 12px; display: grid; gap: 8px; }
.chat-reference-list > .component, .chat-reference-list > .tool-group { margin: 0; }
.source-reference-body { padding: 14px; max-height: 480px; overflow: auto; overflow-wrap: anywhere; font-family: inherit; font-size: 14px; line-height: 1.65; }
.source-reference-body .json-fallback { font-family: inherit; max-height: none; background: transparent; margin: 0; }
.source-reference-body section { padding: 12px 0; border-bottom: 1px solid #e2e8f0; }
.source-reference-body table { border-collapse: collapse; width: 100%; font-size: 13px; }
.source-reference-body th, .source-reference-body td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; text-align: left; }
.source-reference-body a { color: var(--gj-500); }
.source-reference .component-head { flex-wrap: wrap; gap: 8px; }
.rt-evidence .source-reference { margin: 10px 0; }
/* Checkbox groups must not inherit full-width text-field layout. */
.expert-form fieldset:has(input[type="checkbox"]),
.ew-fields fieldset:has(input[type="checkbox"]) {
  min-width: 0; margin: 0; padding: 12px 14px;
  border: 1px solid #dbe3ef; border-radius: 8px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px;
}
.expert-form fieldset label:has(input[type="checkbox"]),
.ew-fields fieldset label:has(input[type="checkbox"]) {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
  gap: 8px; margin: 0; min-height: 30px; line-height: 1.5; cursor: pointer;
}
.expert-form fieldset input[type="checkbox"],
.ew-fields fieldset input[type="checkbox"] {
  width: 16px; height: 16px; min-width: 16px; flex: 0 0 16px;
  margin: 0; padding: 0; align-self: center; accent-color: var(--gj-500);
}
.expert-chat-chart-body { padding: 16px; overflow: auto; }
.expert-chat-chart .expert-chart { width: 100%; max-width: 760px; min-width: 360px; height: auto; display: block; margin: auto; }
.expert-chat-chart .expert-chart text { font-size: 11px; fill: #475569; }
.expert-chat-chart .expert-chart-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; }
.expert-chat-chart .expert-chart-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 3px; }
@media (max-width: 600px) { .art-btn { right: 8px; padding: 8px 10px; font-size: 12px; } .chat-references > summary span { display: block; margin-left: 16px; } }
.art-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  text-align: center;
  padding: 0 4px;
  vertical-align: 1px;
}
.art-drawer {
  position: absolute;
  top: 46px;
  right: 16px;
  z-index: 21;
  width: 290px;
  max-height: 70%;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  animation: fade-in 0.15s ease;
}
.art-drawer-head {
  position: sticky;
  top: 0;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.art-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.art-item:last-child { border-bottom: none; }
.art-item:hover { background: var(--gj-50); }
.art-icon { font-size: 16px; flex-shrink: 0; }
.art-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.art-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1, #1e293b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.art-sub { font-size: 11px; color: var(--text-3); }
.art-go { color: var(--gj-500); font-size: 13px; flex-shrink: 0; }
.art-preview-btn {
  border: 1px solid var(--gj-200, #d8e3f8);
  background: #fff;
  color: var(--gj-600, #2e6ef7);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}
.art-preview-btn:hover { background: var(--gj-50, #eef4ff); }
.art-empty { padding: 20px 16px; font-size: 12px; color: var(--text-3); line-height: 1.7; }

/* ================= 正式 HTML 成果预览弹层（sandbox iframe，§40） ================= */
.art-preview-mask { z-index: 1200; }
.art-preview-modal {
  width: min(1120px, 94vw);
  height: min(88vh, 940px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.art-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid #e8ecf3;
  background: #fafbfe;
  flex-shrink: 0;
}
.art-preview-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.art-preview-title b {
  font-size: 14px;
  color: #16233b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.art-preview-title small { font-size: 11px; color: #8a94a6; }
.art-preview-ops { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.art-preview-dl {
  font-size: 12.5px;
  color: #2e6ef7;
  border: 1px solid #d8e3f8;
  border-radius: 6px;
  padding: 5px 12px;
  text-decoration: none;
}
.art-preview-dl:hover { background: #eef4ff; }
.art-preview-close {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 12.5px;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 6px;
  font-family: inherit;
}
.art-preview-close:hover { background: #f1f5f9; color: #16233b; }
.art-preview-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* 对话内正式成果卡（§42）：标题 + HTML·版本 + 预览/下载 */
.artifact-card {
  border: 1px solid #e3e9f2;
  border-left: 4px solid var(--gj-500, #2e6ef7);
  border-radius: 10px;
  background: #fbfcff;
  padding: 12px 16px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.artifact-card-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.artifact-card-head b {
  font-size: 13.5px;
  color: #16233b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact-card-head small { font-size: 11px; color: #8a94a6; flex-shrink: 0; }
.artifact-card-ops { display: flex; gap: 8px; flex-wrap: wrap; }
.artifact-card-ops .btn-sm-primary {
  border: 0;
  background: var(--gj-500, #2e6ef7);
  color: #fff;
  border-radius: 7px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.artifact-card-ops .btn-sm-primary:hover { filter: brightness(1.06); }
.artifact-card-ops .btn-sm-ghost {
  border: 1px solid #d8e3f8;
  background: #fff;
  color: #2e6ef7;
  border-radius: 7px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.artifact-card-ops .btn-sm-ghost:hover { background: #eef4ff; }
.artifact-card-failed {
  border: 1px solid #f2d5d5;
  border-left: 4px solid #d46b6b;
  background: #fdf6f6;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #a34545;
  margin: 10px 0;
  line-height: 1.7;
}

/* 跳转定位高亮闪烁 */
@keyframes art-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 110, 247, 0); }
  30% { box-shadow: 0 0 0 4px rgba(46, 110, 247, 0.35); }
}
.component.art-flash {
  animation: art-flash 1.2s ease 2;
  border-left-color: var(--gj-500);
}

/* ================= 可信商机引擎（trust-engine）证据卡 ================= */

.ev-card .ev-verdict { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: #f7f9fc; border: 1px solid #e5eaf2; border-radius: 10px; }
.ev-claim { font-size: 14px; font-weight: 600; color: var(--text-1, #1a2233); line-height: 1.5; }
.ev-score { font-size: 26px; font-weight: 700; line-height: 1; flex-shrink: 0; text-align: center; }
.ev-score small { display: block; font-size: 10.5px; font-weight: 500; margin-top: 3px; color: var(--text-3, #8a94a6); }
.ev-g-high { color: #16a34a; }
.ev-g-mid { color: #ea580c; }
.ev-g-low { color: #dc2626; }
.ev-factors { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.ev-sec-title { font-size: 12px; font-weight: 600; color: var(--text-2, #4a5568); margin: 12px 0 6px; }
.ev-evidences { display: flex; flex-direction: column; gap: 8px; }
.ev-evidence { border: 1px solid #e5eaf2; border-radius: 8px; padding: 8px 12px; background: #fff; }
.ev-ev-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-source { font-size: 12.5px; font-weight: 600; color: var(--gj-500, #2e6ef7); }
.ev-quote { margin: 6px 0; padding: 6px 10px; font-size: 12.5px; color: var(--text-2, #4a5568); background: #f7f9fc; border-left: 3px solid var(--gj-500, #2e6ef7); border-radius: 4px; line-height: 1.6; }
.ev-meta { font-size: 11px; color: var(--text-3, #8a94a6); }
.ev-calc summary { cursor: pointer; font-size: 12px; color: var(--gj-500, #2e6ef7); margin: 8px 0 2px; }
.ev-calc p { font-size: 12.5px; color: var(--text-2, #4a5568); line-height: 1.6; margin: 6px 0 0; }
.ev-analyst { font-size: 12.5px; color: var(--text-2, #4a5568); line-height: 1.6; padding: 6px 10px; border-left: 3px solid #e5eaf2; margin-bottom: 6px; }
.ev-concerns { font-size: 11.5px; color: #b45309; margin-top: 3px; }
.ev-issue { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed #e5eaf2; }
.ev-issue-detail { color: var(--text-2, #4a5568); }
.ev-opp-conclusion { font-size: 12px; color: var(--text-3, #8a94a6); margin-top: 6px; }
.ev-foot { margin-top: 12px; padding-top: 8px; border-top: 1px dashed #e5eaf2; font-size: 11px; color: var(--text-3, #8a94a6); }
.ev-stages { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.ev-stage { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 6px 10px; background: #f7f9fc; border-radius: 8px; }
.ev-stage-idx { width: 18px; height: 18px; border-radius: 50%; background: var(--gj-500, #2e6ef7); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ev-stage-name { font-weight: 600; color: var(--text-1, #1a2233); flex-shrink: 0; }
.ev-stage-dur { font-size: 11px; color: var(--text-3, #8a94a6); flex-shrink: 0; }
.ev-stage-sum { font-size: 12px; color: var(--text-3, #8a94a6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= 竞争格局与产业链卡片 ================= */
.fb-landscape { padding-bottom: 4px; }
.fb-section-title { font-size: 13px; font-weight: 600; color: var(--text-1); margin: 14px 0 6px; }
.fb-signal-summary {
  background: #fff8e6; border: 1px solid #ffe6a3; color: #6b4e00;
  padding: 8px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.6; margin: 10px 0;
}
.fb-signal-detail { margin: 8px 0 4px; }
.fb-signal-detail > summary {
  cursor: pointer; font-size: 12.5px; color: var(--gj-600); user-select: none; padding: 4px 0;
}
.fb-chain { margin-top: 10px; }
.fb-chain-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.fb-chain-source { font-size: 11.5px; color: var(--text-3); margin: 10px 0 4px; }
.fb-monitor-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.fb-monitor-hint { font-size: 11.5px; color: var(--text-3); }

/* ================= 商机提示条：🔥 连续关注 / 🎯 强信号（加入任务入口） ================= */
.fb-attention-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.5;
}
.fb-attention-bar.fb-att-fire { background: #fff1f0; border: 1px solid #ffccc7; color: #873800; }
.fb-attention-bar.fb-att-target { background: #f0f7ff; border: 1px solid #bae0ff; color: #0b3d91; }
.fb-attention-bar .fb-att-text { flex: 1; }
.fb-attention-bar button {
  background: var(--gj-600); color: #fff; border: none; border-radius: 6px;
  padding: 4px 14px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.15s;
}
.fb-attention-bar button:hover { background: var(--gj-700); }


/* ================= M4 后台任务面板 ================= */
.job-row { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.job-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.job-type { font-weight: 600; }
.job-why { color: #64748b; font-size: 12px; }
.job-attempts { color: #b45309; font-size: 12px; }
.job-time { color: #94a3b8; font-size: 12px; margin-left: auto; }
.job-ops { display: inline-flex; gap: 6px; }
.job-error { margin-top: 6px; color: #b91c1c; font-size: 12px; background: #fef2f2; border-radius: 6px; padding: 6px 8px; }
.job-events { margin-top: 8px; border-top: 1px dashed #e2e8f0; padding-top: 6px; max-height: 240px; overflow: auto; font-size: 12px; }
.job-evt { padding: 2px 0; color: #475569; font-family: ui-monospace, Consolas, monospace; }
.job-evt-ok { color: #15803d; }
.job-evt-err { color: #b91c1c; }
.job-evt-sys { color: #94a3b8; }
.job-section-hint { font-size: 12px; font-weight: 400; color: #94a3b8; margin-left: 6px; }

/* ================= 窄屏（≤480px）界面修复（2026-09-05 用户旅程走查发现） ================= */
/* 侧栏 64px 图标列内塞会话列表导致文字竖排错乱——窄屏隐藏会话列表与过滤框 */
@media (max-width: 480px) {
  .sidebar .task-filter,
  .sidebar .task-list { display: none; }
  /* 顶栏中文副标题在窄屏换行错乱——隐藏并收紧主标题 */
  .header-titles .brand-cn { display: none; }
  .header-titles h1 { font-size: 15px; white-space: nowrap; }
  /* 发送按钮被辅助按钮挤出屏——禁止收缩 */
  .btn-send { flex: 0 0 auto; }
  .composer-sub { font-size: 10px; }
}

/* 窄屏输入区修复：辅助按钮挤出屏导致发送按钮半出屏——隐藏语音/帮助/模型选择 */
@media (max-width: 480px) {
  .composer #model,
  .composer .btn-mic,
  .composer .btn-help { display: none; }
  .composer-inner textarea { min-height: 40px; font-size: 14px; }
}

/* 会话重命名显式按钮（与 .t-del 同款 hover 显示，蓝色区分） */
.t-rename {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  line-height: 1;
  visibility: hidden;
}
.task-item:hover .t-rename { visibility: visible; }
.t-rename:hover { color: #2563eb; background: #dbeafe; }

/* 侧栏收窄断点（≤768px）同步隐藏会话列表——修复 481-767px 区间竖排错乱（第四轮走查发现） */
@media (max-width: 768px) {
  .sidebar .task-filter,
  .sidebar .task-list { display: none; }
}

/* 成果审核按钮（草稿→批准 / 已批准徽章） */
.art-review {
  border: 1px solid var(--gj-100, #e5e7eb);
  background: #f0fdf4;
  color: #16a34a;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  cursor: pointer;
  flex: 0 0 auto;
}
.art-review:hover { background: #dcfce7; }
.art-review.approved { background: #dcfce7; color: #15803d; }
.art-review.approved:hover { background: #fef9c3; color: #a16207; }
/* 知识库表单 */
.kb-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.kb-form input, .kb-form textarea { padding: 6px 8px; border: 1px solid var(--gj-100, #e5e7eb); border-radius: 6px; font-size: 13px; }
.kb-form .btn-primary { align-self: flex-start; }
.kb-search { margin-bottom: 8px; }
.kb-search input { width: 100%; padding: 6px 8px; border: 1px solid var(--gj-100, #e5e7eb); border-radius: 6px; font-size: 13px; }

/* 跟进记录扩展字段（interaction_type / participants / customer_signals / open_questions） */
.fu-meta { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }
.fu-signals { font-size: 11.5px; color: var(--text-3); margin-top: 3px; line-height: 1.6; }

/* ================= M23 投行监测报告渲染（图C，2026-09-17）================= */
.ib-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 10px 0; }
.ib-stat-card { display: flex; flex-direction: column; align-items: center; padding: 10px 8px; border: 1px solid var(--gj-100, #e5e7eb); border-radius: 10px; background: rgba(255,255,255,0.6); }
.ib-stat-card span { font-size: 20px; font-weight: 700; color: var(--text-1, #1f2937); font-variant-numeric: tabular-nums; }
.ib-stat-card small { font-size: 11.5px; color: var(--text-3, #6b7280); margin-top: 2px; }
.ib-cat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.ib-cat-chips .tag { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; }
.ib-ev-summary { font-size: 13px; color: var(--text-2, #374151); margin: 6px 0; line-height: 1.55; }
.ib-ev-detail { margin: 6px 0; }
.ib-ev-detail summary { cursor: pointer; font-size: 12.5px; color: var(--brand, #4338ca); user-select: none; }
.ib-ev-ops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ib-op-btn { border: 1px solid var(--gj-200, #d1d5db); background: #fff; border-radius: 8px; padding: 5px 12px; font-size: 12px; cursor: pointer; color: var(--text-1, #1f2937); }
.ib-op-btn:hover { border-color: var(--brand, #4338ca); color: var(--brand, #4338ca); }
.ib-event-card { border-left: 3px solid var(--ev-color, #666); }

/* 商机卡健康报告回查面板（图A P2-7） */
.oc-health-panel { border: 1px dashed var(--gj-200, #d1d5db); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.oc-health-panel h4 { margin: 0 0 4px; font-size: 12px; }
.oc-health-item { font-size: 12px; margin: 3px 0; }

/* 一客一档聚合页（图A P2-8） */
.cd-wrap { max-width: 980px; margin: 0 auto; padding: 18px 16px 60px; }
.cd-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.cd-head h2 { margin: 0; font-size: 20px; }
.cd-head .cd-code { font-size: 13px; color: var(--text-3, #6b7280); font-variant-numeric: tabular-nums; }
.cd-journey { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.cd-journey button { border: 1px solid var(--gj-200, #d1d5db); background: #fff; border-radius: 999px; padding: 5px 14px; font-size: 12.5px; cursor: pointer; }
.cd-journey button:hover { border-color: var(--brand, #4338ca); color: var(--brand, #4338ca); }
.cd-journey .done::after { content: " ✓"; color: #16a34a; }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.cd-panel { border: 1px solid var(--gj-100, #e5e7eb); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,0.7); }
.cd-panel h3 { margin: 0 0 8px; font-size: 14px; }
.cd-panel ul { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.8; }
.cd-empty { font-size: 12.5px; color: var(--text-3, #6b7280); }

/* 商机卡公司名 → 一客一档（图A 闭环入口） */
.oc-company { cursor: pointer; }
.oc-company:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
