/* ==========================================================================
   多引擎协作 · 群聊视图
   --------------------------------------------------------------------------
   版面口径：协作页是独立工作面，不是「单引擎会话 + 协作编排」拼出来的。
   2026-11-24 再修：主区两列 = 左侧栏 + 内容区；内容区里再分「聊天列 + 产出列」，
   中间分界线可拖、宽度记住；产出区常驻，视频/网页/音乐/文档方案都能预览。
   引擎纵向悬浮在聊天列左侧，不占格、不成列；消息头像贴各自气泡，不留大空白。
   左侧会话/空间列表用内收细虚线分隔，颜色跟主题变量走，不用色差切块。
   ========================================================================== */

:root {
  --cg-dash: rgba(92, 102, 120, .18);
}
[data-theme="dark"] {
  --cg-dash: rgba(218, 226, 238, .15);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --cg-dash: rgba(218, 226, 238, .15); }
}

/* Agents 临时覆盖层：只在顶栏下方展开，不遮挡顶部导航栏；Agents 按钮激活高亮 */
#sessView { top: 52px; left: 0; right: 0; bottom: 0; }
#agentsBtn.on { background: var(--acc-l); color: var(--acc); }

/* 左侧栏底部：图片/视频生成与账号行之间加浅色内收实线隔离 + 右侧设置按钮 */
.sbfoot { position: relative; margin-top: 6px; padding-top: 10px; }
.sbfoot::before { content: ''; position: absolute; left: 14px; right: 14px; top: 0; border-top: 1px solid var(--cg-dash); }
.sbfootset { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--ink2); background: transparent; cursor: pointer; flex: none; padding: 0; border: 0; transition: background .14s, color .14s; }
.sbfootset:hover { background: var(--card); color: var(--acc); }
.sbfootset svg { display: block; }

/* 左侧栏 Bot 分组按钮与 Bot 名册已下线（单引擎/多引擎均不显示） */
#teamBtn,
#botRoster { display: none !important; }

/* 协作态：最左栏下半换成空间树，单引擎会话列表/筛选/引擎记录不再占位置 */
.app.collab-mode #sbFind,
.app.collab-mode #sbEngFilter,
.app.collab-mode #sideList,
.app.collab-mode #botRoster,
.app.collab-mode #side > .sbhr,
.app.collab-mode .td-wrap,
.app.collab-mode #sr-fab,
body.collab-mode .td-wrap,
body.collab-mode #sr-fab { display: none !important; }
.app.collab-mode .side { overflow: hidden; }
#cgSideSpaces { display: none; }
.app.collab-mode #cgSideSpaces {
  display: flex !important;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  padding: 8px 12px 12px;
}

/* 群聊态：主区只占一列。旧编排栏/旧产线栏都不占格；
   聊天与产出的分栏放在 .cg-body 里，分界线可拖，跟 WorkBuddy 工作台一致。 */
.main.collab.cg-chat { grid-template-columns: minmax(0, 1fr); }
.main.collab.cg-chat > .stage { grid-column: 1; }
.main.collab.cg-chat > #cfFlow,
.main.collab.cg-chat > #cfLines,
.main.collab.cg-chat > .cf-grip { display: none !important; }
.main.collab.cg-legacy > #cfFlow { display: flex; }

/* 工作空间胶囊 */
.cg-ws { flex: none; margin: 2px 0 10px; display: flex; align-items: center; gap: 9px; background: var(--card); border-radius: 18px; padding: 10px 12px; cursor: pointer; min-width: 0; }
.cg-ws:hover { background: var(--acc-l); }
.cg-ws .wi { width: 24px; height: 24px; border-radius: 9px; background: var(--amber); color: #fff; display: grid; place-items: center; font-size: 9px; font-weight: 800; flex: none; }
.cg-ws .wn { font-weight: 700; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-ws.empty .wn { color: var(--amber); }
.cg-ws .wp { font-size: 10px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* 群里的 Bot：名字 / 引擎 / 模型三行 */
.cg-bmeta { display: flex; flex-direction: column; min-width: 0; gap: 1px; line-height: 1.28; }
.cg-bmeta .bn { font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-bmeta .be { font-size: 11px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cg-bmeta .bm { font-size: 10.5px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 空间树：空间是办公室，群聊是部门。
   两行式微信/飞书会话列表：左侧 38px 完整单聊头像或 2×2 群拼图方格，右侧上下两行（完整标题 + 底部轻预览），
   彻底告别单行横挤与 1 字截断；项间保留内收浅色实线分隔，线色走 --cg-dash 跟随主题。 */
.cg-spaces { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cg-spaces .th { display: flex; align-items: center; padding: 4px 4px 10px; }
.cg-spaces .th h4 { font-size: 12.5px; color: var(--ink3); font-weight: 600; letter-spacing: .4px; }
.cg-new { margin-left: auto; font-size: 12.5px; color: var(--acc); font-weight: 600; background: var(--acc-l); padding: 4px 12px; border-radius: 999px; transition: filter .14s; }
.cg-new:hover { filter: brightness(.96); }
.cg-sp-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; }
.cg-sp { background: transparent; border-radius: 0; padding: 8px 2px; position: relative; }
.cg-sp + .cg-sp::before,
.cg-temp::before { content: ''; position: absolute; left: 8px; right: 6px; top: -1px; border-top: 1px solid var(--cg-dash); }
.cg-sp.on { background: transparent; box-shadow: none; }
.cg-sp.on > .cg-sp-h .nm { color: var(--ink); }
.cg-sp-h { display: flex; align-items: center; gap: 6px; cursor: pointer; min-height: 28px; padding: 0 6px; }
.cg-sp-h .car { font-size: 11px; color: var(--ink3); transition: transform .2s; }
.cg-sp.on .cg-sp-h .car { transform: rotate(90deg); }
.cg-sp-h .nm { font-weight: 600; font-size: 13.5px; color: var(--ink2); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.cg-sp-h .ops { display: flex; align-items: center; gap: 3px; opacity: .72; flex: none; }
.cg-sp-h:hover .ops { opacity: 1; }
.cg-sp-h .ops button,
.cg-sp-h .ops i { font-style: normal; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 16px; font-weight: 600; color: var(--ink2); background: transparent; cursor: pointer; line-height: 1; padding: 0; border: 0; transition: background .14s, color .14s; }
.cg-sp-h .ops button:hover,
.cg-sp-h .ops i:hover { background: var(--card); color: var(--acc); }
.cg-sp-h .ops .op-del:hover { color: var(--warn, #dc2626); }
.cg-sp-gs { display: none; flex-direction: column; gap: 2px; margin-top: 6px; }
.cg-sp.on .cg-sp-gs { display: flex; }
.cg-sp-g { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 12px; font-size: 14px; font-weight: 500; cursor: pointer; background: transparent; min-width: 0; position: relative; transition: background .14s ease; }
.cg-sp-g + .cg-sp-g::before { content: ''; position: absolute; left: 56px; right: 10px; top: -1px; border-top: 1px solid var(--cg-dash); }
.cg-sp-g:hover { background: var(--sb-hover, rgba(23,25,31,.045)); }
.cg-sp-g.on { background: var(--sb-sel, rgba(23,25,31,.08)); }
.cg-sp-g.on::before, .cg-sp-g.on + .cg-sp-g::before { opacity: .35; }
.cg-sp-g:hover .gt, .cg-sp-g.on .gt { color: var(--acc); }
.cg-sp-g .gavs { width: 38px; height: 38px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; box-sizing: border-box; }
.cg-sp-g .gavs.single .av { width: 38px; height: 38px; border-radius: 11px; margin: 0; box-shadow: 0 2px 6px rgba(15,23,42,.08); }
.cg-sp-g .gavs.group { display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); gap: 2px; padding: 2px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line, rgba(15,23,42,.08)), 0 1px 4px rgba(15,23,42,.05); }
.cg-sp-g .gavs.group .av { width: 100%; height: 100%; border-radius: 5px; margin: 0; box-shadow: none; }
.cg-sp-g .gavs.group.n2 { grid-template-rows: 1fr; align-items: center; }
.cg-sp-g .gavs.group.n2 .av { height: 22px; }
.cg-sp-g .gav-ph { width: 38px; height: 38px; border-radius: 11px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; font-size: 14px; font-weight: 600; }
.cg-sp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cg-sp-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cg-sp-g .gt { flex: 1; min-width: 0; font-size: 14px; font-weight: 550; line-height: 1.35; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.cg-sp-g .gl { display: block; width: 100%; min-width: 0; color: var(--ink3); font-size: 12px; font-weight: 400; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-sp-more { position: absolute; right: 6px; top: 8px; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--ink2); background: var(--rail); cursor: pointer; flex: none; opacity: 0; pointer-events: none; transition: opacity .14s, background .14s, color .14s; }
.cg-sp-g:hover .cg-sp-more, .cg-sp-g.on .cg-sp-more { opacity: .88; pointer-events: auto; }
.cg-sp-more:hover { opacity: 1 !important; background: var(--card); color: var(--ink); box-shadow: 0 2px 6px rgba(15,23,42,.1); }
.cg-taskmenu { position: fixed; z-index: 2300; width: 184px; background: var(--card); border-radius: 16px; padding: 6px; box-shadow: 0 16px 44px rgba(20,28,50,.20); display: flex; flex-direction: column; gap: 2px; }
.cg-tm-opt { width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--ink); background: transparent; cursor: pointer; transition: background .12s, color .12s; }
.cg-tm-opt:hover { background: var(--bg); color: var(--acc); }
.cg-tm-opt.danger { color: var(--warn, #dc2626); }
.cg-tm-opt.danger:hover { background: var(--warn-l, color-mix(in srgb, #dc2626 12%, transparent)); color: var(--warn, #dc2626); }
.cg-sp-empty { font-size: 12.5px; color: var(--ink3); padding: 8px 10px; }
.cg-temp { display: flex; align-items: center; gap: 8px; background: transparent; border-radius: 14px; padding: 10px 8px; font-size: 11px; font-weight: 700; color: var(--ink2); cursor: pointer; position: relative; }
.cg-temp:hover { background: transparent; color: var(--acc); }
.cg-temp .ti { background: var(--amber); color: #fff; border-radius: 8px; padding: 2px 8px; font-size: 9px; font-weight: 800; flex: none; }
.cg-newsp { margin-top: 2px; padding: 9px; border-radius: 12px; background: transparent; color: var(--acc); font-size: 11px; font-weight: 800; cursor: pointer; }
.cg-newsp:hover { background: var(--acc-l); }

/* 候选引擎：伪 3D 悬浮在内容页上的一排按钮，跟内容区同底色，不占列、不画线。
   默认最多显示 8 个字符宽，鼠标放上去弹性浮起 + Logo 轻摆 + 平滑展开完整名称。 */
.cg-cand { position: absolute; z-index: 24; left: 18px; top: 58px; width: auto; overflow: visible; box-sizing: border-box; display: block; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; pointer-events: none; }
.cg-cand-h { display: none; }
.cg-cand-list { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.cg-cand-tip { display: none; }
.cg-cand-add { pointer-events: auto; margin-top: 8px; width: 60px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--bg); color: var(--ink2); font-size: 16px; font-weight: 500; line-height: 1; border: 0; cursor: pointer; box-shadow: 0 8px 20px rgba(18,28,54,.14), 0 2px 6px rgba(18,28,54,.08), inset 0 1px 0 rgba(255,255,255,.78); transition: transform .22s cubic-bezier(.34,1.56,.64,1), background .16s ease, color .16s ease, box-shadow .2s ease; }
.cg-cand-add:hover { background: var(--card); color: var(--acc); transform: translateY(-2px) scale(1.06); box-shadow: 0 12px 24px rgba(18,28,54,.18), 0 3px 8px rgba(18,28,54,.10); }
[data-theme="dark"] .cg-cand-add { box-shadow: 0 10px 24px rgba(0,0,0,.48), 0 3px 8px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.12); }
.cg-cand-menu { position: fixed; z-index: 2350; width: 256px; background: var(--card); border-radius: 18px; padding: 8px; box-shadow: 0 18px 48px rgba(15,23,42,.22); border: 1px solid rgba(15,23,42,.06); display: flex; flex-direction: column; gap: 4px; }
.cg-cand-mopt { width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; background: transparent; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: background .14s; }
.cg-cand-mopt:hover { background: var(--acc-l); }
.cg-cand-mopt b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cg-cand-mopt:hover b { color: var(--acc); }
.cg-cand-mopt span { font-size: 11.5px; color: var(--ink3); line-height: 1.4; }
/* 外部 Agent 配置页按入口聚焦：单引擎进只看 BYOS，多引擎进只看网络/CLI 插头 */
#setCustomEngines[data-ce-mode="byos"] #plugCardGrid,
#setCustomEngines[data-ce-mode="byos"] #customEngList,
#setCustomEngines[data-ce-mode="byos"] .plug-adv { display: none !important; }
#setCustomEngines[data-ce-mode="network"] #byosAuthHub { display: none !important; }
.cg-bot { pointer-events: auto; width: max-content; box-sizing: border-box; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 0; border-radius: 999px; padding: 6px 12px 6px 6px; box-shadow: 0 8px 20px rgba(18,28,54,.14), 0 2px 6px rgba(18,28,54,.08), inset 0 1px 0 rgba(255,255,255,.78), inset 0 -1px 0 rgba(18,28,54,.05); cursor: grab; user-select: none; min-width: 0; position: relative; will-change: transform, box-shadow; transition: transform .26s cubic-bezier(.34,1.56,.64,1), box-shadow .24s ease, background .18s ease; }
[data-theme="dark"] .cg-bot { box-shadow: 0 10px 24px rgba(0,0,0,.48), 0 3px 8px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.12), inset 0 -1px 0 rgba(0,0,0,.35); }
.cg-bot:hover { z-index: 30; }
.cg-bot:hover:not(.used) { background: var(--card); transform: translateX(5px); box-shadow: 0 14px 28px rgba(18,28,54,.20), 0 4px 10px rgba(18,28,54,.11), inset 0 1px 0 rgba(255,255,255,.9); }
[data-theme="dark"] .cg-bot:hover:not(.used) { box-shadow: 0 16px 32px rgba(0,0,0,.62), 0 5px 12px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.18); }
.cg-bot:active:not(.used) { transform: translateY(0) translateX(2px) scale(.98); cursor: grabbing; }
.cg-bot.used { opacity: .34; cursor: default; box-shadow: 0 2px 6px rgba(18,28,54,.06); }
.cg-bot .av { width: 26px; height: 26px; border-radius: 9px; flex: none; }
.cg-etag { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 9.5px; font-weight: 700; color: #fff; letter-spacing: .2px; background: #5b6472; box-shadow: 0 2px 6px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.28); overflow: hidden; transition: transform .26s cubic-bezier(.34,1.56,.64,1); }
.cg-etag.img { background: #fff !important; padding: 2px; box-sizing: border-box; box-shadow: 0 2px 6px rgba(18,28,54,.10); }
.cg-elogo { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 5px; }
.cg-etag svg { display: block; }
.cg-bot:hover:not(.used) .cg-etag { transform: scale(1.12) rotate(-6deg); }
.cg-etag.cc { background: #d97757; } .cg-etag.cx { background: #10a37f; }
.cg-etag.ds { background: #4d6bfe; } .cg-etag.oc { background: #7c5cff; }
.cg-etag.ai { background: #d9622b; } .cg-etag.bu { background: #0f8b8d; }
.cg-etag.dr { background: #b4348e; } .cg-etag.oi { background: #2f6fed; }
.cg-etag.cw { background: #c2410c; }
.cg-etag.gem { background: linear-gradient(135deg, #4285f4, #9b72cb); }
.cg-etag.owui { background: #1e293b; }
.cg-ename { font-size: 12.5px; font-weight: 550; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 8ch; }

/* 群列表（保留给老结构，聊天态不再显示） */
.cg-tasks { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 4px 12px 12px; }
.cg-tasks .th { display: flex; align-items: center; padding: 0 4px 8px; }
.cg-tasks .th h4 { font-size: 10px; color: var(--ink3); font-weight: 800; letter-spacing: 1px; }
.cg-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.cg-item { border-radius: 14px; padding: 10px 12px; background: var(--card); cursor: pointer; }
.cg-item.on, .cg-item:hover { background: var(--acc-l); }
.cg-item .t1 { font-weight: 700; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.cg-item .badge { margin-left: auto; font-size: 9px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: rgba(120,130,150,.14); color: var(--ink3); white-space: nowrap; }
.cg-item .badge.live { background: rgba(15,181,164,.14); color: var(--teal); }
.cg-item .t2 { font-size: 10.5px; color: var(--ink3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 聊天头：群名居中，挂上去的 Bot 头像紧跟在名字右边。
   原来靠 .spacer(flex:1) 把名字顶到最左；那一组右侧按钮（tabs/kind/产出/管理）
   早已隐藏，spacer 留着只会把标题推到边角。现在取消占位、整行居中。 */
.cg-chathead { flex: none; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 22px 10px; }
.cg-chathead .ct { font-weight: 600; font-size: 17px; letter-spacing: -.015em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-chathead .avatars { display: flex; gap: 5px; margin-left: 2px; flex: none; }
.cg-chathead .avatars .av { width: 30px; height: 30px; border-radius: 10px; box-shadow: 0 2px 6px rgba(15,23,42,.08); }
.cg-chathead .spacer { display: none; }
.cg-tabs { display: flex; gap: 2px; background: var(--card); border-radius: 999px; padding: 3px; flex: none; }
.cg-tabs button { font-size: 10.5px; font-weight: 800; color: var(--ink2); padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.cg-tabs button.on { background: var(--acc-l); color: var(--acc); }
.cg-kind { font-size: 10.5px; color: var(--ink3); font-weight: 700; white-space: nowrap; }
.cg-mgmt { font-size: 10.5px; color: var(--ink2); background: var(--card); border-radius: 999px; padding: 5px 12px; font-weight: 800; white-space: nowrap; }
.cg-mgmt:hover { background: var(--violet-soft); color: var(--violet); }
.cg-out-toggle { font-size: 10.5px; color: var(--ink2); background: var(--card); border-radius: 999px; padding: 5px 12px; font-weight: 800; white-space: nowrap; }
.cg-out-toggle:hover, .cg-out-toggle.on { background: var(--acc-l); color: var(--acc); }
.cg-chathead .cg-tabs,
.cg-chathead .kind,
.cg-chathead .cg-out-toggle,
.cg-chathead .cg-mgmt { display: none !important; }

/* 产出预览列（对齐 WorkBuddy）：有内容时展开，无内容时自动收起留白 */
.cg-out-panel { grid-column: 3; min-width: 0; display: flex; flex-direction: column; padding: 12px 14px 16px 8px; background: var(--bg); overflow: hidden; }
.cg-stage-wrap.cg-out-closed .cg-out-panel { display: none; }
.cg-out-bar { flex: none; display: flex; align-items: center; gap: 6px; padding-bottom: 10px; }
.cg-out-tabs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 0; }
.cg-out-tab { display: inline-flex; align-items: center; gap: 6px; max-width: 200px; font-size: 11.5px; font-weight: 700; color: var(--ink2); background: var(--card); border-radius: 12px; padding: 6px 8px 6px 11px; cursor: pointer; flex: none; }
.cg-out-tab.on { color: var(--ink); background: var(--card); box-shadow: 0 2px 10px rgba(24,34,60,.07); }
.cg-out-tab .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-out-tab .dx { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: var(--ink3); background: transparent; flex: none; }
.cg-out-tab .dx:hover { background: rgba(120,130,150,.16); color: var(--ink); }
.cg-out-add { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; color: var(--ink2); background: transparent; font-size: 16px; font-weight: 600; flex: none; }
.cg-out-add:hover { background: var(--card); color: var(--ink); }
.cg-out-bar .x { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; color: var(--ink2); background: var(--card); font-size: 15px; flex: none; }
/* 多引擎协作：隐藏单体专属 Agents 入口；「网页端」7 排胶囊精准锚定在输入框右上方（左沿贴齐输入框右沿，下沿贴齐输入框上沿） */
.main.cg-chat #agentsBtn, .main.cg-legacy #agentsBtn, body.arena #agentsBtn { display: none !important; }
.cg-composer { position: relative; overflow: visible !important; }
.cg-strat-dock { position: absolute; left: calc(100% + 10px); bottom: 100%; z-index: 16; display: flex; flex-direction: column; align-items: stretch; gap: 7px; width: 112px; }
.cg-stage-wrap:not(.cg-out-closed) .cg-strat-dock { left: auto; right: 0; bottom: calc(100% + 44px); }
.cg-strat-lbl { font-size: 11px; font-weight: 700; color: var(--ink3); text-align: center; letter-spacing: .06em; user-select: none; margin-bottom: 1px; }
.cg-strat-list { display: flex; flex-direction: column; align-items: stretch; gap: 7px; }
.cg-strat-item { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; width: 100%; padding: 6px 10px 6px 7px; border: 1px solid rgba(120,130,150,.12); border-radius: 999px; background: var(--card); color: var(--ink); box-shadow: 0 3px 12px rgba(24,34,60,.06); cursor: grab; transition: transform .12s, box-shadow .14s, background .14s, border-color .14s; box-sizing: border-box; }
.cg-strat-item:active { cursor: grabbing; }
.cg-strat-item:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(24,34,60,.1); border-color: rgba(79,107,255,.32); }
.cg-strat-item.used { background: var(--acc-l); color: var(--acc); border-color: rgba(79,107,255,.35); }
.cg-strat-dot, .cg-sp-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.cg-strat-dot.on, .cg-sp-dot.on { background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.22); }
.cg-strat-dot.off, .cg-sp-dot.off { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.18); }
.cg-strat-dot { margin-left: auto; }
.cg-tok-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-top: 5px; border-top: 1px dashed rgba(120,130,150,.18); font-size: 11px; color: var(--ink3, #7a8399); }
.cg-tok-foot.warn { color: #d97706; }
.cg-tok-foot .cg-tok-pill { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 999px; background: rgba(120,130,150,.1); font-variant-numeric: tabular-nums; }
.cg-tok-foot.warn .cg-tok-pill { background: rgba(217,119,6,.12); color: #b45309; font-weight: 600; }
.cg-usage-tip { position: fixed; z-index: 260; min-width: 210px; max-width: 260px; padding: 10px 12px; border-radius: 12px; background: var(--card, #fff); color: var(--ink, #1b2030); border: 1px solid rgba(120,130,150,.18); box-shadow: 0 12px 32px rgba(15,23,42,.16); font-size: 11.5px; line-height: 1.55; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .14s, transform .14s; }
.cg-usage-tip.show { opacity: 1; transform: translateY(0); }
.cg-usage-tip .ut-hd { font-weight: 700; font-size: 12.5px; margin-bottom: 5px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cg-usage-tip .ut-row { display: flex; justify-content: space-between; color: var(--ink3, #6b7280); }
.cg-usage-tip .ut-row b { color: var(--ink, #1b2030); font-variant-numeric: tabular-nums; }
.cg-usage-tip .ut-note { margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(120,130,150,.14); font-size: 10.5px; color: var(--ink3, #8a93a6); }
.cg-strat-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--ink); font-size: 11.5px; font-weight: 800; overflow: hidden; flex: none; }
.cg-strat-av img { width: 18px; height: 18px; object-fit: contain; display: block; }
.cg-strat-nm { font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 军师账号选择弹层（A / B / C / D / E 独立隔离账号选择） */
.cg-strat-pop { position: fixed; z-index: 2600; width: 256px; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid rgba(120,130,150,.18); box-shadow: 0 16px 46px rgba(16,24,44,.18); display: none; flex-direction: column; gap: 8px; box-sizing: border-box; }
.cg-strat-pop.show { display: flex; }
.cg-sp-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cg-sp-hd b { font-size: 13px; color: var(--ink); }
.cg-sp-hd .x { width: 22px; height: 22px; border: 0; border-radius: 7px; background: transparent; color: var(--ink3); font-size: 16px; cursor: pointer; display: grid; place-items: center; }
.cg-sp-hd .x:hover { background: var(--bg); color: var(--ink); }
.cg-sp-sub { font-size: 11px; color: var(--ink3); line-height: 1.45; }
.cg-sp-list { display: flex; flex-direction: column; gap: 5px; }
.cg-sp-item { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 10px; border-radius: 11px; border: 1px solid rgba(120,130,150,.14); background: var(--bg); color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; text-align: left; box-sizing: border-box; }
.cg-sp-row { display: flex; align-items: center; gap: 6px; }
.cg-sp-row .cg-sp-item { flex: 1; min-width: 0; }
.cg-sp-ren { flex-shrink: 0; padding: 5px 8px; border-radius: 9px; border: 1px solid rgba(120,130,150,.16); background: var(--card); color: var(--ink3); font-size: 11px; cursor: pointer; }
.cg-sp-ren:hover { color: var(--acc); border-color: var(--acc); background: var(--acc-l); }
.cg-sp-add { width: 100%; margin-top: 8px; padding: 7px 10px; border-radius: 11px; border: 1px dashed rgba(120,130,150,.32); background: transparent; color: var(--ink2); font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; box-sizing: border-box; }
.cg-sp-add:hover { border-color: var(--acc); color: var(--acc); background: var(--acc-l); }
.cg-sp-edit { display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 6px; }
.cg-sp-edit input { flex: 1; min-width: 0; padding: 6px 9px; border-radius: 9px; border: 1px solid var(--acc); background: var(--bg); color: var(--ink); font-size: 12px; outline: none; }
.cg-sp-edit button { padding: 6px 10px; border-radius: 9px; border: 0; background: var(--acc); color: #fff; font-size: 11.5px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.cg-sp-item:hover { border-color: var(--acc); background: var(--acc-l); color: var(--acc); }
.cg-sp-item.used { border-color: rgba(79,107,255,.35); background: var(--acc-l); color: var(--acc); }
.cg-sp-code { width: 22px; height: 22px; border-radius: 7px; background: var(--card); color: var(--ink); font-size: 11.5px; font-weight: 800; display: grid; place-items: center; flex: none; }
.cg-sp-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-sp-px { font-size: 10px; padding: 1px 5px; border-radius: 5px; background: var(--card); color: var(--ink2); flex: none; }
.cg-sp-tag, .cg-sp-go { font-size: 10.5px; font-weight: 700; flex: none; }

/* 气泡内联图片与视频播放器 + 对象操作条 + 灯箱 */
.cg-media-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.cg-media-card { width: 100%; max-width: 440px; border-radius: 14px; overflow: hidden; background: var(--bg); border: 1px solid rgba(120,130,150,.16); }
.cg-media-card.img img { display: block; width: 100%; max-height: 320px; object-fit: contain; background: #0f131c; cursor: zoom-in; }
.cg-media-card.vid video { display: block; width: 100%; max-height: 320px; background: #000; }
.cg-media-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; font-size: 11.5px; color: var(--ink2); }
.cg-media-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; min-width: 0; }
.cg-media-acts { flex: none; display: inline-flex; align-items: center; gap: 5px; }
.cg-media-acts button { height: 23px; padding: 0 8px; border-radius: 7px; border: 1px solid rgba(120,130,150,.24); background: var(--card); color: var(--ink); font-size: 11px; font-weight: 700; cursor: pointer; }
.cg-media-acts button:hover { border-color: var(--acc); color: var(--acc); }
.cg-lb-ov { z-index: 3200; }
.cg-lb-box { width: min(92vw, 1080px); max-height: 90vh; background: var(--card); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.cg-lb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(120,130,150,.16); }
.cg-lb-title { font-size: 13px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-lb-acts { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.cg-lb-acts button { height: 27px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(120,130,150,.24); background: var(--bg); color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.cg-lb-acts button:hover { border-color: var(--acc); color: var(--acc); }
.cg-lb-acts button.x { width: 27px; padding: 0; font-size: 16px; }
.cg-lb-body { flex: 1; min-height: 0; background: #0e1118; display: flex; align-items: center; justify-content: center; padding: 14px; overflow: auto; }
.cg-lb-body img { max-width: 100%; max-height: 76vh; object-fit: contain; border-radius: 8px; }

.cg-out-stage { flex: 1; min-height: 0; overflow: auto; background: var(--card); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cg-out-stage.is-native-web { padding: 8px; overflow: hidden; }
.cg-out-view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.cg-out-view.is-native-web { gap: 0; }
.cg-out-webbtn { width: auto; padding: 0 9px; font-size: 11.5px; font-weight: 700; }

/* 右侧内嵌原生多账号真浏览器控制栏 */
.cg-web-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.cg-web-tabstrip { flex: none; display: flex; align-items: center; gap: 5px; min-width: 0; }
.cg-web-tablist { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cg-web-tablist::-webkit-scrollbar { display: none; }
.cg-web-tab { display: inline-flex; align-items: center; gap: 5px; max-width: 168px; padding: 4px 7px 4px 10px; border-radius: 9px; background: var(--bg); color: var(--ink2); font-size: 11.5px; font-weight: 600; cursor: pointer; flex: none; user-select: none; }
.cg-web-tab.on { background: var(--acc-l); color: var(--acc); font-weight: 700; }
.cg-web-tab .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-web-tab .tx { width: 15px; height: 15px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: transparent; color: currentColor; opacity: .65; font-size: 12px; cursor: pointer; }
.cg-web-tab .tx:hover { opacity: 1; background: rgba(0,0,0,.08); }
.cg-web-tadd { width: 24px; height: 24px; border-radius: 7px; border: 0; background: var(--bg); color: var(--ink2); font-size: 15px; font-weight: 600; display: grid; place-items: center; cursor: pointer; flex: none; }
.cg-web-tadd:hover { color: var(--ink); background: rgba(120,130,150,.15); }
.cg-web-prof { flex: none; height: 25px; border-radius: 8px; border: 1px solid var(--cg-dash, rgba(120,130,150,.22)); background: var(--bg); color: var(--ink); font-size: 11px; font-weight: 700; padding: 0 6px; outline: none; cursor: pointer; }
.cg-web-profbar { flex: none; display: flex; align-items: center; gap: 5px; padding: 6px 8px; border-radius: 9px; background: var(--bg); border: 1px solid var(--cg-dash, rgba(120,130,150,.22)); }
.cg-web-profbar[hidden] { display: none !important; }
.cg-web-profinp { height: 25px; border-radius: 7px; border: 1px solid rgba(120,130,150,.26); background: var(--card); color: var(--ink); font-size: 11.5px; padding: 0 8px; outline: none; box-sizing: border-box; }
.cg-web-profinp.nm { width: 120px; flex: none; }
.cg-web-profinp.px { flex: 1; min-width: 0; }
.cg-web-profbar .bbtn { height: 25px; padding: 0 9px; border-radius: 7px; border: 1px solid rgba(120,130,150,.28); background: var(--card); color: var(--ink); font-size: 11px; font-weight: 700; cursor: pointer; flex: none; }
.cg-web-profbar .bbtn.pri { border-color: var(--acc); background: var(--acc); color: #fff; }
.cg-web-navbar { flex: none; display: flex; align-items: center; gap: 5px; }
.cg-web-navbtn { width: 27px; height: 27px; border-radius: 8px; border: 0; background: var(--bg); color: var(--ink2); display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.cg-web-navbtn:hover:not(:disabled) { color: var(--ink); background: rgba(120,130,150,.15); }
.cg-web-navbtn:disabled { opacity: .35; cursor: default; }
.cg-web-url { flex: 1; min-width: 0; height: 28px; border-radius: 9px; border: 1px solid transparent; background: var(--bg); color: var(--ink); font-size: 12px; padding: 0 10px; outline: none; box-sizing: border-box; }
.cg-web-url:focus { border-color: var(--acc); background: var(--card); }
.cg-web-vaultbtn { flex: none; height: 27px; padding: 0 9px; border-radius: 8px; border: 0; background: var(--bg); color: var(--ink2); font-size: 11px; font-weight: 700; cursor: pointer; }
.cg-web-vaultbtn:hover { background: var(--acc-l); color: var(--acc); }
.cg-web-banner { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 10px; font-size: 12px; line-height: 1.45; }
.cg-web-banner[hidden] { display: none !important; }
.cg-web-banner.busy { background: var(--acc-l); color: var(--acc); }
.cg-web-banner.handoff { background: rgba(217, 119, 6, 0.12); color: var(--ink); border: 1px solid rgba(217, 119, 6, 0.28); }
.cg-web-banner.warn { background: rgba(220, 38, 38, 0.1); color: var(--ink); border: 1px solid rgba(220, 38, 38, 0.28); }
.cg-web-banner .bmain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cg-web-banner .btxt { font-weight: 600; word-break: break-word; }
.cg-web-banner .bcode { width: 132px; height: 25px; border-radius: 7px; border: 1px solid rgba(120,130,150,.3); background: var(--card); color: var(--ink); padding: 0 8px; font-size: 12px; outline: none; }
.cg-web-banner .bacts { flex: none; display: flex; align-items: center; gap: 6px; }
.cg-web-banner .bbtn { height: 25px; padding: 0 10px; border-radius: 7px; border: 1px solid rgba(120,130,150,.28); background: var(--card); color: var(--ink); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.cg-web-banner .bbtn.pri { border-color: var(--acc); background: var(--acc); color: #fff; }
.cg-web-slot { flex: 1; min-height: 280px; border-radius: 12px; background: #f7f8fb; background-size: cover; background-position: top left; background-repeat: no-repeat; }
.cg-out-view video, .cg-out-view img { max-width: 100%; max-height: 60vh; border-radius: 16px; background: #111; }
.cg-out-view audio { width: 100%; }
.cg-out-view iframe { width: 100%; flex: 1; min-height: 320px; border: 0; border-radius: 16px; background: #fff; }
.cg-out-view pre { margin: 0; flex: 1; min-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--bg); color: var(--ink); border-radius: 16px; padding: 14px; font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.cg-out-view .filelink { margin: auto; display: flex; align-items: center; justify-content: center; min-height: 160px; padding: 20px; background: var(--bg); color: var(--acc); border-radius: 16px; font-size: 12px; font-weight: 800; }

/* 聊天 / 产出分界线：平时透明，指针压上才亮一条浅线；拖动生效。 */
.cg-split { grid-column: 2; position: relative; z-index: 25; cursor: col-resize; touch-action: none; background: transparent; }
.cg-stage-wrap.cg-out-closed .cg-split { display: none; }
.cg-split::before { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .15s, width .15s; }
.cg-split:hover::before, .cg-split.drag::before { background: var(--cg-dash); width: 3px; }
body.cg-out-resizing, body.cg-out-resizing * { cursor: col-resize !important; user-select: none !important; }

/* 消息流：无产出时与单引擎共用 --content-w 居中列，切换模式不跳动；有产出时自适应并左避让引擎条。 */
.cg-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px 18px; display: flex; flex-direction: column; gap: 25px; width: 100%; max-width: var(--content-w, 920px); margin: 0 auto; box-sizing: border-box; border-radius: 22px; transition: background .16s ease; }
.cg-maincol.cg-drop-ready { position: relative; }
.cg-maincol.cg-drop-ready::before { content: ''; position: absolute; top: 8px; bottom: 14px; left: 50%; transform: translateX(-50%); width: min(calc(100% - 36px), var(--content-w, 920px)); background: color-mix(in srgb, var(--acc-l) 52%, transparent); border-radius: 22px; box-shadow: inset 0 0 0 2px rgba(79,107,255,.22); pointer-events: none; z-index: 0; }
.cg-maincol.cg-drop-ready .cg-msgs,
.cg-maincol.cg-drop-ready .cg-crew.dragover,
.cg-maincol.cg-drop-ready .cg-composer.dragover { background: transparent; }
.cg-stage-wrap:not(.cg-out-closed) .cg-msgs { max-width: 100%; padding-left: 216px; }
/* 窄窗口自适应：左侧候选引擎条 .cg-cand 是 absolute 悬浮、不占格。
   宽屏时消息列居中，左边缘天然落在引擎条右侧；窗口收窄到列不再居中后，
   消息列贴到左边，发言人名和头像就被那一排引擎胶囊压住。
   实测重叠临界点在 1440 附近（1401~1440 消息左缘 408~428，引擎条右缘 422），
   所以阈值取 1460 留余量，把整段会重叠的区间都纳入避让；更宽的窗口靠居中天然躲开，
   不触发这段，保持原来的居中观感。216px = 引擎条实占约 200px + 一点呼吸。 */
@media (max-width: 1460px) {
  .cg-stage-wrap.cg-out-closed .cg-msgs { padding-left: 216px; }
  .cg-stage-wrap.cg-out-closed .cg-desk { padding-left: 216px; }
}
.cg-msg { display: flex; gap: 11px; width: max-content; max-width: min(680px, calc(100% - 12px)); }
.cg-msg.me { align-self: flex-end; flex-direction: row-reverse; max-width: min(620px, calc(100% - 12px)); }
.cg-msg .av { width: 38px; height: 38px; border-radius: 12px; flex: none; }
.cg-msg .body { min-width: 0; max-width: calc(100% - 49px); }
.cg-msg.me .body { max-width: 100%; }
.cg-msg .who { font-size: 13px; color: var(--ink2); font-weight: 600; margin-bottom: 5px; display: flex; align-items: center; gap: 6px; letter-spacing: -.01em; }
.cg-msg.me .who { text-align: right; justify-content: flex-end; }
/* 去框：正文靠底色差分层，不描边不投影 —— 跟单引擎主聊一个观感。 */
.cg-bubble { max-width: 100%; box-sizing: border-box; background: var(--card); border: 0; border-radius: 20px; padding: 13px 17px; font-size: 15px; line-height: 1.75; box-shadow: none; word-break: break-word; overflow-wrap: anywhere; }
.cg-msg.me .cg-bubble { background: var(--acc-l); border: 0; border-radius: 20px; white-space: pre-wrap; }
.cg-bubble.cg-md { white-space: normal; }
.cg-bubble.cg-md p { margin: 0 0 9px; }
.cg-bubble.cg-md p:last-child { margin-bottom: 0; }
.cg-bubble.cg-md h1, .cg-bubble.cg-md h2, .cg-bubble.cg-md h3, .cg-bubble.cg-md h4 { font-weight: 600; line-height: 1.42; margin: 14px 0 7px; color: var(--ink); letter-spacing: -.015em; }
.cg-bubble.cg-md h1 { font-size: 18px; }
.cg-bubble.cg-md h2 { font-size: 16.5px; }
.cg-bubble.cg-md h3 { font-size: 15.5px; }
.cg-bubble.cg-md h4 { font-size: 15px; color: var(--ink2); }
.cg-bubble.cg-md > h1:first-child, .cg-bubble.cg-md > h2:first-child, .cg-bubble.cg-md > h3:first-child, .cg-bubble.cg-md > h4:first-child { margin-top: 0; }
.cg-bubble.cg-md ul, .cg-bubble.cg-md ol { margin: 0 0 8px; padding-left: 20px; }
.cg-bubble.cg-md li { margin: 3px 0; }
.cg-bubble.cg-md blockquote { margin: 8px 0; padding: 7px 12px; background: var(--bg); border-left: 3px solid var(--acc); border-radius: 0 8px 8px 0; color: var(--ink2); }
.cg-bubble.cg-md hr { border: 0; border-top: 1px solid var(--cg-dash); margin: 10px 0; }
.cg-bubble.cg-md pre { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); overflow-x: auto; font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.cg-bubble.cg-md code:not(pre code) { background: rgba(120,130,150,.12); padding: 1px 5px; border-radius: 5px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.cg-bubble.cg-md .tbl, .cg-bubble.cg-md .md-table-wrap { width: 100%; overflow-x: auto; margin: 8px 0; border-radius: 10px; }
.cg-bubble.cg-md table { border-collapse: collapse; font-size: 12px; width: 100%; }
.cg-bubble.cg-md th, .cg-bubble.cg-md td { border-bottom: 1px solid var(--cg-dash); padding: 6px 9px; text-align: left; vertical-align: top; }
.cg-bubble.cg-md th { font-weight: 700; color: var(--ink2); background: var(--bg); white-space: nowrap; }
.cg-msg.sec .cg-bubble { background: var(--violet-soft); }
.cg-msg.review .cg-bubble { background: color-mix(in srgb, var(--violet-soft) 55%, var(--card)); }
.cg-msg.sys { align-self: center; max-width: 92%; gap: 6px; align-items: center; width: max-content; }
.cg-msg.sys .body { max-width: none; }
.cg-msg.sys .cg-bubble { background: rgba(120,130,150,.12); color: var(--ink2); font-size: 11px; border-radius: 999px; padding: 3px 14px; box-shadow: none; white-space: nowrap; line-height: 1.5; }
.cg-msg.sys .who { display: none; }
.cg-bubble .line { padding: 2px 0; }
.cg-bubble .stored { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; background: rgba(120,130,150,.12); border-radius: 999px; padding: 3px 10px; font-size: 10px; color: var(--ink2); }
.cg-bubble .stored b { color: var(--teal); }
.cg-confirm { margin-top: 10px; }
.cg-confirm button { background: var(--violet); color: #fff; font-weight: 800; font-size: 12px; padding: 8px 16px; border-radius: 12px; }
.cg-typing { display: inline-flex; gap: 5px; align-items: center; padding: 11px 14px; background: var(--card); border-radius: 18px; }
.cg-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink3); animation: cgbl 1s infinite; }
.cg-typing i:nth-child(2) { animation-delay: .2s; }
.cg-typing i:nth-child(3) { animation-delay: .4s; }
.cg-typing .cg-tstatus { font-size: 11.5px; color: var(--ink3); margin-left: 6px; font-weight: 600; }
.cg-live-status { font-size: 11px; color: var(--ink3); margin-top: 4px; padding-left: 2px; }
.cg-live-status.warn { color: var(--warn, #dc2626); }
@keyframes cgbl { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; } }

/* 输入区：成员胶囊在上，输入框沉底；与单引擎共用 --content-w 居中列，底沿上抬留呼吸感 */
.cg-desk { flex: none; padding: 8px 24px 34px; background: var(--bg); width: 100%; max-width: var(--content-w, 920px); margin: 0 auto; box-sizing: border-box; }
.cg-stage-wrap:not(.cg-out-closed) .cg-desk { padding-left: 18px; max-width: 100%; }
.cg-crew { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 40px; padding: 0 4px; margin-bottom: 10px; border-radius: 16px; }
.cg-crew.dragover { background: var(--acc-l); }
.cg-chip { position: relative; display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid rgba(15,23,42,.05); border-radius: 16px; padding: 6px 12px 6px 6px; font-weight: 600; font-size: 13px; box-shadow: 0 2px 10px rgba(15,23,42,.04); }
.cg-chip .cg-chip-del { position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink2); color: var(--card); display: grid; place-items: center; font-size: 11px; line-height: 1; border: 0; padding: 0; margin: 0; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .15s, background .15s; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.cg-chip:hover .cg-chip-del { opacity: 1; pointer-events: auto; }
.cg-chip .cg-chip-del:hover { background: var(--warn, #dc2626); color: #fff; }
.cg-chip .cg-bmeta .bn,
.cg-chip .cg-bmeta .be,
.cg-chip .cg-bmeta .bm { max-width: 11ch; }
.cg-chip.sec { background: var(--violet-soft); }
.cg-chip .av { width: 32px; height: 32px; border-radius: 10px; flex: none; }
.cg-chip .x { width: 16px; height: 16px; border-radius: 50%; background: rgba(120,130,150,.16); display: grid; place-items: center; font-size: 10px; margin-left: 2px; }
.cg-chip .role { font-size: 11px; font-weight: 600; color: var(--acc); background: var(--acc-l); padding: 2px 8px; border-radius: 999px; }
.cg-crew-add { width: 36px; height: 36px; border-radius: 999px; background: var(--card); border: 1px solid rgba(15,23,42,.06); color: var(--ink2); display: grid; place-items: center; font-size: 20px; font-weight: 500; line-height: 1; cursor: pointer; flex: none; box-shadow: 0 2px 8px rgba(15,23,42,.06); transition: background .15s, color .15s; }
.cg-crew-add:hover { background: var(--acc-l); color: var(--acc); }
.cg-ep-modal { width: min(460px, 92vw); }
.cg-ep-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 12px; max-height: 54vh; overflow-y: auto; padding: 2px; }
@media (max-width: 520px) { .cg-ep-list { grid-template-columns: 1fr; } }
.cg-ep-item { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 16px; background: var(--bg); color: var(--ink); text-align: left; cursor: pointer; transition: transform .18s ease, background .15s ease; min-width: 0; }
.cg-ep-item:hover:not(:disabled) { background: var(--acc-l); transform: translateY(-1px); }
.cg-ep-item.used { opacity: .45; cursor: default; }
.cg-ep-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-ep-ext { font-size: 9px; font-weight: 800; color: var(--violet); background: var(--violet-soft); padding: 2px 6px; border-radius: 999px; flex: none; }
.cg-ep-plus { font-size: 15px; font-weight: 700; color: var(--acc); flex: none; }
.cg-ep-done { font-size: 10px; font-weight: 700; color: var(--ink3); flex: none; }
.cg-composer { border-radius: 22px; background: var(--card); padding: 13px 16px; box-shadow: 0 6px 24px rgba(24,34,60,.08); }
.cg-composer.dragover { background: var(--acc-l); }
.cg-atts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cg-att { display: flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 999px; padding: 5px 10px; font-size: 10.5px; max-width: 260px; }
.cg-att .ai { width: 16px; height: 16px; border-radius: 5px; background: var(--amber); color: #fff; display: grid; place-items: center; font-size: 8px; font-weight: 800; flex: none; }
.cg-att .an { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-att .as { font-size: 9.5px; color: var(--ink3); flex: none; }
.cg-att.err .as { color: var(--warn, #dc2626); }
.cg-att .x { color: var(--ink3); font-size: 12px; flex: none; cursor: pointer; }
.cg-composer textarea { width: 100%; min-height: 54px; resize: vertical; background: transparent; border: 0; outline: 0; color: var(--ink); font-size: 15px; line-height: 1.65; padding: 4px; font-family: inherit; }
.cg-composer textarea::placeholder { color: var(--ink3); }
.cg-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cg-plus, .cg-mic { width: 34px; height: 34px; border-radius: 11px; background: var(--bg); color: var(--ink2); display: grid; place-items: center; font-size: 18px; font-weight: 600; line-height: 1; flex: none; }
.cg-ws-btn { height: 34px; max-width: 190px; border-radius: 11px; background: var(--bg); color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; font-size: 13px; font-weight: 550; cursor: pointer; flex: none; }
.cg-ws-btn:hover { background: var(--acc-l); color: var(--acc); }
.cg-ws-btn .wn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-ws-btn svg { flex: none; }
.cg-mic svg { display: block; }
.cg-plus:hover, .cg-mic:hover { background: var(--acc-l); color: var(--acc); }
.cg-mic.rec { background: var(--warn-l, color-mix(in srgb, var(--warn) 14%, transparent)); color: var(--warn); }
.cg-mic.busy { opacity: .6; }
.cg-foot .spacer { flex: 1; }
.cg-send { background: var(--acc); color: var(--acc-txt); font-weight: 600; font-size: 13.5px; padding: 9px 22px; border-radius: 13px; }
.cg-send:disabled { background: rgba(120,130,150,.18); color: var(--ink3); cursor: not-allowed; }
.cg-send.stop { background: var(--warn, #dc2626); color: #fff; }
.cg-mode-btn { height: 34px; border-radius: 11px; background: var(--bg); color: var(--ink2); display: inline-flex; align-items: center; gap: 5px; padding: 0 12px; font-size: 13px; font-weight: 550; cursor: pointer; flex: none; }
.cg-mode-btn:hover { background: var(--acc-l); color: var(--acc); }
.cg-mode-btn .car { font-size: 10px; opacity: .75; }
.cg-modemenu { position: fixed; z-index: 2150; width: 280px; background: var(--card); border-radius: 16px; padding: 8px; box-shadow: 0 14px 44px rgba(20,28,50,.22); display: flex; flex-direction: column; gap: 4px; }
.cg-mm-opt { text-align: left; padding: 8px 10px; border-radius: 11px; background: transparent; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.cg-mm-opt:hover { background: var(--bg); }
.cg-mm-opt.on { background: var(--acc-l); color: var(--acc); }
.cg-mm-opt .mn { font-size: 12.5px; font-weight: 800; }
.cg-mm-opt .md { font-size: 10.5px; color: var(--ink3); line-height: 1.35; }
.cg-mm-opt.on .md { color: var(--ink2); }
.cg-role-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; color: var(--acc); background: var(--acc-l); vertical-align: middle; }
.cg-msg-plan { max-width: min(680px, calc(100% - 12px)); width: 100%; }
.cg-plan-card { background: var(--card); border-radius: 16px; padding: 11px 14px; box-shadow: 0 3px 14px rgba(24,34,60,.06); text-align: left; }
.cg-plan-hd { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); }
.cg-plan-tag { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--violet-soft); color: var(--violet); flex: none; }
.cg-plan-why { font-size: 11px; color: var(--ink3); margin-top: 4px; line-height: 1.45; }
.cg-plan-stages { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cg-st-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--bg); color: var(--ink2); }
.cg-st-chip i { width: 15px; height: 15px; border-radius: 50%; background: rgba(120,130,150,.22); color: var(--ink); font-style: normal; font-size: 9.5px; display: grid; place-items: center; }
.cg-st-chip.running { background: var(--acc-l); color: var(--acc); }
.cg-st-chip.running i { background: var(--acc); color: var(--acc-txt); }
.cg-st-chip.done { background: rgba(16,185,129,.12); color: #047857; }
.cg-st-chip.done i { background: #10b981; color: #fff; }
.cg-st-arr { font-size: 11px; color: var(--ink3); }

/* 消息底部行动条与元数据 */
.cg-msg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; padding-left: 2px; }
.cg-mmeta { font-size: 10.5px; color: var(--ink3); margin-right: 4px; display: inline-flex; align-items: center; gap: 5px; }
.cg-adopted-tag { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(15,181,164,.14); color: var(--teal); }
.cg-mcp-tag { font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: rgba(91,110,245,.12); color: var(--acc); margin-left: 5px; vertical-align: middle; }
.cg-mact { font-size: 10.5px; font-weight: 600; color: var(--ink2); background: var(--card); border-radius: 999px; padding: 3px 9px; border: 1px solid rgba(120,130,150,.14); transition: background .15s, color .15s; cursor: pointer; }
.cg-mact:hover { background: var(--acc-l); color: var(--acc); }
.cg-mact.on { background: rgba(15,181,164,.14); color: var(--teal); border-color: rgba(15,181,164,.25); }
.cg-mchip { font-size: 10.5px; font-weight: 600; color: var(--acc); background: rgba(91,110,245,.08); border-radius: 8px; padding: 2px 8px; cursor: pointer; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-mchip:hover { background: var(--acc-l); }
/* 形成文件的产出：文件 chip 嵌在气泡内，没形成文件就只有文字 */
.cg-bubble-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
/* 尾部产物折叠条：和头部思考条首尾呼应，一行灰字带 ›，点开把方案送进右侧产出区 */
.cg-art-foot { display:inline-flex; align-items:center; gap:4px; margin-top:10px; padding:0; background:transparent; border:0; font-size:12px; color:var(--acc-txt, var(--acc)); cursor:pointer; font-family:inherit; }
.cg-art-foot span { font-size:14px; line-height:1; transition:transform .2s; }
.cg-art-foot:hover { opacity:.72; }
.cg-art-foot:hover span { transform:translateX(3px); }
/* 消息右键菜单：默认隐藏，右键消息才出现 */
.cg-msg-menu { position: fixed; z-index: 2400; min-width: 196px; background: var(--card); border-radius: 18px; padding: 8px; box-shadow: 0 18px 48px rgba(15,23,42,.22); display: flex; flex-direction: column; gap: 3px; }
.cg-msg-menu.cg-hidden { display: none; }
.cg-msg-menu-t { font-size: 10px; color: var(--ink3); font-weight: 700; padding: 5px 10px 4px; letter-spacing: .5px; }
.cg-msg-menu-i { width: 100%; text-align: left; padding: 9px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; color: var(--ink2); background: transparent; cursor: pointer; transition: background .14s; }
.cg-msg-menu-i:hover { background: var(--acc-l); color: var(--acc); }

/* 右侧 Markdown 方案预览正文 */
.cg-out-md { font-size: 13px; line-height: 1.72; color: var(--ink); word-break: break-word; overflow-wrap: anywhere; }
.cg-out-md h1, .cg-out-md h2, .cg-out-md h3 { margin: 12px 0 6px; font-weight: 700; color: var(--ink); }
.cg-out-md p { margin: 0 0 8px; }
.cg-out-md pre { background: var(--bg); padding: 10px 12px; border-radius: 10px; overflow-x: auto; font-size: 12px; }
.cg-out-md table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 8px 0; }
.cg-out-md th, .cg-out-md td { border-bottom: 1px solid var(--cg-dash); padding: 6px 8px; text-align: left; }

/* 已确认记忆列表行 */
.cg-memrow { display: flex; align-items: flex-start; gap: 6px; padding: 5px 8px; border-radius: 10px; background: var(--bg); margin-bottom: 4px; }
.cg-memrow label { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 7px; font-size: 11.5px; line-height: 1.45; color: var(--ink2); cursor: pointer; }
.cg-memrow input[type="checkbox"] { margin-top: 2px; flex: none; }
.cg-memdel { width: 20px; height: 20px; border-radius: 6px; font-size: 13px; color: var(--ink3); flex: none; display: grid; place-items: center; }
.cg-memdel:hover { background: rgba(239,68,68,.12); color: #dc2626; }

/* 外部 MCP 配对码弹窗与入口按钮 */
.cg-ep-inv { width: 100%; margin-top: 8px; padding: 9px 12px; border-radius: 12px; background: var(--acc-l); color: var(--acc); font-size: 12px; font-weight: 700; text-align: center; cursor: pointer; }
.cg-ep-inv:hover { filter: brightness(0.97); }
.cg-inv-code { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: var(--acc-l); color: var(--ink); font-size: 13px; margin-bottom: 12px; }
.cg-inv-code b { font-size: 16px; letter-spacing: 1px; color: var(--acc); }
.cg-inv-code span { font-size: 11px; color: var(--ink3); }
.cg-inv-pre { background: var(--bg); color: var(--ink); border-radius: 10px; padding: 10px 12px; font: 11.5px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-all; margin: 6px 0 8px; max-height: 160px; overflow-y: auto; }

.cg-hint { font-size: 10.5px; color: var(--ink3); }

/* 弹层：大圆角、色差分层、无描边 */
.cg-overlay { position: fixed; inset: 0; background: rgba(20,28,50,.28); display: none; place-items: center; z-index: 2000; }
.cg-overlay.show { display: grid; }
.cg-modal { background: var(--card); border-radius: 24px; padding: 22px; width: min(540px, 92vw); box-shadow: 0 24px 70px rgba(20,28,50,.22); }
.cg-modal h4 { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.cg-modal .sub { font-size: 12px; color: var(--ink3); margin-bottom: 16px; }
.cg-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--bg); margin-bottom: 8px; cursor: pointer; }
.cg-opt:hover { background: var(--acc-l); }
.cg-opt .oi { width: 30px; height: 30px; border-radius: 10px; background: var(--card); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--acc); flex: none; }
.cg-opt .on { font-weight: 700; font-size: 13px; }
.cg-opt .od { font-size: 11px; color: var(--ink3); }
.cg-opt .arrow { margin-left: auto; color: var(--ink3); }
.cg-wschip { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--bg); margin-bottom: 8px; cursor: pointer; }
.cg-wschip:hover, .cg-wschip.on { background: var(--acc-l); }
.cg-wschip .fi { width: 30px; height: 30px; border-radius: 10px; background: var(--amber); color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; }
.cg-wschip .wn { font-weight: 700; font-size: 13px; }
.cg-wschip .wpath { font-size: 11px; color: var(--ink3); }
.cg-storegrid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 14px 0; }
.cg-storecell { border-radius: 16px; background: var(--bg); padding: 12px; text-align: center; }
.cg-storecell .n { font-size: 19px; font-weight: 800; }
.cg-storecell .l { font-size: 10.5px; color: var(--ink3); margin-top: 2px; }
.cg-ctxbar { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; margin: 6px 0 14px; }
.cg-ctxbar i { display: block; height: 100%; border-radius: 999px; background: var(--amber); transition: .3s; }
.cg-mrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--bg); margin-bottom: 7px; }
.cg-mrow .av { width: 26px; height: 26px; border-radius: 9px; }
.cg-mrow .mn { font-weight: 700; font-size: 12.5px; }
.cg-mrow .x { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; background: var(--warn-l, color-mix(in srgb, var(--warn) 12%, transparent)); color: var(--warn); display: grid; place-items: center; font-size: 12px; cursor: pointer; }
.cg-section-t { margin-top: 14px; font-size: 12px; font-weight: 800; color: var(--ink2); }
.cg-memlist { max-height: 160px; overflow-y: auto; margin-top: 8px; }
.cg-memlist label { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 11px; background: var(--bg); margin-bottom: 5px; font-size: 12px; cursor: pointer; }
.cg-memlist input { width: 15px; height: 15px; accent-color: var(--acc); }
.cg-close { margin-top: 6px; width: 100%; padding: 10px; border-radius: 13px; background: var(--acc-l); color: var(--acc); font-weight: 800; font-size: 12.5px; }

.cg-hidden { display: none !important; }

/* 群聊层盖住原 stream/composer；必须逐层锁定 min-height:0 + overflow:hidden 防止长回复把 .cg-desk 顶出屏幕 */
.main.collab.cg-chat > .stage { min-height: 0; overflow: hidden; }
.cg-stage-host > .cg-stage-wrap { --cg-out-w: 420px; position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; min-height: 0; height: 100%; overflow: hidden; background: var(--bg); }
.cg-stage-host > .cg-stage-wrap[hidden] { display: none; }
.cg-stage-wrap .cg-desk { background: var(--bg); }
.cg-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, 1fr) 10px var(--cg-out-w); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.cg-stage-wrap.cg-out-closed .cg-body { grid-template-columns: minmax(0, 1fr) 0 0; }
/* 群聊模式下隐藏旧「平铺」按钮；打开右侧网页/产出栏时，顶栏模式胶囊自适应居中到对话窗正上方，右侧网页顶到最上方 */
#boardBtn { display: none !important; }
body.cg-web-open header.top { padding-right: calc(var(--cg-out-w, 46%) + 14px); transition: padding-right .15s ease; }
body.cg-web-open header.top .top-mode-wrap { left: calc((100% - var(--cg-out-w, 46%)) / 2) !important; transform: translateX(-50%) !important; transition: left .15s ease; }
body.cg-web-open .main.collab.cg-chat,
body.cg-web-open .main.collab.cg-chat > .stage,
body.cg-web-open .cg-stage-wrap { overflow: visible !important; }
.cg-stage-wrap:not(.cg-out-closed) .cg-chathead { justify-content: flex-start; padding-left: 24px; padding-right: 16px; }
.cg-stage-wrap:not(.cg-out-closed) .cg-body { overflow: visible; }
.cg-stage-wrap:not(.cg-out-closed) .cg-out-panel { position: relative; z-index: 45; margin-top: -54px; height: calc(100% + 54px); border-top: none; border-radius: 0; }
.cg-maincol { grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.cg-out-panel { min-height: 0; height: 100%; }

/* 右键菜单：放大、上移，别贴屏幕底；外部 Agent 隐藏引擎与模型切换，保留性格预设 */
.cg-brainmenu { width: 280px; }
.cg-brainmenu.cg-bm-ext .cg-bm-s:not(.cg-bm-trait-s),
.cg-brainmenu.cg-bm-ext .cg-bm-engs,
.cg-brainmenu.cg-bm-ext .cg-bm-mods { display: none; }
.cg-brainmenu .cg-bm-h { font-size: 12px; font-weight: 800; padding: 3px 4px 9px; }
.cg-brainmenu { position: fixed; z-index: 2200; width: 216px; background: var(--card); border-radius: 16px; padding: 8px; box-shadow: 0 12px 36px rgba(20, 28, 50, .18); border: 1px solid rgba(15, 23, 42, .06); }
.cg-brainmenu .cg-bm-h { font-size: 11px; font-weight: 700; color: var(--ink3); padding: 4px 8px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-brainmenu .cg-bm-edit { font-size: 12.5px; font-weight: 600; color: var(--ink); background: transparent; padding: 8px 10px; border-radius: 10px; cursor: pointer; margin-bottom: 2px; transition: background .12s; }
.cg-brainmenu .cg-bm-edit:hover { background: var(--bg); color: var(--acc); }
.cg-brainmenu .cg-bm-mention { background: var(--acc-l); color: var(--acc); font-weight: 700; margin-bottom: 4px; }
.cg-brainmenu .cg-bm-mention:hover { background: var(--acc); color: var(--acc-ink, #fff); }
.cg-me-modal { width: min(460px, 92vw); max-height: 86vh; overflow-y: auto; }
.cg-me-field { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.cg-me-field label { font-size: 12px; font-weight: 700; color: var(--ink2); }
.cg-me-field input, .cg-me-field select, .cg-me-field textarea { width: 100%; border: 1px solid var(--line, #e2e5ea); background: var(--bg); color: var(--ink); border-radius: 11px; padding: 8px 11px; font-size: 13px; outline: none; }
.cg-me-field input:focus, .cg-me-field select:focus, .cg-me-field textarea:focus { border-color: var(--acc); background: var(--card); }
.cg-me-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cg-me-modrow { display: flex; align-items: center; gap: 6px; }
.cg-me-modrow select { flex: 1; min-width: 0; }
.cg-me-modhint { font-size: 11px; color: var(--ink3); line-height: 1.4; min-height: 15px; }
.cg-me-ava-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg); border-radius: 12px; }
.cg-me-ava-row .av { width: 44px; height: 44px; border-radius: 13px; flex: none; }
.cg-me-avalbl { font-size: 12px; color: var(--ink2); flex: 1; min-width: 0; }
.cg-me-avagrid { margin-top: 8px; padding: 10px; background: var(--bg); border-radius: 16px; display: flex; flex-direction: column; gap: 12px; }
.cg-me-grp { display: flex; flex-direction: column; gap: 7px; }
.cg-me-gt { font-size: 11px; font-weight: 600; color: var(--ink3); letter-spacing: .04em; }
.cg-me-colors { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cg-me-ctip { font-style: normal; font-size: 11px; color: var(--ink3); margin-left: auto; }
.cg-me-col { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.cg-me-col.on { border-color: var(--ink); transform: scale(1.12); }
.cg-me-faces { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cg-me-face { display: grid; place-items: center; padding: 5px; border-radius: 10px; background: var(--card); border: 1.5px solid transparent; cursor: pointer; }
.cg-me-face:hover { border-color: var(--line-deep, #cbd0d8); }
.cg-me-face.on { border-color: var(--acc); background: var(--acc-l); }
.cg-me-up { gap: 2px; color: var(--ink2); }
.cg-me-up svg { display: block; }
.cg-me-up em { font-style: normal; font-size: 10px; line-height: 1; }
.cg-me-up:hover { background: var(--acc-l); color: var(--acc); border-color: transparent; }
.cg-me-up:disabled { opacity: .45; cursor: wait; }
.cg-me-mine { padding: 3px; overflow: hidden; }
.cg-me-mine img { width: 100%; height: 100%; border-radius: 8px; object-fit: cover; display: block; }
.cg-me-traits { display: flex; flex-wrap: wrap; gap: 6px; }
.cg-me-trait { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--bg); color: var(--ink2); cursor: pointer; border: 1px solid transparent; }
.cg-me-trait:hover { border-color: var(--line-deep, #cbd0d8); }
.cg-me-trait.on { background: var(--acc-l); color: var(--acc); font-weight: 700; border-color: var(--acc); }
.cg-me-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.cg-me-kick { font-size: 12px; font-weight: 600; color: var(--warn); background: transparent; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.cg-me-kick:hover { background: rgba(192, 57, 43, .08); }
.cg-inv-hero { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.cg-inv-code-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.cg-inv-lbl { font-size: 12px; color: var(--ink3); }
.cg-inv-val { font-size: 16px; letter-spacing: .04em; color: var(--ink); font-family: ui-monospace, Consolas, monospace; }
.cg-inv-exp { font-size: 11px; color: var(--ink3); margin-left: auto; }
.cg-inv-mainbtn { width: 100%; padding: 11px 14px; border-radius: 12px; background: var(--acc); color: var(--acc-ink, #fff); font-size: 13.5px; font-weight: 700; cursor: pointer; text-align: center; transition: filter .15s; }
.cg-inv-mainbtn:hover { filter: brightness(1.06); }
.cg-inv-hint { font-size: 12px; color: var(--ink3); line-height: 1.5; }
.cg-inv-adv { margin-top: 12px; border-top: 1px solid var(--line, #e6e8ec); padding-top: 10px; }
.cg-inv-adv summary { font-size: 12px; color: var(--ink3); cursor: pointer; user-select: none; list-style: none; }
.cg-inv-adv summary::-webkit-details-marker { display: none; }
.cg-inv-adv summary::before { content: '▸ '; }
.cg-inv-adv[open] summary::before { content: '▾ '; }
.cg-inv-adv-body { margin-top: 6px; }
.cg-status-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-left: auto; background: #475569; }
.cg-status-dot.online { background: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, .22); }
.cg-status-dot.offline { background: #475569; }
.cg-status-dot.expired { background: #ef4444; box-shadow: 0 0 0 2px rgba(239, 68, 68, .20); }
.av.cg-av-logo { display: inline-flex; align-items: center; justify-content: center; background: #fff !important; padding: 4px; box-sizing: border-box; border: 1px solid rgba(15, 23, 42, 0.08); overflow: hidden; }
.av.cg-av-logo .cg-elogo { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 4px; }
.av.cg-av-logo svg { width: 78%; height: 78%; color: var(--ink); }
.cg-sp-g .gavs.group .av.cg-av-logo { padding: 1.5px; border: 0; }
.cg-chip .av.cg-av-logo, .cg-dm-strip .av.cg-av-logo { padding: 2px; }
.cg-msg.sys .av.cg-av-sys { width: 24px; height: 24px; border-radius: 8px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--soft, #f0f2f5); color: var(--ink3); font-size: 12px; font-weight: 700; box-shadow: none; }
/* 系统短句（如「已移出群聊」）不带头像，干净一行 */
.cg-msg.sys > .av.cg-av-sys { display: none; }
.cg-ava-reset { margin-left: auto; font-size: 11px; color: var(--ink3); background: var(--soft, #f2f3f5); border-radius: 8px; padding: 4px 8px; cursor: pointer; flex: none; }
.cg-ava-reset:hover { color: var(--acc); background: var(--acc-l); }
.cg-brainmenu .cg-bm-s { font-size: 9.5px; color: var(--ink3); font-weight: 800; letter-spacing: 1px; padding: 7px 4px 5px; text-transform: uppercase; }
.cg-bm-engs, .cg-bm-mods { display: flex; flex-direction: column; gap: 2px; max-height: 168px; overflow-y: auto; }
.cg-bm-opt { font-size: 11.5px; font-weight: 600; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.cg-bm-opt:hover { background: var(--bg); }
.cg-bm-opt.on { background: var(--acc-l); color: var(--acc); font-weight: 800; }

.cg-toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--card); border-radius: 999px; padding: 10px 20px; font-size: 12.5px; opacity: 0; transition: .25s; z-index: 3000; pointer-events: none; }
.cg-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.cg-addmenu .cg-opt { margin: 0; }
.cg-root, .cg-top, .cg-top .cg-title, .cg-top .cg-spacer, .cg-root-legacy-btn { display: none; }

/* 头像点击私聊与左侧会话私聊标识 */
.cg-msg .av[data-cg-dm] { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.cg-msg .av[data-cg-dm]:hover { transform: scale(1.08); box-shadow: 0 0 0 2px var(--acc); }
.cg-chathead .avatars .av[data-cg-dm] { cursor: pointer; transition: transform .15s ease; }
.cg-chathead .avatars .av[data-cg-dm]:hover { transform: scale(1.1); box-shadow: 0 0 0 2px var(--acc); }
.cg-sp-g .cg-dm-badge { flex: none; font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--acc-l); color: var(--acc); }

/* 一对一私聊顶部提示条与单引擎态简化 */
.cg-dm-strip {
  width: 100%; max-width: var(--content-w, 920px); margin: 10px auto 0;
  padding: 9px 14px; border-radius: 14px; background: var(--card);
  display: flex; align-items: center; gap: 9px; box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(24,34,60,.05);
}
.cg-dm-strip[hidden] { display: none; }
.cg-dm-strip .av { width: 24px; height: 24px; border-radius: 8px; flex: none; }
.cg-dm-strip .nm { font-size: 13px; font-weight: 800; color: var(--ink); }
.cg-dm-strip .meta { font-size: 11px; color: var(--ink3); font-weight: 600; }
.cg-dm-strip .tip { margin-left: 4px; font-size: 11px; color: var(--ink2); padding: 2px 8px; border-radius: 999px; background: var(--bg); }
.cg-dm-strip .sp { flex: 1; }
.cg-dm-back { font-size: 11.5px; font-weight: 700; color: var(--acc); background: var(--acc-l); border-radius: 999px; padding: 5px 12px; cursor: pointer; flex: none; }
.cg-dm-back:hover { filter: brightness(.97); }
.cg-stage-wrap.cg-mode-dm .cg-cand,
.cg-stage-wrap.cg-mode-dm #cgModeBtn,
.cg-stage-wrap.cg-mode-dm .cg-crew-add { display: none !important; }
.cg-stage-wrap.cg-mode-dm .cg-msgs { padding-top: 14px; }
.cg-stage-wrap.cg-mode-dm .cg-msg:not(.me):not(.sys) { max-width: min(780px, calc(100% - 12px)); }

/* 思考过程与工作步骤轨迹 —— 和单引擎主聊 think-box 一个观感：
   收起态就是一行灰字 + 圆头下箭头，常驻可见；点开看正文，箭头翻转。不描边不投影，靠底色差。 */
.cg-live-trace { margin-bottom: 6px; display: flex; flex-direction: column; gap: 6px; }
.cg-think-box, .cg-steps-box {
  background: rgba(120,130,150,.08);
  border: 0;
  border-radius: 13px;
  padding: 6px 12px;
  margin: 0 0 8px;
  font-size: 12px;
}
.cg-live-trace .cg-think-box, .cg-live-trace .cg-steps-box { margin-bottom: 0; }
.cg-think-box summary, .cg-steps-box summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; font-weight: 500; color: var(--ink3); user-select: none;
}
.cg-think-box summary::-webkit-details-marker,
.cg-steps-box summary::-webkit-details-marker { display: none; }
.cg-think-badge { display: inline-flex; align-items: center; gap: 7px; }
.cg-think-arr { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; opacity: .7; }
.cg-think-box[open] .cg-think-arr, .cg-steps-box[open] .cg-think-arr { transform: rotate(180deg); }
.cg-think-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--acc); flex: none;
  box-shadow: 0 0 0 3px var(--acc-l); animation: cgPulse 1.3s ease-in-out infinite;
}
.cg-think-dot.done { animation: none; background: var(--ink3); box-shadow: none; }
@keyframes cgPulse { 0%, 100% { opacity: .45; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.15); } }
.cg-think-live { background: color-mix(in srgb, var(--bg) 78%, var(--card)); }
.cg-think-body {
  margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(120,130,150,.14);
  font-size: 11.5px; line-height: 1.65; color: var(--ink2); white-space: pre-wrap;
  word-break: break-word; max-height: 240px; overflow-y: auto;
}
.cg-steps-list { margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(120,130,150,.14); display: flex; flex-direction: column; gap: 4px; }
.cg-step-row { display: flex; align-items: baseline; gap: 7px; font-size: 11.5px; line-height: 1.45; }
.cg-step-st { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; flex: none; background: var(--acc-l); color: var(--acc); }
.cg-step-st.ok { background: rgba(16,185,129,.14); color: #047857; }
.cg-step-st.err { background: rgba(220,38,38,.12); color: #b91c1c; }
.cg-step-lbl { font-weight: 700; color: var(--ink); word-break: break-word; }
.cg-step-brief { color: var(--ink3); font-size: 11px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-step-ms { font-size: 10.5px; color: var(--ink3); margin-left: auto; flex: none; }
.cg-todo-list { margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(120,130,150,.14); display: flex; flex-direction: column; gap: 3px; }
.cg-todo-item { font-size: 11px; color: var(--ink2); display: flex; align-items: center; gap: 6px; }
.cg-todo-item.done { color: var(--ink3); text-decoration: line-through; }

/* 成员性格预设胶囊与输入框思考/人格开关 */
.cg-trait-tag { font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: rgba(217,119,87,.12); color: #b45309; margin-left: 5px; vertical-align: middle; }
.cg-vibe-btn { margin-left: 4px; }
.cg-vibe-btn.is-focus { background: rgba(120,130,150,.12); color: var(--ink2); }
.cg-vibe-btn.is-lively { background: rgba(217,119,87,.14); color: #b45309; }
.cg-bm-traits { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 0 4px; }
.cg-bm-trait { font-size: 10.5px; font-weight: 600; padding: 4px 8px; border-radius: 999px; background: var(--bg); color: var(--ink2); cursor: pointer; }
.cg-bm-trait:hover { background: var(--acc-l); color: var(--acc); }
.cg-bm-trait.on { background: var(--acc-l); color: var(--acc); font-weight: 800; }

/* 中途拉人交接卡、私聊升群与全盘交接包预览 */
.cg-dm-promote {
  font-size: 11.5px; font-weight: 700; color: var(--card); background: var(--acc);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; flex: none;
}
.cg-dm-promote:hover { filter: brightness(.95); }
.cg-msg.sys.cg-msg-ho { max-width: min(680px, 100%); margin: 10px auto; justify-content: center; }
.cg-ho-card {
  width: 100%; box-sizing: border-box;
  background: var(--card); border: 1px solid var(--cg-dash); border-radius: 16px;
  padding: 12px 15px; box-shadow: 0 2px 12px rgba(24,34,60,.05); text-align: left;
}
.cg-ho-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cg-ho-tag {
  font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  background: var(--acc-l); color: var(--acc); flex: none;
}
.cg-ho-title { font-size: 12.5px; color: var(--ink); font-weight: 700; }
.cg-ho-meta { font-size: 11.5px; color: var(--ink2); margin-top: 5px; }
.cg-ho-pv {
  margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--bg);
  display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; line-height: 1.45;
}
.cg-ho-pv-row { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-ho-pv-row b { color: var(--ink); font-weight: 700; }
.cg-ho-acts { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.cg-ho-btn {
  font-size: 11.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  background: var(--bg); color: var(--ink2); cursor: pointer; border: 1px solid var(--cg-dash);
}
.cg-ho-btn:hover { color: var(--ink); border-color: var(--acc); }
.cg-ho-btn.pri { background: var(--acc); color: var(--card); border-color: var(--acc); }
.cg-ho-btn.pri:hover { filter: brightness(.95); }
.cg-ho-btn.done { background: var(--acc-l); color: var(--acc); border-color: transparent; }

.cg-ho-modal { width: min(680px, 94vw); max-height: 84vh; display: flex; flex-direction: column; }
.cg-ho-body { overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding-right: 4px; }
.cg-ho-sec-t { font-size: 12px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.cg-ho-plan { border: 1px solid var(--cg-dash); border-radius: 12px; padding: 10px 12px; background: var(--bg); margin-bottom: 8px; }
.cg-ho-plan-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; margin-bottom: 6px; }
.cg-ho-plan-h span { color: var(--ink3); font-size: 11px; }
.cg-ho-pre {
  margin: 0; font-family: inherit; font-size: 11.5px; line-height: 1.55; color: var(--ink2);
  white-space: pre-wrap; word-break: break-word; max-height: 210px; overflow-y: auto;
}
.cg-ho-chat {
  background: var(--bg); border: 1px solid var(--cg-dash); border-radius: 12px;
  padding: 10px 12px; max-height: 260px;
}
.cg-ho-empty { font-size: 12px; color: var(--ink3); padding: 8px 2px; }

.cg-pr-opt { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink2); margin-bottom: 10px; }
.cg-pr-opt select {
  font-size: 12px; padding: 4px 10px; border-radius: 10px; background: var(--bg);
  color: var(--ink); border: 1px solid var(--cg-dash); font-family: inherit;
}
.cg-pr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 8px; max-height: 44vh; overflow-y: auto; padding: 2px; }
.cg-pr-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px;
  background: var(--bg); border: 1px solid transparent; cursor: pointer; font-size: 12px;
}
.cg-pr-item:hover { border-color: var(--cg-dash); }
.cg-pr-item.same { opacity: .82; }
.cg-pr-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.cg-pr-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--card); color: var(--ink3); }
.cg-pr-tag.ext { background: var(--acc-l); color: var(--acc); }
.cg-pr-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; align-items: center; }
.cg-pr-acts .cg-close { margin-top: 0; }

.cg-imp-list { overflow-y: auto; max-height: 50vh; display: flex; flex-direction: column; gap: 8px; }
.cg-imp-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--cg-dash);
}
.cg-imp-info { flex: 1; min-width: 0; }
.cg-imp-info b { display: block; font-size: 12.5px; color: var(--ink); }
.cg-imp-info span { display: block; font-size: 11px; color: var(--ink3); margin-top: 2px; }
.cg-imp-info p { margin: 4px 0 0; font-size: 11.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- WorkBuddy 上下文仪表盘 & 手动提炼压缩 ---------- */
.cg-ctx-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 9px 0 6px; margin-right: 4px;
  border-radius: 999px; border: 1px solid #e2e8f0;
  background: #f8fafc; color: #334155; font-size: 11.5px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.cg-ctx-btn:hover, .cg-ctx-btn.open { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.cg-ctx-btn.warn { background: #fffbeb; border-color: #fcd34d; color: #b45309; }
.cg-ctx-btn.danger { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }
.cg-ctx-ring { display: block; flex-shrink: 0; }
.cg-ctx-btn-txt { font-variant-numeric: tabular-nums; line-height: 1; }
.cg-ctx-zip {
  font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 999px;
  background: #dcfce7; color: #15803d; line-height: 1.25;
}
.cg-ctx-zip.hidden { display: none; }

.cg-ctxpop {
  position: fixed; z-index: 1200; width: 320px; max-width: calc(100vw - 24px);
  background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .05);
  padding: 14px 16px; color: #0f172a;
}
.cg-ctxpop.cg-hidden { display: none; }
.cg-ctxpop-hd {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 600; color: #475569; margin-bottom: 6px;
}
.cg-ctxpop-x {
  border: none; background: transparent; color: #64748b;
  font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; cursor: pointer;
}
.cg-ctxpop-x:hover { background: #f1f5f9; color: #0f172a; }
.cg-ctxpop-big { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; }
.cg-ctxpop-big strong { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; color: #0f172a; font-variant-numeric: tabular-nums; }
.cg-ctxpop-big span { font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; }
.cg-ctx-saved-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 11px; color: #15803d; background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px; padding: 5px 8px; margin-bottom: 10px;
}
.cg-ctx-saved-pill.paused { color: #64748b; background: #f8fafc; border-color: #e2e8f0; }

.cg-ctx-segbar {
  height: 7px; border-radius: 999px; background: #e5e7eb;
  display: flex; align-items: stretch; overflow: hidden; gap: 1.5px; margin-bottom: 12px;
}
.cg-ctx-seg { height: 100%; border-radius: 2px; transition: width .2s ease; flex-shrink: 0; }
.cg-ctx-rows { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.cg-ctx-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #334155; }
.cg-ctx-rl { display: flex; align-items: center; gap: 8px; }
.cg-ctx-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cg-ctx-rv { font-variant-numeric: tabular-nums; color: #475569; font-weight: 500; }
.cg-ctx-rv small { color: #94a3b8; font-weight: 400; margin-left: 3px; }

.cg-ctx-divider { height: 1px; background: #e2e8f0; margin: 11px 0; }
.cg-ctx-tier-title { text-align: center; font-size: 12.5px; font-weight: 600; color: #1e293b; margin-bottom: 8px; }
.cg-ctx-slider-wrap { position: relative; padding: 2px 0 4px; }
.cg-ctx-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1677ff var(--fill, 50%), #e2e8f0 var(--fill, 50%));
  outline: none; cursor: pointer; padding: 0 2px; box-sizing: border-box;
}
.cg-ctx-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%; background: #ffffff;
  border: 1px solid rgba(15, 23, 42, .12);
  box-shadow: 0 2px 6px rgba(15, 23, 42, .22); cursor: pointer;
}
.cg-ctx-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #ffffff;
  border: 1px solid rgba(15, 23, 42, .12);
  box-shadow: 0 2px 6px rgba(15, 23, 42, .22); cursor: pointer;
}
.cg-ctx-stops { display: flex; justify-content: space-between; font-size: 10.5px; color: #94a3b8; margin-top: 4px; padding: 0 2px; }

.cg-ctx-actions { display: flex; flex-direction: column; gap: 7px; }
.cg-ctx-actbtn {
  width: 100%; height: 34px; border-radius: 9px; border: none;
  background: #2563eb; color: #ffffff; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.cg-ctx-actbtn:hover { background: #1d4ed8; }
.cg-ctx-actrow { display: flex; gap: 6px; }
.cg-ctx-actrow button {
  flex: 1; height: 30px; border-radius: 8px; border: 1px solid #cbd5e1;
  background: #f8fafc; color: #334155; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.cg-ctx-actrow button:hover { background: #f1f5f9; }
.cg-ctx-actrow button.pri { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
.cg-ctx-acthint { font-size: 11px; color: #64748b; line-height: 1.45; text-align: center; }

.cg-msg-distill { margin: 8px 0; max-width: 100%; width: 100%; }
.cg-distill-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
  border: 1px solid #bae6fd; border-radius: 12px; padding: 11px 14px;
  font-size: 12.5px; color: #0f172a;
}
.cg-distill-card.paused { background: #f8fafc; border-color: #e2e8f0; color: #64748b; }
.cg-distill-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 5px; }
.cg-distill-badge {
  font-size: 11px; font-weight: 700; color: #0369a1; background: #e0f2fe;
  padding: 2px 8px; border-radius: 999px;
}
.cg-distill-title { font-weight: 700; color: #0f172a; font-size: 13px; }
.cg-distill-stat {
  font-size: 11px; font-weight: 600; color: #15803d; background: #dcfce7;
  padding: 2px 8px; border-radius: 999px; margin-left: auto;
}
.cg-distill-card.paused .cg-distill-stat { background: #e2e8f0; color: #475569; }
.cg-distill-meta { font-size: 11.5px; color: #475569; margin-bottom: 6px; }
.cg-distill-details summary { cursor: pointer; font-size: 11.5px; font-weight: 600; color: #2563eb; user-select: none; }
.cg-distill-md {
  margin-top: 7px; padding: 9px 11px; background: #ffffff;
  border: 1px solid #e2e8f0; border-radius: 8px; font-size: 12px;
  line-height: 1.55; max-height: 220px; overflow-y: auto; white-space: pre-wrap; color: #1e293b;
}
.cg-distill-foot { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }
.cg-distill-foot button {
  height: 27px; padding: 0 11px; border-radius: 7px; border: 1px solid #cbd5e1;
  background: #ffffff; color: #334155; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.cg-distill-foot button:hover { background: #f1f5f9; }
.cg-distill-foot button.pri { border-color: #2563eb; color: #1d4ed8; background: #eff6ff; }

.cg-distill-modal { width: min(640px, 94vw) !important; max-height: 88vh; display: flex; flex-direction: column; }
.cg-distill-grans { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.cg-dgran-btn {
  height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid #cbd5e1;
  background: #f8fafc; color: #334155; font-size: 12px; font-weight: 600; cursor: pointer;
}
.cg-dgran-btn.on { background: #2563eb; border-color: #2563eb; color: #ffffff; }
.cg-dgran-custom {
  width: 88px; height: 30px; border-radius: 8px; border: 1px solid #cbd5e1;
  padding: 0 8px; font-size: 12px; box-sizing: border-box;
}
.cg-distill-statsbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: #334155; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 8px 11px; margin-bottom: 10px;
}
.cg-distill-ta {
  width: 100%; min-height: 210px; max-height: 340px; resize: vertical;
  border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.55; color: #0f172a; box-sizing: border-box;
}
.cg-distill-checks { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 12px; color: #334155; }
.cg-distill-checks label { display: flex; align-items: center; gap: 7px; cursor: pointer; }

/* ====== 隐藏多引擎/单引擎右侧原生滚动条，改用 WorkBuddy 同款消息目录导航 ====== */
.cg-msgs, #msgs {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.cg-msgs::-webkit-scrollbar, #msgs::-webkit-scrollbar {
  display: none !important;
}
.wb-msg-nav {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 12px;
  max-height: 68vh;
  overflow-y: auto;
  scrollbar-width: none;
  transition: background 0.2s, box-shadow 0.2s, padding 0.2s;
}
.wb-msg-nav::-webkit-scrollbar { display: none; }
.wb-msg-nav:hover {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 10px 12px;
}
.wb-msg-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #666;
  font-size: 12px;
  line-height: 1.4;
}
.wb-msg-nav-item:hover { color: #111; }
.wb-msg-nav-txt {
  display: none;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.wb-msg-nav:hover .wb-msg-nav-txt {
  display: inline-block;
}
.wb-msg-nav-bar {
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.18);
  transition: width 0.15s, background 0.15s;
  flex-shrink: 0;
}
.wb-msg-nav-item.on .wb-msg-nav-bar,
.wb-msg-nav-item:hover .wb-msg-nav-bar {
  width: 16px;
  background: #111;
}
