/* 界面模块的样式：消息流（chat.js）、输入区（composer.js）、流程区（flows.js）、提问卡片（ask.js）、
   面板里的东西（panel.js、objects.js）、会话列表（sessions.js）。
   布局骨架在 style.css；颜色、间距、圆角、字号、阴影、动效全部用 theme.css 的 token，这里不写死颜色、不写散落的魔法数。
   组件的统一规则（按钮、卡片、徽章、输入框、菜单、提示条、状态色）见 docs/design/界面规范.md。 */

/* —— 共用的小部件 —— */
/* 图标：同一套 16×16 的线性图标（ui-kit.js），尺寸由 --icon 决定（行内 14，顶栏与面板 16），颜色跟随文字。 */
.icon { display: inline-flex; flex: none; line-height: 0; }
.icon svg { width: var(--icon); height: var(--icon); }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
/* 颜色不做过渡：悬停、按下、换主题都是立刻到位的主题色（过渡中的中间色不是任何 token，外观检查会读到它；苹果的控件悬停也不渐变）。
   动效只给位移与形变：展开箭头的旋转、新消息的出场、进度条里走动的那一截。 */
/* 文字按钮（界面规范第三十节，与会话侧栏的“新建会话”、控制台 v3 同一种语言）：高 32、圆角 8。
   次要 = --control 底（浅色白、深色比卡片亮一档）、--edge 细边、--shadow-seg 轻投影；主要 = 强调色实心（带一点同色投影）；危险 = 红色实心；安静 = 透明、淡字。
   悬停、按下是在底色里混一点前景色（color-mix，算出来仍是确定的颜色，外观检查认得；不用 filter：深色下变暗看不出来）。 */
button.small { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1); min-height: var(--ctl); padding: 0 var(--sp-3); border: 1px solid var(--edge); border-radius: var(--r-sm); background: var(--control); color: var(--fg); font-size: var(--fs-md); font-weight: var(--fw-regular); line-height: var(--lh); white-space: nowrap; box-shadow: var(--shadow-seg); }
button.small:hover:not(:disabled) { background-color: color-mix(in srgb, var(--fg) 4%, var(--control)); }
button.small:active:not(:disabled) { background-color: color-mix(in srgb, var(--fg) 8%, var(--control)); }
button.primary { border-color: transparent; background: var(--accent-fill); color: var(--on-accent); font-weight: var(--fw-medium); box-shadow: 0 1px 2px color-mix(in srgb, var(--accent-fill) 35%, transparent); }
button.primary:hover:not(:disabled) { background-color: color-mix(in srgb, var(--accent-fill) 88%, #000); }
button.primary:active:not(:disabled) { background-color: color-mix(in srgb, var(--accent-fill) 78%, #000); }
/* 次要的一句（“以后这类都不问”）：不抢主按钮的眼。 */
button.small.quiet { border-color: transparent; background: transparent; color: var(--dim); font-weight: var(--fw-regular); box-shadow: none; }
button.small.quiet:hover:not(:disabled) { background-color: var(--hover); color: var(--fg); }
button.small.quiet[data-armed="true"] { color: var(--accent); font-weight: var(--fw-medium); }
button.danger { border-color: transparent; background: var(--bad-fill); color: var(--on-accent); font-weight: var(--fw-medium); box-shadow: 0 1px 2px color-mix(in srgb, var(--bad-fill) 35%, transparent); }
button.danger:hover:not(:disabled) { background-color: color-mix(in srgb, var(--bad-fill) 88%, #000); }
button:disabled { opacity: .5; }
button.small:disabled { box-shadow: none; }
/* 聚焦环（协议第 154 节）：一圈 2px 的强调色，贴着控件的边——按钮、链接画在边上（offset 0），输入框画在边里面（offset -2px），不再离开一截。
   选择器用 :where()（特异性为 0）：组件自己写的 outline: none（里面的输入框交给外面的框去画环）才压得过它，不会被这条盖回来——
   以前“数字框”里的 <input> 就是这样被盖回来的：灰框里面多出一圈偏开的蓝框。程序化聚焦的容器（tabindex=-1，如编辑器、面板）不画环。 */
:where(button, a, .session-item, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
:where(select, input, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
:where([tabindex="-1"]):focus-visible { outline: none; }
/* 超链接（真正的外部链接，如数据来源）：蓝色 + 下划线，只此一种；别的东西不用蓝色下划线。 */
a.link { color: var(--link); text-decoration: underline; text-underline-offset: 3px; border-radius: var(--r-xs); }
a.link:hover { text-decoration-thickness: 2px; }
/* 右侧展示按钮：凡是“点了在右侧面板显示”的都是它（ui-kit.js 的 viewButton）——紧跟在所属文字右边的小胶囊，图标 + 一个词，中性色，悬停变强调色；到处同高。
   外观与文字按钮同一种“浮起的白块”（--control 底、--edge 细边、--shadow-seg），只是更小、是胶囊；任务条上的“全部任务”同此（.flow-list-toggle）。 */
.view-btn { flex: none; display: inline-flex; align-items: center; gap: var(--sp-1); height: var(--ctl-xs); margin-inline-start: var(--sp-2); padding: 0 var(--sp-2); border: 1px solid var(--edge); border-radius: var(--r-pill); background: var(--control); box-shadow: var(--shadow-seg); color: var(--dim); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1; white-space: nowrap; vertical-align: middle; }
.view-btn:hover:not(:disabled), .view-btn.on { border-color: transparent; background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.view-btn:active:not(:disabled) { background-image: linear-gradient(var(--press), var(--press)); }
.view-btn:disabled { opacity: .55; cursor: wait; }
.view-btn[data-state="failed"] { color: var(--warn); }
/* 文字按钮：平常的小动作（暂停、取消、返回……）——中性色的字，悬停变深加底色；不是链接，不用蓝色。取消的第二下（data-armed）变红。 */
.text-btn { padding: 0 var(--sp-1); border: 0; border-radius: var(--r-xs); background: none; color: var(--dim); font-size: inherit; }
.text-btn:hover:not(:disabled) { background: var(--hover); color: var(--fg); }
.text-btn:disabled { opacity: .5; }
.text-btn[data-armed="true"] { color: var(--bad); font-weight: var(--fw-semibold); }
/* 图标按钮：24 见方（对象列表、撤销重做这类密的地方）。 */
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: var(--ctl-xs); height: var(--ctl-xs); padding: 0 var(--sp-1); border: 0; background: transparent; color: var(--dim); border-radius: var(--r-xs); font-size: var(--fs-xs); white-space: nowrap; }
.icon-button:hover:not(:disabled) { background: var(--hover); color: var(--fg); }
.icon-button:active:not(:disabled) { background: var(--press); }
.icon-button.remove:hover:not(:disabled) { color: var(--bad); }
.icon-button[data-armed="true"], .icon-button[data-armed="true"]:hover:not(:disabled) { background: var(--bad); color: var(--on-status); padding: 0 var(--sp-2); }
/* 分段按钮（面板的标签）。 */
.seg { display: inline-flex; min-width: 0; background: var(--seg-track); border-radius: var(--r-sm); padding: var(--sp-0); }
.seg button { min-width: 0; max-width: 160px; min-height: var(--ctl-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--dim); background: transparent; border: 0; border-radius: var(--r-xs); padding: 0 var(--sp-3); }
.seg button:hover:not(.on) { color: var(--fg); }
.seg button.on { background: var(--seg-on); color: var(--fg); box-shadow: var(--shadow-seg); }
/* 徽章：小的胶囊标记（危险操作、用显卡、第 n 次、超时）。同一种高度、内边距、字号。 */
.tag, .plan-flag, .step-flag { flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 var(--sp-2); border-radius: var(--r-pill); font-size: var(--fs-2xs); font-weight: var(--fw-medium); line-height: 1; white-space: nowrap; }
/* 状态圆点：8px。完成 --ok、流程失败 --bad、运行中 --run 并脉动、取消与等待 --faint；工具没成功是空心的灰圈（不标红，见下面“工具卡片”）。 */
.dot { flex: none; width: var(--dot); height: var(--dot); border-radius: 50%; background: var(--faint); }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* —— 消息流 —— */
#chat { display: flex; flex-direction: column; gap: var(--sp-3); }
/* 空状态（V6 S6）：几条跨领域、可点的示例；从没连上网关时直说。 */
.empty { margin: auto; width: 100%; max-width: 680px; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); text-align: center; }
.empty-title { font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: .01em; }
.empty-sub { max-width: 460px; font-size: var(--fs-md); line-height: var(--lh); color: var(--dim); }
/* 四个示例：两列、卡片宽一些松一些，边框 1.5px 比平时的细线明显；点之前就看得出是能点的。 */
.examples { align-self: stretch; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-4); }
/* 示例分屏：换屏时整组淡入（不是连续滚动）；下面一排小圆点标出共几屏、现在是哪一屏，点一下直接换。 */
.examples { transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.examples.leaving { opacity: 0; transform: translateY(-8px); }
.examples.swap { animation: examples-in 280ms var(--ease); }
.examples.swap .example { animation: example-in 320ms var(--ease) backwards; }
.examples.swap .example:nth-child(2) { animation-delay: 40ms; }
.examples.swap .example:nth-child(3) { animation-delay: 80ms; }
.examples.swap .example:nth-child(4) { animation-delay: 120ms; }
@keyframes examples-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes example-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.example-dots { display: flex; justify-content: center; gap: var(--sp-1); margin-top: var(--sp-1); }
.example-dot { box-sizing: content-box; width: 6px; height: 6px; min-height: 0; padding: var(--sp-1); border: 0; border-radius: var(--r-pill); background-color: var(--faint); background-clip: content-box; cursor: pointer; transition: background-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.example-dot[aria-current="true"] { background-color: var(--accent); transform: scale(1.25); }
.example-dot:hover { background-color: var(--dim); }
.example-dot[aria-current="true"]:hover { background-color: var(--accent); }
.example-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.example { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); min-height: 112px; padding: var(--sp-4) var(--sp-4) var(--sp-4); border: 1px solid var(--sep); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1); color: var(--fg); text-align: left; font-size: var(--fs-md); line-height: var(--lh); }
.example:hover { background: var(--fill); border-color: var(--accent); box-shadow: var(--shadow-1); }
.example:active { background: var(--fill-2); }
.example-field { display: inline-flex; align-items: center; padding: var(--sp-0) var(--sp-2); border-radius: var(--r-pill); background: var(--accent-soft); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--accent); }
.example-text { color: var(--fg); }
/* 提示条（界面卡片 P1，界面规范第八节）：浅色底上的一句话（连不上、计算量提醒、出错、检查提示之类）。
   一种形状——内边距、圆角、正文色字、字号 --fs-sm——两种语气：提醒（默认，--warn 的浅底）与错误（--bad 的浅底）；语气只给底色和前面的图标，字不染色
   （彩色字叠在同色浅底上到不了 4.5:1）。用 :where 让形状的优先级为 0，各条提示自己需要的差别（宽度、排版）写在自己的规则里就能覆盖。 */
:where(.empty-offline, .compute-warnings, .ask-warning, .msg.note.quota-note, .msg.note.error-note, .msg.assistant[data-error]) {
  --banner-tone: var(--warn); --banner-bg: var(--warn-soft);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-item); background: var(--banner-bg); color: var(--fg); font-size: var(--fs-sm); line-height: var(--lh-relaxed);
}
:where(.msg.note.error-note, .msg.assistant[data-error], .msg.note.quota-note.quota-over) { --banner-tone: var(--bad); --banner-bg: var(--bad-soft); }
:where(.empty-offline, .compute-warnings, .ask-warning, .msg.note.quota-note, .msg.note.error-note, .msg.assistant[data-error]) > .icon { color: var(--banner-tone); }
.empty-offline { max-width: 420px; }
.msg { flex: none; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.msg.fresh { animation: msg-in var(--dur-2) var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 用户的话：靠右的浅色气泡。一轮从用户的话开始，上面多留一点空（协议里没有时间字段，轮次靠节奏分开）。 */
.msg.user { align-self: flex-end; max-width: 85%; display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-1); }
.msg.user:not(:first-child) { margin-top: var(--sp-3); }
.msg.user .bubble { padding: var(--sp-2) var(--sp-4); border-radius: var(--r-bubble) var(--r-bubble) var(--r-xs) var(--r-bubble); background: var(--fill-2); white-space: pre-wrap; }
.msg.user .context { order: -1; display: inline-flex; align-items: center; gap: var(--sp-1); max-width: 100%; padding: var(--sp-0) var(--sp-3) var(--sp-0) var(--sp-2); border-radius: var(--r-pill); font-size: var(--fs-xs); color: var(--accent); background: var(--accent-soft); }
.msg.user .context span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.assistant { align-self: stretch; white-space: pre-wrap; }
/* 出错的那一段（网关发的 error 为真的 assistant）：错误语气的提示条；字号保持这条消息原来的（不缩成提示条的 --fs-sm）。 */
.msg.assistant[data-error] { display: flex; align-items: baseline; gap: var(--sp-2); font-size: inherit; line-height: inherit; }
.msg.assistant[data-error] > .icon { align-self: center; }
.msg code, .card pre { font-family: var(--mono); font-size: var(--fs-code); }
.msg.assistant code { padding: 1px var(--sp-1); border-radius: var(--r-code); background: var(--fill); }
.msg.note { align-self: center; font-size: var(--fs-xs); color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 没人认领的网关拒绝：在对话里留一行，不自己消失（错误语气的提示条）。.msg.note 的小号灰字优先级更高，所以字色、字号在这里重写。 */
.msg.note.error-note { display: inline-flex; align-items: center; gap: var(--sp-1); max-width: 100%; color: var(--fg); font-size: var(--fs-sm); white-space: normal; }
/* 计算量提醒（网关的 quota_notice）：不是错误，提醒语气；用完（quota-over）换成错误语气并加粗，更醒目。 */
.msg.note.quota-note { display: inline-flex; align-items: center; gap: var(--sp-1); max-width: 100%; color: var(--fg); font-size: var(--fs-sm); white-space: normal; }
.msg.note.quota-note.quota-over { font-weight: var(--fw-semibold); }
/* 游客内容并入账号成功：成功语气（--ok 的浅底与对勾），不是提醒的暖色；空会话里放在欢迎语上面（chat.js addMergeNote），示例照常显示。 */
.msg.note.quota-note[data-testid="merge-note"][data-state="ok"] { --banner-tone: var(--ok); --banner-bg: var(--ok-soft); }
.empty > .merge-note { align-self: center; margin-bottom: var(--sp-4); }
.msg.note.stopped { color: var(--warn); }
/* 压缩（协议第 38 节）：对话流里的一行细线，标签在中间；点开在下面看前情摘要。 */
.msg.compact { align-self: stretch; display: flex; flex-direction: column; }
/* 流程结束后系统发起的一轮（协议第 51 节）：与“较早的对话已压缩”同一种细线，低调地说明下面是 AI 自动查看。 */
.msg.wake { align-self: stretch; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-0) 0; color: var(--faint); font-size: var(--fs-xs); white-space: nowrap; }
.msg.wake::before, .msg.wake::after { content: ""; flex: 1; border-top: 1px solid var(--sep); }
.msg.wake span { overflow: hidden; text-overflow: ellipsis; max-width: 80%; }
/* 压缩过的对话：一行不可点的细线（摘要是给模型看的，界面不展示，§258） */
.compact-head { display: flex; align-items: center; gap: var(--sp-2); width: 100%; padding: var(--sp-0) 0; color: var(--faint); font-size: var(--fs-xs); white-space: nowrap; }
.compact-head::before, .compact-head::after { content: ""; flex: 1; border-top: 1px solid var(--sep); }

/* 结果入口：点了才打开右侧面板 */
.msg.entries { align-self: stretch; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.entry { display: inline-flex; align-items: center; gap: var(--sp-2); max-width: 100%; min-height: var(--ctl); padding: 0 calc((var(--ctl) - 2px - var(--ctl-xs)) / 2) 0 var(--sp-3); border: 1px solid var(--edge); border-radius: var(--r-pill); background: var(--surface); color: var(--fg); font-size: var(--fs-md); font-weight: var(--fw-medium); }
.entry-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry > .icon { color: var(--faint); }
.entry .view-btn { margin-inline-start: 0; }
/* 入口打不开的原因：写在那个入口后面（V6 M7）。 */
.open-error { flex: 1 1 100%; font-size: var(--fs-sm); color: var(--bad); overflow-wrap: anywhere; }

/* 提问的摘要：问了什么、选了什么 */
/* 已答的提问（界面规范第三十节）：一块浅灰底（--fill，与工具组同一种底），问题一行淡字、答案在下面一行正文色；多个问题之间一道发丝线。
   原来问与答挤在同一行、各自换行，几题摞在一起分不清哪句是问、哪句是答。 */
.msg.asked { align-self: stretch; display: flex; flex-direction: column; gap: var(--sp-0); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-item); background: var(--fill); font-size: var(--fs-sm); line-height: var(--lh-tight); color: var(--dim); }
.asked-a { color: var(--fg); font-weight: var(--fw-medium); }
.asked[data-skipped="true"] .asked-a { color: var(--dim); font-weight: var(--fw-regular); }
.msg.asked-many { padding-block: var(--sp-0); gap: 0; }
.asked-row { display: flex; flex-direction: column; gap: var(--sp-0); padding-block: var(--sp-2); }
.asked-row + .asked-row { border-top: 1px solid var(--sep); }
.asked-row[data-skipped="true"] .asked-a { color: var(--dim); font-weight: var(--fw-regular); }

/* 卡片的共同外形：细边、16 的圆角；内边距 16（待确认的卡片、提问卡片、流程区），里层的小块 12。
   标题行 15px 半粗；说明小字 12–13px 用 --dim。 */
.card { align-self: stretch; border: 1px solid var(--sep); border-radius: var(--r-card); background: var(--surface); }
.card .label { margin: var(--sp-2) 0 var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--dim); }
.card .label:first-child { margin-top: 0; }
.card pre { margin: 0; padding: var(--sp-2) var(--sp-3); max-height: 220px; overflow: auto; border-radius: var(--r-item); background: var(--fill); white-space: pre-wrap; overflow-wrap: anywhere; line-height: var(--lh); }
.card .origin { font-size: var(--fs-xs); color: var(--dim); }
.card .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); }
.card .tag { background: var(--bad); color: var(--on-status); }

/* 附件条：在用户消息里、文字下面（V10）。连着添加的几个合成一行，末尾一句去了哪（V6 打磨）。 */
.msg.user .attachments { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-1) var(--sp-3); max-width: 100%; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-item); background: var(--fill); font-size: var(--fs-sm); }
.attachment { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); min-width: 0; max-width: 100%; }
.attachment-main { display: inline-flex; align-items: center; gap: var(--sp-1); min-width: 0; max-width: 100%; }
.attachment .view-btn { margin-inline-start: 0; }
.attachment .icon { flex: none; color: var(--accent); }
.attachment-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-medium); }
.attachment-size { flex: none; font-size: var(--fs-xs); color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }   /* 大小不收缩：原来它和文件名一起被压，文字溢出灰框 */
.attachment-note { flex: 0 1 auto; min-width: 0; font-size: var(--fs-xs); color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 末尾那一句去了哪：窄的时候换行，不撑破对话列。 */
.attachment-note { white-space: normal; text-align: right; }

/* 工具组：同一轮里连着的工具卡片收成一行“做了 N 件事”，点开才逐条显示 */
.msg.tool-group { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); }
.group-head { display: inline-flex; align-items: center; gap: var(--sp-2); max-width: 100%; min-height: var(--ctl-sm); padding: 0 var(--sp-2); border: 0; border-radius: var(--r-pill); background: transparent; color: var(--dim); font-size: var(--fs-sm); text-align: left; }
.group-head:hover { background: var(--hover); color: var(--fg); }
.group-head:active { background: var(--press); }
.tool-group[data-state="done"] .group-head .dot { background: var(--faint); }
/* 工具没成功（命令退出码非 0、文件找不到……）是常事、模型会自己重试：空心的灰圈加“未成功 / 退出码 N”的字，不标红、不自动展开。
   红色只留给审核拦下、流程失败、危险操作这类要用户处理的事。 */
.tool-group[data-state="failed"] .group-head .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
/* 需要注意的调用（没成功、审核后放行；tool-kinds.js 的 needsAttention）：那一行的圆点换成警示色的空心圈，折叠起来也看得见（不用红色）。 */
.tool-group[data-attention="true"][data-state][data-count] .group-head .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--warn); }
/* “一行”类：只有一行字，点不开——没有箭头、没有悬停底色（tool-kinds.js）。 */
.tool-group[data-expandable="false"] .group-head, .card.tool[data-kind="line"] > .card-head { cursor: default; }
.tool-group[data-expandable="false"] .group-head:hover { background: transparent; color: var(--dim); }
.tool-group[data-expandable="false"] .group-head:active { background: transparent; }
.tool-group[data-expandable="false"] .group-head .icon, .card.tool[data-kind="line"] > .card-head .icon { display: none; }
.card.tool[data-kind="line"] > .card-head:hover { background: transparent; }
/* 还在做：运行色（与流程区、会话列表的运行标记同一种颜色），慢慢脉动。 */
.tool-group[data-state="pending"] .group-head .dot { background: var(--run); animation: pulse var(--dur-pulse) ease-in-out infinite; }
.group-label { flex: none; font-weight: var(--fw-medium); color: var(--fg); white-space: nowrap; }
.group-kinds { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-head .icon { flex: none; color: var(--faint); transition: transform var(--dur-2) var(--ease); }
.tool-group[data-open="true"] .group-head .icon { transform: rotate(90deg); }
.group-list { align-self: stretch; display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; margin-left: var(--sp-2); padding-left: var(--sp-3); border-left: 1px solid var(--sep); }
/* 折叠着：卡片都还在 DOM 里，只是不显示；带截图的只露出缩略图。 */
.tool-group[data-open="false"] .card.tool:not(.has-shot) { display: none; }
.tool-group[data-open="false"] .card.tool.has-shot { background: transparent; border-color: transparent; }
.tool-group[data-open="false"] .card.tool.has-shot > .card-head, .tool-group[data-open="false"] .card.tool.has-shot > .card-body { display: none; }
.tool-group[data-open="false"] .card.tool.has-shot > .shot { padding: 0 0 0 var(--sp-2); }
.tool-group[data-open="false"]:not([data-shots="true"]) .group-list { display: none; }
/* 面板开着时 3D 截图的缩略图不再露出来：同一个画面右边已经有了（V6 打磨）。 */
body[data-panel="true"] .tool-group[data-open="false"] .group-list { display: none; }
/* 过程折叠：反复试命令、跑流程时连着的几组收成一行，点开才看里面的工具组、叙述与思考；点开后里面的样子和平时一样。 */
.msg.process-fold { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); }
.process-fold[data-state="done"] > .group-row .group-head .dot { background: var(--faint); }
.process-fold[data-state="failed"] > .group-row .group-head .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.process-fold[data-state="pending"] > .group-row .group-head .dot { background: var(--run); animation: pulse var(--dur-pulse) ease-in-out infinite; }
.process-fold[data-open="true"] > .group-row .group-head .icon { transform: rotate(90deg); }
.process-body { align-self: stretch; display: none; flex-direction: column; gap: var(--sp-2); min-width: 0; margin-left: var(--sp-2); padding-left: var(--sp-3); border-left: 1px solid var(--sep); }
.process-fold[data-open="true"] > .process-body { display: flex; }
/* 只有一件事的组：那一行就是那件事，展开直接是它的详情（卡片自己的那一行不再出现）。 */
.tool-group[data-single="true"] .card.tool > .card-head { display: none; }
.tool-group[data-single="true"][data-open="true"] .card.tool { background: var(--surface); border-color: var(--sep); }
/* 工具组那一行：开关，后面可能还有“在 3D 中查看”；窄的时候换行。 */
.group-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-0) var(--sp-2); max-width: 100%; min-width: 0; padding: var(--sp-1); border-radius: var(--r-view); background: var(--fill); }
.group-row .group-head { min-width: 0; }
/* 工具卡片：一行摘要（做什么 · 结果），点开看命令、环境、用时与输出 */
.card.tool { min-width: 0; border-color: transparent; background: var(--fill); border-radius: var(--r-item); }
.card.tool[data-declined] .card-head .dot { background: var(--faint); }
.card.tool[data-declined] .card-head .meta { color: var(--dim); }
.card.tool.open { background: var(--surface); border-color: var(--sep); }
.card-head { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: var(--ctl); padding: var(--sp-1) var(--sp-3); border: 0; border-radius: var(--r-item); background: transparent; text-align: left; font-size: var(--fs-sm); color: var(--fg); }
.card-head:hover { background: var(--hover); }
.tool[data-ok="true"] .dot { background: var(--ok); }
.tool[data-ok="false"]:not([data-declined]) .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.tool[data-ok="pending"] .dot { background: var(--run); animation: pulse var(--dur-pulse) ease-in-out infinite; }
.tool[data-attention="true"][data-ok] .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--warn); }
.card-head .tool-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-medium); }
.card-head .brief { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.card-head .meta { flex: none; font-size: var(--fs-xs); color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card-head .icon { color: var(--faint); transition: transform var(--dur-2) var(--ease); }
.tool.open .card-head .icon { transform: rotate(90deg); }
.card-body { padding: var(--sp-1) var(--sp-3) var(--sp-3); }
.card .shot { padding: 0 var(--sp-3) var(--sp-3); }
.shot-button { display: block; padding: 0; border: 0; border-radius: var(--r-item); overflow: hidden; background: var(--stage); cursor: zoom-in; line-height: 0; }
.shot-button img { display: block; width: 168px; max-width: 100%; height: auto; }
.shot.large .shot-button { cursor: zoom-out; width: 100%; }
.shot.large .shot-button img { width: 100%; }
.shot-missing { font-size: var(--fs-xs); color: var(--faint); }

/* 点开才看的细节（tool-detail.js）：命令的代码块、事实的小标签、可折叠的块。工具卡片、确认卡片、流程确认卡片共用。 */
.cmd-block { position: relative; min-width: 0; }
/* 命令保留换行、不自动折行，长的横向滚动；右边给复制按钮留出位置。 */
.card .cmd-code { padding-right: var(--sp-8); max-height: 160px; white-space: pre; overflow-wrap: normal; }
.cmd-copy { position: absolute; top: var(--sp-1); right: var(--sp-1); }
.cmd-copy[data-state="copied"] { color: var(--ok); }
.facts { display: flex; flex-wrap: wrap; gap: var(--sp-0) var(--sp-4); margin-top: var(--sp-2); }
.fact { display: inline-flex; align-items: baseline; gap: var(--sp-1); max-width: 100%; color: var(--dim); font-size: var(--fs-xs); line-height: var(--lh); }
.fact .k { flex: none; }
.fact .v { min-width: 0; color: var(--fg); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.fold { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; margin-top: var(--sp-2); }
.fold-head { display: inline-flex; align-items: center; gap: var(--sp-1); align-self: flex-start; max-width: 100%; min-height: var(--ctl-xs); padding: 0 var(--sp-2) 0 var(--sp-1); border: 0; border-radius: var(--r-xs); background: transparent; color: var(--dim); font-size: var(--fs-xs); font-weight: var(--fw-medium); text-align: left; }
.fold-head:hover { background: var(--hover); color: var(--fg); }
.fold-head .icon { color: var(--faint); transition: transform var(--dur-2) var(--ease); }
.fold[data-open="true"] > .fold-head .icon { transform: rotate(90deg); }
.fold-body { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
/* 确认卡片折叠区的那一行：命令（或文件名、软件名）的第一行，等宽，放不下就省略。 */
.fold-preview { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-regular); color: var(--fg); }
.confirm-fold { margin-top: var(--sp-1); }
.fold-empty { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); color: var(--dim); }

/* 确认卡片、流程确认卡片 */
/* 卡片的基本样式以计划卡为准（2026-11-07，用户要求所有卡片对齐）：白底、细边、圆角、--shadow-1 的阴影、内边距 --sp-4 / --sp-4 / --sp-3、标题半粗 --fs-md。
   待答的、答完留在对话里的都一样（原来答完的命令确认卡去掉了阴影、内边距也不同）；确认卡、流程卡、计划卡（plan-audit）、结构卡共用这一条，不各写各的。 */
.card.confirm, .card.plan, .card.plan-audit, .card.structure { padding: var(--sp-4) var(--sp-4) var(--sp-3); box-shadow: var(--shadow-1); }
.card.confirm .title, .card.plan .title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
/* 要点：不用浏览器默认的实心圆点，换成小的淡色圆点，与正文左对齐。 */
.card .points { margin: var(--sp-1) 0 0; padding: 0; list-style: none; font-size: var(--fs-md); color: var(--dim); }
.card .points li { padding: 0; line-height: 1.55; overflow-wrap: anywhere; }
.card .status { display: inline-flex; align-items: center; gap: var(--sp-1); margin-top: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.card[data-state="approved"] .status { color: var(--ok); }
.card[data-state="rejected"] .status { color: var(--dim); }
.card[data-state="waiting"] .status { color: var(--warn); font-weight: var(--fw-regular); }
/* 答完的命令确认卡（2026-10-30，用户嫌标题、命令、“已确认”没有层次，背景也平）：三层——
   卡片本身与别的卡一样（上面的基本样式，2026-11-07 起答完也有阴影）；标题（半粗）在左，结果（小一号）靠右同一行，窄屏放不下时落到标题下一行；
   命令放在卡里的 --fill 嵌入块中（等宽、--fs-code），白底 → 灰块的两层就是背景的层次。点开命令块的折叠区后，环境、最长运行等排在块下面。 */
.card.confirm:not([data-state="waiting"]) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
/* 标题与结果同一行（放不下时结果落到标题下一行、靠右），其余各占整行；结果在 DOM 里排在最后，用 order 提到标题后面。 */
.card.confirm:not([data-state="waiting"]) > * { flex: 1 1 100%; order: 2; min-width: 0; }
.card.confirm:not([data-state="waiting"]) > .title { flex: 0 1 auto; order: 0; }
.card.confirm:not([data-state="waiting"]) > .status { flex: 0 0 auto; order: 1; margin: 0 0 0 auto; font-size: var(--fs-xs); }
.card.confirm:not([data-state="waiting"]) .confirm-fold { margin: 0; }
.card.confirm:not([data-state="waiting"]) .confirm-fold > .fold-head { align-self: stretch; width: 100%; min-height: var(--ctl); padding: var(--sp-1) var(--sp-3); border-radius: var(--r-item); background: var(--fill); }
.card.confirm:not([data-state="waiting"]) .confirm-fold > .fold-head:hover { background: var(--fill-2); }
.card.confirm:not([data-state="waiting"]) .fold-preview { font-family: var(--mono); font-size: var(--fs-code); color: var(--fg); }
.card.confirm:not([data-state="waiting"]) .fold-body { padding: var(--sp-1) var(--sp-3) 0; }
/* 危险的卡片和别的卡片一样是中性的（Apple 的 alert 也是这样）：只有警示图标、“危险操作”标记和主按钮（红色的“允许一次”“开始”）是红的，不再整张染红。 */
.card.confirm.danger .title, .card.plan.danger .title { color: var(--fg); }
.card.confirm.danger .title .icon, .card.plan.danger .title .icon { color: var(--bad); }
/* 流程确认卡片与计划卡片（.plan-audit）同一套样式：白底、阴影、小图标加标题、步骤用编号小圆标（.plan-list）；确认之后卡片留在对话里当记录，结果（“5 步 · 已开始”）靠右同一行，步骤摘要行拿掉（详情里有）。 */
.card.plan .title .icon { color: var(--glyph); }
.card.plan .title .status { margin: 0 0 0 auto; font-size: var(--fs-sm); font-weight: var(--fw-regular); }
/* 重做（2026-11-04，用户嫌难看）：每一节都是计划卡的做法——“小图标 + 半粗标签”，内容缩进到标签文字的位置；流程与详情是 .plan-fold（标签后面带箭头）。 */
.card.plan .plan-run .points { display: inline; margin: 0; padding: 0; font-size: inherit; color: inherit; }
.card.plan .plan-run .points li { display: inline; margin-right: var(--sp-3); }
.card.plan .plan-run .points li:last-child { margin-right: 0; }
.card.plan .plan-run .points li.long { display: block; margin: var(--sp-1) 0 0; }      /* 长句（安装、危险、确认说明）自己占一行，不和短的要点混排 */
.plan-steps { margin: 0; }
.plan-steps li { padding: var(--sp-1) 0; }
.plan-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-fold .plan-meta { font-size: var(--fs-xs); color: var(--faint); }
.card.plan .review { margin: var(--sp-3) 0 0; padding-top: var(--sp-2); border-top: 1px solid var(--sep); }
.plan-meta { flex: none; display: inline-flex; align-items: baseline; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* “详情”里每一步：步骤名一行，下面命令、小标签、依赖；步与步之间留一道细线。 */
.plan-more .fold-body { display: flex; flex-direction: column; gap: var(--sp-3); }
/* 详情顶上各步共有的几行（环境、每步超时）：贴在一起，字号一致 */
.plan-more .fold-body > .points, .plan-more .fold-body > .facts { margin: 0; }
.plan-more .fold-body > .facts { font-size: var(--fs-sm); }
.plan-more .fold-body > .facts .fact { font-size: var(--fs-sm); }
.plan-more .fold-body > .points + .facts { margin-top: calc(var(--sp-2) * -1); }
.plan-detail { display: flex; flex-direction: column; gap: var(--sp-2); }
.plan-detail + .plan-detail { padding-top: var(--sp-3); box-shadow: inset 0 1px 0 var(--sep); }
.plan-detail .facts { margin: 0; }
.plan-step-name { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.plan-env { font-size: var(--fs-sm); color: var(--dim); }
/* 要点（步数与时长、核数、显卡……）：淡灰的短句并排，靠间距分开（不画分隔点：折行时分隔点会落在行首）；长的（危险、确认说明）自己占整行。 */
.card.plan .points li { padding: 0; }
.card.plan .plan-more .points { display: flex; flex-direction: column; }
.card.plan .origin { margin-top: var(--sp-2); }
/* 长文字的截断：默认最多三行；放不下时“更多”压在第三行行末（按钮不透明，盖住末尾的省略号，左边用同色阴影淡出），展开后“收起”跟在全文最后
   （tool-detail.js 的 clampedText 按实际版面判断放不放得下，全文始终在 DOM 里）。按钮与正文同字号，淡蓝底、半粗，一眼看得出能点。 */
.clamp { position: relative; display: block; overflow-wrap: anywhere; padding-right: var(--sp-1); }
.clamp[data-open="false"] { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }      /* 右边留出的 --sp-1 就是“更多”按钮往里缩的那一条：文字不进这一条，所以按钮右边不会露出半个字或省略号 */
.clamp[data-lines="4"][data-open="false"] { -webkit-line-clamp: 4; }      /* 行数上限是 4 的（审核意见的回应） */
/* “更多 / 收起”（2026-10-30，用户嫌按钮太大、显得离卡片边框很近）：比正文小一档（--fs-xs），内边距收一点；收起时压在第三行行末，往里缩 --sp-1，不贴着文字块右缘。 */
.clamp-toggle { margin-left: var(--sp-2); padding: 0 var(--sp-2); border: 0; border-radius: var(--r-pill); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1.5; cursor: pointer; }
.clamp-toggle:hover { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.clamp[data-open="false"] > .clamp-toggle { position: absolute; right: var(--sp-1); bottom: 2px; margin-left: 0; box-shadow: -14px 0 10px 4px var(--surface); }
.view-error { color: var(--warn); font-size: var(--fs-xs); }
/* 分子卡片（molecule-card.js，协议 §251）：分子确认卡与流程确认卡里的“用户给的结构”共用。
   多个分子是一张卡：上面一排页签（segmented，与面板标签同一套），下面是当前分子的页面；所有页面叠在同一个格子里、只显示一个，卡片高度跟最高的一页，切换不跳。
   页面：左边结构图（白底，RDKit 的黑线条深色主题下也看得清）与 2D / 3D 一对入口，右边名称与作用、分子式与分子量、形态/净电荷/数量、来源与片段；
   下面是提醒（黄底）与 SMILES 一行。复杂分子图更大、SMILES 默认收着。窄的时候（按卡片自己的宽度，不是窗口宽度）图放到上面。 */
.mol-set { container-type: inline-size; display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; margin: var(--sp-3) 0 0; }
.mol-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); min-width: 0; }
.mol-bar > .mol-hint { flex: none; margin-inline-start: auto; font-size: var(--fs-xs); color: var(--faint); white-space: nowrap; }
.mol-bar > .mol-hint[hidden] { display: none; }
/* 页签条（segmented）：外框一直铺到卡片内容区的右边（不是“刚好包住页签”）；页签多了在条里横向滚（滚轮、触摸、键盘），不画滚动条。
   选中页签的圆角 = 外框圆角 − 内边距（同心圆角，10 − 2 = 8 = --r-sm）。注意写成 .mol-tabs .mol-tab：molecules.css 里的 .mol-tab（分子窗口的标签，圆角 pill）
   后加载、同样的优先级，原来盖掉了这里的圆角，选中的页签变成了胶囊，与外框对不上。 */
.mol-tabs { display: flex; flex: 1 1 0; gap: var(--sp-0); min-width: 0; padding: var(--sp-0); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: var(--r-item); background: color-mix(in srgb, var(--seg-track) 45%, var(--surface)); }
.mol-tabs::-webkit-scrollbar { display: none; }
.card .title-meta { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--dim); }
.mol-tabs .mol-tab { flex: none; display: inline-flex; align-items: center; gap: var(--sp-1); max-width: 200px; min-height: var(--ctl-sm); padding: 0 var(--sp-3); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--dim); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.mol-tabs .mol-tab:focus-visible { outline-offset: -2px; }       /* 页签条会裁掉条外的内容：焦点环画在页签里面，不被条的边裁掉 */
.mol-tab:hover:not([aria-selected="true"]) { color: var(--fg); }
.mol-tabs .mol-tab[aria-selected="true"] { background: var(--seg-on); color: var(--fg); box-shadow: var(--shadow-seg); }
.mol-tab-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 警告与未读共用一个圆点。查看后只清除未读状态，警告继续显示。 */
.mol-tabs .mol-tab:is([data-unseen="true"], [data-warn="true"])::after { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.mol-tabs .mol-tab[data-warn="true"]::after { background: var(--warn); }
.mol-stack { display: grid; min-width: 0; }
.mol-stack > .plan-molecule { grid-area: 1 / 1; }
.mol-set[data-fit="true"] .plan-molecule[data-active="false"] { display: none; }
.card.confirm:not([data-state="waiting"]) > .mol-set { margin-top: 0; }
/* 确认模型卡（model-gate.js）：最上面是整块可点的 3D 入口（强调色浅底），然后黄底提示，再是用细分隔线分段的内容（体系、AI 的理解、接下来、文件，不用灰底）。
   组成按溶质（紫）、溶剂（蓝）、离子（青）上色——颜色只是辅助，每一行都写着“溶质/溶剂/离子”；状态小标签（不是红色的 .tag）。 */
.model-gate .title > .icon { transform: translateY(-1px); }       /* 分子图标带一根向下的短柄，图形重心偏低，上提 1px 与文字对齐 */
.model-gate .gate-state { flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 var(--sp-2); border-radius: var(--r-pill); font-size: var(--fs-2xs); font-weight: var(--fw-medium); line-height: 1; white-space: nowrap; background: var(--warn-soft); color: var(--warn); }
.model-gate .gate-state[data-state="approved"] { background: var(--ok-soft); color: var(--ok); }
.model-gate .gate-state[data-state="ended"], .model-gate .gate-state[data-state="expired"] { background: var(--fill); color: var(--dim); }
.model-gate .gate-body { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.model-gate .gate-hero { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-width: 0; padding: var(--sp-3) var(--sp-4); box-sizing: border-box; border: 0; border-radius: var(--r-item); background: var(--accent-soft); color: var(--fg); font: inherit; text-align: start; cursor: default; }
.model-gate button.gate-hero { cursor: pointer; transition: box-shadow .15s var(--ease), background-color .15s var(--ease); }
.model-gate button.gate-hero:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.model-gate button.gate-hero:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--accent), var(--ring); }
.model-gate .gate-hero[data-empty="true"] { background: none; box-shadow: inset 0 0 0 1px var(--sep); }
.model-gate .gate-hero-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-item); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.model-gate .gate-hero-icon .icon, .model-gate .gate-hero-icon .icon svg { width: 22px; height: 22px; }       /* .icon 是 span，svg 另有固定的 14px：两个都放大，图形才居中 */
.model-gate .gate-hero[data-empty="true"] .gate-hero-icon { background: var(--fill-2); color: var(--faint); }
.model-gate .gate-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-0); }
.model-gate .gate-hero-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); min-width: 0; }
.model-gate .gate-order { flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 var(--sp-2); border-radius: var(--r-pill); background: var(--surface); color: var(--dim); font-size: var(--fs-2xs); font-weight: var(--fw-medium); white-space: nowrap; box-shadow: 0 0 0 1px var(--sep); }
.model-gate .gate-hero-name { font-size: var(--fs-body); font-weight: var(--fw-semibold); line-height: var(--lh-tight); overflow-wrap: anywhere; }
.model-gate .gate-hero-sub { font-size: var(--fs-xs); color: var(--dim); line-height: var(--lh-tight); }
.model-gate .gate-hero-cta { flex: none; display: inline-flex; align-items: center; gap: var(--sp-0); color: var(--accent); font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; }
.model-gate button.gate-hero:hover .gate-hero-cta .icon { transform: translateX(2px); }
.model-gate .gate-hero-cta .icon { transition: transform .15s var(--ease); }
.model-gate .mol-notes { gap: var(--sp-2); }
.model-gate .gate-hints { font-size: var(--fs-xs); border-radius: var(--r-item); background: var(--warn-soft); color: var(--warn); }       /* 几何体检提示：默认一行，点开看全文 */
.model-gate .gate-hints > summary { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); list-style: none; cursor: pointer; }
.model-gate .gate-hints > summary::-webkit-details-marker { display: none; }
.model-gate .gate-hints-label { flex: none; font-weight: var(--fw-medium); white-space: nowrap; }
.model-gate .gate-hints-first { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .75; }
.model-gate .gate-hints > summary .icon:last-child { flex: none; transition: transform .15s var(--ease); }
.model-gate .gate-hints[open] > summary .icon:last-child { transform: rotate(90deg); }
.model-gate .gate-hints[open] .gate-hints-first { visibility: hidden; }
.model-gate .gate-hints-body { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; padding: 0 var(--sp-3) var(--sp-3) calc(var(--sp-3) + var(--icon) + var(--sp-2)); list-style: none; }
.model-gate .gate-hint { line-height: var(--lh-relaxed); overflow-wrap: anywhere; }
.model-gate .gate-groups { display: flex; flex-direction: column; min-width: 0; }
.model-gate .gate-group { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; padding: var(--sp-4) 0; border-top: 1px solid var(--sep); }       /* 不再用灰色底：同一张白卡里只靠细分隔线分段（苹果设置页的分组方式） */
.model-gate .gate-group-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.model-gate .gate-group-title { margin: 0; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--faint); letter-spacing: .02em; line-height: var(--lh-tight); }
.model-gate .gate-group-meta { font-size: var(--fs-xs); color: var(--faint); font-variant-numeric: tabular-nums; }
.model-gate .gate-fold > summary { list-style: none; cursor: pointer; }
.model-gate .gate-fold > summary::-webkit-details-marker { display: none; }
.model-gate .gate-fold > summary .gate-group-title { flex: 1; }
.model-gate .gate-fold > summary .icon { flex: none; align-self: center; color: var(--faint); transition: transform .15s var(--ease); }
.model-gate .gate-fold[open] > summary .icon { transform: rotate(90deg); }
.model-gate .gate-fold, .model-gate .gate-group[data-group="file"] { padding: var(--sp-3) 0; }       /* 只有一行的分段（接下来、文件）矮一点，免得比有内容的分段还松 */
.model-gate .gate-fold[open] { gap: var(--sp-3); }
.model-gate .gate-fold:not([open]) { gap: 0; }
.model-gate .gate-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: var(--sp-2) var(--sp-4); min-width: 0; }       /* 名称 | 内容 两列，原子数、盒子、溶质、溶剂、离子的名称列自然对齐 */
.model-gate .gate-row, .model-gate .gate-comp, .model-gate .gate-comp-row { display: contents; }
.model-gate .gate-comp-label { font-size: var(--fs-xs); color: var(--faint); white-space: nowrap; }
.model-gate .gate-row-value { min-width: 0; color: var(--dim); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }       /* 原子数、盒子：加粗，但是灰色，不抢入口与按钮 */
.model-gate .mol-parts { align-items: center; gap: var(--sp-1) var(--sp-4); color: var(--dim); font-size: var(--fs-xs); }       /* 组分的名称与数量和前面的“溶质 / 溶剂 / 离子”同一个字号；原子数、盒子是大一号的加粗字（2026-11-17 用户要求） */
.model-gate .mol-part { padding: 0; background: none; }       /* 数量不再套框：和上面的原子数、盒子一样是表里的字 */
.model-gate .mol-part-more { grid-column: 2; font-size: var(--fs-xs); color: var(--faint); }
.model-gate .gate-quote { margin: 0; padding: var(--sp-0) var(--sp-3); border-inline-start: 3px solid var(--fill-2); color: var(--dim); line-height: var(--lh-relaxed); overflow-wrap: anywhere; }
.model-gate .gate-steps { display: flex; flex-direction: column; gap: var(--sp-1); margin: 0; padding: 0; list-style: none; }
.model-gate .gate-step { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.model-gate .gate-step-n { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: none; box-shadow: inset 0 0 0 1px var(--sep); color: var(--dim); font-size: var(--fs-2xs); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.model-gate .gate-step-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.model-gate .gate-step-eta { flex: none; font-size: var(--fs-xs); color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.model-gate .gate-group[data-group="file"] { flex-direction: row; align-items: center; gap: var(--sp-3); }
.model-gate .gate-group[data-group="file"] .gate-group-head { flex: none; }
.model-gate .gate-group[data-group="file"] .mol-path { min-width: 0; color: var(--faint); font-size: var(--fs-xs); }
.model-gate:not([data-state="waiting"]) .gate-hero { background: none; box-shadow: inset 0 0 0 1px var(--sep); }
.model-gate:not([data-state="waiting"]) .gate-hero-icon { background: var(--fill); color: var(--dim); }
.model-gate-note { margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--faint); line-height: var(--lh-tight); }
@container (max-width: 420px) { .model-gate .gate-hero-cta { display: none; } }       /* 窄栏里入口整块可点，右边的胶囊让位给文字 */
/* 确认点与提示（协议 §367）：文件列表、同组合并的页签 */
.model-gate .gate-files { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.model-gate .gate-file { display: flex; align-items: baseline; gap: var(--sp-3); min-width: 0; }
.model-gate .gate-file .mol-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font-size: var(--fs-xs); }
.model-gate .gate-file[data-missing="true"] .mol-path { color: var(--warn); text-decoration: line-through; }
.model-gate .gate-file-meta { flex: none; font-size: var(--fs-xs); color: var(--faint); font-variant-numeric: tabular-nums; }
.model-gate .gate-file-open { flex: none; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-medium); cursor: pointer; }
.model-gate .gate-file-open:hover { text-decoration: underline; }
.model-gate[data-kind="notice"] .gate-state { background: var(--fill); color: var(--dim); }
.gate-bundle { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.gate-bundle > [hidden] { display: none; }
.gate-pager { padding: 0 var(--sp-1); }
/* 小横杠每个是一个按钮（点哪个看哪个）：点击区比看得见的那条横杠高，横杠画在伪元素上；颜色同分子确认的进度条 */
.gate-pager .mol-segs { gap: 2px; }
.gate-pager button.mol-seg { all: unset; box-sizing: border-box; position: relative; flex: none; width: 24px; height: 20px; cursor: pointer; border-radius: var(--r-item); }
.gate-pager button.mol-seg::before { content: ""; position: absolute; inset: 8px 2px; border-radius: var(--r-pill); background: var(--seg-track); }
.gate-pager button.mol-seg[data-state="current"]::before { background: var(--accent); }
.gate-pager button.mol-seg[data-state="ok"]::before { background: var(--ok); }
.gate-pager button.mol-seg:hover::before { filter: brightness(0.92); }
.gate-pager button.mol-seg:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
/* 左右切换：两个小箭头按钮靠右；到头了置灰、位置不动；左边的箭头是右箭头翻过来 */
.gate-navs { margin-inline-start: auto; display: inline-flex; gap: 2px; }
.gate-nav { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--r-pill); color: var(--accent); cursor: pointer; }
.gate-nav .icon { width: 14px; height: 14px; }
.gate-nav-prev .icon { transform: scaleX(-1); }
.gate-nav:hover:not(:disabled) { background: var(--accent-soft); }
.gate-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.gate-nav:disabled { color: var(--faint); cursor: default; opacity: 0.5; }
.gate-bundle[data-many="true"] .gate-order { display: none; }      /* 上面已经写了“第 n / m 个” */
.gate-all { align-self: flex-start; padding: var(--sp-1) var(--sp-3); border: 0; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; }
.model-gate.flash { animation: gate-flash 1.6s var(--ease); }
@keyframes gate-flash { 0%, 60% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: var(--shadow-1); } }
/* 计算连续性的小提示卡（continuity-note.js，协议 §388）：比确认卡轻——没有阴影、不进决策区，默认展开，“知道了”之后收成一行（图标、标题、分子名）。
   灰色内框（--fill、--r-item）与提问卡、计划卡一致；只用主题变量，深浅色自动跟随；版面靠 flex 换行与 min-width: 0，窄栏不横向溢出。 */
.card.continuity-note { min-width: 0; padding: var(--sp-1) var(--sp-4); }
.continuity-note .cn-head { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-width: 0; padding: var(--sp-2) 0; border: 0; background: none; color: var(--fg); font-size: var(--fs-md); line-height: var(--lh-tight); text-align: start; cursor: pointer; }
.continuity-note .cn-head:focus-visible { outline: none; border-radius: var(--r-sm); box-shadow: 0 0 0 1px var(--accent), var(--ring); }
.continuity-note .cn-head > .icon { flex: none; color: var(--glyph); }
.continuity-note .cn-title { flex: none; font-weight: var(--fw-semibold); }
.continuity-note .cn-head-name { flex: 1 1 0; min-width: 0; overflow: hidden; color: var(--dim); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.continuity-note .cn-head > .icon:last-child { margin-inline-start: auto; transition: transform .15s var(--ease); }
.continuity-note[data-collapsed="false"] .cn-head > .icon:last-child { transform: rotate(90deg); }
.continuity-note .cn-body { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; padding: var(--sp-1) 0 var(--sp-3); }
.continuity-note .cn-from { display: flex; flex-direction: column; gap: var(--sp-0); min-width: 0; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-item); background: var(--fill); }
.continuity-note .cn-name { font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.continuity-note .cn-when { color: var(--dim); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.continuity-note .cn-comp { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); min-width: 0; color: var(--dim); font-size: var(--fs-sm); }
.continuity-note .cn-chip { max-width: 100%; padding: 0 var(--sp-2); border-radius: var(--r-pill); background: var(--fill-2); color: var(--fg); font-size: var(--fs-xs); line-height: 20px; overflow-wrap: anywhere; }
.continuity-note .cn-lead { margin: 0; color: var(--dim); font-size: var(--fs-sm); line-height: var(--lh-tight); }
.continuity-note .cn-lead.cn-sub { color: var(--faint); font-size: var(--fs-xs); }
.continuity-note .cn-rows { display: flex; flex-direction: column; min-width: 0; border-radius: var(--r-item); background: var(--fill); overflow: hidden; }
.continuity-note .cn-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-0) var(--sp-3); min-width: 0; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); }
.continuity-note .cn-row + .cn-row { box-shadow: inset 0 1px 0 var(--sep); }
.continuity-note .cn-label { color: var(--dim); overflow-wrap: anywhere; }
.continuity-note .cn-value { min-width: 0; margin-inline-start: auto; font-variant-numeric: tabular-nums; text-align: end; overflow-wrap: anywhere; }
.continuity-note .cn-old { color: var(--dim); }
.continuity-note .cn-arrow { margin: 0 var(--sp-1); color: var(--faint); }
.continuity-note .cn-new { font-weight: var(--fw-medium); }
.continuity-note .cn-actions { margin-top: 0; }
/* 交给 AI 判断的审核意见（confirm.js 的 findingsNode，协议 §464）：一条两行——“审核意见（重要）：说法”与“AI 的处理：采纳（理由）”。执行确认卡、对话里的小卡、流程详情共用。
   重要的那条标签用暖色，未采纳的处理用暖色；其余是正文与次要灰。只用主题变量，深浅色自动跟随；长文字折行，不横向溢出。 */
/* 审核意见的样式向计划卡看齐（协议 §509，用户嫌执行确认卡里这一块与计划卡不和谐）：计划卡的做法是“淡灰内容 + 宽松行距”——步骤与视角行都是 --lh（1.75），
   内容用 --dim / --faint，不拿前景色压过周围；原来这里行距收到 --lh-tight（1.45）、说法用整张卡最亮的 --fg，夹在淡灰的要点行与宽松的视角行之间显得突兀。
   重要的那一档仍然用 --warn（与下面“计划审核”的头、视角名同一个色），“未采纳”也照旧——这是信号，不是装饰。 */
.findings { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; margin: var(--sp-2) 0 0; padding: 0; list-style: none; font-size: var(--fs-sm); line-height: var(--lh); }
.finding { display: flex; flex-direction: column; gap: 0; min-width: 0; overflow-wrap: anywhere; }
.finding-claim { color: var(--dim); }
.finding-action { color: var(--faint); }
.finding-label { color: var(--faint); }
.finding[data-level="high"] > .finding-claim > .finding-label { color: var(--warn); font-weight: var(--fw-medium); }
.finding[data-decision="dismiss"] .finding-decision { color: var(--warn); font-weight: var(--fw-medium); }
.finding[data-decision="accept"] .finding-decision { color: var(--fg); }
/* 对话里的审核意见小卡：同计算连续性小卡（没有阴影、不进决策区），默认收成一行（图标、“审核意见”、几条与 AI 的处理），点开逐条 */
.card.findings-note { min-width: 0; padding: var(--sp-1) var(--sp-4); }
.findings-note .fn-head { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-width: 0; padding: var(--sp-2) 0; border: 0; background: none; color: var(--fg); font-size: var(--fs-md); line-height: var(--lh-tight); text-align: start; cursor: pointer; }
.findings-note .fn-head:focus-visible { outline: none; border-radius: var(--r-sm); box-shadow: 0 0 0 1px var(--accent), var(--ring); }
.findings-note .fn-head > .icon { flex: none; color: var(--warn); }
.findings-note .fn-head > .icon:last-child { margin-inline-start: auto; color: var(--glyph); transition: transform .15s var(--ease); }
.findings-note[data-collapsed="false"] .fn-head > .icon:last-child { transform: rotate(90deg); }
.findings-note .fn-title { flex: none; font-weight: var(--fw-semibold); }
.findings-note .fn-line { flex: 1 1 0; min-width: 0; color: var(--dim); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.findings-note .findings { margin: 0; padding: var(--sp-1) 0 var(--sp-3); }
.step-flag.warn { background: var(--warn-soft); color: var(--warn); }
.plan-molecule[data-active="false"] { visibility: hidden; pointer-events: none; }
.plan-molecule { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "media info" "notes notes"; align-content: start; gap: var(--sp-3) var(--sp-4); min-width: 0; font-size: var(--fs-sm); line-height: var(--lh-tight); }
.mol-media { grid-area: media; width: 188px; min-width: 0; }
.plan-molecule[data-complex="true"] .mol-media { width: 216px; }
.mol-tile { display: block; width: 100%; aspect-ratio: 4 / 3; padding: var(--sp-2); box-sizing: border-box; border: 0; border-radius: var(--r-item); background: #fff; box-shadow: 0 0 0 1px var(--sep); overflow: hidden; }
button.mol-tile { cursor: pointer; }
button.mol-tile:hover { box-shadow: 0 0 0 1px var(--accent); }
button.mol-tile:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--accent), var(--ring); }
.mol-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mol-tile-empty { display: grid; place-items: center; height: 100%; color: var(--faint); font-size: var(--fs-xs); }
.mol-views { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); margin-inline-start: auto; min-width: 0; }
.mol-views .view-btn { margin-inline-start: 0; }
.mol-view { display: contents; }
.mol-view-error, .mol-info .view-error { flex-basis: 100%; }
.mol-info { grid-area: info; display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.mol-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); }
.mol-name { font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--fg); line-height: var(--lh-tight); overflow-wrap: anywhere; }
.mol-role { flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 var(--sp-2); border-radius: var(--r-pill); background: var(--fill); color: var(--dim); font-size: var(--fs-2xs); font-weight: var(--fw-medium); line-height: 1; }
.mol-check { flex: none; display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1; }
.mol-check[data-state="ok"] { color: var(--ok); }
.mol-check[data-state="unchecked"] { color: var(--warn); }
.mol-v[data-testid="mol-ident"] { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-0) var(--sp-3); font-variant-numeric: tabular-nums; }
.mol-formula { font-weight: var(--fw-medium); color: var(--fg); }
.mol-formula sub, .mol-formula sup, .mol-part sub, .mol-part sup { font-size: .72em; line-height: 0; }
.mol-mass { color: var(--dim); }
.mol-mass .unit { font-size: var(--fs-xs); color: var(--faint); }
/* 事实表：所有行在同一张两列的表里（左边名称、右边内容），行高一致、左对齐；内容一行放不下的（来源、SMILES）用省略号，全文在悬停提示里。 */
.mol-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; gap: var(--sp-2) var(--sp-3); }
.mol-k { color: var(--faint); line-height: 22px; }
.mol-v { min-width: 0; min-height: 22px; display: flex; align-items: center; color: var(--fg); line-height: 22px; overflow-wrap: anywhere; }
.mol-v[data-testid="mol-ident"] { align-items: baseline; }
.mol-v[data-testid="mol-form"][data-sign="+"], .mol-v[data-testid="mol-form"][data-sign="-"] { color: var(--accent); }
.mol-source { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mol-parts { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1); }
.mol-part { padding: 0 var(--sp-2); border-radius: var(--r-xs); background: var(--fill); font-variant-numeric: tabular-nums; }
.mol-notes { grid-area: notes; display: flex; flex-direction: column; gap: var(--sp-1); }
.mol-note { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-item); background: var(--warn-soft); color: var(--warn); }
.mol-note .icon { flex: none; margin-top: 2px; }
.mol-smiles-v { display: flex; align-items: center; gap: var(--sp-1); min-width: 0; min-height: 22px; }
.mol-smiles { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: var(--fs-xs); color: var(--dim); user-select: all; }
.mol-smiles-len { flex: none; color: var(--faint); font-size: var(--fs-xs); }
.mol-smiles-v[data-open="true"][data-complex="true"] { align-items: flex-start; }
.mol-smiles-v[data-open="true"][data-complex="true"] .mol-smiles { max-height: 9em; overflow: auto; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.mol-smiles-v .text-btn { flex: none; height: 22px; color: var(--accent); font-size: var(--fs-xs); }
.mol-smiles-v .mol-smiles-copy { height: 22px; min-width: 22px; }
.mol-smiles-copy[data-state="copied"] { color: var(--ok); }
@container (max-width: 520px) {
  .plan-molecule { grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "info" "notes"; }
  .mol-media, .plan-molecule[data-complex="true"] .mol-media { width: 100%; }
  .mol-tile { aspect-ratio: auto; height: 168px; }
}
/* 结构文件（蛋白、核酸、复合物、晶体材料；molecule-card.js，协议 §258）：图块是链条图或大号化学式，不是白底的化学结构图；事实表沿用上面的两列表。 */
.plan-molecule[data-structure="true"] .mol-media { width: 216px; }
@container (max-width: 520px) { .plan-molecule[data-structure="true"] .mol-media { width: 100%; } }       /* 窄的时候图块占满宽（cartoon 放大些，链条图也不再留空） */
.mol-struct { aspect-ratio: auto; min-height: 96px; display: flex; flex-direction: column; justify-content: center; padding: var(--sp-3); background: var(--fill); box-shadow: none; }
.mol-chains { display: flex; flex-direction: column; gap: var(--sp-1); width: 100%; }
.mol-chain { display: flex; align-items: center; gap: var(--sp-2); }
.mol-chain-id { flex: none; min-width: 14px; font-size: var(--fs-2xs); line-height: 1; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.mol-chain-bar { flex: 1; display: flex; align-items: center; gap: 2px; height: 8px; min-width: 0; }
.mol-chain-seen { flex: none; height: 100%; min-width: 2px; border-radius: var(--r-xs); background: var(--accent); }
.mol-chain[data-type="dna"] .mol-chain-seen, .mol-chain[data-type="rna"] .mol-chain-seen, .mol-chain[data-type="nucleic"] .mol-chain-seen { background: var(--ft-teal); }
.mol-chain-gap { flex: none; height: 100%; box-sizing: border-box; border: 1px dashed var(--warn); border-radius: var(--r-xs); }
.mol-chain-more { font-size: var(--fs-2xs); color: var(--faint); text-align: right; }
.mol-crystal { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-1); width: 100%; }
.mol-crystal-formula { font-size: var(--fs-xl); font-weight: var(--fw-semibold); color: var(--fg); line-height: var(--lh-tight); overflow-wrap: anywhere; text-align: center; }
.mol-crystal-formula sub, .mol-crystal-formula sup { font-size: .6em; line-height: 0; }
.mol-crystal-system { font-size: var(--fs-xs); color: var(--faint); }
.mol-v[data-testid="mol-composition"] { flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); }
.mol-complex { font-weight: var(--fw-medium); }
.mol-warn { color: var(--warn); font-weight: var(--fw-medium); }
.mol-faint, .mol-part-more { color: var(--faint); font-size: var(--fs-xs); }
.mol-path { font-family: var(--mono); font-size: var(--fs-xs); color: var(--dim); }
@container (max-width: 520px) { .mol-struct { height: auto; } }
/* 蛋白、核酸、复合物的 cartoon 缩略图（协议 §266）：白底的图块，与小分子的结构图一样；退回链条图时图块下面一行小字写明原因。 */
.mol-tile[data-art="true"] { background: #fff; }
.mol-tile-note { margin-top: var(--sp-1); font-size: var(--fs-2xs); line-height: var(--lh-tight); color: var(--faint); }
/* 逐个确认（moleculeSteps）：一排小段表示进度（当前的是强调色、确认无误的是绿、有疑问的是黄、还没问的是灰），右边写第几个，再右边是“上一个”。
   确认之前页签条收起；确认之后（卡片成了记录，data-steps="done"）进度条收起、页签条回来，可以回看每个分子。 */
.mol-set[data-steps="true"] > .mol-bar, .mol-set[data-steps="done"] > .mol-steps { display: none; }
.mol-steps { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); min-width: 0; }
.mol-steps[hidden] { display: none; }
.mol-segs { display: flex; flex-wrap: wrap; gap: var(--sp-1); min-width: 0; }
.mol-seg { flex: none; width: 20px; height: 4px; border-radius: var(--r-pill); background: var(--seg-track); }
.mol-seg[data-state="current"] { background: var(--accent); }
.mol-seg[data-state="ok"] { background: var(--ok); }
.mol-seg[data-state="ask"] { background: var(--warn); }
.mol-step-label { font-size: var(--fs-xs); color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mol-step-back { margin-inline-start: auto; height: 22px; color: var(--accent); font-size: var(--fs-xs); }
.mol-step-back[hidden] { display: none; }
.mol-set[data-steps] .plan-molecule:focus { outline: none; }
/* 流程确认卡里的分子：缩进到“分子”标签文字的位置 */
.plan-mols > .plan-molecules { padding-left: calc(12px + var(--sp-2)); margin-top: var(--sp-2); }
/* 用显卡是中性的事实，不是警告（M2）。 */
.plan-flag { background: var(--fill-2); color: var(--dim); }


/* 结构卡片 */
.card.structure { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; }
.card.structure .figure { flex: none; display: flex; align-items: center; justify-content: center; width: 132px; height: 112px; border-radius: var(--r-item); background: var(--paper); color: var(--on-paper); overflow: hidden; box-shadow: inset 0 0 0 1px var(--sep); }
.card.structure .figure svg { width: 100%; height: 100%; }
.card.structure .figure-missing { padding: var(--sp-2); text-align: center; font-size: var(--fs-xs); color: var(--faint); }
.card.structure .side { flex: 1 1 120px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
.card.structure .smiles { display: block; max-width: 100%; padding: var(--sp-0) var(--sp-2); border-radius: var(--r-code); background: var(--fill); user-select: all; }
.card.structure .smiles.missing { font-family: inherit; color: var(--dim); user-select: none; }

/* —— 流程区：固定在输入框上方 ——
   输入区整块最多占对话列的一半（style.css 的 #dock-area）；多个流程过高时滚动整个输入区；
   单条流程的步骤列表自己也有上限（约六步），步骤再多也是内部滚动。 */
.dock { flex: none; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--edge); border-bottom: 0; border-radius: var(--r-composer) var(--r-composer) 0 0; background: var(--surface); }
.flow-item { flex: none; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.flow-item + .flow-item { border-top: 1px solid var(--sep); }
.flow-row { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--sp-2) var(--sp-3); padding: var(--sp-3) var(--sp-4) 0; }
.flow-heading { min-width: 0; min-height: 32px; display: flex; align-items: center; gap: var(--sp-2); }
.flow-row > .flow-heading { grid-column: 1; }
/* 标题按钮：整块可点，点了展开或收起这个任务的步骤。 */
.flow-toggle { min-width: 0; flex: 1 1 auto; display: flex; align-items: center; gap: var(--sp-2); padding: 0; border: 0; background: transparent; color: var(--fg); font: inherit; font-size: var(--fs-sm); text-align: left; }
.flow-toggle:hover b { color: var(--accent); }
.flow-toggle b { flex: 1; min-width: 0; max-width: 100%; overflow: hidden; font-weight: var(--fw-medium); white-space: nowrap; text-overflow: ellipsis; }
/* 状态字：有问题时是可点的按钮（展开问题详情），没有时是普通文字；颜色表示状态，不画底色。 */
.flow-status { flex: none; display: inline-flex; align-items: center; min-height: 22px; padding: 0; border: 0; background: transparent; color: var(--dim); font-size: var(--fs-xs); font-weight: var(--fw-regular); white-space: nowrap; }
button.flow-status:hover { text-decoration: underline; text-underline-offset: 2px; }
.flow-status[data-status="running"] { color: var(--accent); }
.flow-status[data-status="paused"], .flow-status[data-status="partial"] { color: var(--warn); }
.flow-status[data-status="failed"] { color: var(--bad); }
/* 协议第 141 节：AI 正在排查的失败用警示色（失败的那一步仍是红的）；已被新流程取代的用中性灰，不再是红。 */
.flow-status[data-state="analyzing"] { color: var(--warn); }
.flow-status[data-state="superseded"] { color: var(--dim); }
.flow-summary { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-1) var(--sp-3); color: var(--dim); }
.flow-row .meta, .flow-row .flow-progress { flex: none; color: var(--dim); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.flow-row .flow-actions { grid-column: 3; grid-row: 1; align-self: center; flex: none; font-size: var(--fs-sm); }
.flow-row > .flow-error, .flow-row > .flow-tail { grid-column: 1 / -1; }
/* 每个任务行下面的进度条与“计算任务”那一行（.flow-current-bar）同一个样子：左右各缩进 12px、2px 高、圆角、离底 3px。 */
.task-progress { display: block; flex: none; width: auto; height: 2px; margin: 0 12px 3px; overflow: hidden; border-radius: var(--r-pill); background: var(--fill-2); }
.task-progress span { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width var(--dur-2) var(--ease); }
.task-progress.warning span { background: var(--warn); }
.task-progress.failed span { background: var(--bad); }
.task-progress.neutral span { background: var(--faint); }
.flow-item[data-status="failed"] .flow-summary > .meta { color: var(--bad); }
.flow-item[data-state="analyzing"] .flow-summary > .meta { color: var(--warn); }
.flow-item[data-state="superseded"] .flow-summary > .meta, .flow-item[data-state="superseded"] .flow-error { color: var(--dim); }
.flow-error { flex: 1 1 100%; min-width: 0; font-size: var(--fs-sm); color: var(--bad); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
/* 失败那一步日志的最后几行与“让 AI 看看”（V6 S4）。 */
.flow-tail { flex: 1 1 100%; min-width: 0; margin: 0; padding: var(--sp-2) var(--sp-3); max-height: 120px; overflow: auto; border-radius: var(--r-item); background: var(--fill); font: var(--fs-xs)/var(--lh) var(--mono); color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; }
/* 步骤列表：缩进到与任务标题文字同一条竖线（行左内边距 + 序号宽 + 间距），每一步是一块浅灰底的小卡片，没有分隔线；
   完成的是浅浅的绿底，失败的是浅红底，在跑的靠左边的 Step n 标签用强调色。标记写成“Step 1…n”，不再用对勾。 */
.flow-item { --steps-indent: calc(var(--sp-4) + 18px + var(--sp-2)); }
/* 一个任务里分开的体系：每个体系是一个任务行（和普通任务一样的行：序号、名字、状态、几步、细进度），不再套一层流程名；整个任务的状态与控制在下面一条小行里 */
.flow-item[data-branched="true"] > .flow-sub + .flow-sub { border-top: 1px solid var(--sep); }
.flow-sub { display: flex; flex-direction: column; min-width: 0; }
.flow-sub[data-state="failed"] .flow-status { color: var(--bad); }
.flow-sub[data-state="gate"] .flow-status { color: var(--warn); }
.flow-sub[data-state="running"] .flow-status { color: var(--accent); }
.flow-sub[data-state="succeeded"] .flow-status { color: var(--ok); }
.flow-strip { border-top: 1px solid var(--sep); }
.steps { box-sizing: border-box; flex: 0 1 auto; min-height: 40px; max-height: 180px; overflow-y: auto; list-style: none; margin: 0; padding: var(--sp-2) var(--sp-4) var(--sp-2) var(--steps-indent); display: flex; flex-direction: column; gap: var(--sp-1); }
.steps li { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-3); align-items: start; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-item); background: var(--fill); font-size: var(--fs-sm); color: var(--dim); }
.steps .mark { min-width: 52px; box-sizing: border-box; padding: 1px var(--sp-2); border-radius: var(--r-pill); text-align: center; white-space: nowrap; font-size: var(--fs-xs); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; background: var(--fill-2); color: var(--dim); }
.steps li[data-status="succeeded"] { background: var(--ok-soft); color: var(--fg); }
.steps li[data-status="succeeded"] .mark { background: var(--ok-soft-strong); color: var(--ok); }
.steps li[data-status="running"] { color: var(--fg); font-weight: var(--fw-medium); }
.steps li[data-status="running"] .mark { background: var(--accent-soft); color: var(--accent); }
.steps li[data-status="failed"] { background: var(--bad-soft); color: var(--fg); }
.steps li[data-status="failed"] .mark { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.step-main { min-width: 0; display: flex; flex-direction: column; }
/* 步骤标题后面的小标记：重试中的“第 n 次”、超时（协议第 53 节）。 */
.step-line { display: flex; align-items: center; flex-wrap: nowrap; gap: var(--sp-0) var(--sp-2); min-width: 0; }      /* 步骤行最多两行：第一行标题 + 标记不换行，标题过长用省略号，标记不收缩 */
.step-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-flag { background: var(--fill-2); color: var(--dim); font-weight: var(--fw-regular); }
.step-flag.bad { background: var(--bad-soft); color: var(--bad); }
.step-main > .step-flag { align-self: flex-start; }      /* 第二行的“等待资源”标签：不被纵向排布拉成整行宽 */
.step-progress { font: var(--fw-regular) var(--fs-xs)/var(--lh) var(--mono); color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-progress:empty { display: none; }
.steps .t { color: var(--dim); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; font-weight: var(--fw-regular); white-space: nowrap; }
.flow-foot { flex: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-1) var(--sp-3); padding: var(--sp-2) var(--sp-4) var(--sp-3); border-top: 1px solid var(--sep); color: var(--dim); font-size: var(--fs-sm); }
.flow-actions { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); margin-left: auto; }
/* “让 AI 看看”（失败、部分失败的流程；2026-10-30 起平时藏着）：鼠标移到这个任务上（或键盘聚焦进它）时，从右边淡入滑出；位置一直占着，滑出时一行不跳。
   样式：胶囊、--accent-soft 的淡蓝底、--accent 的字与小对话图标，不再是一个大按钮；悬停加深一点。没有悬停的触屏设备一直显示；“减少动态效果”由 style.css 里统一的那一条处理，这里不另写。 */
.flow-ask { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 24px; padding: 0 var(--sp-3) 0 var(--sp-2); border: 0; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1; white-space: nowrap; cursor: pointer;
  opacity: 0; transform: translateX(6px); pointer-events: none; transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease); }
.flow-ask .icon { --icon: 12px; }
.flow-item:hover .flow-ask, .flow-item:focus-within .flow-ask { opacity: 1; transform: none; pointer-events: auto; }
.flow-ask:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.flow-ask:active { transform: scale(.97); }
/* “停止自动处理”（协议第 141 节）：和“让 AI 看看”同样的胶囊，但是中性色（--fill-2 底、--dim 字），不抢眼；排查中、重试中一直显示，窄屏也在。 */
.flow-stop { flex: none; display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--sp-3); border: 0; border-radius: var(--r-pill); background: var(--fill-2); color: var(--dim); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1; white-space: nowrap; cursor: pointer; transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.flow-stop:hover:not(:disabled) { background: var(--fill); color: var(--fg); }
.flow-stop:active:not(:disabled) { transform: scale(.97); }
.flow-stop:disabled { opacity: .5; cursor: default; }
@media (hover: none) { .flow-ask { opacity: 1; transform: none; pointer-events: auto; } }
/* 窄屏：任务行改成一列。（前面 .flow-row 的 padding-bottom 为 0，这里同样不给底部内边距，进度条紧贴行底。） */
@media (max-width: 820px) {
  .flow-item { --steps-indent: calc(var(--sp-3) + 18px + var(--sp-2)); }
  .flow-row { grid-template-columns: minmax(0, 1fr); gap: var(--sp-1) var(--sp-2); padding: var(--sp-3) var(--sp-3) 0; }
  .flow-row > .flow-heading, .flow-summary { grid-column: 1; justify-content: flex-start; }
  .flow-row .flow-actions { grid-column: 1; grid-row: auto; justify-self: start; margin-left: 0; }
  .flow-actions { gap: 0 var(--sp-1); }
  /* 状态字很长时（“AI 正在排查（已自动处理 2/3 次）”“失败 · 已停止自动处理”）换到标题下一行，不把任务名挤成零宽（真渲染 390px 时发现）。 */
  .flow-heading { flex-wrap: wrap; }
  .flow-toggle { flex: 1 1 9em; }
}
/* 触屏与窄屏：流程区的按钮至少 40×40 的可点区域（V6 打磨）。 */
@media (pointer: coarse), (max-width: 820px) {
  .flow-actions .text-btn, .flow-actions .view-btn, .dock button { min-width: var(--ctl-touch); min-height: var(--ctl-touch); padding: 0 var(--sp-2); }
}

/* —— 决策区（decision-dock.js，方案 C）：等你决定的卡在输入区上方取代输入框；对话里原位留一行“等你决定” ——
   卡片还是原来的卡片（.card.confirm / .card.plan），进来时是浮起的“待答”样子，答完回到对话里变成一行记录。
   卡自己最多占 40vh 并在里面滚动（输入框、提问卡不跟着滚）：矮窗口（600px 高）里 40vh = 240px，加上底下一行“打断”与上下的空隙，
   对话区仍留得出 220px 以上；多张卡从上到下排。比决策区高的卡（步骤多的流程确认），按钮区钉在决策区底部，随时点得到。 */
.decision-dock { flex: none; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: var(--sp-1); margin-inline: -3px; }
.decision-dock[hidden] { display: none; }
/* 3px 的内边距配 -3px 的外边距（决策区左右、卡片滚动区上下）：版面不变，卡片的焦点环（2px）不会被滚动区裁掉。 */
.decision-cards { flex: 0 1 auto; min-height: 0; max-height: 40vh; display: flex; flex-direction: column; gap: var(--sp-2); margin-block: -3px; padding: 3px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.decision-cards:empty { display: none; }       /* 只有提问、没有待决定的卡时，决策区只剩底下那一行“打断” */
.decision-cards > .card { flex: none; margin: 0; }
.decision-cards > .gate-bundle { flex: none; margin: 0; max-width: none; }      /* 确认模型的块（几个体系逐个看）：块里的卡和别的卡一样钉按钮 */
.decision-cards > .card:focus { outline: none; }
.decision-cards > .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
/* 比决策区高的卡（decision-dock.js 量出来标 data-tall）：按钮区钉在决策区底部（连同卡片下内边距一起，钉住时离底边仍有一个内边距；bottom 取 -3px 是抵消滚动区的 3px 内边距，不然下面会露出一条列表）。 */
.decision-cards > .card[data-tall="true"] .actions-area, .decision-cards > .gate-bundle[data-tall="true"] .model-gate .actions-area { position: sticky; bottom: -3px; z-index: 1; margin-bottom: calc(-1 * var(--sp-4)); padding: var(--sp-2) 0 var(--sp-4); background: var(--surface); box-shadow: 0 -1px 0 var(--sep); }
.decision-foot { display: flex; justify-content: flex-end; margin-inline: 3px; }
/* 对话里的占位行：一行字，一个呼吸的小圆点，告诉你这一处在等你，卡片在下面的决策区。 */
.msg.pending-mark { align-self: stretch; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) 0; color: var(--dim); font-size: var(--fs-sm); }
.msg.pending-mark::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); animation: pulse var(--dur-pulse) ease-in-out infinite; }
.pending-title { min-width: 0; overflow: hidden; color: var(--fg); text-overflow: ellipsis; white-space: nowrap; }
.pending-tag { flex: none; color: var(--bad); font-weight: var(--fw-medium); }

/* —— 提问卡片：出现时替换输入框 —— */
.ask { flex: none; display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4) var(--sp-3); border: 1px solid var(--sep); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1); }
.ask .q { color: var(--fg); font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: var(--lh); }
/* 与计划卡片同一套语言（.plan-steps）：选项放进浅灰圆角内框，行与行之间一条细线，选中的行淡强调底色；内框里的各行贴边，悬停与选中的底色铺满整行。 */
.ask .opts { gap: 0; margin: 0; border-radius: var(--r-view); background: var(--fill); overflow: hidden; }
.ask .opts > * + * { box-shadow: inset 0 1px 0 var(--sep); }
.ask .opts .opt { border-radius: 0; padding: var(--sp-2) var(--sp-3); }
.ask .opts .opt.sel { background: var(--accent-soft); }
/* 内框 overflow:hidden，选项行铺满整行：默认的外描边在边缘会被裁掉，键盘焦点就看不见了，所以画在行里面（内描边）。 */
.ask .opts .opt:focus-visible { outline-offset: -2px; }
.opts { display: flex; flex-direction: column; gap: var(--sp-0); margin: 0 calc(-1 * var(--sp-2)); }
.opt { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 0 var(--sp-3); align-items: center; text-align: left; width: 100%; color: var(--fg); background: transparent; border: 0; border-radius: var(--r-item); padding: var(--sp-2); }
.opt:hover { background: var(--hover); }
.opt:active { background: var(--press); }
/* 单选框、复选框：14 见方，选中时底色与边都是强调色。 */
.opt .radio, .opt .check { width: 14px; height: 14px; border: 1.5px solid var(--faint); display: grid; place-items: center; }
.opt .radio { border-radius: 50%; }
.opt .check { border-radius: calc(var(--r-xs) / 2); }      /* 14px 的方框：圆角 3px，不会看成圆（r-xs 的 6px 在 14px 上就是圆） */
.opt.sel .radio, .opt.sel .check { border-color: var(--accent); background: var(--accent); }
.opt.sel .radio::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--on-accent); }
.opt.sel .check::after { content: ""; width: 8px; height: 4px; margin-top: -2px; border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent); transform: rotate(-45deg); }
/* “其他”：选项列表的最后一行，单选 / 复选框加一个词，后面接行内输入框。 */
/* 选项行的内边距是 --sp-3（选项在灰色内框里，行铺满内框），“其他”这一行右边补同样的 --sp-3，输入框右缘与各行文字的左缘留出对称的空。 */
.ask-other-row { display: flex; align-items: center; gap: var(--sp-2); padding-inline-end: var(--sp-3); }
.ask-other-row .opt { flex: none; width: auto; grid-template-columns: 14px auto; }
.ask .ask-other { min-height: var(--ctl); padding: var(--sp-1) var(--sp-3); font-size: var(--fs-md); background: var(--surface); }
.ask-other-row .ask-other { flex: 1; }
.opt small { display: block; color: var(--dim); font-size: var(--fs-sm); }
/* 输入框（提问的“其他”、登录框）：浅底细边，聚焦时白底、强调色的边加一圈浅光。改名的就地输入框同一种聚焦。 */
.ask-other { width: 100%; min-width: 0; min-height: 40px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--edge); border-radius: var(--r-item); background: var(--fill); color: var(--fg); outline: none; }
.ask-other::placeholder { color: var(--faint); }
.ask-other:focus, .session-rename:focus, .object-rename:focus, .title-rename:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent); }
.ask-note { font-size: var(--fs-sm); color: var(--warn); }
.ask .foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: var(--sp-2); }
.ask-hint { flex-basis: 100%; font-size: var(--fs-sm); color: var(--faint); }
.ask .foot .primary:disabled { opacity: 1; background: var(--fill); color: var(--faint); box-shadow: none; }
/* 标签很长使 2D/3D 按钮换到下一行时，按钮不能贴着灰内框的边（内框 overflow:hidden，焦点环左侧会被裁）：按钮、说明的左右各留一个 --sp-3，与选项行的内边距一致，换行后正好对齐单选框；同一行时选项自己的右内边距加这一个就是与标签的间距，所以列间距为 0。 */
.ask-option-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-0) 0; }
.ask-option-row .opt { flex: 0 1 auto; min-width: 0; width: auto; }
.ask-option-row > :not(.opt) { margin-inline: var(--sp-3); }
/* 标签文字（SMILES、路径、DOI 一类无空格的长串）超出一行时在任意位置断行，不被灰内框截掉。 */
.ask .opt > span:last-child { overflow-wrap: anywhere; }
/* 带原图的候选（image / printed / check）：选项行下面接一块对照——原图在左，图上标注与结构计算的对照表在右，窄屏上下叠放；
   结构与图上标注对不上（data-check="mismatch"）时整块换警示色，警示行写明原因，用户仍可选“图上的不是这个”。 */
.ask-option-block { display: flex; flex-direction: column; gap: var(--sp-2); }
.ask-evidence { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-3) var(--sp-4); margin: 0 var(--sp-2) var(--sp-1) calc(var(--sp-3) + 14px + var(--sp-3)); padding: var(--sp-3); border: 0; border-radius: var(--r-view); background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep); }
.ask-option-block[data-check="mismatch"] .ask-evidence { box-shadow: inset 0 0 0 1px var(--warn); }
.ask-figure { flex: 0 1 180px; display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; margin: 0; }
.ask-figure-image { display: block; box-sizing: border-box; max-width: 100%; max-height: 160px; padding: 4px; object-fit: contain; border-radius: var(--r-sm); background: #fff; box-shadow: 0 0 0 1px var(--sep); }
.ask-figure figcaption, .ask-figure-fallback { font-size: var(--fs-xs); color: var(--faint); overflow-wrap: anywhere; }
.ask-evidence-side { flex: 1 1 200px; display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.ask-compare { border-collapse: collapse; font-size: var(--fs-xs); }
.ask-compare th, .ask-compare td { padding: 5px var(--sp-4) 5px 0; text-align: left; font-weight: var(--fw-regular); overflow-wrap: anywhere; }
.ask-compare tbody tr + tr th, .ask-compare tbody tr + tr td { border-top: 1px solid var(--sep); }
.ask-compare thead th { color: var(--faint); }
.ask-compare tbody th { color: var(--dim); }
.ask-compare td { color: var(--fg); font-family: var(--mono); font-size: var(--fs-xs); }
/* 提问卡片里的检查提示：提示条的形状（上面“提示条”一段），不再自己写一套。 */
.ask-warning strong { margin-inline-end: var(--sp-2); font-weight: var(--fw-semibold); }
/* “用我编辑后的结构”：按钮在候选的 3D 按钮下面，停用时旁边的小字说明怎么启用；取回成功、失败各一行说明。 */
.ask-edit { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin: 0 var(--sp-2); }
.ask-edit-hint { font-size: var(--fs-xs); color: var(--faint); }
.ask-edit-done { font-size: var(--fs-xs); color: var(--ok); }
.ask-edit-error { flex-basis: 100%; }
/* 多问题的卡片：每个问题一段，段与段之间一条细线；必填没答时标题变警示色；“提交”贴在可视区底部，问题多时也不会滚出去。 */
.ask-q { display: flex; flex-direction: column; gap: var(--sp-2); }
.ask-q + .ask-q { padding-top: var(--sp-3); border-top: 1px solid var(--sep); }
.ask-q[data-missing="true"] .q { color: var(--warn); }
.ask-tag { margin-left: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--faint); }
.ask-q[data-missing="true"] .ask-tag { color: var(--warn); }
.ask[data-many="true"] .foot { position: sticky; bottom: 0; padding: var(--sp-2) 0 var(--sp-1); background: var(--surface); }
/* 需求卡（ask_user 的 brief，协议第 200 节）：和计划卡同一套视觉——小节标题、内容、流程折叠项、“更多 / 收起”都直接用计划卡的类
   （.plan-line、.plan-fold、.plan-list、.k[data-tint]、.clamp，见上面计划卡片一节），不另写一份；这里只补：卡片标题（同 .plan-audit .title）、
   与下面问题之间的一条分隔线，以及“放不下时谁滚动”：输入区最多占对话列的 62%（style.css），需求卡比一般提问卡高得多——不能让用户第一眼只看到“跳过”、
   选项在折叠线以下；也不能再起一层滚动（输入区本身已经会滚，两层里按钮会被挤没）。所以带需求卡时：提问卡自己收缩到输入区给的高度（flex: 0 1 auto），
   只有需求卡这一块（.ask-brief）在里面滚动（至少留 72px），问题、选项、“提交 / 跳过”始终在可见范围内；矮到连这些都放不下的窗口才退回输入区整体滚动。 */
.ask-brief { padding-bottom: var(--sp-3); border-bottom: 1px solid var(--sep); }
.ask-brief .title { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
.ask-brief .title .icon { color: var(--glyph); }
.ask[data-brief="true"] { flex: 0 1 auto; min-height: 0; }
.ask[data-brief="true"] > :not(.ask-brief) { flex: none; }
.ask[data-brief="true"] > .ask-brief { flex: 0 1 auto; min-height: 72px; overflow-y: auto; overscroll-behavior: contain; }

/* —— 输入区（卡片、附件、发送按钮在 style.css） —— */
#composer { display: flex; flex-direction: column; gap: var(--sp-2); flex: none; }
/* 排队中的话：一组淡底的圆角行（像“设置”里的分组列表），行之间一条细线；右边是“打断并提交”“删除”两个小圆钮 */
#composer .input-queue { display: flex; flex-direction: column; gap: 0; max-height: 150px; overflow-y: auto; padding: 2px 6px 2px 14px; border: 0; border-radius: var(--r-card); background: var(--fill); }
#composer .input-queue-row { display: flex; align-items: center; gap: var(--sp-1); min-height: 36px; }
#composer .input-queue-row + .input-queue-row { border-top: 1px solid var(--sep); }
#composer .input-queue-text { flex: 1; min-width: 0; overflow: hidden; color: var(--dim); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
#composer .input-queue-row .round { width: 28px; height: 28px; --icon: var(--icon); }
#composer .input-queue-row .round:hover:not(:disabled) { background: var(--surface); }
#composer .chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { display: inline-flex; align-items: center; gap: var(--sp-1); max-width: 100%; min-height: 24px; padding: var(--sp-0) var(--sp-1) var(--sp-0) var(--sp-3); border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-size: var(--fs-xs); }
.chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-remove { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; --icon: 12px; }
.chip-remove:hover { background: var(--accent-soft); }
/* 菜单（标题菜单、会话行菜单，sessions.js）：fixed 定位的浮层，贴在标题下方，右边不伸到右侧面板（3D）上面。 */
.mode-menu { position: fixed; z-index: 4; width: max-content; max-width: min(300px, calc(100vw - 32px)); padding: var(--sp-1); display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--sep); border-radius: var(--r-view); background: var(--surface); box-shadow: var(--shadow-2); }
.mode-option { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 0 var(--sp-2); align-items: start; width: 100%; min-height: var(--ctl); padding: 6px var(--sp-2); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg); text-align: left; }
.mode-option:hover, .mode-option:focus-visible { background: var(--hover); outline: none; }
.mode-option:active:not(:disabled) { background: var(--press); }
.mode-check { margin-top: 3px; color: var(--accent); visibility: hidden; }
.mode-option:disabled { opacity: .5; }
.mode-text { min-width: 0; display: flex; flex-direction: column; }
.mode-name { font-size: var(--fs-md); font-weight: var(--fw-regular); }
/* 菜单项的悬停说明（sessions.js menuTip）：停留 0.3 秒后在菜单旁弹出的小浮层，不拦鼠标。 */
.menu-tip { position: fixed; z-index: 5; width: max-content; max-width: min(280px, calc(100vw - 16px)); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--sep); border-radius: var(--r-item); background: var(--surface); box-shadow: var(--shadow-2); color: var(--dim); font-size: var(--fs-xs); line-height: var(--lh-tight); pointer-events: none; }
.menu-tip[hidden] { display: none; }

/* —— 面板里：对象列表（在 3D 下面，条目横向排开，放不下就换行、滚动） —— */
#objects { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); font-size: var(--fs-sm); }
.objects-head { flex: none; font-size: var(--fs-xs); color: var(--dim); }
/* 撤销 / 重做：常驻在对象列表旁（V6 M6）。 */
#objects .history { flex: none; display: inline-flex; gap: var(--sp-0); }
.objects-list { display: contents; }
.objects-empty { color: var(--faint); font-size: var(--fs-sm); }
.objects-error { flex-basis: 100%; color: var(--bad); font-size: var(--fs-xs); }
.object-item { display: inline-flex; align-items: center; gap: 1px; max-width: 100%; min-height: var(--ctl-sm); padding: var(--sp-0) var(--sp-1); border-radius: var(--r-sm); background: var(--surface); }
.object-item[data-enabled="false"] { background: transparent; box-shadow: inset 0 0 0 1px var(--sep); }
.object-item[data-enabled="false"] .name { color: var(--dim); text-decoration: line-through; }
.object-name { display: inline-flex; align-items: baseline; gap: var(--sp-1); min-width: 0; padding: var(--sp-0) var(--sp-1); border: 0; background: transparent; font-size: var(--fs-sm); }
.object-name:hover .name { color: var(--accent); }
.object-name .name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-medium); }
.object-name .count { flex: none; font-size: var(--fs-xs); color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* —— 面板里：文件与流程详情 —— */
.pane-title { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); min-width: 0; min-height: var(--ctl); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.pane-sub { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--dim); font-variant-numeric: tabular-nums; }
.file-download, .detail-actions { margin-left: auto; }
.detail-actions { display: inline-flex; gap: var(--sp-2); font-weight: var(--fw-regular); }
.detail-actions button.small[data-armed="true"] { background: var(--bad); color: var(--on-status); }
.file-body { color: var(--dim); font-size: var(--fs-md); }
.file-view { flex: 1; min-height: 0; overflow: auto; border-radius: var(--r-view); background: var(--surface); padding: var(--sp-3) var(--sp-4); box-shadow: inset 0 0 0 1px var(--sep); }
/* 正文用等宽字体，字号向对话正文看齐（等宽字形偏大，14px 与对话的 15px 看上去一样大）；长行换行。 */
.file-view pre { margin: 0; font: var(--fs-md)/var(--lh-relaxed) var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.file-view img { display: block; max-width: 100%; height: auto; border-radius: var(--r-sm); }
/* SVG（协议 §485）：按图显示，透明底的图垫白底才看得清；源码折在下面 */
.file-svg { padding: var(--sp-3); border-radius: var(--r-sm); background: #fff; box-shadow: inset 0 0 0 1px var(--sep); }
.file-svg img { margin: 0 auto; max-height: 70vh; }
.file-svg-source { margin-top: var(--sp-3); }
.file-svg-source > summary { color: var(--dim); font-size: var(--fs-xs); cursor: pointer; }
.file-svg-source > pre { margin-top: var(--sp-2); }
.file-name { font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.file-note { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--sep); font-size: var(--fs-sm); color: var(--dim); }
.file-name + .file-note { padding-top: 0; border-top: 0; }
.detail-steps { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--sp-3); }
.detail-step { flex: none; display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-view); background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep); }
.detail-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.detail-head b { min-width: 0; font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
/* 每步的状态：前面一个同语义的圆点（与对话里、流程区里的状态色一致）。 */
.detail-status { flex: none; display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); color: var(--dim); }
.detail-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.detail-step[data-status="running"] .detail-status { color: var(--run); }
.detail-step[data-status="running"] .detail-status::before { animation: pulse var(--dur-pulse) ease-in-out infinite; }
.detail-step[data-status="succeeded"] .detail-status { color: var(--ok); }
.detail-step[data-status="failed"] .detail-status { color: var(--bad); }
.detail-step pre { margin: 0; padding: var(--sp-2) var(--sp-3); max-height: 200px; overflow: auto; border-radius: var(--r-item); background: var(--fill); font: var(--fs-xs)/var(--lh) var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-facts { font-size: var(--fs-sm); color: var(--dim); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.detail-artifacts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.artifact-link { overflow-wrap: anywhere; text-align: left; margin-inline-end: var(--sp-3); }
.attempt-select { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: var(--fs-sm); }
.detail-error { font-size: var(--fs-sm); color: var(--bad); overflow-wrap: anywhere; }

/* —— V5：流式输出、思考过程、用量、上下文提示、会话列表的流程标记 —— */
/* 正在写的气泡：还没有内容时是统一的进行状态行（.activity-line，style.css）；打断后末尾一行“已打断”。 */
/* 对话末尾的状态条：与输入框右下角同一个组件（.activity-line，style.css）；这里只管位置：独占一行、略缩进，隐藏时不占位。 */
.turn-status { display: flex; padding: 0 var(--sp-1); }
.turn-status[hidden] { display: none; }
.stream-mark { margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--warn); white-space: nowrap; }
/* 思考过程：默认折叠成一行灰字，点开是纯文本。 */
.reasoning { margin-bottom: var(--sp-2); white-space: normal; }
.reasoning-head { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--ctl-xs); padding: 0; border: 0; border-radius: var(--r-item); background: transparent; color: var(--faint); font-size: var(--fs-xs); font-weight: var(--fw-regular); font-variant-numeric: tabular-nums; }
.reasoning-head:hover { color: var(--dim); }
.reasoning-head .icon { transition: transform var(--dur-2) var(--ease); }
.reasoning[data-open="true"] .reasoning-head .icon { transform: rotate(90deg); }
.reasoning-body { margin: var(--sp-1) 0 var(--sp-2) var(--sp-1); padding: 0 0 0 var(--sp-3); border: 0; border-left: 2px solid var(--sep); border-radius: 0; background: transparent; color: var(--faint); font-size: var(--fs-sm); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow-y: auto; }
/* 上下文快满的提示：输入框上方一行。 */

/* —— 第三轮打磨：重试、对象改名、会话搜索、标题菜单（改名、询问与权限范围） —— */
/* 重试：最近一轮出错或被打断时，那一轮末尾一行。 */
.msg.retry { align-self: center; display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--dim); }
.msg.retry button.small { min-height: var(--ctl-sm); padding: 0 var(--sp-3); font-size: var(--fs-sm); }
/* 对象改名：双击名字后就地变成输入框。 */
.object-rename { width: 140px; padding: 1px var(--sp-1); border: 1px solid var(--accent); border-radius: var(--r-xs); background: var(--surface); font-size: var(--fs-sm); }
.object-rename[aria-invalid="true"] { border-color: var(--bad); }
/* 会话菜单：点顶栏的标题打开（苹果“文稿标题菜单”的做法）；样式沿用权限模式的菜单。 */
.title-button { flex: 0 1 auto; min-width: 0; max-width: min(48vw, 520px); min-height: var(--ctl); display: inline-flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-2); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg); text-align: left; }
.title-button:hover, .title-button[aria-expanded="true"] { background: var(--hover); }
.title-button:active { background: var(--press); }
/* 菜单的箭头常显（V6 M6）。 */
.title-button .icon { color: var(--dim); }
.brand-mark { flex: none; width: 24px; height: 24px; display: grid; place-items: center; overflow: hidden; border-radius: var(--r-xs); background: var(--brand-mark); box-shadow: inset 0 0 0 1px var(--brand-mark-edge); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.title-rename { flex: 0 1 325px; min-width: 0; padding: var(--sp-1) var(--sp-2); border: 1px solid var(--accent); border-radius: var(--r-sm); background: var(--surface); font-weight: var(--fw-semibold); }
.session-menu .menu-label { padding: var(--sp-2) var(--sp-2) var(--sp-0); font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--faint); }
.session-menu .mode-option[aria-checked="true"] .mode-check { visibility: visible; }

.session-menu .account-usage { font-variant-numeric: tabular-nums; }
/* V17：设置里多了权限的几项，矮窗口里菜单可能比窗口高——限高、在菜单里滚动，不伸出窗口。 */
.session-menu { min-width: 197px; max-height: calc(100vh - var(--top-h) - 12px); overflow-y: auto; }      /* 标题菜单（点标题出来的，里面有“改名”）原来只有 131px 宽，先加宽 25%（164），再加宽 20%（197） */

/* —— 计划审核的结论（confirm.js，协议第 67 节）：低调的一块；没通过的视角排在前面、结论词醒目（审核未通过红，有风险与警告暖色），标题下面另有红色的原因一行 —— */
.card .review { margin: var(--sp-2) 0; font-size: var(--fs-sm); color: var(--dim); }
.review-error { color: var(--bad); font-size: var(--fs-sm); }
.card .review-head { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-0) 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.card .review-head .icon:last-child { transition: transform var(--dur-2) var(--ease); opacity: .6; }
.card .review-head[aria-expanded="true"] .icon:last-child { transform: rotate(90deg); }
.card .review[data-verdict="warning"] .review-head, .card .review[data-verdict="doubt"] .review-head, .card .review[data-verdict="incomplete"] .review-head { color: var(--warn); }
.card .review[data-verdict="block"] .review-head, .card .review[data-verdict="high"] .review-head { color: var(--warn); font-weight: 600; }
.card .review .tag.quiet { background: var(--warn-soft); color: var(--warn); }
.card .review-views { list-style: none; margin: 2px 0 0; padding: 0 0 0 4px; }
.card .review-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 2px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.card .review-row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.card .review-views [data-verdict="pass"] .dot { background: var(--ok); }
.card .review-views [data-verdict="doubt"] .dot, .card .review-views [data-verdict="incomplete"] .dot { background: var(--warn); }
.card .review-views [data-verdict="block"] .dot { background: var(--bad); }
/* 非安全类的 block（协议 §465）：“有重要意见”，暖色、半粗，不用红色（红色只给安全类的硬拦） */
.card .review-views [data-verdict="high"] .dot { background: var(--warn); }
.card .review-views [data-verdict="high"] .review-name, .card .review-views [data-verdict="high"] .review-word { color: var(--warn); font-weight: var(--fw-semibold); }
.card .review-name { min-width: 6em; color: var(--fg); }
.card .review-word { color: var(--dim); font-size: var(--fs-xs); }
.card .review-views [data-verdict="block"] .review-name, .card .review-views [data-verdict="block"] .review-word { color: var(--bad); font-weight: var(--fw-semibold); }
.card .review-views [data-verdict="doubt"] .review-word, .card .review-views [data-verdict="warning"] .review-word, .card .review-views [data-verdict="incomplete"] .review-word { color: var(--warn); }
/* 审核未通过的原因（界面规范第三十节）：前面的图标是红的，原因本身是正文色——原来整段红字，几条原因摞起来一大片红，压过了卡片的其余内容；
   “没通过”已经由标题的结论词、视角行的红点与红字说明了。 */
.card .review-fail { display: flex; align-items: baseline; gap: var(--sp-1); margin: var(--sp-1) 0 0; color: var(--fg); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.card .review-fail .icon { align-self: center; color: var(--bad); }
.card .review-fail[data-tone="warn"] .icon { color: var(--warn); }
.card .review-detail { margin: var(--sp-0) 0 var(--sp-2) var(--sp-4); }
.card .review-verify { margin: 4px 0 0; color: var(--faint); overflow-wrap: anywhere; }
.card .review-evidence { margin: 4px 0 0; padding-left: 16px; color: var(--faint); font-style: italic; }
/* 审核硬拦（blocked）的卡片保持中性：不再整张染暖色（界面规范第七节“危险态保持中性卡”）；红色原因一行、按钮换成“退回让 AI 修改 / 仍然执行”已经说明了状态。 */

/* —— 确认卡片的按钮区（confirm.js，协议第 69 节）：必须人工确认的说明、“同类的都允许”会加的规则、拒绝的理由 —— */
.card .actions-area { display: flex; flex-direction: column; gap: var(--sp-2); }
.card .must-note { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--warn); }
/* “同类的都允许”会加哪几条规则：不在界面上显示（用户的决定：指到按钮时它在下面展开，卡片会上下跳）。文字仍在 DOM 里（读屏与测试照常读到），只是视觉上隐藏、不占位置；加了什么规则在设置的“权限”里看。 */
.card .rule-note { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
/* 没有悬停的触屏设备：本来就不会因为“指到”而跳动，说明照常显示（点之前要看得到会加什么规则）。 */
@media (hover: none) { .card .rule-note { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none; white-space: normal; } }
.card .reject-reason { flex: 1; min-width: 12em; padding: var(--sp-1) var(--sp-2); border: 1px solid var(--edge); border-radius: var(--r-item); background: var(--surface); color: var(--fg); font: inherit; font-size: var(--fs-md); }
.card .reject-reason:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* —— 设置里“权限”一页（rules.js，协议第 69 节）—— */
.pane[data-pane="rules"] { overflow: auto; gap: var(--sp-2); padding: var(--sp-1) var(--sp-1) var(--sp-4); font-size: var(--fs-md); }
.rules-page h3 { margin: 4px 0 0; font-size: var(--fs-lg); }
.rules-page h4 { margin: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-sm); color: var(--dim); font-weight: var(--fw-semibold); }
.rules-page .rules-mode, .rules-page .rules-help { margin: 0; font-size: var(--fs-xs); color: var(--faint); }
.rules-page .rule-list, .rules-page .rules-must ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.rules-page .rule-row { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-item); background: var(--surface); }
.rules-page .rule-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: var(--fs-code); }
.rules-page .rule-row small, .rules-page .rules-must small { color: var(--faint); font-size: var(--fs-xs); }
.rules-page .rule-effect { flex: none; min-width: 2.6em; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.rules-page .rule-row[data-effect="deny"] .rule-effect { color: var(--bad); }
.rules-page .rule-row[data-effect="ask"] .rule-effect { color: var(--warn); }
.rules-page .rule-row[data-effect="allow"] .rule-effect { color: var(--ok); }
.rules-page .rules-empty { margin: 0; font-size: var(--fs-sm); color: var(--faint); }
.rules-page .rules-form { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.rules-page .rules-form select, .rules-page .rules-form input { padding: var(--sp-1) var(--sp-2); border: 1px solid var(--edge); border-radius: var(--r-item); background: var(--surface); color: var(--fg); font: inherit; font-size: var(--fs-md); }
.rules-page .rules-form input { flex: 1; min-width: 14em; font-family: var(--mono); }
.rules-page .rules-error { font-size: var(--fs-sm); color: var(--bad); }
.rules-page .rules-must li { display: flex; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); border-radius: var(--r-item); background: var(--surface); font-size: var(--fs-sm); }
.rules-page .rules-must li[data-on="false"] { color: var(--faint); }

/* 任务列表保持一行，详细过程由用户展开：收起的任务行更紧凑（样式的主体见上面“流程区”一节）。 */
/* 多体系任务里每个子任务的标题栏永远是这个紧凑的高度：展开哪个子任务都不改它（子任务展开后标题栏里没有多出内容，高度也没有理由变，2026-11-17）。 */
.flow-item[data-expanded="false"] .flow-row, .flow-sub > .flow-row { gap: var(--sp-2); padding: 6px var(--sp-3) 0; }
.flow-item[data-expanded="false"] .flow-actions .text-btn { font-size: var(--fs-xs); }
.flow-item[data-expanded="false"] .flow-summary, .flow-sub > .flow-row .flow-summary { font-size: var(--fs-xs); }
.tool-group[data-single="true"][data-open="false"] [data-testid="traj-entry"] { display: none; }

/* 结果报告：结论、主要数值、结果目录。 */
.pane[data-pane="report"] { overflow-y: auto; }
.pane[data-pane="report"] { margin: 0 8px 8px; gap: 0; }
.task-report { --figure-w: 440px; --figure-h: 340px; --report-pad: var(--sp-3); --r-inner: max(var(--r-sm), calc(var(--r-card) - var(--report-pad))); width: 100%; margin: 0; padding: var(--report-pad); display: flex; flex-direction: column; gap: var(--sp-2); border: 1px solid var(--sep); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1); }
.report-header p, .report-header h2, .report-method { margin: 0; }
.report-header { display: flex; flex-direction: row; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-1) var(--sp-0) var(--sp-2); border-bottom: 1px solid var(--sep); }
.report-header-copy { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.report-downloads { position: relative; flex: none; }
.report-downloads > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--sp-1); height: var(--ctl-xs); padding: 0 var(--sp-2); border: 1px solid var(--sep); border-radius: var(--r-pill); background: var(--fill); color: var(--dim); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1; white-space: nowrap; }
.report-downloads > summary:hover, .report-downloads[open] > summary { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.report-downloads > summary::-webkit-details-marker { display: none; }
.report-download-menu { position: absolute; z-index: 4; top: calc(100% + 6px); right: 0; width: min(220px, calc(100vw - 40px)); padding: var(--sp-1); display: grid; gap: var(--sp-1); border: 1px solid var(--sep); border-radius: var(--r-view); background: var(--surface); box-shadow: var(--shadow-2); }
.report-download-action { padding: var(--sp-1) var(--sp-2); min-height: var(--ctl); border: 0; border-radius: var(--r-sm); text-align: left; background: transparent; color: var(--fg); font-size: var(--fs-sm); cursor: pointer; }
.report-download-action:hover:not(:disabled) { background: var(--hover); }
.report-download-action:disabled { color: var(--faint); cursor: not-allowed; }
.report-source { color: var(--dim); font-size: var(--fs-xs); line-height: 1.6; }
.report-source-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); font-size: var(--fs-xs); }
.report-source-links a { color: var(--accent); }
.report-conclusion { color: var(--fg); font-size: var(--fs-md); line-height: var(--lh-relaxed); }
.report-eyebrow, .report-note { font-size: var(--fs-xs); line-height: var(--lh); color: var(--dim); }
.report-header h2 { font-size: var(--fs-xl); font-weight: var(--fw-semibold); line-height: var(--lh-tight); overflow-wrap: anywhere; letter-spacing: -.015em; }
.report-method { font-size: var(--fs-md); color: var(--dim); line-height: var(--lh-relaxed); }
.report-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; overflow: hidden; border: 1px solid var(--sep); border-radius: var(--r-inner, var(--r-view)); background: var(--fill); }
.report-metrics > div { min-width: 0; padding: var(--sp-2) var(--sp-3); }
.report-metrics > div:nth-child(odd):not(:last-child) { border-right: 1px solid var(--sep); }
.report-metrics > div:nth-child(n+3) { border-top: 1px solid var(--sep); }
.report-metrics dt { font-size: var(--fs-2xs); color: var(--dim); margin-bottom: var(--sp-1); }
.report-metrics dd { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-semibold); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.report-more { padding: var(--sp-2) var(--sp-0); border-bottom: 1px solid var(--sep); }
.report-more > summary { font-size: var(--fs-sm); color: var(--dim); cursor: pointer; }
.report-more[open] > summary { margin-bottom: var(--sp-2); color: var(--fg); }
/* 展开方式统一（界面卡片 P1，界面规范第八节）：<details> 的 <summary> 和按钮式的折叠头（.fold-head、.group-head 等）是同一个符号——朝右的 chevron，展开时转向下，
   画在文字前面；不用浏览器默认的三角（各浏览器长得不一样）。颜色不过渡，只有旋转用 --dur-2。读屏与键盘照常：仍是真正的 <details>。 */
:is(.report-more, .web-source-attachments, .web-source-table, .web-source-candidate details) > summary { display: flex; align-items: center; gap: var(--sp-2); list-style: none; }
:is(.report-more, .web-source-attachments, .web-source-table, .web-source-candidate details) > summary::-webkit-details-marker { display: none; }
:is(.report-more, .web-source-attachments, .web-source-table, .web-source-candidate details) > summary::before { content: ""; flex: none; width: 6px; height: 6px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(-45deg); transition: transform var(--dur-2) var(--ease); }
:is(.report-more, .web-source-attachments, .web-source-table, .web-source-candidate details)[open] > summary::before { transform: rotate(45deg); }
:is(.report-more, .web-source-attachments, .web-source-table, .web-source-candidate details) > summary:hover::before { border-color: var(--fg); }
:is(.report-more, .web-source-attachments, .web-source-table, .web-source-candidate details) > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-radius: var(--r-xs); }
.report-warnings { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-inner, var(--r-view)); background: color-mix(in srgb, var(--warn-soft) 60%, transparent); color: var(--dim); font-size: var(--fs-xs); }
.report-warnings p { margin: var(--sp-1) 0; overflow-wrap: anywhere; }
/* 数据被清理过的任务：报告里只有这一块说明（results.js 的 cleanedNotice），不列文件 */
.report-cleaned { display: grid; gap: var(--sp-1); padding: var(--sp-3); border-radius: var(--r-inner, var(--r-view)); background: var(--fill); }
.report-cleaned strong { color: var(--fg); font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.report-cleaned p { margin: 0; color: var(--dim); font-size: var(--fs-sm); line-height: var(--lh-relaxed); }
.report-cleaned small { color: var(--faint); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.report-results, .report-layer { padding: var(--sp-2); border: 1px solid var(--sep); border-radius: var(--r-inner, var(--r-view)); background: var(--surface); }
.report-analyses, .report-citations { padding: var(--sp-2); border: 1px solid var(--sep); border-radius: var(--r-inner, var(--r-view)); background: var(--surface); }
.report-analyses h3, .report-citations h3 { margin: 0 0 var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.report-analysis { padding: var(--sp-2) 0; border-top: 1px solid var(--sep); }
.report-analysis-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.report-analysis-head .text-btn { flex: none; min-height: var(--ctl-xs); padding: 0 var(--sp-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.report-analysis h4 { min-width: 0; margin: 0; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.report-analysis .report-note { margin: var(--sp-1) 0; overflow-wrap: anywhere; }
.report-citations p { margin: var(--sp-1) 0 0; display: flex; flex-wrap: wrap; gap: var(--sp-1); font-size: var(--fs-xs); line-height: var(--lh); color: var(--dim); }
.report-citations a { color: var(--accent); }
/* 结论审核卡片（panel.js conclusionAuditCard）：状态小标签用 --ok / --warn / --bad 的浅底；文字出自模型，长的截成三行、点“展开”看全文（真正的 <details>）。 */
.report-audit { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-2); border: 1px solid var(--sep); border-radius: var(--r-inner, var(--r-view)); background: var(--surface); font-size: var(--fs-sm); line-height: var(--lh-tight); }
.report-audit p, .report-audit h3, .report-audit h4, .report-audit ul { margin: 0; overflow-wrap: anywhere; }
.report-audit-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.report-audit-head h3 { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.report-audit-chip { padding: 1px var(--sp-2); border-radius: var(--r-pill); background: var(--fill-2); color: var(--dim); font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap; }
.report-audit-chip[data-status="pass"] { background: var(--ok-soft); color: var(--ok); }
.report-audit-chip[data-status="revise"] { background: var(--warn-soft); color: var(--warn); }
.report-audit-chip[data-status="block"] { background: var(--bad-soft); color: var(--bad); }
.report-audit-meta { margin-left: auto; font-size: var(--fs-2xs); color: var(--faint); overflow-wrap: anywhere; }
.report-audit-group h4 { margin-bottom: var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--dim); }
.report-audit-group[data-severity="high"] h4 { color: var(--bad); }
.report-audit-group[data-severity="medium"] h4 { color: var(--warn); }
.report-audit-list { list-style: none; padding: 0; }
.report-audit-finding { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-2) 0; border-top: 1px solid var(--sep); }
.report-audit-tags { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.report-audit-tags:empty { display: none; }
.report-audit-category, .report-audit-lint { padding: 0 var(--sp-2); border-radius: var(--r-pill); font-size: var(--fs-2xs); line-height: 1.6; white-space: nowrap; }
.report-audit-category { background: var(--fill-2); color: var(--dim); }
.report-audit-lint { border: 1px solid var(--sep); color: var(--faint); }
.report-audit-claim { font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.report-audit-field { display: flex; align-items: baseline; gap: var(--sp-2); }
.report-audit-field > :last-child { flex: 1; min-width: 0; }
.report-audit-label { flex: none; font-size: var(--fs-2xs); color: var(--faint); }
.report-audit-long > summary { list-style: none; cursor: pointer; }
.report-audit-long > summary::-webkit-details-marker { display: none; }
.report-audit-long > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-radius: var(--r-xs); }
.report-audit-clip { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.report-audit-long[open] .report-audit-clip { display: block; -webkit-line-clamp: unset; }
.report-audit-expand, .report-audit-collapse { font-size: var(--fs-xs); color: var(--accent); }
.report-audit-long[open] .report-audit-expand, .report-audit-long:not([open]) .report-audit-collapse { display: none; }
/* 默认只显示摘要（协议第 144 节）：状态、条数、回交情况、两行摘要；“全部意见”点开才看每条发现与此前几轮的审核。 */
.report-audit-count { padding: 1px var(--sp-2); border-radius: var(--r-pill); background: var(--fill-2); color: var(--dim); font-size: var(--fs-xs); white-space: nowrap; }
.report-audit-summary { color: var(--fg); }
.report-audit:not([data-open="true"]) .report-audit-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.report-audit-handback { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--dim); }
.report-audit-handback[data-state="working"] { color: var(--accent); }
.report-audit-handback[data-state="exhausted"] { color: var(--warn); }
.report-audit-more > summary { list-style: none; cursor: pointer; width: fit-content; }
.report-audit-more > summary::-webkit-details-marker { display: none; }
.report-audit-more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-radius: var(--r-xs); }
.report-audit-more > :not(summary) { margin-top: var(--sp-2); }
.report-audit-more[open] .report-audit-expand, .report-audit-more:not([open]) .report-audit-collapse { display: none; }
.report-audit-history h4 { margin-bottom: var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--dim); }
.report-audit-rounds { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.report-audit-round { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--dim); }
.report-audit-round-no { font-variant-numeric: tabular-nums; }
.report-audit-round .report-audit-meta { margin-left: 0; }
.report-results h3, .report-layer h3 { display: flex; align-items: baseline; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); margin: 0 0 var(--sp-1); }
.report-layer-count { font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--faint); font-variant-numeric: tabular-nums; }
/* 补充分析的条目：新增的用强调色标一下，已更新的用中性色；中间文件折叠在最后，字更淡。 */
.report-row[data-supplement="新增"] small { color: var(--accent); }
.report-layer[data-layer="intermediate"] .report-row { color: var(--dim); }
/* 文件网格（file-grid.js）：一个文件或文件夹是一个小方块——图标（按类型换形状）、名字（至多两行）；
   文件夹是整块可点的按钮，进去后上面一行路径。图标见下面的“图标”一段。 */
.file-browser { display: flex; flex-direction: column; gap: var(--sp-2); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--sp-2); }
.file-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); font-size: var(--fs-xs); color: var(--dim); }
.file-crumbs .icon { color: var(--faint); }
.file-crumb { font-size: var(--fs-xs); }
.file-crumb-current { color: var(--fg); font-weight: var(--fw-medium); outline: none; }
.report-row { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); min-width: 0; padding: var(--sp-2) var(--sp-1); border: 0; border-radius: var(--r-item); background: transparent; font: inherit; font-size: var(--fs-xs); line-height: var(--lh-tight); color: var(--fg); text-align: center; cursor: pointer; }
.report-row:hover { background: var(--hover); }
button.report-row:focus-visible, .file-tile:has(.file-tile-open:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
/* 展示按钮铺满方块、看不见：点方块任何地方就是点它；“新增”的补充分析在图标角上点一个强调色的点。 */
.report-row.file-tile .file-tile-open { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: inherit; opacity: 0; cursor: pointer; }
.file-tile[data-supplement="新增"] .file-tile-icon::after { content: ""; position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
/* 图标（file-grid.js，参照苹果的 Finder）：文件夹是蓝色的前后两层，文件是一张折角的纸、纸上是类型的图形、下面一个小小的扩展名标；
   都带柔和的两层阴影，悬停时轻轻浮起。颜色与阴影都是 theme.css 的令牌，深浅两套主题各有取值。 */
.file-tile-icon { position: relative; display: block; width: 54px; height: 66px; margin-top: var(--sp-1); transition: transform 160ms ease; }
.ft-folder .file-tile-icon { width: 70px; }
.ft-shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: var(--file-shadow); transition: filter 160ms ease; }
.ft-paper { fill: var(--file-paper); stroke: var(--file-edge); stroke-width: 1; }
.ft-fold { fill: var(--file-fold); stroke: var(--file-edge); stroke-width: 1; stroke-linejoin: round; }
.ft-folder-back { fill: var(--folder-back); }
.ft-folder-front { fill: var(--folder-front); stroke: color-mix(in srgb, #ffffff 55%, transparent); stroke-width: 1; }
.ft-glyph { position: absolute; left: 0; right: 0; top: 21px; display: grid; place-items: center; color: var(--ft, var(--dim)); }
.ft-glyph .icon svg { width: 24px; height: 24px; stroke-width: 1.3; }
.ft-ext { position: absolute; left: 50%; bottom: 9px; transform: translateX(-50%); padding: 0 var(--sp-1); border-radius: var(--r-pill); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: .03em; line-height: 1.5; white-space: nowrap;
  color: color-mix(in srgb, var(--ft, var(--dim)) 80%, var(--fg)); background: color-mix(in srgb, var(--ft, var(--dim)) 14%, var(--file-paper)); }
.report-row.file-tile:hover .file-tile-icon { transform: translateY(-2px); }
.report-row.file-tile:hover .ft-shape { filter: var(--file-shadow-lift); }
.report-row-name { max-width: 100%; margin-top: var(--sp-1); line-height: 1.3; font-size: var(--fs-sm); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.report-row small { color: var(--dim); font-size: var(--fs-2xs); }
.report-row .view-btn { margin: var(--sp-1) 0 0; }
.report-row .view-error { color: var(--warn); }
/* 类型的色相只给图形与扩展名标（纸本身永远是白的）。 */
.ft-structure { --ft: var(--ok); } .ft-trajectory { --ft: var(--ft-purple); } .ft-data { --ft: var(--ft-teal); } .ft-image { --ft: var(--ft-pink); }
.ft-text { --ft: var(--dim); } .ft-code { --ft: var(--ft-orange); } .ft-document { --ft: var(--bad); } .ft-archive { --ft: var(--warn); } .ft-other { --ft: var(--faint); }
.ft-folder .report-row-name { font-weight: var(--fw-medium); }
.artifact-link { display: inline-flex; align-items: center; gap: var(--sp-2); max-width: 100%; }
.report-footer { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-2xs); color: var(--dim); padding-top: var(--sp-2); }
.report-footer { align-items: center; }
.report-footer-actions { display: flex; align-items: center; gap: var(--sp-2); }
.report-footer-actions .view-btn { margin-inline-start: 0; }
.report-footer .report-download-menu { top: auto; bottom: calc(100% + 6px); }
.result-content { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--sp-3); }
.result-content img { display: block; width: 100%; max-height: 100%; min-height: 0; object-fit: contain; border-radius: var(--r-view); background: var(--surface); }
.result-content pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-md); line-height: 1.7; }
.result-tools { display: flex; gap: var(--sp-2); }
.result-table-wrap { overflow: auto; flex: 1; min-height: 0; }
/* 结果面板里的数据表：同样是三线表；表头固定在顶部滚动时，表头线用内阴影画（sticky 的单元格带不走 collapse 的边框） */
.result-table { border-collapse: collapse; width: 100%; border-top: 1.5px solid var(--fg); border-bottom: 1.5px solid var(--fg); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.result-table th, .result-table td { padding: var(--sp-1) var(--sp-3); text-align: left; border: 0; white-space: nowrap; }
.result-table th { color: var(--fg); font-weight: var(--fw-semibold); position: sticky; top: 0; background: var(--panel-bg); box-shadow: inset 0 -1px 0 var(--fg); }
.result-table tbody tr:hover { background: var(--hover); }
@media (max-width: 820px) {
  .pane[data-pane="report"] { margin: 0 4px 4px; }
  .task-report { --report-pad: var(--sp-2); padding: var(--report-pad); gap: var(--sp-2); }
  .report-header { gap: var(--sp-2); }
  .report-metrics > div { padding: var(--sp-2) var(--sp-2); }
  .report-footer { flex-wrap: wrap; }
}
@media (max-width: 820px) {
  .flow-item[data-expanded="false"] .flow-heading, .flow-sub > .flow-row .flow-heading { gap: 6px; }
  .flow-item[data-expanded="false"] .flow-summary { display: none; }
  .flow-item[data-expanded="false"] .flow-row, .flow-sub > .flow-row { grid-template-columns: minmax(0, 1fr) auto; }
  .flow-item[data-expanded="false"] .flow-actions { grid-column: 2; grid-row: 1; }
  .flow-item[data-expanded="false"] .flow-status, .flow-sub > .flow-row .flow-status { font-size: var(--fs-2xs); }
  .task-report { --report-pad: var(--sp-2); padding: var(--report-pad); }
}
.flow-order { flex: none; width: 18px; color: var(--faint); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.tool-group[data-single="true"][data-state="done"] .group-head .dot { background: var(--faint); }
.card[data-state="approved"] .status { color: var(--dim); font-weight: var(--fw-regular); }
.report-preview { position: relative; margin: var(--sp-1) 0 var(--sp-2); padding: var(--sp-2); border: 1px solid var(--sep); border-radius: var(--r-inner, var(--r-view)); background: var(--surface); }
.report-preview h3 { font-size: var(--fs-sm); font-weight: var(--fw-medium); margin: 0 0 var(--sp-2); }
.report-preview-body { min-width: 0; }
.report-supplement { margin-left: var(--sp-2); padding: 0 var(--sp-2); border-radius: var(--r-pill); background: var(--hover); color: var(--dim); font-size: var(--fs-xs); font-weight: var(--fw-regular, 400); }
.report-preview-body img { display: block; width: auto; height: auto; max-width: min(100%, var(--figure-w)); max-height: var(--figure-h); margin: 0 auto; object-fit: contain; border-radius: var(--r-xs); background: #fff; }
.report-preview-body svg { max-width: 100%; }
/* 看不见但仍可聚焦、读屏读得到的展示按钮（点卡片空白处触发它）；Tab 到它时卡片外围出现焦点环。 */
.report-preview { cursor: pointer; }
.report-preview:hover { box-shadow: var(--shadow-1); }
.report-preview:has(.report-preview-open:focus-visible) { outline: 2px solid var(--accent); outline-offset: 0; }
.report-preview > .report-preview-open { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* 审核采用低对比状态行，详情按需展开。（原先误放在 theme.css 里；theme.css 只放设计令牌。） */
.report-audits { margin: var(--sp-4) 0; border-top: 1px solid var(--sep); }
.report-audits details { border-bottom: 1px solid var(--sep); padding: var(--sp-3) 0; }
.report-audits summary { display: flex; justify-content: space-between; gap: 16px; cursor: pointer; }
.report-audits small { color: var(--dim); }
/* plan_submit 的计划与审核：目标、编号的步骤（“计划 list”，默认展开）、折叠的方法与资源校验、各视角的审核结论。 */
/* 层次：标题（卡片名、目标 / 方法 / 数据来源）偏深、半粗；下面的内容颜色稍淡；数据来源最淡最小。
   每个小节的标题前有一个细、淡、无底块的小图标（五个同一种颜色），步骤是编号小圆标，来源等级是甲乙丙小标签——不只剩文字。
   标签在内容上方，不左右分栏：内容占满整行宽度。 */
.plan-audit .title { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
/* 目标、方法：标签（图标加名字，加粗）后面直接跟内容（不加粗、颜色淡一些）；折行后从最左边开始。
   五个小节的标题（目标、方法、流程、数据来源、其它）一样大、一样粗、左边对齐；目标与方法的内容与标题同字号，靠颜色分出层次。 */
/* 计划卡片里的文字行距统一用 --lh（1.75）：都是文字信息，行距小了挤；小节之间、列表项之间的间隔也跟着放松。 */
.plan-line { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); line-height: var(--lh); color: var(--faint); overflow-wrap: anywhere; }
.plan-line + .plan-line { margin-top: var(--sp-3); }
.plan-line .clamp-text { font-weight: var(--fw-regular); }
.plan-line .k, .plan-note .k { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: var(--lh); color: var(--fg); }
.plan-line .k { display: inline-flex; vertical-align: middle; margin: 0 var(--sp-2) 0 0; }
.plan-line .k, .plan-fold > .fold-head .k { gap: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: var(--lh); color: var(--fg); }
.plan-note .k:not([data-tint]) { font-size: var(--fs-xs); color: var(--dim); }
/* 计划卡片的小图标：尺寸与粗细回到最初的样子（小标题前 12px、标题前默认大小，描边是图标的默认粗细），只保留现在的颜色——无底块、--glyph（--faint 淡一档）、五个小标题同一种颜色（data-tint 只留作钩子）。 */
.k[data-tint] .icon { --icon: 12px; color: var(--glyph); }
.plan-audit .title .icon { color: var(--glyph); }
/* 流程、数据来源：默认收着的小项，没有底色；标题与内容之间留一行小间隔，内容缩进到标题文字的位置（有层次）。
   流程是编号清单（序号是小圆标，阶段名是小标签），字号与数据来源的小字相当。 */
.plan-fold { gap: var(--sp-2); margin-top: var(--sp-3); }
.plan-fold > .fold-head .k { display: inline-flex; align-items: center; margin: 0; }
.plan-fold > :not(.fold-head) { padding-left: calc(12px + var(--sp-2)); }      /* 内容缩进到标题文字的位置（图标 12px + 间距；折叠体就是步骤列表、来源列表、其它的表，没有 fold-body 这个类） */
/* 展开与收起的箭头放在名字后面（fold 的 trailing 选项）：与别处同一个符号——收着朝右、展开转向下（第八节）；名字前面的小图标不跟着转。 */
.fold.fold-trailing[data-open] > .fold-head .icon { transform: none; }
.fold.fold-trailing[data-open="true"] > .fold-head > .icon:last-child { transform: rotate(90deg); }
.fold-trailing > .fold-head { padding: 0 var(--sp-1) 0 0; gap: var(--sp-2); }      /* 左边不留空：标题与上面目标、方法的文字左对齐 */
.plan-list { margin: 0; padding: 0; list-style: none; counter-reset: plan-step; font-size: var(--fs-xs); line-height: var(--lh); color: var(--faint); }
.plan-list li { display: flex; align-items: baseline; gap: var(--sp-2); padding: var(--sp-1) 0; overflow-wrap: anywhere; counter-increment: plan-step; }
.plan-list li::before { content: counter(plan-step); flex: none; align-self: flex-start; box-sizing: border-box; min-width: 18px; height: 18px; margin-top: 1px; padding: 0 5px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; background: var(--surface); box-shadow: 0 0 0 1px var(--sep); color: var(--dim); font-size: var(--fs-2xs); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.plan-list li > .clamp { flex: 1; min-width: 0; }
.plan-phase { flex: none; padding: 0 var(--sp-2); border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-size: var(--fs-2xs); font-weight: var(--fw-medium); line-height: 18px; white-space: nowrap; }
.plan-notes { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-3); }
.plan-note { overflow-wrap: anywhere; }
.plan-note > .clamp { display: block; font-size: var(--fs-sm); line-height: var(--lh); color: var(--faint); }
/* 数据来源：每条一行，前面是来源等级小标签（甲=可追溯 绿，乙=用户/数据库/文献 蓝，丙=模型记忆 橙），后面是最淡最小的字 */
.plan-sources-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.plan-unverified { flex: none; font-size: var(--fs-2xs); color: var(--warn); white-space: nowrap; }
.plan-source { display: flex; align-items: baseline; gap: var(--sp-2); font-size: var(--fs-xs); line-height: var(--lh); color: var(--faint); }
.plan-source .clamp { flex: 1; min-width: 0; display: block; }
.plan-grade { flex: none; min-width: 18px; padding: 0 5px; border-radius: var(--r-xs); text-align: center; background: var(--fill-2); color: var(--dim); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); line-height: 17px; }
.plan-grade[data-grade="甲"] { background: var(--ok-soft); color: var(--ok); }
.plan-grade[data-grade="乙"] { background: var(--accent-soft); color: var(--accent); }
.plan-grade[data-grade="丙"] { background: var(--warn-soft); color: var(--warn); }
.plan-audit .plan-more { margin-top: var(--sp-2); }
/* 同一轮的多版计划合并成一张卡（chat.js 的 paintPlan，协议 §287）：右上角“‹ 第 n/m 版 ›”加一个“最新 / 已废弃”小标签；旧版的内容调淡，一眼看出不是现行的。 */
.plan-audit > summary.title { list-style: none; cursor: pointer; }
.plan-audit > summary::-webkit-details-marker { display: none; }
.plan-audit .plan-chevron { display: inline-flex; margin-inline-start: auto; color: var(--dim); }
.plan-audit[open] .plan-chevron { transform: rotate(90deg); }
.plan-audit .plan-tag { padding: 0 var(--sp-2); border-radius: var(--r-pill); background: var(--fill-2); color: var(--dim); font-size: var(--fs-2xs); line-height: 18px; white-space: nowrap; }
.plan-audit[data-stale="true"]:not([open]) > .title { color: var(--dim); }
.plan-audit[data-stale="true"] .plan-body { opacity: .6; }
/* 审核意见下面执行 AI 的回应（confirm.js 的 review-reply，2026-11-12 改版）：标题“AI 对审核的回应：”和正文是同一段，折行后从最左边开始（不缩进、没有图标）；
   最多 4 行（.clamp 的 data-lines），放不下的带“更多”。标题比正文深一档、半粗，正文是淡色。 */
.card .review-reply { margin: var(--sp-2) 0 0; color: var(--faint); font-size: var(--fs-sm); line-height: var(--lh); overflow-wrap: anywhere; }
.card .review-reply .review-reply-label { color: var(--dim); font-weight: var(--fw-medium); }
.plan-audit .review { margin: var(--sp-3) 0 0; padding-top: var(--sp-2); border-top: 1px solid var(--sep); }

/* 任务摘要与输入框连成一张卡片（.dock 的圆角与边框在上面“流程区”一节）；列表展开时仅内部滚动。 */
.flow-current { position: relative; flex: none; display: flex; align-items: center; gap: var(--sp-2); height: 44px; padding: 0 var(--sp-3) 0 var(--sp-4); min-width: 0; }
.flow-current-bar { position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; overflow: hidden; border-radius: var(--r-pill); background: var(--fill-2); }
.flow-current-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width var(--dur-2) var(--ease); }
.flow-current-bar.warning span { background: var(--warn); }
.flow-current-bar.failed span { background: var(--bad); }
.flow-current-bar.neutral span { background: var(--faint); }
.flow-current-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.flow-current[data-status="running"] .flow-current-dot { background: var(--accent); }
.flow-current[data-status="failed"] .flow-current-dot { background: var(--bad); }
.flow-current[data-state="analyzing"] .flow-current-dot { background: var(--warn); }
.flow-current[data-state="superseded"] .flow-current-dot { background: var(--faint); }
.flow-current-title { flex: 1; min-width: 0; border: 0; padding: var(--sp-1) 0; background: transparent; text-align: left; color: var(--fg); font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-current-status, .flow-current-progress { flex: none; color: var(--dim); font-size: var(--fs-xs); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 对话列被挤得很窄时（会话侧栏开着加宽面板）状态字先让位，免得整行比流程区还宽。 */
.flow-current-status { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.flow-current .view-btn, .flow-actions .view-btn { margin-inline-start: 0; }
.flow-list-toggle { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--sp-1); height: var(--ctl-xs); padding: 0 var(--sp-2); border: 1px solid var(--edge); border-radius: var(--r-pill); background: var(--control); box-shadow: var(--shadow-seg); color: var(--dim); font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; }
.flow-list-toggle span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }   /* 对话列窄到连按钮都放不下时，字先收成省略号，不把整行撑出去 */
.flow-list-toggle .icon { flex: none; }
.flow-list-toggle:hover { border-color: transparent; background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.flow-list-toggle .icon { transform: rotate(-90deg); transition: transform var(--dur-2) var(--ease); }
.flow-list-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }
.flow-list { min-height: 0; max-height: min(288px, max(96px, calc(60vh - 240px))); overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--sep); }
@media (max-width: 820px) {
  .flow-current { gap: var(--sp-1); padding-left: var(--sp-3); padding-right: var(--sp-2); }
  .flow-current-progress { display: none; }
  .flow-current-title { flex: 1 0 6em; }      /* 状态字（带次数、“失败 · 已停止自动处理”时很长）先让位，任务名至少留 6 个字 */
  .flow-current-status { flex: 0 100 auto; }
  .flow-current:has(.flow-current-stop) .view-btn { display: none; }      /* 有“停止自动处理”时报告按钮让位（行里仍有）：不然标题被挤成一个字 */
}
/* 外部来源与下载产物：次级信息折叠展示，沿用中性色与现有字号。 */
.web-source { margin-top: var(--sp-3); padding-top: var(--sp-2); border-top: 1px solid var(--sep); }
.web-source-links, .web-source-records { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; }
.web-source a { overflow-wrap: anywhere; }
.web-source-note { margin: var(--sp-1) 0 0; font-size: var(--fs-xs); line-height: var(--lh-relaxed); color: var(--dim); }
.web-source-excerpt { font-size: var(--fs-sm); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.web-source-records { display: grid; gap: var(--sp-3); margin-top: var(--sp-3); }
.web-source-candidate { min-width: 0; font-size: var(--fs-sm); line-height: var(--lh-relaxed); }
.web-source-candidate summary { color: var(--dim); font-size: var(--fs-xs); cursor: pointer; }

.web-source-attachments { margin-top: var(--sp-3); }
.web-source-attachments summary { font-size: var(--fs-xs); color: var(--dim); cursor: pointer; }
.web-source-attachments[open] .web-source-links { margin-top: var(--sp-2); }
.web-source-error-title { margin: 0; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }

.web-source-table { margin-top: var(--sp-3); font-size: var(--fs-sm); }
.web-source-table summary { cursor: pointer; font-weight: var(--fw-medium); }
.web-source-table-scroll { overflow-x: auto; margin-top: var(--sp-2); }
.web-source-table table { width: 100%; border-collapse: collapse; border-top: 1.5px solid var(--fg); border-bottom: 1.5px solid var(--fg); font-size: var(--fs-xs); }
.web-source-table th, .web-source-table td { padding: var(--sp-1) var(--sp-2); border: 0; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.web-source-table th { font-weight: var(--fw-semibold); border-bottom: 1px solid var(--fg); }
.record-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
/* 数据库记录页：右侧展示按钮与外部链接一行，事实是“标签 / 值”的两列表；缺的字段整行不出现。 */
.record { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.record-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.record-head .view-btn, .record-structures .view-btn { margin-inline-start: 0; }
.record-head a.link { font-size: var(--fs-sm); }
.record-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); margin: 0; font-size: var(--fs-sm); }
.record-row { display: contents; }
.record-row dt { color: var(--dim); }
.record-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.record-structures { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); }
.record-source { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin: 0; }

/* 独立只读问答浮层与输入定位。 */
/* 消息导航（message-nav.js）：平时是对话列右边缘上下居中的一列短横线（位置由脚本写 top / right），右边挨着面板里的可视化，所以要轻；
   当前所在的一条拉长并用强调色。鼠标移上去或键盘聚焦时展开成一张卡片：圆角、细边、浮层阴影，列出全部提问（单行省略，靠右对齐在各自的横线旁）。
   宽度由脚本按对话列算进 --message-nav-w（有上限），高度不超过对话列，多了在卡片里滚动。卡片的边与内边距平时就占着（边透明），展开时横线不动。 */
.message-nav { position: absolute; right: 2px; transform: translateY(-50%); z-index: 3; box-sizing: border-box; width: 22px; padding: 5px 0; display: flex; flex-direction: column; align-items: stretch; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; border: 1px solid transparent; border-radius: 16px; background: transparent; transition: width var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.message-nav:hover, .message-nav:focus-within { width: var(--message-nav-w, 260px); background: var(--surface); border-color: var(--sep); box-shadow: var(--shadow-2); scrollbar-width: thin; }
.message-nav-item { flex: none; display: flex; align-items: center; justify-content: flex-end; height: 26px; padding: 0 6px 0 0; border: 0; background: transparent; text-align: right; color: var(--faint); transition: padding var(--dur-2) var(--ease); }
.message-nav:hover .message-nav-item, .message-nav:focus-within .message-nav-item { padding: 0 10px 0 14px; }
.message-nav-label { flex: 1 1 0; min-width: 0; margin-right: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); opacity: 0; transition: opacity var(--dur-2) var(--ease), margin var(--dur-2) var(--ease); }
.message-nav:hover .message-nav-label, .message-nav:focus-within .message-nav-label { margin-right: 12px; opacity: 1; }
.message-nav-tick { flex: none; width: 8px; height: 2px; border-radius: var(--r-pill); background: var(--faint); opacity: .5; transition: opacity var(--dur-2) var(--ease), width var(--dur-2) var(--ease); }
.message-nav-item:hover { color: var(--fg); }
.message-nav-item:hover .message-nav-tick { opacity: 1; background: var(--dim); }
.message-nav-item[aria-current="true"] { color: var(--accent); }
.message-nav-item[aria-current="true"] .message-nav-tick { width: 14px; opacity: 1; background: var(--accent); }
.message-nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-item); }
#composer[data-side-chat="true"] .box { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, var(--sep)); }
#composer .side-chat-toggle[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
/* 底下一行左边的几个按钮（添加、不打断提问、演示用的加载）：同样大的淡底圆，与右边的发送 / 打断一个尺寸 */
#composer .bar > [data-testid="attach"], #composer .bar > .side-chat-toggle, #composer .bar > .demo-only { background: var(--fill); color: var(--dim); }
#composer .bar > [data-testid="attach"]:hover:not(:disabled), #composer .bar > .side-chat-toggle:hover:not(:disabled), #composer .bar > .demo-only:hover:not(:disabled) { background: var(--fill-2); color: var(--fg); }
#composer .bar > .side-chat-toggle[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
#dock-area:has(#composer[data-side-chat="true"]) .flow-current-status,
#dock-area:has(#composer[data-side-chat="true"]) .flow-current-progress,
#dock-area:has(#composer[data-side-chat="true"]) .flow-current-bar,
#dock-area:has(#composer[data-side-chat="true"]) .flow-status,
#dock-area:has(#composer[data-side-chat="true"]) .flow-note,
#dock-area:has(#composer[data-side-chat="true"]) .flow-item .meta,
#dock-area:has(#composer[data-side-chat="true"]) .flow-item .task-progress,
#dock-area:has(#composer[data-side-chat="true"]) .flow-item .flow-progress { display: none; }
.side-chat { position: fixed; z-index: 12; border: 1px solid var(--sep); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-2); overflow: hidden; }
.side-chat-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--sep); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.side-chat-state { margin-left: auto; color: var(--dim); font-size: var(--fs-xs); font-weight: var(--fw-regular); }
.side-chat-body { max-height: min(240px, 32vh); overflow-y: auto; padding: var(--sp-2) var(--sp-4); overscroll-behavior: contain; font-size: var(--fs-sm); }
.side-chat-message { margin: 0 0 var(--sp-3); overflow-wrap: anywhere; }
.side-chat-message.user { margin-left: 20px; padding: var(--sp-1) var(--sp-2); border-radius: var(--r-item); background: var(--fill); color: var(--dim); }
.side-chat-message p { margin: var(--sp-1) 0; }
.side-chat-empty { color: var(--dim); }
#dock-area { position: relative; }
#dock-area:is([data-asking="true"], [data-deciding="true"]) #composer[data-side-chat="true"] { display: block; }
@media (max-width: 600px) { .message-nav { width: 18px; } .side-chat-body { max-height: 30vh; } }

.side-chat-head .round { width: var(--ctl-sm); height: var(--ctl-sm); border: 0; border-radius: 50%; background: transparent; color: var(--dim); display: grid; place-items: center; }
.side-chat-head .round:hover { background: var(--fill); }

/* —— 触屏热区（放在本文件最后：要压过上面各处对这些按钮尺寸的定义）——
   触屏（pointer: coarse）与窄窗口下，小按钮的可点区域至少 var(--ctl-touch)（40px）。
   · 单个、周围有空地的小按钮：视觉不变，用 ::after 把可点区域向四周扩到 40px（inset 是 (40 - 按钮尺寸) / 2）；
   · 挨在一起的（顶栏、输入框底下一排圆钮、对象列表里的图标按钮）：相邻的扩展区会互相抢地方，所以直接把按钮本身放大到 40px。
   消息导航（message-nav）一列点挨着点，只把每个按钮的高度放到 40px（宽度受对话列右边的空隙限制）。
   流程区的触屏按钮规则在流程区那一段（窄窗口块）。 */
@media (pointer: coarse), (max-width: 820px) {
  .top-button { width: var(--ctl-touch); height: var(--ctl-touch); }
  #content-header .title-button { min-height: var(--ctl-touch); }
  #composer .round, #composer .input-queue-row .round { width: var(--ctl-touch); height: var(--ctl-touch); }
  .icon-button { min-width: var(--ctl-touch); height: var(--ctl-touch); }
  .message-nav-item { height: var(--ctl-touch); }
  /* 命令代码块右上角的复制按钮变成 40 高：代码块至少一样高，免得按钮探出去；折叠开关同样。 */
  .card .cmd-code { box-sizing: border-box; min-height: var(--ctl-touch); }
  .fold-head { min-height: var(--ctl-touch); }
  .session-more, .chip-remove { position: relative; }
  .session-more::after, .attach-remove::after, .chip-remove::after { content: ""; position: absolute; }
  .session-more::after { inset: -8px; }          /* 24 → 40 */
  .attach-remove::after { inset: -10px; }        /* 20 → 40 */
  .chip-remove::after { inset: -11px; }          /* 18 → 40 */
}

/* 结果报告顶部的四项（报告、输入、结果、分析）：一条铺满卡片宽度的半透明玻璃条，粘在面板顶部，里面是居中的分段控件；条下面一条细分隔线，
   往下滚时正文从条后面滑过去而不会和按钮叠在一起。选中项记在内存里（panel.js 的 reportTabs）。 */
.report-tabbar { position: sticky; top: 0; z-index: 3; display: flex; justify-content: center; margin: calc(-1 * var(--report-pad)) calc(-1 * var(--report-pad)) var(--sp-1); padding: var(--sp-2) var(--report-pad); border-bottom: 1px solid var(--sep); border-radius: var(--r-card) var(--r-card) 0 0; background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); }
.report-tabs { display: inline-grid; grid-template-columns: repeat(4, minmax(72px, 1fr)); width: min(100%, 360px); }
.report-tabs button { max-width: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1); }
.report-tab-count { font-size: var(--fs-2xs); font-weight: var(--fw-regular); color: var(--faint); font-variant-numeric: tabular-nums; }
.report-tabs button.on .report-tab-count { color: var(--fg); }

/* 报告正文（报告.md 渲染）：图文混排；表格是三线表（richtext.css 里统一定义，这里只收紧字号与内边距）。 */
.report-markdown { min-width: 0; font-size: var(--fs-md); line-height: var(--lh-relaxed); overflow-wrap: anywhere; }
.report-markdown .rt > :first-child { margin-top: 0; }
.report-markdown .rt h1 { font-size: var(--fs-xl); border-bottom: 1px solid var(--sep); padding-bottom: var(--sp-1); }
.report-markdown .rt h2 { margin-top: var(--sp-4); font-size: var(--fs-lg); letter-spacing: -.01em; }
.report-markdown .rt h3 { font-size: var(--fs-body); }
.report-markdown .rt-table table { font-size: var(--fs-sm); }
.report-markdown .rt-table th, .report-markdown .rt-table td { padding: var(--sp-1) var(--sp-2); }
/* 图：居中、限宽限高的一张白底图卡（单张图撑满整个面板时字会大得出奇，也盖过正文）；分析页的预览用同一个尺寸。 */
.report-figure { display: flex; justify-content: center; margin: var(--sp-3) 0 var(--sp-2); }
.report-figure-image { display: block; width: auto; height: auto; max-width: min(100%, var(--figure-w)); max-height: var(--figure-h); object-fit: contain; padding: var(--sp-2); border: 1px solid var(--sep); border-radius: var(--r-inner, var(--r-view)); background: #fff; }
.report-figure-missing { color: var(--dim); font-size: var(--fs-xs); }
.report-figure[data-testid] { cursor: pointer; }
/* 作图界面（graphic.js）：图的白纸与静态图片的说明，卡片与结果页共用。图永远是白纸，不随主题变（同 figure.css 的 .fig-paper）。 */
.graphic-figure { display: flex; flex-direction: column; gap: var(--sp-2); }
.graphic-paper { background: #fff; border: 1px solid var(--sep); border-radius: var(--r-card); padding: var(--sp-2); }
.graphic-paper svg { display: block; width: 100%; height: auto; }
.graphic-legend { display: flex; justify-content: center; }
.graphic-legend svg { width: calc(100% * var(--legend-ratio, 1)); max-width: 100%; }        /* 与图缩放同样的倍数；两张白纸的内边距相同 */
.graphic-image { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
.graphic-image img { display: block; max-width: 100%; height: auto; border-radius: var(--r-xs); background: #fff; }
.graphic-note { margin: 0; }
/* 不写 min-height: 0：放大视图的外层（.result-content）是限高的竖向弹性盒，允许收缩的话，比区域高的曲线会把选项卡（overflow 的最小高度是 0）压扁，曲线盖到按钮上（2026-11-04）；放不下由外层整块滚动。 */
.graphic-data { display: flex; flex-direction: column; gap: var(--sp-2); }
.graphic-table { max-height: 16em; }
/* 子选项卡（表格 | 图 1 | 图 2 …）与右上角浮出的操作（编辑图表、删除这张图）：协议第 154 节。操作悬停、键盘聚焦时显示，触屏（没有悬停）常显。 */
.graphic-tabs { display: flex; gap: var(--sp-0); width: fit-content; max-width: 100%; padding: var(--sp-0); border-radius: var(--r-item); background: var(--seg-track); overflow-x: auto; scrollbar-width: none; }
.graphic-tabs::-webkit-scrollbar { display: none; }
.graphic-tab { flex: none; max-width: 14em; min-height: var(--ctl-xs); padding: 0 var(--sp-3); overflow: hidden; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--dim); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.graphic-tab:hover:not([aria-selected="true"]) { background: var(--hover); color: var(--fg); }
.graphic-tab[aria-selected="true"] { background: var(--seg-on); color: var(--fg); box-shadow: var(--shadow-tab); }
.graphic-stage { min-width: 0; }
.graphic-frame { position: relative; min-width: 0; }
.graphic-fab { position: absolute; top: var(--sp-2); right: var(--sp-2); z-index: 2; display: flex; gap: var(--sp-1); opacity: 0; transform: translateY(-2px); pointer-events: none; transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.graphic-frame:hover > .graphic-fab, .graphic-frame:focus-within > .graphic-fab { opacity: 1; transform: none; pointer-events: auto; }
/* 触屏没有悬停：常显，并且挪到内容上面一行靠右（不再浮在图或表上盖住它）。 */
@media (hover: none) { .graphic-frame { display: flex; flex-direction: column; gap: var(--sp-1); } .graphic-fab { position: static; order: -1; justify-content: flex-end; opacity: 1; transform: none; pointer-events: auto; } }
/* 表格页（协议第 154 节）：操作条占表格上面的一行、常显，不浮在表头上（桌面也一样）。 */
.graphic-frame-bar { display: flex; flex-direction: column; gap: var(--sp-1); }
.graphic-frame-bar > .graphic-fab { position: static; order: -1; justify-content: flex-end; opacity: 1; transform: none; pointer-events: auto; }
.graphic-edit, .graphic-remove { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--ctl-sm); padding: 0 var(--sp-3); border: 1px solid var(--edge); border-radius: var(--r-pill); background: var(--surface); color: var(--fg); font-size: var(--fs-xs); box-shadow: var(--shadow-1); cursor: pointer; }
.graphic-edit:hover { border-color: var(--accent); color: var(--accent); }
.graphic-remove { padding: 0 var(--sp-2); color: var(--dim); }
.graphic-remove:hover, .graphic-remove[data-armed="true"] { border-color: var(--bad); color: var(--bad); }
.graphic-problem { color: var(--bad); }
.report-markdown .rt p > em:only-child { display: block; text-align: center; color: var(--dim); font-size: var(--fs-sm); font-style: normal; }

/* 结果文件夹卡片（folder-card.js，show kind=folder）：对话里的一张圆角卡片，列出文件夹里的文件，每个文件一个下载，头部有“下载全部”。 */
.msg.folder-entry { align-self: stretch; }
/* 苹果“设置”的样子：一张圆角卡，默认一行——[图标块 · 标题与说明（点它也能展开）] [实心的“下载全部”] [折叠箭头]，展开后是分组列表。
   卡片是尺寸容器：窄的时候（对话列窄、或手机宽度）按卡片自己的宽度收紧，而不是按整个窗口的宽度——右侧面板开着时对话列也会很窄。 */
.folder-card { box-sizing: border-box; align-self: stretch; width: 100%; display: flex; flex-direction: column; container-type: inline-size; border: 1px solid var(--sep); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden; }
.folder-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); }
.folder-card[data-open="true"] .folder-head { border-bottom: 1px solid var(--sep); }
/* 标题那一块：普通的可点击区域（不是 button：头部里唯一的展开控件是最右的箭头，见 folder-card.js 文件头）；整块撑开，标题太长就省略。 */
.folder-summary { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-1); border-radius: var(--r-item); cursor: pointer; transition: background var(--dur-2) var(--ease); }
.folder-summary:hover:not([data-empty]) { background: var(--hover); }
.folder-summary[data-empty] { cursor: default; }
.folder-tile { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-item); background: var(--accent-soft); color: var(--accent); }
.folder-tile.small { width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--fill); color: var(--dim); }
.folder-heading { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.folder-title { color: var(--fg); font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: var(--lh-tight); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-sub { font-size: var(--fs-xs); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-all { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1); height: 32px; padding: 0 var(--sp-4); border: 0; border-radius: var(--r-pill); background: var(--accent-fill); color: var(--on-accent); font-size: var(--fs-sm); font-weight: var(--fw-semibold); box-shadow: 0 1px 2px color-mix(in srgb, var(--accent-fill) 35%, transparent); transition: filter var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.folder-all:hover:not(:disabled) { filter: brightness(1.08); }
.folder-all:active:not(:disabled) { transform: scale(.97); }
.folder-all:disabled { opacity: .45; box-shadow: none; }
/* 折叠箭头：“下载全部”右边一个 32px 的圆形小按钮；收起时朝右，展开转 90 度朝下。 */
.folder-toggle { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--faint); transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.folder-toggle:hover:not(:disabled) { background: var(--hover); color: var(--fg); }
.folder-toggle:disabled { opacity: .45; cursor: default; }
.folder-toggle .icon { transition: transform var(--dur-2) var(--ease); }
.folder-card[data-open="true"] .folder-toggle .icon { transform: rotate(90deg); }
/* 焦点环：贴着控件自己的边（box-shadow，不是偏出去的 outline + offset）。透明的 outline 留给强制配色模式。
   行与标题块这种大区域用 inset；实心的“下载全部”里圈一道白线加外圈，在蓝底上也看得见。 */
.folder-card button:focus-visible { outline: 2px solid transparent; outline-offset: 0; box-shadow: 0 0 0 2px var(--accent); }
.folder-card .folder-all:focus-visible { box-shadow: inset 0 0 0 2px var(--on-accent), 0 0 0 2px var(--accent); }
.folder-files { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.folder-files[hidden] { display: none; }
.folder-file { position: relative; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-4); color: var(--dim); }
.folder-file + .folder-file::before { content: ""; position: absolute; top: 0; left: 60px; right: 0; height: 1px; background: var(--sep); }
.folder-file:hover { background: var(--hover); }
/* 名字与“在右侧打开”并成一块（占满中间）：名字按内容宽、太长省略，按钮紧跟在名字后面。 */
.folder-label { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.folder-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); }
.folder-dir { color: var(--faint); }
.folder-base { color: var(--fg); }
.folder-size { flex: none; font-size: var(--fs-xs); color: var(--faint); font-variant-numeric: tabular-nums; }
.folder-one { flex: none; display: inline-flex; align-items: center; justify-content: center; position: relative; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent); transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.folder-one:hover { background: var(--accent); color: #fff; }
/* “在右侧打开”（viewButton，样式同别处的“3D”“文件”小胶囊）：鼠标移到这一行（或键盘聚焦进这一行）时从左边淡入；位置一直占着，淡入时名字不跳。
   不用 display:none / visibility:hidden（那样它会从 Tab 顺序里消失，键盘用户就永远到不了）；平时 pointer-events 关着，免得看不见的按钮挡住点击。
   没有悬停的触屏设备一直显示。“减少动态效果”由 style.css 里统一的那一条处理。 */
.folder-open { flex: none; position: relative; opacity: 0; transform: translateX(-4px); pointer-events: none; transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.folder-file:hover .folder-open, .folder-file:focus-within .folder-open { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: none) { .folder-open { opacity: 1; transform: none; pointer-events: auto; } }
/* 触屏：两个小按钮的点按范围向外扩 8px（样子不变，行也不变高）。 */
@media (pointer: coarse) { .folder-open::after, .folder-one::after { content: ""; position: absolute; inset: -8px; } }
.folder-more, .folder-note { margin: 0; padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--sep); font-size: var(--fs-xs); color: var(--faint); }
.folder-note[hidden] { display: none; }
/* 窄卡片（手机宽度，或右侧面板开着时的对话列）：“下载全部”只留图标（名字由 aria-label 给），“在右侧打开”只留图标，行的间距收紧；标题与说明省略号。 */
@container (max-width: 440px) {
  .folder-head { padding-inline: var(--sp-2); }
  .folder-all { width: 32px; padding: 0; }
  .folder-all-label { display: none; }
  .folder-file { gap: var(--sp-2); padding-inline: var(--sp-3) var(--sp-2); }
  .folder-file + .folder-file::before { left: 48px; }
  .folder-open .view-btn-word { display: none; }
  .folder-open { padding: 0 var(--sp-1); }
}
/* 结构卡片可以点：在右侧 2D 窗口打开这个结构（chat.js addStructure）。 */
.card.structure[role="button"] { cursor: pointer; }
.card.structure[role="button"]:hover { background: var(--hover); }
.card.structure[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.card.structure .side button { cursor: pointer; }

/* 流程详情里的“需求与计划”（协议 §215）：需求卡与批准的计划，折叠着，点开看 */
.flow-plan-fold { margin: 0 0 var(--sp-3); }
.flow-plan-record { display: flex; flex-direction: column; gap: var(--sp-4); padding-top: var(--sp-2); }
.flow-plan-record .record-part { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.flow-plan-record .record-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
.flow-plan-record .record-answer { display: flex; flex-wrap: wrap; gap: var(--sp-2); color: var(--dim); font-size: var(--fs-sm); }
.flow-plan-record .record-answer strong { color: var(--fg); font-weight: var(--fw-medium); }

/* 会滚动的面板：滚动条出现与消失（展开折叠内容、内容变长变短）时不让正文宽度跳一下，把滚动条的位置留出来 */
.pane[data-pane="report"], .pane[data-pane="record"], .pane[data-pane="rules"], .detail-steps, .result-content, .file-view, .account-page { scrollbar-gutter: stable; }

/* 执行确认卡的正文（协议 §254）：一句话——按哪个计划执行、预计在服务器上跑多久、花多少点；字号同正文，颜色是前景色（它是这张卡的主角）。 */
.card.execution .plan-summary { margin: var(--sp-2) 0 0; font-size: var(--fs-md); line-height: var(--lh); color: var(--fg); overflow-wrap: anywhere; }

/* 执行确认卡（协议 §366）：计划名是主角（.exec-plan），用时与花费是灰色的“名称 | 内容”小表（.exec-rows），“估计值”脚注最小最淡（.plan-estimate），勾选行用细分隔线隔开；没有 facts 的老卡还是 .plan-summary 一句话。 */
.card.execution .exec-plan { margin: var(--sp-2) 0 0; font-size: var(--fs-body); font-weight: var(--fw-semibold); line-height: var(--lh-tight); color: var(--fg); overflow-wrap: anywhere; }       /* 计划名是这张卡的主角 */
.card.execution .exec-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-1) var(--sp-4); align-items: baseline; margin: var(--sp-3) 0 0; }       /* 预计用时、花费：名称 | 内容，灰色，次一级 */
.card.execution .exec-row { display: contents; }
.card.execution .exec-row-label { font-size: var(--fs-xs); color: var(--faint); white-space: nowrap; }
.card.execution .exec-row-value { min-width: 0; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--dim); font-variant-numeric: tabular-nums; }
.card.execution .exec-skip { margin: var(--sp-3) 0 0; padding-top: var(--sp-3); border-top: 1px solid var(--sep); }
.card.execution .exec-skip label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 0 var(--sp-2); cursor: pointer; }
.card.execution .exec-skip-text { display: flex; flex-direction: column; gap: var(--sp-0); min-width: 0; }
.card.execution .exec-skip-name { font-size: var(--fs-sm); line-height: var(--lh-tight); color: var(--fg); }
.card.execution .exec-skip-hint { font-size: var(--fs-xs); line-height: var(--lh-tight); color: var(--faint); }
.card.execution .exec-skip input { appearance: auto; -webkit-appearance: auto; flex: none; width: var(--icon-lg); height: var(--icon-lg); margin: 0; accent-color: var(--accent); }       /* 全局 input 是 appearance: none，不写大小与 appearance 就是 0×0：线上走查发现勾选框看不见（别处的勾选框同样这样写） */
.card.execution .plan-estimate { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); line-height: var(--lh-tight); color: var(--faint); overflow-wrap: anywhere; }       /* 估计值脚注：最淡的一行 */

/* —— 手机窄屏走查补的（2026-11-14；放在文件最后：要压过上面各处对这些控件尺寸的定义）—— */
@media (pointer: coarse), (max-width: 820px) {
  /* 2026-11-14 手机窄屏走查补的：整行的开关、标签、小按钮、勾选框都到 40 的可点高度；挨着的箭头与小横杠放大本身，单个的小按钮向四周扩热区。 */
  /* 卡片里的主按钮（确认、开始、允许、取消……）与整行的开关：32 高太小，手指点不准——一律 40（!important：这些控件各处有更具体的尺寸定义） */
  .actions-area button, .gate-all, .dock-stop, .decision-foot button { min-height: var(--ctl-touch) !important; }
  .group-head, .fold-head, .review-head, .card-head, .mol-tab, .report-preview-open { min-height: var(--ctl-touch) !important; }
  .review-row, .card details > summary { min-height: 36px; }
  .plan-prev, .example-dot, .web-source-file, .web-source-3d { position: relative; }
  .plan-prev::before, .example-dot::before, .web-source-file::before, .web-source-3d::before { content: ""; position: absolute; inset: -9px -6px; }
  .mol-smiles-copy { min-width: var(--ctl-touch); min-height: var(--ctl-touch); }
  .mol-2d, .mol-3d, [data-testid="open-entry"], [data-testid$="-text-toggle"] { position: relative; }
  .mol-2d::before, .mol-3d::before, [data-testid="open-entry"]::before, [data-testid$="-text-toggle"]::before { content: ""; position: absolute; inset: -9px -4px; }      /* 24 / 18 → 40 */
  .card.execution .exec-skip label { min-height: var(--ctl-touch); align-items: center; }      /* 勾选框 16px 太小：整行都是可点的，行高 40 */
  .card.execution .exec-skip input { width: 20px; height: 20px; }
  .gate-nav { width: var(--ctl-touch); height: var(--ctl-touch); }
  .gate-nav .icon { width: 18px; height: 18px; }
  .gate-pager button.mol-seg { height: 32px; width: 32px; }
  .gate-pager button.mol-seg::before { inset: 14px 2px; }
}
/* 手机窄屏：输入框上面那一行（任务栏）的“报告”与“全部任务”都只留图标——没有边框、没有底色、没有字，字挤给状态与任务名（390 宽时“等你确认…”“全部任…”都被截成省略号）。
   字不用 display:none，而是视觉隐藏（仍在可访问名称里：读屏念“全部任务 3”，英文模式照样走翻译）；可点区域 40×40，悬停不再出底色（触屏上悬停会粘住），按下仍有反馈。 */
@media (max-width: 820px) {
  .flow-current .view-btn-word, .flow-current .flow-list-toggle > span:not(.icon) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .flow-current .view-btn, .flow-current .flow-list-toggle { position: relative; flex: none; box-sizing: border-box; justify-content: center; width: var(--ctl-touch); max-width: none; height: var(--ctl-touch); margin: 0; padding: 0; border: 0; border-radius: var(--r-pill); background: transparent; box-shadow: none; }
  .flow-current .view-btn:hover:not(:disabled), .flow-current .flow-list-toggle:hover { background: transparent; color: var(--accent); }
  /* 全部任务的个数：字视觉隐藏后，图标前面留一个小数字（读屏仍念“全部任务 n”），看得出还有几个任务；展开时按钮是“收起”，不显示 */
  .flow-current .flow-list-toggle[aria-expanded="false"]::before { content: attr(data-count); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; line-height: 1; }
  .flow-current .flow-list-toggle { gap: 2px; }
  /* 多体系任务里每个子任务行的“几/几 步”：窄屏上单独占一行、把行撑高，直接不显示（进度条与状态字已经说明了进度） */
  .flow-sub .flow-summary { display: none; }
}
/* 手机窄屏走查补的（2026-11-15）：提问卡的“提交 / 跳过”32 高太小，到 40；代码块右上角的“复制”（richtext.css 里它只有 22 高）上下多给点内边距，离字近的一侧不变。 */
@media (pointer: coarse), (max-width: 820px) {
  .ask button.small { min-height: var(--ctl-touch); }
  .continuity-note button.small, .continuity-note .cn-head { min-height: var(--ctl-touch); }      /* 小提示卡的“按之前的设置”“知道了”与标题行：触屏 40 高 */
  .seg button, .report-tabs button { min-height: 36px; }      /* 分段控件（报告、输入、结果、分析……）28 → 36；放不到 40：顶上一条要和面板标签条、关闭按钮同一行 */
  .report-audit-more > summary { display: flex; align-items: center; min-height: 36px; }      /* “全部意见（n）”原来 20 高 */
  .rt-copy { position: relative; }
  .rt-copy::after { content: ""; position: absolute; inset: -4px -6px -10px; }      /* 22 → 36 高的可点区域，版面不变（上沿只有 4px 余地，多的往下扩） */
}

/* 对话顶部的“载入更早的对话”（协议 §505）：首屏只有最近几轮，往上翻到顶会自动取，这个按钮是手动的那条路。
   它是消息流的第一个子元素，跟着内容一起滚动；居中、不占满一行，没有更早的时整个移出 DOM。 */
.chat-earlier { display: block; margin: var(--sp-2) auto; }
.chat-earlier[hidden] { display: none; }
