/* Auto-split from _07_workflow_blocks.css - DO NOT EDIT MANUALLY */
/* See _07_workflow_blocks.css.bak for original */

/* Block系统·优先级驱动动态可视化 */
/* 自动生成 — 由 _split_css.py 从 workflow.css 提取 (L596-1156) */

/* ============================================================
 *  Block系统 — 优先级驱动的动态可视化块 + 模块色彩注入
 * ============================================================ */

/* Block容器 — 默认grid单列布局, JS动态覆盖gridTemplate */
.wf-block-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: 100%;
    overflow: hidden;
    gap: 0;
    position: relative; /* handles绝对定位的参照 */
}

.wf-block-container > .wf-block {
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
    align-self: stretch;
}

/* 工具库横向3区布局 — grid模式下不再需要flex-direction: row */
.wf-block-container.wf-block-horizontal {
    overflow: hidden;
}
.wf-block-container.wf-block-horizontal > .wf-block.wf-block-hz-main {
    min-width: 25vw;
    overflow-y: auto;
}
.wf-block-container.wf-block-horizontal > .wf-block-right-zone {
    min-width: 22vw;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-left: 2px solid var(--border-primary);
}

/* 单个Block外壳 — 注入模块色彩, grid子项自动填充 */
.wf-block {
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--block-accent, var(--accent-color));
    margin: 0;
    height: 100%;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-panel-hover, rgba(0,0,0,0.15));
}
.wf-block:hover {
    border-color: var(--block-accent, var(--accent-color));
    box-shadow: inset 0 0 12px var(--block-glow, rgba(74,144,217,0.08));
}

/* Block交互态 — 用户正在交互时：纯亮黑底 + 雷达扫描线，无彩色光晕 */
.wf-block.wf-block-interacting {
    background: var(--bg-input, rgba(22, 26, 33, 0.92));
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    position: relative;
}
/* 雷达扫描线 — GPU transform, 禁止 animating top (layout). 滚动时暂停. */
.wf-block.wf-block-interacting::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 0.125rem;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.35) 30%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0.35) 70%, transparent 100%);
    box-shadow: 0 0 6px rgba(255,255,255,0.15),
                0 0 12px rgba(255,255,255,0.06);
    animation: tno-scanline-hover 2.4s linear infinite;
    pointer-events: none;
    z-index: 5;
    opacity: 0.7;
    will-change: transform, opacity;
    transform: translate3d(0, 0, 0);
}
html.leucs-scrolling .wf-block.wf-block-interacting::after {
    animation-play-state: paused;
    opacity: 0;
}
.wf-block:first-child {
    border-top: none;
}

/* Block标题栏 — 模块强调色半透明底，标题栏是拖拽把手 强制单行 */
.wf-block-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(90deg, var(--block-glow, rgba(255,255,255,0.03)) 0%, transparent 80%);
    border-bottom: 1px solid var(--block-border, var(--border-primary));
    cursor: grab;
    user-select: none;
    min-height: 3.5vh;
    font-size: var(--font-xs);
    font-family: var(--tno-font-mono);
    flex-wrap: nowrap; /* 强制单行 */
    overflow: hidden; /* 溢出隐藏 */
    max-height: 4.5vh; /* 防止撑高 */
    position: relative; /* 建立层叠上下文，高于 divider(z:20) */
    z-index: 25;
}
.wf-block-title:active {
    cursor: grabbing;
}
.wf-block-title button {
    cursor: pointer;
}
.wf-block-title:hover {
    background: linear-gradient(90deg, var(--block-glow, rgba(255,255,255,0.06)) 0%, rgba(255,255,255,0.02) 80%);
}

.wf-block-collapsed .wf-block-title {
    border-bottom: none;
}

/* ── Block 标题栏三按钮共享底座 — Phase 434+618+619v2: expand/toggle/replace 统一尺寸+间距+交互，防漂移 ── */
.wf-block-expand-btn,
.wf-block-toggle,
.wf-block-replace-btn {
    background: none;
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    width: 1.125rem;
    height: 1.125rem;
    font-family: var(--tno-font-mono);
    font-size: var(--font-canvas-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    margin-left: 0.25rem;
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, color 0.15s;
}
.wf-block-expand-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
}

/* ── Block 展开态: absolute定位铺满所在列 ── */
.wf-block.wf-block-expanded {
    /* 只用 box-shadow 过渡; top/left/right/bottom 不 transition 避免 ResizeObserver 反复触发闪烁 */
    transition: box-shadow 0.3s;
    box-shadow: 0 0 24px var(--block-glow, rgba(74,144,217,0.18));
    /* Phase SCROLLBAR-FIX: 展开态overflow移到body, 标题栏保持吸顶不滚走 */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* ★ Phase 437-V7: CSS 防线 — 禁止展开模块坍缩为 0 宽度 (JS 计算失误的最后兜底) */
    min-width: 5vw !important;
    min-height: 5vh !important;
}
/* Phase SCROLLBAR-FIX: 展开态内容区独立滚动, 标题栏吸顶 */
.wf-block.wf-block-expanded .wf-block-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}
/* Phase 417-V9: 展开+交互时，overflow:clip 截断雷达线溢出（覆盖 expanded 的 auto） */
.wf-block.wf-block-expanded.wf-block-interacting {
    overflow: hidden;          /* fallback */
    overflow: clip;
}

/* ── 其他Block淡出: 保留DOM但视觉隐藏 ── */
.wf-block.wf-block-faded,
.wf-block-divider.wf-block-faded {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* 展开覆盖其他 block 时, 其他 block 的拉伸栏必须消失 (不是展开块自己的轴).
   展开块背景半透明, 仅靠 z-index 盖不住 divider 的 ::after 指示条. */
#leucs-module-body:has(> .wf-block.wf-block-expanded) > .wf-block-divider,
#leucs-module-body:has(> .wf-block.wf-block-expanded) > .wf-block-divider::before,
#leucs-module-body:has(> .wf-block.wf-block-expanded) > .wf-block-divider::after {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Block LED (方形 TNO风格 — 颜色由JS注入) */
.wf-block-led {
    width: 0.5rem;
    height: 0.5rem;
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s;
    /* 默认颜色，JS会覆盖 */
    background: var(--block-accent, var(--blue-info-dim));
}

.wf-block-label {
    flex: 1 1 0%;
    min-width: 2.5rem; /* Phase 619: 防止标签被完全挤扁，保证至少可见 */
    color: var(--text-primary);
    font-weight: bold;
    letter-spacing: 0.0312rem;
    white-space: nowrap; /* 不换行 */
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-block-priority {
    color: var(--accent-color);
    font-size: var(--font-xs);
    font-weight: bold;
    letter-spacing: 0.05rem;
    padding: 0.0625rem 0.375rem;
    border: 1.5px solid currentColor;
    border-radius: var(--radius-sm);
    text-transform: lowercase;
    background: rgba(0,0,0,0.3);
    white-space: nowrap; /* 不换行 */
    flex-shrink: 0;
    margin-left: auto; /* ★ Phase 434: 将右侧按钮组推到标题栏最右 */
}

/* Phase 146 Step 9: 双保险 — JS 漏改时 CSS 兜底
 *  1) 仅剩单个 Block 时 #N 徽章无比较意义，隐藏以免显得死板
 *  2) 越界隐藏的 block 不应漏出 (用 !important 锁死) */
.wf-block-container .wf-block:only-child .wf-block-priority,
.wf-panel-body .wf-block:only-child .wf-block-priority {
    display: none !important;
}
.wf-block.wf-block-overflow-hidden {
    display: none !important;
}

/* ── Block 折叠切换按钮 hover（共享底座见上方三按钮统一规则）── */
.wf-block-toggle:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
}

/* Block内容体 — 每个block独立滚动 */
.wf-block-body {
    flex: 1;
    min-height: 0;
    padding: 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: var(--font-sm);
    scrollbar-width: thin;
    scrollbar-color: var(--border-primary) transparent;
    display: flex;
    flex-direction: column;
}
/* Block内容默认撑满 — 子元素可用 flex:1 填充空间 */
.wf-block-body > .wf-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Block底部操作栏 — 固定在body最下方 */
.wf-block-footer {
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-primary);
    flex-shrink: 0;
}

/* Block resize handles — grid覆盖层(绝对定位在grid线上), 透明底+居中指示器
 * T4 层级宪法: z-index 唯一权威在 _05c_api_edit_forms.css 的 .wf-block-divider (28),
 *   高于 .wf-block-title(25)/展开块(30 以下), 低于弹层(500+)。
 *   本文件不再声明 z-index — 旧值(10/4)曾让标题栏盖住拖拽手柄导致"拖不动/发涩"。 */
/* 列分割线 — 垂直线, 左右拖拽 */
.wf-block-divider-col {
    position: absolute;
    top: 0;
    width: 0.5rem;
    cursor: ew-resize;
    background: transparent;
    transition: background 0.15s, box-shadow 0.15s;
}
.wf-block-divider-col::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0.125rem;
    height: 4vh;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    transition: background 0.15s, height 0.15s, box-shadow 0.15s;
}
.wf-block-divider-col:hover,
.wf-block-divider-col:active {
    background: rgba(74, 144, 217, 0.08);
}
.wf-block-divider-col:hover::after,
.wf-block-divider-col:active::after {
    background: var(--accent-color, var(--blue-info-dim));
    height: 6vh;
    box-shadow: 0 0 6px var(--accent-color, var(--blue-info-dim));
}

/* 行分割线 — 水平线, 上下拖拽 — z-index 同列分割线: 唯一权威 .wf-block-divider(28) */
.wf-block-divider-row {
    position: absolute;
    left: 0;
    height: 0.5rem;
    cursor: ns-resize;
    background: transparent;
    transition: background 0.15s, box-shadow 0.15s;
}
.wf-block-divider-row::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 0.125rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    transition: background 0.15s, width 0.15s, box-shadow 0.15s;
}
.wf-block-divider-row:hover,
.wf-block-divider-row:active {
    background: rgba(74, 144, 217, 0.08);
}
.wf-block-divider-row:hover::after,
.wf-block-divider-row:active::after {
    background: var(--accent-color, var(--blue-info-dim));
    width: 3rem;
    box-shadow: 0 0 6px var(--accent-color, var(--blue-info-dim));
}

/* ===== Block内部通用组件 ===== */

/* KV 网格 */
.wf-kv-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    font-size: var(--font-xs);
}
.wf-kv-key {
    color: var(--text-secondary);
    font-family: var(--tno-font-mono);
    white-space: nowrap;
}
.wf-kv-val {
    color: var(--text-primary);
    word-break: break-all;
}
.wf-kv-val.mono {
    font-family: var(--tno-font-mono);
}

/* KV行 (单行) */
.wf-kv-row {
    display: flex;
    gap: 0.5rem;
    font-size: var(--font-xs);
    padding: 0.125rem 0;
}

/* 占位符 */
.wf-placeholder {
    color: var(--text-secondary);
    font-size: var(--font-xs);
    padding: 0.5rem 0;
    text-align: center;
    border: 1px dashed var(--border-primary);
    min-height: 5vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Block内文本 */
.wf-block-text {
    color: var(--text-secondary);
    font-size: var(--font-xs);
    line-height: 1.5;
}

/* Block内预格式化 */
.wf-block-pre {
    margin: 0;
    font-family: var(--tno-font-mono);
    font-size: var(--font-xs);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Block内滚动区 */
.wf-block-scroll {
    max-height: 20vh;
    overflow-y: auto;
    font-size: var(--font-xs);
    color: var(--text-secondary);
    scrollbar-width: thin;
    scrollbar-color: var(--border-primary) transparent;
}

/* 小按钮 */
.wf-btn-sm {
    background: none;
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 0.1875rem 0.625rem;
    font-family: var(--tno-font-mono);
    font-size: var(--font-xs);
    cursor: pointer;
    margin-top: 0.375rem;
}
.wf-btn-sm:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* ===== Chat容器（工具创建专用） ===== */
.wf-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 16vh;
}
.wf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem;
    font-size: var(--font-xs);
    border: 1px solid var(--border-primary);
    margin-bottom: 0.375rem;
    min-height: 10vh;
    scrollbar-width: thin;
    scrollbar-color: var(--border-primary) transparent;
}
.wf-chat-msg {
    padding: 0.25rem 0.5rem;
    margin: 0.125rem 0;
    border-left: 2px solid var(--border-primary);
    font-family: var(--tno-font-mono);
    font-size: var(--font-xs);
    line-height: 1.5;
    color: var(--text-primary);
}
.wf-chat-msg.user {
    border-left-color: var(--accent-color);
    background: rgba(74, 144, 217, 0.18);  /* 增强可见度 */
}
.wf-chat-msg.assistant {
    border-left-color: var(--border-primary);
    /* SEGMENT-V18: 卡片自身中性, 颜色由段内 .wf-steps-segment[data-segment] 控制 */
    background: var(--bg-panel);
    color: var(--text-primary);
    transition: border-left-color 0.2s ease;
}
.wf-chat-msg.system {
    border-left-color: var(--text-secondary);
    color: var(--text-secondary);
    font-style: italic;
}

/* === 对话轮次选中高亮 — TNO+CAD白色虚线框 === */
.wf-chat-msg.wf-turn-selected {
    border: 2px dashed var(--turn-select-color, var(--c-ffffff)) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.06);
    position: relative;
    border-radius: var(--radius-sm);
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.wf-chat-msg.wf-turn-selected::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 0; height: 0;
    border-top: 12px solid var(--turn-select-color, var(--c-ffffff));
    border-left: 12px solid transparent;
    opacity: 0.6;
    transition: border-top-color 0.25s ease;
}
.wf-chat-msg.user {
    cursor: pointer;
    transition: border-left-color 0.2s ease;
}
.wf-chat-msg.assistant {
    cursor: pointer;
    transition: border-left-color 0.2s ease;
}
.wf-chat-msg.user:hover:not(.wf-turn-selected),
.wf-chat-msg.assistant:hover:not(.wf-turn-selected) {
    border-left-color: rgba(255, 255, 255, 0.3);
}
.wf-chat-input-row {
    display: flex;
    gap: 0.25rem;
}
.wf-chat-input {
    flex: 1;
    background: var(--bg-bunker);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    font-family: var(--tno-font-mono);
    font-size: var(--font-xs);
    resize: none;
}
.wf-chat-input:focus {
    border-color: var(--accent-color);
    outline: none;
}

/* ── MCP 管线分段着色 (单卡内着色, 不拆卡) ── */
.wf-steps-segment {
    margin: 0.125rem 0;
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    /* ★ Phase PIPELINE-COLOR-ENGINE 2026-08-01: 基础管线 (无 data-segment)
       统一灰色 — 与五管线 (金/青/紫/红/绿) 严格区分, 未分配状态一眼可辨。 */
    background: var(--pipeline-base, rgba(156, 163, 175, 0.03));
    border-left-color: var(--pipeline-base-border-left, rgba(156, 163, 175, 0.35));
}
/* ★ Phase LIVE-STREAM-FIX 2026-07-31: 空段/全排队段不显示背景与 padding —
   段容器在首卡创建时即存在, 但队列卡 display:none 不占高度; 旧样式给空段
   也铺底色 + 6px padding, 用户看到"思考卡还没出现、管线段背景/高度先出现"
   的预留感 (S01 思考中下方出现金色空条)。仅当段内有"非排队可见卡"时才
   显示段背景 (含 :has() 不支持的浏览器降级为不隐藏, 无害)。 */
.wf-steps-segment:not(:has(> .wf-collapsible-event-card:not(.leucs-card-queued),
                          > .wf-step-card:not(.leucs-card-queued))) {
    padding: 0;
    background: transparent;
    border-left-color: transparent;
}
/* ★ Phase CONTENT-FIRST-BG 2026-08-01: 段内已放行卡全部"内容为空"时
   隐藏段背景 — 占位思考卡/刚放行的 API 卡只有卡片骨架没有文字时,
   背景不得先铺开 (用户实拍: 背景高度先变、内容后出、空白管线色条)。
   任一可见卡出现真实内容后背景立即铺开 — 背景严格跟随内容。 */
.wf-steps-segment:has(> .wf-collapsible-event-card:not(.leucs-card-queued), > .wf-step-card:not(.leucs-card-queued), > .leucs-api-call-card:not(.leucs-card-queued)):not(:has(> .wf-collapsible-event-card:not(.leucs-card-queued) .wf-cev-body:not(:empty), > .wf-step-card:not(.leucs-card-queued), > .leucs-api-call-card:not(.leucs-card-queued) .leucs-api-body:not(:empty))) {
    padding: 0;
    background: transparent;
    border-left-color: transparent;
}
/* ★ PIPELINE-FIX-2026-07-21: 相邻段之间消除 margin-top,
   使 border-left 管线条连续不断裂。 */
.wf-steps-segment + .wf-steps-segment {
    margin-top: 0;
}
.wf-steps-segment[data-segment="react"] {
    /* 主管线 · 分类/ReAct — 段底色淡淡金色铺底, 非渐变 */
    background: var(--pipeline-gold, rgba(255, 193, 7, 0.035));
    border-left-color: var(--pipeline-gold-border-left, rgba(255, 193, 7, 0.55));
    /* 段内卡片: 统一中性深色, 不继承管线色 (防金渗透) */
    --seg-card-bg: rgba(100,100,100,0.04);
    --seg-card-border: rgba(100,100,100,0.15);
    --seg-badge-bg: rgba(100,100,100,0.10);
}
.wf-steps-segment[data-segment="mcp-a"] {
    /* A管线 · MCP功能工具 — 段底色淡淡青色铺底 */
    background: var(--pipeline-mcp-a, rgba(14, 165, 233, 0.035));
    border-left-color: var(--pipeline-mcp-a-border-left, rgba(14, 165, 233, 0.45));
    --seg-card-bg: rgba(100,100,100,0.04);
    --seg-card-border: rgba(100,100,100,0.15);
    --seg-badge-bg: rgba(100,100,100,0.10);
}
.wf-steps-segment[data-segment="mcp-b"] {
    /* B管线 · SYS-MCP系统工具 — 段底色淡淡紫色铺底 */
    background: var(--pipeline-mcp-b, rgba(149, 97, 255, 0.035));
    border-left-color: var(--pipeline-mcp-b-border-left, rgba(149, 97, 255, 0.40));
    --seg-card-bg: rgba(100,100,100,0.04);
    --seg-card-border: rgba(100,100,100,0.15);
    --seg-badge-bg: rgba(100,100,100,0.10);
}
.wf-steps-segment[data-segment="mcp-c"] {
    /* C管线 · 流水线组合 — 段底色淡淡红色铺底
       ★ Phase PIPELINE-COLOR-ENGINE 2026-08-01: 琥珀橙 var(--amber-tailwind) → 红 var(--red-danger)
       (旧色与主管线金黄 var(--c-ffc107) 高度撞色, 用户无法区分) */
    background: var(--pipeline-mcp-c, rgba(239, 68, 68, 0.035));
    border-left-color: var(--pipeline-mcp-c-border-left, rgba(239, 68, 68, 0.45));
    --seg-card-bg: rgba(100,100,100,0.04);
    --seg-card-border: rgba(100,100,100,0.15);
    --seg-badge-bg: rgba(100,100,100,0.10);
}
.wf-steps-segment[data-segment="final"] {
    /* 最终答案管线 — 段底色淡淡绿色铺底 */
    background: var(--pipeline-green, rgba(34, 197, 94, 0.03));
    border-left-color: var(--pipeline-green-border-left, rgba(34, 197, 94, 0.45));
    --seg-card-bg: rgba(100,100,100,0.04);
    --seg-card-border: rgba(100,100,100,0.15);
    --seg-badge-bg: rgba(100,100,100,0.10);
}

/* ★ FA 最终答案区域: 绿色管线背景 (覆盖 _07b 的钢蓝 base 规则, 用 --pipeline-green 集中变量) */
/* Phase 636-SPLIT-V3: margin-top 从 8px 改为 0，消除与上方 step segment 之间的视觉间隙，
   使绿色管线条 (border-left) 从段首卡片到最终答案连续不断裂。 */
#leucs-messages.leucs-pipeline-final .wf-final-answer {
    background: var(--pipeline-green, rgba(34, 197, 94, 0.057));
    border-left: 3px solid var(--pipeline-green-border-left, rgba(34, 197, 94, 0.55));
    border-top: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.625rem 0.875rem;
    margin-top: 0;
}
/* 折叠预览中的 FA 也用绿色 (历史回放等场景) */
#leucs-messages.leucs-pipeline-final .wf-msg-collapsed-preview .wf-collapsed-answer {
    background: var(--pipeline-green, rgba(34, 197, 94, 0.05));
    border-left: 3px solid var(--pipeline-green-border-left, rgba(34, 197, 94, 0.45));
    padding: 0.375rem 0.625rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
/* 段内工具卡片 — 使用段变量，不再硬编码黑色 */
.wf-steps-segment .wf-collapsible-event-card {
    background: var(--seg-card-bg, var(--bg-panel, transparent));
    border-color: var(--seg-card-border, var(--border-default, var(--c-30363d)));
}
.wf-steps-segment .wf-cev-summary {
    background: color-mix(in srgb, var(--event-accent, var(--accent-authority)) 4%, transparent);
}

/* ── MCP 卡片内容渲染增强: JSON 语法高亮 ── */
pre.mcj-json-block {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.625rem;
    margin: 0.375rem 0;
    overflow-x: auto;
    font-family: var(--tno-font-mono, 'Consolas','Courier New',monospace);
    font-size: var(--font-canvas-xs, 0.6875rem);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
}
.mcj-key { color: var(--c-82aaff); }       /* JSON key 蓝紫 */
.mcj-str { color: var(--c-c3e88d); }       /* JSON string 绿 */
.mcj-num { color: var(--c-f78c6c); }       /* JSON number 橙 */
.mcj-kw  { color: var(--c-c792ea); }       /* JSON keyword 紫 */

/* 统计关键词着色 */
.mcj-stat-kw { color: var(--c-89ddff); font-weight: 600; }   /* 统计名 亮蓝 */
.mcj-stat-val { color: var(--c-ffcb6b); font-weight: 600; }  /* 统计值 金 */

/* 请求参数名着色 */
.mcj-param-kw { color: var(--c-f07178); font-weight: 600; }  /* 参数名 红 */

/* ── Python 语法高亮 ── */
pre.mcj-py-block {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.625rem;
    margin: 0.375rem 0;
    overflow-x: auto;
    font-family: var(--tno-font-mono, 'Consolas','Courier New',monospace);
    font-size: var(--font-canvas-xs, 0.6875rem);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}
.mcj-py-kw      { color: var(--c-c792ea); font-weight: 600; }  /* from/import/def/class 紫 */
.mcj-py-builtin  { color: var(--c-82aaff); }                    /* print/len/Path 蓝 */
.mcj-py-func     { color: var(--c-5ccfe6); }                    /* 函数调用 青 */
.mcj-py-deco     { color: var(--c-ffe082); }                    /* @装饰器 金 */
.mcj-py-str      { color: var(--c-c3e88d); }                    /* 字符串 绿 */
.mcj-py-comment  { color: var(--c-546e7a); font-style: italic; } /* 注释 灰 */
.mcj-py-num      { color: var(--c-f78c6c); }                    /* 数字 橙 */

/* ── Git diff 行着色 ── */
.mcj-diff-add  { color: var(--c-a5d6a7); background: rgba(76,175,80,0.08); display: inline-block; width: 100%; }  /* +行 绿 */
.mcj-diff-del  { color: var(--c-ef9a9a); background: rgba(244,67,54,0.08); display: inline-block; width: 100%; }  /* -行 红 */
.mcj-diff-hunk { color: var(--c-82aaff); font-weight: 600; }                                                     /* @@行 蓝 */

/* MCP 卡片 body 默认 pre-wrap 确保 \n 换行 */
.wf-cev-body {
    white-space: normal;  /* 默认 normal, marked 输出用 HTML 标签控制换行 */
}
.wf-cev-body pre,
.wf-cev-body code {
    white-space: pre-wrap;
}
