/* ===== 知识体系（Agentic 引擎深钻）思维导图 overlay ===== */
/* 知识体系不再是全屏遮罩弹层，而是停靠在侧栏右侧、铺满整个主区的面板；
   关闭即隐藏面板，露出底下一直在的卡片广场。 */
.sysmap-overlay { position: fixed; top: 0; right: 0; bottom: 0; left: var(--sidebar-w);
  z-index: 1000; background: var(--bg); display: flex; }
.sysmap-overlay.hidden { display: none; }
.sysmap-panel { background: var(--bg); border: none; border-radius: 0;
  box-shadow: none; width: 100%; height: 100%;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  resize: none; min-width: 0; min-height: 0; max-width: none; max-height: none; }
/* 窄屏侧栏堆叠到顶部，知识体系铺满整屏（放在基础规则之后才能覆盖 left） */
@media (max-width: 1040px) { .sysmap-overlay { left: 0; } }
.sysmap-close { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border: none;
  border-radius: 8px; background: transparent; cursor: pointer; font-size: 22px; line-height: 1; color: var(--muted); z-index: 2; }
.sysmap-close:hover { background: var(--accent-tint); color: var(--accent); }
.sysmap-head { padding: 16px 22px 12px; border-bottom: 1px solid var(--line); }
.sysmap-head h2 { margin: 0 0 4px; font-size: 19px; color: var(--text); }
.sysmap-stats { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.sysmap-marquee { display: flex; flex-wrap: wrap; gap: 6px; }
.sysmap-chip { font-size: 11px; color: var(--hot); background: var(--hot-soft); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.sysmap-body { flex: 1; display: flex; min-height: 0; }
/* 左：思维导图树 */
.sysmap-tree { width: 360px; flex-shrink: 0; overflow-y: auto; padding: 12px; border-right: 1px solid var(--line); background: var(--sidebar); }
.sysmap-area-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-bottom: 10px; padding: 4px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel); }
.sysmap-area-tab { min-width: 0; display: flex; align-items: center; justify-content: flex-start; gap: 6px; cursor: pointer;
  border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 6px 6px; text-align: left; }
.sysmap-area-tab:hover { background: var(--line-soft); }
.sysmap-area-tab.active { border-color: var(--accent-soft); background: var(--accent-tint); }
.sysmap-area-n { flex: 0 0 auto; font-weight: 850; font-size: 11px; color: #fff; background: var(--text); border-radius: 6px; padding: 2px 6px; }
.sysmap-area-tab.active .sysmap-area-n { background: var(--accent); }
.sysmap-area-tab-main { min-width: 0; }
.sysmap-area-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 800; font-size: 11.5px; line-height: 1.25; color: var(--text); min-width: 0; }
.sysmap-area-layer { font-size: 10px; color: var(--muted); white-space: nowrap; justify-self: end; }
.sysmap-area-count { display: none; }
.sysmap-area-focus { border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--panel) 72%, transparent); overflow: hidden; }
.sysmap-area-focus-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px;
  background: var(--panel); padding: 9px; }
.sysmap-area-note { font-size: 11px; color: var(--text-soft); line-height: 1.45; padding: 0 10px 8px 34px; background: var(--panel); }
.sysmap-area-themes { padding: 8px; display: flex; flex-direction: column; gap: 7px; }
.sysmap-theme { margin-bottom: 8px; }
.sysmap-theme.nested { margin: 0; border-left: 2px solid var(--line); padding-left: 7px; }
.sysmap-area-focus .sysmap-theme:not(.nested) { border-left: 2px solid var(--line); padding-left: 7px; }
.sysmap-theme.leaf { margin: 0; }
.sysmap-theme.leaf.active { border-left-color: var(--accent); }
.sysmap-theme-head { width: 100%; display: flex; align-items: center; gap: 7px; cursor: pointer;
  border: none; background: transparent; padding: 6px 4px; text-align: left; }
.sysmap-theme-head.leaf { border-radius: 8px; padding: 8px 7px; }
.sysmap-theme-head.leaf:hover,
.sysmap-theme.leaf.active .sysmap-theme-head.leaf { background: var(--accent-tint); color: var(--text); }
.sysmap-caret { color: var(--muted); font-size: 11px; width: 12px; }
.sysmap-theme-n { font-weight: 800; font-size: 11px; color: #fff; background: var(--accent); border-radius: 5px; padding: 1px 6px; }
.sysmap-theme-title { font-weight: 700; font-size: 14px; color: var(--text); }
.sysmap-theme-layer { font-size: 10px; color: var(--muted); margin-left: auto; }
.sysmap-theme-note { font-size: 11px; color: var(--muted); padding: 0 4px 6px 23px; line-height: 1.45; }
.sysmap-theme.leaf .sysmap-theme-note { padding-left: 31px; }
.sysmap-theme.collapsed .sysmap-theme-note,
.sysmap-theme.collapsed .sysmap-modcards { display: none; }
.sysmap-modcards { display: flex; flex-direction: column; gap: 6px; padding-left: 14px; }
.sysmap-mod.synthetic { padding-left: 0; }
.sysmap-modcard { text-align: left; cursor: pointer; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; transition: border-color .12s, box-shadow .12s; }
.sysmap-modcard:hover { border-color: var(--accent); }
.sysmap-modcard.active { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); }
.sysmap-mc-top { display: flex; align-items: center; gap: 6px; }
.sysmap-mc-n { font-weight: 800; font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 1px 6px; }
.sysmap-mc-n.big { font-size: 15px; padding: 2px 9px; color: #fff; background: var(--accent); }
.sysmap-mc-title { font-size: 13px; font-weight: 600; color: var(--text); }
.sysmap-mc-count { font-size: 10px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.sysmap-mc-hl { display: flex; flex-wrap: wrap; gap: 4px; }
.sysmap-hl { font-size: 10px; color: var(--text-soft); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
/* 右：详情 */
.sysmap-detail { flex: 1; overflow-y: auto; padding: 18px 24px; }
.sysmap-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sysmap-detail-head h3 { margin: 0 0 6px; font-size: 18px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.sysmap-detail-actions { display: flex; gap: 6px; flex-shrink: 0; }
.sysmap-act { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 5px 11px;
  font-size: 12px; cursor: pointer; color: var(--text-soft); white-space: nowrap; }
.sysmap-act:hover { border-color: var(--accent); color: var(--accent); }
.sysmap-act.ai { color: var(--accent-hover); border-color: var(--accent-soft); background: var(--accent-tint); }
.sysmap-act.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.sysmap-intro { background: var(--accent-tint); border: 1px solid var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin: 6px 0 12px; }
.sysmap-intro-label { font-size: 11px; font-weight: 700; color: var(--accent-hover); margin-bottom: 5px; letter-spacing: .3px; }
.sysmap-intro-body { font-size: 13px; line-height: 1.85; color: var(--text); }
.sysmap-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.sysmap-tag { font-size: 11px; color: var(--follow); background: var(--follow-soft); border-radius: 999px; padding: 1px 8px; }
/* 左树模块热度徽章：近 14 天关联的每日卡片数 */
.sysmap-mc-fresh { font-size: 10px; color: var(--hot); background: var(--hot-soft); border-radius: 999px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }
/* 关联动态时间线（每日卡片 → 点击跳卡） */
.sysmap-related { margin: 2px 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--sidebar); overflow: hidden; }
.sysmap-rel-head { font-size: 12px; font-weight: 600; color: var(--text); padding: 6px 10px; background: var(--hot-soft); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.sysmap-rel-head.muted { color: var(--muted); font-weight: 500; background: transparent; border-bottom: none; }
.sysmap-rel-hint { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: auto; }
.sysmap-rel-caret { border: none; background: transparent; cursor: pointer; font-size: 11px; color: var(--muted); padding: 0 2px; flex-shrink: 0; }
.sysmap-rel-titlerow { flex: 1; }
.sysmap-rel-sort { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.sysmap-rel-sort button { border: none; background: var(--bg); color: var(--muted); font-size: 10px; padding: 2px 8px; cursor: pointer; font: inherit; }
.sysmap-rel-sort button.on { background: var(--accent); color: #fff; }
.sysmap-rel-sem { border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 6px; font-size: 11px; padding: 2px 7px; cursor: pointer; flex-shrink: 0; }
.sysmap-rel-sem:hover { background: var(--accent-tint); border-color: var(--accent-soft); }
.sysmap-sem { margin-top: 8px; }
.sysmap-sem:empty { display: none; }
.sysmap-rel-sim { font-size: 9px; color: var(--follow); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.sysmap-rel-list { max-height: 230px; overflow-y: auto; }
.sysmap-rel-list.collapsed { display: none; }
.sysmap-rel-rel { font-size: 8px; color: var(--hot); flex-shrink: 0; width: 24px; letter-spacing: -1px; }
.sysmap-rel-rel.dim { color: var(--line); }
.sysmap-rel-pin { font-size: 10px; flex-shrink: 0; width: 24px; }
.sysmap-rel-item { display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; border: none; background: transparent; cursor: pointer; padding: 6px 12px; border-bottom: 1px solid var(--line); font: inherit; }
.sysmap-rel-item:last-child { border-bottom: none; }
.sysmap-rel-item:hover { background: var(--accent-tint); }
.sysmap-rel-date { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; width: 64px; }
.sysmap-rel-src { font-size: 10px; color: var(--follow); background: var(--follow-soft); border-radius: 4px; padding: 0 5px; flex-shrink: 0; }
.sysmap-rel-title { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sysmap-rel-rate { font-size: 10px; color: var(--star); flex-shrink: 0; }
/* 方向级近期关联条（挂在每个方向卡底部） */
.dir-related { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px 10px; border-top: 1px dashed var(--line); background: var(--sidebar); }
.dir-related-label { font-size: 10px; color: var(--hot); background: var(--hot-soft); border-radius: 999px; padding: 1px 7px; flex-shrink: 0; }
.dir-rel-item { font-size: 11px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; }
.dir-rel-item:hover { background: var(--accent-tint); border-color: var(--accent-soft); }
.dir-rel-item.pinned { border-color: var(--star); }
.dir-rel-date { font-size: 9px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 力导向关系图视图 */
.sysmap-graph { display: none; flex: 1; position: relative; overflow: hidden; background: var(--sidebar); }
.sysmap-body.graphmode .sysmap-tree, .sysmap-body.graphmode .sysmap-detail { display: none; }
.sysmap-body.graphmode .sysmap-graph { display: block; }
.sysmap-graph svg { width: 100%; height: 100%; cursor: grab; }
.sysmap-graph-hint { position: absolute; top: 10px; left: 12px; font-size: 11px; color: var(--muted); background: var(--bg); padding: 4px 10px; border-radius: 6px; z-index: 2; opacity: 0.92; border: 1px solid var(--line); }
.gnode { cursor: pointer; }
.gnode.module:hover circle { stroke: var(--accent); stroke-width: 2.5; }
.gnode.area:hover circle { filter: brightness(1.15); }
/* 知识卡就地展现（体系图右侧，← 返回回到模块） */
.sysmap-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sysmap-card-back { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; padding: 4px 12px; cursor: pointer; font: inherit; font-size: 12px; flex-shrink: 0; }
.sysmap-card-back:hover { background: var(--accent-tint); border-color: var(--accent-soft); }
.sysmap-card-meta { font-size: 12px; color: var(--muted); flex: 1; }
.sysmap-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.sysmap-card-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 12px; line-height: 1.4; }
.sysmap-card-body { font-size: 14px; line-height: 1.75; color: var(--text); }
/* 候选新方向面板 */
.sysmap-cand-head { font-size: 14px; font-weight: 700; color: var(--text); padding: 4px 2px 10px; }
.sysmap-cand-note { font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.sysmap-rel-list.cand { max-height: none; border: 1px solid var(--line); border-radius: 10px; }
/* 关联到体系：选择器弹窗 */
.pin-overlay { position: fixed; inset: 0; z-index: 1100; background: rgba(20,20,19,0.4); display: flex; align-items: center; justify-content: center; }
.pin-box { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; width: min(520px, 92vw); box-shadow: 0 20px 50px rgba(20,20,19,0.3); }
.pin-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.pin-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.pin-row select { flex: 1; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; }
.pin-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.pin-actions button { padding: 6px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.pin-actions button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.sysmap-dirs { display: flex; flex-direction: column; gap: 14px; }
/* 方向卡：web 风格——标题条 + 分字段块 */
.sysmap-dir { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; box-shadow: 0 1px 3px rgba(20,20,19,0.04); }
.sysmap-dir-title { font-size: 15px; font-weight: 700; color: var(--text); padding: 11px 16px; background: var(--accent-tint); border-bottom: 1px solid var(--accent-soft); display: flex; align-items: center; gap: 6px; }
.sysmap-dir-n { font-weight: 800; font-size: 12px; color: #fff; background: var(--accent); border-radius: 6px; padding: 2px 8px; }
/* 字段块：左侧彩色竖条 + 小标签 + 内容 */
.dir-field { padding: 9px 16px 9px 18px; border-left: 3px solid var(--line); margin: 8px 10px; border-radius: 0 8px 8px 0; background: var(--bg); }
.dir-flabel { font-size: 11px; font-weight: 700; letter-spacing: .3px; margin-bottom: 4px; display: flex; align-items: center; gap: 5px; color: var(--muted); }
.dir-ic { font-size: 12px; }
.dir-ftext { font-size: 13px; line-height: 1.75; color: var(--text-soft); }
.dir-lead { font-size: 13.5px; line-height: 1.7; color: var(--text); font-weight: 500; }
.dir-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dir-chip { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--text-soft); }
.dir-chip.lnk { color: var(--accent); border-color: var(--accent-soft); text-decoration: none; cursor: pointer; }
.dir-chip.lnk:hover { background: var(--accent-soft); }
/* 各字段配色 */
.dir-field.f-q   { border-left-color: var(--accent); background: var(--accent-tint); }
.dir-field.f-m   { border-left-color: var(--follow); }
.dir-field.f-w   { border-left-color: #7a8b5f; }
.dir-field.f-r   { border-left-color: var(--star); }
.dir-field.f-t   { border-left-color: var(--warn); }
.dir-field.f-ref { border-left-color: var(--line); }
.dir-field.f-q .dir-flabel   { color: var(--accent-hover); }
.dir-field.f-m .dir-flabel   { color: var(--follow); }
.dir-field.f-r .dir-flabel   { color: var(--star); }
.dir-field.f-t .dir-flabel   { color: var(--warn); }
.sysmap-ilink { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent-soft); }
.sysmap-ilink:hover { border-bottom-style: solid; }
.sysmap-empty { color: var(--muted); font-size: 13px; padding: 24px; text-align: center; }
/* 编辑器 */
.sysmap-edit-tip { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.sysmap-edit-tip code { background: var(--line-soft); border-radius: 4px; padding: 0 4px; font-size: 11px; }
.sysmap-editor { width: 100%; height: calc(100% - 150px); min-height: 320px; resize: vertical;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; line-height: 1.6; color: var(--text); background: var(--panel); }
.sysmap-edit-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.sysmap-edit-msg { font-size: 12px; color: var(--muted); }
.sysmap-act.danger { color: #b8553a; border-color: var(--hot-soft); }
.sysmap-act.danger:hover { background: var(--hot-soft); border-color: var(--hot); color: var(--hot); }
.sysmap-headrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sysmap-headrow .sysmap-stats { margin: 0; }
.sysmap-headrow .sysmap-act { padding: 3px 10px; font-size: 12px; }

/* ===== 知识体系：思维导图三级树（主题→模块→方向小标题） ===== */
.sysmap-treebar { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.sysmap-treebar button { font-size: 11px; padding: 2px 8px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 6px; cursor: pointer; color: var(--muted); }
.sysmap-treebar button:hover { border-color: var(--accent); color: var(--accent); }
/* 模块 + 其方向子节点的容器：左侧竖连接线 = 思维导图主干 */
.sysmap-mod { position: relative; }
.sysmap-modcaret { cursor: pointer; color: var(--muted); font-size: 10px; width: 12px; display: inline-block; text-align: center; }
.sysmap-modcaret:hover { color: var(--accent); }
.sysmap-mod.active .sysmap-modcaret { color: var(--accent); }
/* 方向小标题子节点：默认折叠，模块 .open 时展开 */
.sysmap-dirnodes { display: none; margin: 2px 0 6px 20px; padding-left: 10px; border-left: 1.5px solid var(--accent-soft); }
.sysmap-mod.open .sysmap-dirnodes { display: block; }
.sysmap-dirnode { position: relative; display: flex; align-items: baseline; gap: 6px; width: 100%; text-align: left;
  border: none; background: transparent; cursor: pointer; padding: 3px 6px; border-radius: 6px; font-size: 12px; color: var(--text-soft); }
.sysmap-dirnode.area-dir { padding: 6px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
/* 横向连接线：从竖干引到每个方向节点 */
.sysmap-dirnode::before { content: ""; position: absolute; left: -10px; top: 12px; width: 9px; height: 1.5px; background: var(--accent-soft); }
.sysmap-dirnode:hover { background: var(--accent-tint); color: var(--text); }
.sysmap-dirnode.active { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
.sysmap-dn-n { font-weight: 700; font-size: 11px; color: var(--accent); flex-shrink: 0; }
.sysmap-dn-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sysmap-mc-count { min-width: 16px; text-align: center; }
/* 右侧方向块被左树点中时的高亮闪烁 */
.sysmap-dir.flash { animation: sysmapFlash 1.4s ease; }
@keyframes sysmapFlash {
  0% { box-shadow: 0 0 0 2px var(--accent); }
  60% { box-shadow: 0 0 0 2px var(--accent-soft); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── 能力画像（左侧紧凑行）──────────────────── */
#capabilityProfile { margin-bottom: 4px; }
.cap-empty { font-size: 11px; color: var(--muted); padding: 4px 2px; }
.cap-dim-wrap { border-radius: 5px; overflow: hidden; }
.cap-row {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 4px; border-radius: 5px; cursor: pointer; transition: background 0.12s;
}
.cap-row:hover { background: var(--accent-tint); }
.cap-row-toggle { font-size: 0.62rem; color: var(--muted); width: 10px; flex-shrink: 0; user-select: none; }
.cap-row-key { font-size: 0.67rem; font-weight: 700; color: var(--accent); min-width: 22px; flex-shrink: 0; }
.cap-row-name { font-size: 0.72rem; color: var(--text-soft); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-row-cells { display: flex; gap: 2px; flex-shrink: 0; }
.cap-row-cnt { font-size: 0.62rem; color: var(--muted); min-width: 14px; text-align: right; flex-shrink: 0; }
.cap-cell {
  width: 16px; height: 14px; border-radius: 2px; font-size: 0.60rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.cap-cell.L1 { background: #dff0fc; color: #2471a3; }
.cap-cell.L2 { background: #cce4fa; color: #1a6faf; }
.cap-cell.L3 { background: #aed0f0; color: #0d5a96; }
.cap-cell.z { background: transparent; color: transparent; border: 1px dashed var(--line); }
.cap-subs-compact { padding: 2px 4px 4px 14px; }
.cap-subs-compact.hidden { display: none; }
.cap-sub-compact { padding: 3px 2px 1px; font-size: 0.68rem; }
.cap-sub-head { display: flex; align-items: baseline; gap: 4px; }
.cap-sub-compact-name { color: var(--text-soft); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-sub-compact-cnt { color: var(--muted); font-size: 0.62rem; flex-shrink: 0; min-width: 14px; text-align: right; }
.cap-sub-tags { display: flex; flex-wrap: wrap; gap: 3px; margin: 3px 0 1px 18px; }
.cap-stag {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  background: var(--line-soft); color: var(--text-soft);
  font-size: 0.60rem; white-space: nowrap;
}
.cap-stag.neg { background: #fef2f2; color: #b91c1c; }
.cap-stag-more { display: contents; }
.cap-stag-more.hidden { display: none; }
.cap-stag-expand {
  font-size: 0.58rem; color: var(--accent); background: none; border: none;
  cursor: pointer; padding: 1px 4px; flex-shrink: 0;
}
.cap-neg-tags { display: flex; flex-wrap: wrap; gap: 3px; margin: 2px 0 1px 18px; }

/* ── 能力画像详情对话框 ──────────────────────── */
#capDetailDialog {
  width: min(1120px, 96vw);
  max-height: 92vh;
}
#capDetailDialog .dialog-body {
  width: 100%;
  box-sizing: border-box;
  padding: 20px 24px 16px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: 90vh;
}
#capDetailDialog .dialog-body > .muted {
  margin: 0;
  line-height: 1.6;
}

.cap-detail-content {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0;
  max-height: calc(90vh - 166px); overflow-y: auto;
  padding: 2px 4px 8px 2px;
}
.cap-detail-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 11px; color: #64748b;
}
.cap-detail-meta span {
  padding: 3px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
}
.cap-detail-dims {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 12px;
  align-items: start;
}

/* 每个维度卡片 */
.cap-detail-dim {
  border: 1px solid #e2e8f0;
  border-top: 3px solid var(--dim-color, #6b7280);
  border-radius: 8px; overflow: hidden;
  background: #fff;
}
.cap-detail-focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--dim-color, #6b7280) 28%, transparent);
}

/* 维度表头行 */
.cap-detail-dim-head {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.15fr);
  align-items: center; gap: 12px;
  padding: 11px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.cap-detail-title-block {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.cap-dim-key {
  font-size: 0.70rem; font-weight: 800; letter-spacing: 0.02em;
  padding: 3px 7px; border-radius: 5px; text-align: center;
  background: color-mix(in srgb, var(--dim-color, #6b7280) 14%, transparent);
  color: var(--dim-color, #374151);
  flex-shrink: 0;
}
.cap-detail-dim-name {
  min-width: 0;
  font-size: 0.86rem; font-weight: 700; color: #1e293b;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.cap-detail-dim-metrics {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto auto;
  align-items: center; gap: 10px;
  min-width: 0;
}

/* 横向比例条 */
.cap-dim-lbar {
  display: flex; height: 20px; border-radius: 5px;
  overflow: hidden; gap: 2px; align-items: stretch;
  min-width: 0;
}
.cap-lbar-seg {
  display: flex; align-items: center; justify-content: center;
  font-size: 0.58rem; font-weight: 700; min-width: 22px;
}
.cap-lbar-seg.L1 { background: #bfdbfe; color: #1e40af; }
.cap-lbar-seg.L2 { background: #60a5fa; color: #fff; }
.cap-lbar-seg.L3 { background: #2563eb; color: #fff; }
.cap-lbar-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: #94a3b8; font-size: 0.65rem;
  border-radius: 5px; border: 1px dashed #cbd5e1;
}
.cap-est { font-size: 0.72rem; color: #64748b; text-align: right; font-weight: 600; }
.cap-detail-cnt { font-size: 0.69rem; color: #94a3b8; text-align: right; }

/* 子维度行 */
.cap-detail-subs-table {
  display: flex;
  flex-direction: column;
  padding: 8px 12px 10px;
}
.cap-detail-sub {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1.2fr);
  align-items: start;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid #f1f5f9;
}
.cap-detail-sub:last-child { border-bottom: none; }
.cap-detail-sub-main {
  display: flex; align-items: baseline; gap: 8px;
  min-width: 0;
}
.cap-sub-key {
  font-size: 0.65rem; font-weight: 700; color: var(--dim-color, #6b7280);
  flex-shrink: 0;
}
.cap-detail-sub-name {
  min-width: 0;
  font-size: 0.77rem; color: #374151; line-height: 1.45;
  overflow-wrap: anywhere;
}
.cap-detail-sub-stat { font-size: 0.67rem; color: #94a3b8; text-align: right; white-space: nowrap; }
.cap-detail-tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.cap-detail-sub-empty {
  display: block;
  color: #94a3b8;
  font-size: 0.73rem;
}
.detail-tags { margin: 6px 0 8px; }
.cap-tags-empty { font-size: 11px; color: #cbd5e1; }
.cap-ftag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 4px;
  background: #f1f5f9; color: #475569; font-size: 0.65rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.cap-ftag-cnt { font-weight: 700; color: #94a3b8; font-size: 0.60rem; padding-left: 2px; }

/* 认知增量 */
.cap-growth-list { border-top: 1px solid #e2e8f0; padding-top: 8px; margin-top: 4px; }
.cap-detail-growth { padding: 8px 14px; }
.cap-detail-section-title { font-size: 11px; font-weight: 700; color: #64748b; margin-bottom: 6px; }
.cap-growth-item {
  padding: 4px 8px; font-size: 0.73rem; color: #475569;
  border-left: 3px solid #e2e8f0; margin-bottom: 4px; border-radius: 0 5px 5px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; transition: background 0.12s;
}
.cap-growth-item:hover { white-space: normal; overflow: visible; background: #f0f9ff; border-left-color: #60a5fa; }
.cap-growth-badge {
  display: inline-block; padding: 1px 5px; border-radius: 3px;
  background: #dbeafe; color: #1d4ed8; font-size: 0.65rem; margin-right: 3px;
}

@media (max-width: 760px) {
  #capDetailDialog .dialog-body { padding: 16px; }
  .cap-detail-content { max-height: calc(90vh - 150px); }
  .cap-detail-dims { grid-template-columns: 1fr; }
  .cap-detail-dim-head,
  .cap-detail-dim-metrics,
  .cap-detail-sub {
    grid-template-columns: 1fr;
  }
  .cap-detail-dim-metrics { gap: 7px; }
  .cap-est,
  .cap-detail-cnt,
  .cap-detail-sub-stat {
    text-align: left;
  }
  .cap-detail-tags { padding-left: 0; }
}

/* ── 加载更多(服务端分页) ─────────────────────────────────────────────── */
.load-more-wrap { display: flex; justify-content: center; padding: 16px 0 28px; }
.load-more-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 8px 22px;
  font-size: 13px;
  cursor: pointer;
}
.load-more-btn:hover { border-color: var(--accent, #888); }
.load-more-btn:disabled { opacity: 0.5; cursor: wait; }

/* ── 提问侧融合（仅「能力画像 · 详情」弹窗内）：综合判断 + 优势/成长 ─────────── */
.qcap-block { margin: 4px 0 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.qcap-head { font-size: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.qcap-head #qcapRefreshBtn { margin-left: auto; }
.qcap-assess { font-size: 12px; line-height: 1.55; color: var(--text-soft); margin-top: 6px; }
.qcap-sub { margin-top: 7px; }
.qcap-sub-title { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.qcap-sub-item { font-size: 11.5px; line-height: 1.5; color: var(--text-soft); padding-left: 2px; }

/* 子维度（能力项）下的「🗨️N」点击 → 展开该能力下的具体提问 */
.qcap-sub-toggle {
  display: inline-flex; align-items: center; gap: 1px; cursor: pointer; user-select: none;
  font-size: 11px; color: #b45309; background: #fef3c7; border-radius: 10px;
  padding: 0 7px; margin-left: 6px; line-height: 18px; white-space: nowrap;
}
.qcap-sub-toggle:hover { background: #fde68a; }
.qcap-caret { display: inline-block; transition: transform 0.12s; font-size: 9px; }
.qcap-sub-toggle.open .qcap-caret { transform: rotate(90deg); }
.qcap-qlist {
  margin: 2px 0 6px; padding: 4px 6px 4px 10px;
  border-left: 2px solid #fcd34d; background: var(--accent-tint, rgba(0,0,0,.02)); border-radius: 0 4px 4px 0;
}
.qcap-qitem { display: flex; align-items: baseline; gap: 6px; font-size: 12px; line-height: 1.7; }
.qcap-qtext { color: var(--text); flex: 1; }
.qcap-qcount { color: var(--muted); font-size: 10.5px; flex: none; }
.qcap-qdepth {
  flex: none; font-size: 9.5px; font-weight: 700; border-radius: 3px; padding: 0 4px;
  color: #fff; line-height: 15px;
}
.qcap-qdepth.L1 { background: #93c5fd; }
.qcap-qdepth.L2 { background: #3b82f6; }
.qcap-qdepth.L3 { background: #1d4ed8; }
