/* ── Kairos chat — DSH 对齐层（2026-10-20）──────────────────────────
   只做布局/视觉对齐，不改功能：会话标题条、底部状态栏、左栏宽度、
   消息气泡、composer 尺寸。全部带 .kc-kosmos-shell 前缀，仅本页生效。
   回退方式：删除 kairos/chat/index.html（及 zh）里对本文件的 <link>。
   安全边界：不覆盖 #kcThread 的渲染宿主规则、不动虚拟化、不动 SSE。
   圆角与字体遵循 2026-10-20 chat-unify 统一层（composer 8px），不在此覆盖。 */

/* 单列左栏：285px（与登录态一致，去掉 64px 图标栏）；移动端保持单列抽屉。
   旧 localStorage 里的 kc-rail-collapsed / kc-sidebar-collapsed 会带来 0 0 1fr
   的三列规则，这里用 !important 让单列在任何折叠态下都成立。 */
@media (min-width:721px){
  .kc-kosmos-shell{grid-template-columns:280px 1fr !important}
}
@media (max-width:720px){
  .kc-kosmos-shell{grid-template-columns:1fr !important}
}
.kc-kosmos-shell>.kc-history{grid-column:1}
.kc-kosmos-shell>.kc-main{grid-column:2}
/* 单列后没有独立的“展开”入口；旧折叠态不再隐藏左栏，避免无法恢复 */
.kc-kosmos-shell.kc-sidebar-collapsed .kc-history{display:flex !important}
.kc-kosmos-shell .kc-iconrail,
.kc-kosmos-shell .kc-rail-restore{display:none !important}

/* 左栏底部一行：账户 + Docs / Support / Files / Settings（菜单触发器）。
   原来是 64px 图标栏里的内容，2026-10-20 移到面板内。 */
.kc-kosmos-shell .kc-history-foot{display:flex;align-items:center;gap:2px;flex:none;
  padding:6px 8px;border-top:1px solid var(--sidebar-border,#e4e4e7);position:relative}
.kc-kosmos-shell .kc-history-foot .kc-account-chip{display:flex;align-items:center;gap:8px;
  flex:1;min-width:0;height:34px;padding:0 8px;margin:0;border:0;border-radius:8px;
  background:transparent;cursor:pointer;text-align:left;font-family:inherit}
.kc-kosmos-shell .kc-history-foot .kc-account-chip:hover{background:rgba(var(--black-rgb),.04)}
.kc-kosmos-shell .kc-history-foot .kc-acct-lines{display:flex;flex-direction:column;
  align-items:flex-start;line-height:1.15;min-width:0}
.kc-kosmos-shell .kc-history-foot .kc-rail-btn{width:30px;height:30px;min-width:30px;
  display:flex;align-items:center;justify-content:center;border:0;border-radius:8px;
  background:transparent;color:var(--gray-5,#6b7280);cursor:pointer}
.kc-kosmos-shell .kc-history-foot .kc-rail-btn:hover{background:rgba(var(--black-rgb),.05);color:var(--ink)}
/* 菜单改为从底栏向上弹出（原先是 rail 右侧） */
.kc-kosmos-shell .kc-history-foot .kc-rail-menu{position:absolute;left:8px;right:auto;
  bottom:calc(100% + 6px);width:210px}

/* ── 会话标题条（DSH 顶栏的对应物；空态隐藏）────────────────── */
.kc-kosmos-shell .kc-chat-head{display:flex;align-items:center;gap:8px;flex:none;
  height:46px;padding:0 20px;border-bottom:1px solid var(--gray-2,#e4e4e7);
  background:var(--paper,#fff)}
.kc-kosmos-shell .kc-chat-head[hidden]{display:none}
.kc-kosmos-shell .kc-chat-head-title{font-size:14px;font-weight:600;line-height:20px;
  color:var(--ink,#0f172a);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  min-width:0;flex:0 1 auto}
.kc-kosmos-shell .kc-chat-head-meta{font-size:12px;line-height:18px;color:var(--gray-5,#6e6e80);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1 1 auto}
.kc-kosmos-shell .kc-chat-head-meta:empty{display:none}

/* ── 消息节奏：间隔 24px；用户消息改为 DSH 的浅色气泡 ───────────── */
.kc-kosmos-shell .kc-msg{margin-bottom:20px}
/* 主题表给 .kc-msg 强加了白底（!important）；去掉卡片底，让消息落在工作区上 */
html:not([data-theme="dark"]) .kc-kosmos-shell .kc-msg{background-color:transparent !important}
html:not([data-theme="dark"]) .kc-kosmos-shell .kc-msg-docbody{background-color:transparent !important}
.kc-kosmos-shell .kc-msg-user{margin:4px auto 20px auto;display:flex;flex-direction:column;align-items:flex-end}
.kc-kosmos-shell .kc-msg-user .kc-msg-body{max-width:min(34rem,100%);margin:0;
  padding:10px 14px;border:1px solid rgba(var(--brand-rgb),.14);border-radius:14px;
  background:rgba(var(--brand-rgb),.06);color:var(--ink,#0f172a);
  font-size:14px;line-height:22px;text-align:left;white-space:pre-wrap;word-break:break-word}
[data-theme="dark"] .kc-kosmos-shell .kc-msg-user .kc-msg-body{
  border-color:rgba(var(--brand-rgb),.22);background:rgba(var(--brand-rgb),.12);color:var(--ink,#ececf1)}

/* ── 输入区：尺寸与两行结构对齐 DSH（圆角交给统一层）────────────── */
.kc-kosmos-shell .kc-composer{width:calc(100% - 80px);max-width:770px;margin:0 auto 6px;
  padding:8px 12px 7px;border:1px solid var(--gray-2,#e4e4e7);row-gap:4px;border-radius:12px;
  background:var(--paper,#fff);box-shadow:0 1px 2px rgba(var(--black-rgb),.05)}
.kc-kosmos-shell .kc-composer:focus-within{border-color:var(--gray-3,#cbd5e1);
  box-shadow:0 1px 2px rgba(var(--black-rgb),.05),0 0 0 3px rgba(var(--brand-rgb),.10)}
.kc-kosmos-shell .kc-composer-input{font-size:14.5px;line-height:20px;padding:2px 0 4px;min-height:24px}
.kc-kosmos-shell .kc-composer-input:focus,
.kc-kosmos-shell .kc-composer-input:focus-visible{outline:none !important}
.kc-kosmos-shell .kc-addfiles{height:28px;border-radius:7px;font-size:12.5px;padding:0 8px;gap:5px}
.kc-kosmos-shell .kc-composer-send{min-width:32px;height:32px;border:1px solid var(--brand,#1D4ED8);
  border-radius:8px;background:var(--brand,#1D4ED8);color:#fff;font-size:15px;
  transition:background .15s,border-color .15s}
.kc-kosmos-shell .kc-composer-send:not(:disabled):hover{background:var(--brand-strong,#1E40AF);
  border-color:var(--brand-strong,#1E40AF)}
[data-theme="dark"] .kc-kosmos-shell .kc-composer-send{color:#0D1117}
[data-theme="dark"] .kc-kosmos-shell .kc-composer-send:not(:disabled):hover{background:var(--brand-strong,#93C5FD);
  border-color:var(--brand-strong,#93C5FD)}
.kc-kosmos-shell .kc-composer-send:disabled{background:var(--gray-2,#e4e4e7);border-color:var(--gray-2,#e4e4e7);
  color:var(--gray-4,#94a3b8);opacity:1}
.kc-kosmos-shell .kc-fast-label{font-size:12px;margin-left:4px}

/* ── 底部状态栏（只用已有数据：轮次/步数/耗时/用量）─────────────── */
.kc-kosmos-shell .kc-statusbar{display:flex;align-items:center;justify-content:center;
  gap:8px;flex:none;min-height:28px;padding:4px 16px 10px;font-family:var(--font-mono);
  font-size:11.5px;line-height:17px;color:var(--gray-5,#6e6e80);white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
.kc-kosmos-shell .kc-statusbar[hidden]{display:none}
.kc-kosmos-shell .kc-statusbar span:empty{display:none}

/* ── 图标栏精简：只留 Docs / Support / Files / Settings（去掉两个营销入口）── */
.kc-kosmos-shell .kc-iconrail #kcPlaygroundBtn,
.kc-kosmos-shell .kc-iconrail a[href="/kairos/"]{display:none}
.kc-kosmos-shell .kc-iconrail .kc-rail-spacer{flex:1}

/* ── 会话列表：紧凑行、去掉常驻状态点、活跃项用中性底 ─────────── */
.kc-kosmos-shell .kc-history-head{padding:10px 12px 0}
.kc-kosmos-shell .kc-hh-title{font-size:13px;font-weight:600}
.kc-kosmos-shell .kc-history-search{height:32px;margin:8px 12px 2px;
  font-family:var(--font-sans);font-size:13px}
.kc-kosmos-shell .kc-history-list{padding:6px 8px}
.kc-kosmos-shell .kc-task-item{padding:8px 10px;font-size:13px;line-height:18px;
  margin-bottom:1px;border-radius:6px}
.kc-kosmos-shell .kc-task-title{font-weight:500}
.kc-kosmos-shell .kc-task-item .kc-task-dot{display:none}
.kc-kosmos-shell .kc-task-item.kc-h-run .kc-task-dot,
.kc-kosmos-shell .kc-task-item.kc-h-err .kc-task-dot{display:inline-block}
.kc-kosmos-shell .kc-task-row.kc-task-active .kc-task-item{background:rgba(var(--ink-rgb),.055);color:var(--ink)}

/* 菜单内的外链项与按钮同形 */
.kc-kosmos-shell a.kc-rail-menu-item{text-decoration:none}

/* ── 第二轮（2026-10-20）：列表分组 / composer 克制化 / 时间戳弱化 ── */
.kc-kosmos-shell .kc-task-group-t{font-size:11px;line-height:16px;font-weight:500;
  color:var(--gray-5,#8e8ea0);padding:10px 10px 4px;letter-spacing:.01em}
.kc-kosmos-shell .kc-task-group-t:first-child{padding-top:2px}
/* 字数计数器：空输入时隐藏，输入后才出现 */
.kc-kosmos-shell .kc-compose-count.kc-compose-count-idle{display:none}
/* composer：Add image / Fast 只留图标，说明进 title tooltip */
.kc-kosmos-shell .kc-addfiles > span:not(.kc-rail-label){display:none}
.kc-kosmos-shell .kc-fast-label{display:none}
/* 计数隐藏后重排工具行：+ 靠左，⚡ 与发送一起靠右（不再被 auto margin 挤到中间） */
.kc-kosmos-shell .kc-composer #kcImageBtn{margin-right:0}
.kc-kosmos-shell .kc-composer #kcFastMode{margin-left:auto}
.kc-kosmos-shell .kc-composer #kcComposeSend{margin-left:6px}
/* AI 消息时间戳：默认不抢注意力，hover 时显示 */
.kc-kosmos-shell .kc-msg-ai-label .kc-msg-ts{opacity:0;transition:opacity .12s ease}
.kc-kosmos-shell .kc-msg-ai:hover .kc-msg-ai-label .kc-msg-ts{opacity:1}

/* 报告底部：导出/分享/任务详情收进 ⋯，↻ 留在行内。
   展开内容用行内按钮组（不进 absolute 弹层）——thread 是滚动容器，弹层会被它裁剪。 */
.kc-kosmos-shell .kc-report-more{display:inline-flex;vertical-align:middle;margin-left:2px}
.kc-kosmos-shell .kc-report-more>summary{list-style:none;display:inline-flex;align-items:center;
  justify-content:center;width:24px;height:22px;border-radius:6px;cursor:pointer;
  color:var(--gray-5,#8e8ea0);font-size:14px;line-height:1}
.kc-kosmos-shell .kc-report-more>summary::-webkit-details-marker{display:none}
.kc-kosmos-shell .kc-report-more>summary:hover,
.kc-kosmos-shell .kc-report-more[open]>summary{background:rgba(var(--black-rgb),.05);color:var(--ink)}
.kc-kosmos-shell .kc-report-more-body{display:inline-flex;flex-wrap:wrap;align-items:center;gap:2px;
  margin-left:4px;vertical-align:middle}

/* ── 移动端：标题条让位给左上 Projects 触发器，状态栏压成一行 ────── */
@media (max-width:720px){
  .kc-kosmos-shell .kc-chat-head{display:none}
  .kc-kosmos-shell .kc-msg{margin-bottom:18px}
  .kc-kosmos-shell .kc-msg-user .kc-msg-body{max-width:86%;padding:8px 12px;border-radius:12px}
  .kc-kosmos-shell .kc-composer{width:calc(100% - 16px);max-width:none;margin:0 8px 4px;
    padding:8px 10px}
  .kc-kosmos-shell .kc-statusbar{font-size:10px;padding:0 10px 6px;gap:6px}
}

/* 列表行：hover 出现 ⋯；菜单在行内展开（不弹层，避免被滚动容器裁剪） */
.kc-kosmos-shell .kc-task-row{flex-wrap:wrap}
.kc-kosmos-shell .kc-task-row .kc-task-item{flex:1;min-width:0}
.kc-kosmos-shell .kc-task-more{display:none;width:24px;height:24px;flex:none;align-items:center;
  justify-content:center;border:0;border-radius:6px;background:transparent;
  color:var(--gray-5,#8e8ea0);font-size:14px;line-height:1;cursor:pointer}
.kc-kosmos-shell .kc-task-more:hover,
.kc-kosmos-shell .kc-task-row.kc-more-open .kc-task-more{display:inline-flex;
  background:rgba(var(--black-rgb),.06);color:var(--ink)}
.kc-kosmos-shell .kc-task-row:hover .kc-task-more{display:inline-flex}
.kc-kosmos-shell .kc-task-menu{flex:1 0 100%;display:none;gap:4px;padding:2px 0 6px 2px}
.kc-kosmos-shell .kc-task-row.kc-more-open .kc-task-menu{display:flex}
.kc-kosmos-shell .kc-task-menu button{height:26px;padding:0 10px;border:1px solid var(--gray-2,#e4e4e7);
  border-radius:6px;background:transparent;font:inherit;font-size:12px;color:var(--gray-6,#52525b);cursor:pointer}
.kc-kosmos-shell .kc-task-menu button:hover{color:var(--ink);border-color:var(--gray-3,#d4d4d8)}
.kc-kosmos-shell .kc-task-menu button[data-delete]:hover{color:#dc2626;border-color:#fca5a5}
.kc-kosmos-shell .kc-task-rename{flex:1;min-width:0;height:26px;padding:0 6px;border:1px solid var(--brand,#1d4ed8);
  border-radius:6px;font:inherit;font-size:13px;color:var(--ink);background:var(--paper,#fff)}
@media (max-width:720px){
  .kc-kosmos-shell .kc-task-more{display:inline-flex}
}

/* 搜索命中：标题旁一条上下文片段 + 跳转后的高亮 */
.kc-kosmos-shell .kc-task-snippet{margin-top:2px;font-size:11px;line-height:15px;color:var(--gray-5,#8e8ea0);
  overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.kc-kosmos-shell .kc-task-item.kc-task-hit .kc-task-title{color:var(--brand,#1d4ed8)}
.kc-msg-flash{animation:kcMsgFlash 1.8s ease-out}
@keyframes kcMsgFlash{0%{background:rgba(var(--brand-rgb,29,78,216),.14);border-radius:8px}100%{background:transparent}}

/* 报告页内目录 + 引用角标小卡 */
.kc-kosmos-shell .kc-report-toc{margin:0 0 14px;padding:6px 12px;border:1px solid var(--gray-2,#e4e4e7);
  border-radius:8px;background:var(--sidebar-bg,#fafafa)}
.kc-kosmos-shell .kc-report-toc summary{cursor:pointer;list-style:none;font-size:12px;font-weight:500;color:var(--gray-6,#52525b)}
.kc-kosmos-shell .kc-report-toc summary::-webkit-details-marker{display:none}
.kc-kosmos-shell .kc-report-toc[open] summary{margin-bottom:4px}
.kc-kosmos-shell .kc-report-toc ol{margin:0;padding-left:20px;font-size:12.5px;line-height:1.75}
.kc-kosmos-shell .kc-report-toc li.lv3{margin-left:12px}
.kc-kosmos-shell .kc-report-toc a{color:var(--gray-6,#52525b);text-decoration:none}
.kc-kosmos-shell .kc-report-toc a:hover{color:var(--brand,#1d4ed8)}
.kc-kosmos-shell .kc-cite{cursor:pointer}
.kc-cite-tip{position:fixed;z-index:90;padding:8px 10px;border:1px solid var(--gray-2,#e4e4e7);
  border-radius:8px;background:var(--paper,#fff);box-shadow:0 8px 24px rgba(0,0,0,.12);
  font-size:12px;line-height:1.55;color:var(--ink,#111);white-space:normal;word-break:break-word}
[data-theme="dark"] .kc-cite-tip{background:#161b22;border-color:#30363d;color:#e6edf3}

/* 置顶星标 + 计划卡说明 */
.kc-kosmos-shell .kc-task-pin{color:var(--brand,#1d4ed8);margin-right:4px;font-size:11px;vertical-align:1px}
.kc-kosmos-shell .kc-plan-hint{margin-top:6px;font-size:11.5px;line-height:1.5;color:var(--gray-5,#8e8ea0)}
