/* ============================================================
   画布 —— 节点式工作台（Liblib / 即梦 风格）
   HTML 节点层 + SVG 连线层，不用 Konva
   ============================================================ */
:root {
    --bg:        #141414;
    --bg-soft:   #1a1a1a;
    --card:      #282828;
    --card-hi:   #2f2f2f;
    --panel:     #242424;
    --panel-hi:  #2b2b2b;
    --line:      rgba(255, 255, 255, 0.08);
    --line-2:    rgba(255, 255, 255, 0.14);
    --text:      #eaeaec;
    --text-2:    #9a9a9f;
    --text-3:    #6b6b72;
    --accent:    #3b82f6;
    --accent-2:  #5b9cff;
    --accent-dim:rgba(59, 130, 246, 0.16);
    --danger:    #ef4444;
    --ok:        #22c55e;
    --r:         12px;
    --r-sm:      8px;
    --shadow:    0 10px 34px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    height: 100%; overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
svg { display: block; flex: none; }

#cvApp { position: relative; width: 100vw; height: 100vh; overflow: hidden; }

/* ── 网格背景 ── */
#cvBg {
    position: absolute; inset: 0;
    background-color: var(--bg);
    background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
    background-repeat: repeat;
    pointer-events: none;
}

/* ── 视口 / 世界 ── */
/* ★★ 2026-10-14 两处修复（用户实测：空白画布拖动会「整页文字被选中」→ 变成原生拖拽 → 页面冻住、滚轮全失效）：
   ① `user-select:none` —— 空白画布再也不可能起「文档级选区」。
      （原来只有 `#cvWorld` 有 none，但它是 `width:0;height:0` 的零尺寸锚点，**实际盖不住任何像素**，
       空白处命中测试落到的正是 `#cvViewport`，所以整页文字都能被框选、连顶栏 CPU/GPU 都选中。）
      输入框/便签由下面 `#cvWorld .cv-note/input/textarea{user-select:text}`（选择器更具体）继续可选，
      助手面板挂在 `body` 上、不在 `#cvViewport` 内 → 聊天记录照样能选中复制。
   ② `cursor:grab` —— 原来视口**根本没设 cursor**（空白处是普通箭头），只有开了「抓手工具」才是抓手；
      用户反馈"抓手时有时无"。这里统一成抓手，拖动中由 `.panning`/`.panning *` 接管为 grabbing。 */
#cvViewport {
    position: absolute; inset: 0; overflow: hidden; touch-action: none;
    cursor: grab;
    user-select: none; -webkit-user-select: none;
}
#cvViewport.tool-hand { cursor: grab; }
#cvViewport.panning { cursor: grabbing; }
/* ★★ 2026-10-12 拖画布时误选中框里文字的根治 ────────────────────────────────
   三层防护，缺一不可：
   ① #cvWorld 整体 user-select:none —— 节点标题、标签、说明文字默认就不可选
      （input/textarea 是浏览器故意保留可选的特殊控件，这一层管不住它们，靠②③）。
   ② 拖拽中 .panning * 用 !important 强制禁选 —— 覆盖输入框，鼠标划过提示词框
      也不会把拖动变成"选字"。
   ③ canvas.js 里判定为 pan 时 e.preventDefault() —— 从根上不让浏览器启动选择
      （①②都是"选了也看不见"，③才是"根本没开始选"，最彻底）。 */
#cvWorld {
    position: absolute; left: 0; top: 0;
    width: 0; height: 0;
    transform-origin: 0 0;
    will-change: transform;
    user-select: none; -webkit-user-select: none;
}
/* ★ 便签是 contenteditable、input/textarea 是浏览器保留可选的特殊控件，
   继承 user-select:none 会让它们里面选不了字（实测过：在提示词框里拖选
   selectionStart===selectionEnd，根本选不中）→ 显式恢复成 text。
   ⚠️ 这条必须留在 .panning 规则**之前**理解：平时可选，拖拽中被 .panning 的
      !important 压掉 → 既不耽误正常改字，也不会误选中。 */
#cvWorld .cv-note,
#cvWorld input,
#cvWorld textarea { user-select: text; -webkit-user-select: text; }
/* ★ 替换了原来只有 cursor 的那条：panning 期间连同所有子孙一起强制禁选。
   ★★ 2026-10-29 收窄作用域：禁选**不再覆盖输入框 / 文本域 / 便签**。
      原来是对所有子孙 user-select:none !important —— 状态一旦卡住（丢 pointerup），
      连打字、选字都废了，故障面从「拖动不方便」放大成「整页不能编辑」。
      现在 panning 卡死也顶多是光标不对，输入框照常能用。 */
#cvViewport.panning,
#cvViewport.panning * { cursor: grabbing; }
#cvViewport.panning :not(input):not(textarea):not(.cv-note) { user-select: none !important; -webkit-user-select: none !important; }
#cvViewport.panning input, #cvViewport.panning textarea, #cvViewport.panning .cv-note { user-select: text !important; -webkit-user-select: text !important; cursor: text; }
#cvLinks { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }

/* ── 顶栏 ── */
.cv-top {
    position: absolute; left: 0; right: 0; top: 0; height: 48px;
    display: flex; align-items: center; gap: 8px;
    padding: 0 12px 0 10px;
    background: linear-gradient(180deg, rgba(20,20,20,0.96) 0%, rgba(20,20,20,0.72) 62%, rgba(20,20,20,0) 100%);
    z-index: 30;
    pointer-events: none;
}
.cv-top > * { pointer-events: auto; }
.cv-top-l { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.cv-top-r { display: flex; align-items: center; gap: 8px; }

.cv-logo {
    width: 28px; height: 28px; border-radius: 8px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff; text-decoration: none; flex: none;
}
.cv-ws {
    font-size: 12.5px; color: var(--text-2);
    padding: 4px 6px; border-radius: 6px; white-space: nowrap;
}
.cv-ws:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.cv-tabs { display: flex; align-items: center; gap: 4px; overflow: hidden; }
.cv-tab {
    display: flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 8px 0 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-2);
    font-size: 12.5px;
    max-width: 190px;
    white-space: nowrap;
    border: 1px solid transparent;
}
.cv-tab:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.cv-tab.on {
    background: var(--card); color: var(--text);
    border-color: var(--line);
}
.cv-tab span { overflow: hidden; text-overflow: ellipsis; }
.cv-tab .cv-tab-x {
    width: 16px; height: 16px; border-radius: 4px;
    display: grid; place-items: center; opacity: 0; color: var(--text-3); flex: none;
}
.cv-tab:hover .cv-tab-x { opacity: 1; }
.cv-tab .cv-tab-x:hover { background: rgba(255,255,255,0.12); color: var(--text); }

.cv-icobtn {
    width: 30px; height: 30px; flex: none;
    border-radius: 8px;
    display: grid; place-items: center;
    color: var(--text-2);
    border: 1px solid transparent;
}
.cv-icobtn:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.cv-icobtn:disabled { opacity: .35; cursor: not-allowed; }

.cv-balance {
    display: flex; align-items: center; gap: 5px;
    height: 28px; padding: 0 10px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--line);
    font-size: 12.5px; color: var(--text);
    font-variant-numeric: tabular-nums;
}
.cv-balance svg { color: var(--accent-2); }
/* 扣费后余额跳一下，让用户一眼看到「钱扣了、还剩多少」 */
.cv-balance.flash {
    border-color: var(--accent-2);
    animation: cvbalflash 1.4s ease-out;
}
@keyframes cvbalflash {
    0%   { background: rgba(91,156,255,0.34); }
    100% { background: var(--card); }
}

.cv-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: #fff; font-size: 12px; font-weight: 600;
    text-transform: uppercase; flex: none; cursor: pointer;
}

.cv-savechip {
    font-size: 11.5px; color: var(--text-3);
    padding: 0 4px; white-space: nowrap;
    transition: color .2s;
}
.cv-savechip.saving { color: var(--accent-2); }
.cv-savechip.saved  { color: var(--ok); }

/* ── 底部工具坞 ── */
.cv-dock {
    position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
    display: flex; align-items: center; gap: 4px;
    padding: 5px 6px;
    background: rgba(32, 32, 32, 0.94);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    z-index: 30;
}
.cv-dock-btn {
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    color: var(--text-2);
    flex: none;
}
.cv-dock-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.cv-dock-btn.on { background: rgba(255,255,255,0.1); color: var(--text); }
.cv-dock-btn.accent {
    background: #fff; color: #1a1a1a;
}
.cv-dock-btn.accent:hover { background: #e6e6e6; color: #1a1a1a; }
.cv-dock-sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; }

/* ── 左下 / 右下 ── */
.cv-bl, .cv-br {
    position: absolute; bottom: 18px;
    display: flex; align-items: center; gap: 2px;
    padding: 4px;
    background: rgba(32,32,32,0.94);
    border: 1px solid var(--line);
    border-radius: 10px;
    backdrop-filter: blur(14px);
    z-index: 30;
}
.cv-bl { left: 14px; }
.cv-br { right: 14px; }
.cv-txtbtn {
    display: flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 10px; border-radius: 8px;
    color: var(--text-2); font-size: 12.5px; white-space: nowrap;
}
.cv-txtbtn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.cv-txtbtn.on { background: rgba(255,255,255,0.08); color: var(--text); }
.cv-zoomval {
    min-width: 52px; text-align: center;
    font-size: 12.5px; color: var(--text-2);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}
.cv-zoomval:hover { color: var(--text); }

/* ── 小地图 ── */
.cv-minimap {
    position: absolute; right: 14px; bottom: 62px;
    width: 172px; height: 116px;
    background: rgba(26,26,26,0.94);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden; z-index: 25;
    display: none;
}
.cv-minimap.on { display: block; }
.cv-minimap canvas { display: block; width: 100%; height: 100%; }

/* ── 历史任务面板 ── */
.cv-hist {
    position: absolute; left: 14px; bottom: 62px;
    width: 700px; max-width: calc(100vw - 28px);
    height: 580px; max-height: calc(100vh - 130px);
    display: none; flex-direction: column;
    background: rgba(26,26,26,0.97);
    border: 1px solid var(--line-2);
    border-radius: 12px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    z-index: 40; overflow: hidden;
}
.cv-hist.on { display: flex; }
.cv-hist-head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; flex: none;
    border-bottom: 1px solid var(--line);
}
.cv-hist-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text); font-weight: 500;
}
.cv-hist-title svg { color: var(--accent-2); }
.cv-hist-count { flex: 1; font-size: 12px; color: var(--text-3); }
.cv-hist-acts { display: flex; align-items: center; gap: 2px; }
.cv-hist.spin .cv-hist-acts .cv-icobtn:first-child svg { animation: cvspin .8s linear infinite; }

.cv-hist-body {
    flex: 1; overflow-y: auto; padding: 14px;
    display: grid; gap: 12px; align-content: start;
    /* 固定三列：一排三张，留足间距不拥挤 */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /* 行高必须写死：auto 行会被拉伸填满容器，把卡片压扁、文字区裁掉 */
    grid-auto-rows: 250px;
}
/* 窗口太窄时降级，避免三列被压扁 */
@media (max-width: 720px) {
    .cv-hist-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .cv-hist-body { grid-template-columns: minmax(0, 1fr); }
}
.cv-hist-body::-webkit-scrollbar { width: 8px; }
.cv-hist-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
.cv-hist-empty {
    grid-column: 1 / -1; padding: 70px 0;
    display: grid; place-items: center; gap: 10px;
    color: var(--text-3); font-size: 12.5px;
}

.cv-hi {
    display: flex; flex-direction: column; height: 100%;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px; overflow: hidden;
    cursor: pointer;
    transition: border-color .15s, transform .15s;
}
.cv-hi:hover { border-color: var(--accent); transform: translateY(-1px); }
.cv-hi.is-running { cursor: default; }
.cv-hi.is-running:hover { border-color: var(--line); transform: none; }
.cv-hi-thumb {
    position: relative; width: 100%;
    flex: 1 1 auto; min-height: 0;
    background: #1e1e1e; display: grid; place-items: center; overflow: hidden;
}
.cv-hi-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 视频缩略图：<video> 只预览第一帧（preload=metadata + poster 效果），点卡片看详情里能播 */
.cv-hi-thumb video.cv-hi-vid { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.cv-hi-vid-mark {
    position: absolute; left: 6px; top: 6px; z-index: 1;
    padding: 1px 6px; border-radius: 5px; font-size: 10px; font-weight: 800;
    background: rgba(0,0,0,.6); color: #fff; pointer-events: none;
}
.cv-hid-vid { display: block; width: 100%; max-height: 62vh; border-radius: var(--r-md); background: #000; }
.cv-hi-thumb .ph { color: #47474d; }
/* 缩略图右下角操作按钮：默认淡出，悬停整卡时浮现 */
.cv-hi-acts {
    position: absolute; right: 6px; bottom: 6px;
    display: flex; gap: 6px;
    opacity: 0; transform: translateY(4px);
    transition: opacity .16s ease, transform .16s ease;
}
.cv-hi:hover .cv-hi-acts { opacity: 1; transform: none; }
.cv-hi-act {
    width: 28px; height: 28px; border-radius: 8px;
    display: grid; place-items: center;
    background: rgba(0,0,0,0.6);
    color: #f0f0f2;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.14);
    transition: background .15s, transform .15s;
}
.cv-hi-act:hover { background: rgba(0,0,0,0.85); transform: scale(1.06); }
.cv-hi-act.clone { background: rgba(59,130,246,0.92); border-color: rgba(255,255,255,0.22); }
.cv-hi-act.clone:hover { background: #3b82f6; }
.cv-hi-badge {
    position: absolute; left: 6px; top: 6px;
    display: inline-flex; align-items: center; gap: 4px;
    height: 20px; padding: 0 8px; border-radius: 999px;
    font-size: 11px; font-weight: 500;
    background: rgba(0,0,0,0.66); backdrop-filter: blur(6px);
}
.cv-hi-badge.ok  { color: #4ade80; }
.cv-hi-badge.err { color: #f87171; }
.cv-hi-badge.run { color: var(--accent-2); }
.cv-hi-meta { flex: none; padding: 7px 9px 9px; }
.cv-hi-model {
    font-size: 11px; color: var(--text-3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cv-hi-prompt {
    margin-top: 3px; min-height: 34px;
    font-size: 12px; line-height: 1.45; color: var(--text-2);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; word-break: break-word;
}
.cv-hi-sub { margin-top: 5px; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-hi-sub.err { color: #f87171; }

/* ── 历史任务详情弹窗 ── */
.cv-hid {
    position: fixed; inset: 0; z-index: 60;
    display: none; align-items: center; justify-content: center;
    padding: 36px;
    background: rgba(0,0,0,0.74);
    backdrop-filter: blur(4px);
}
.cv-hid.on { display: flex; }
.cv-hid-box {
    display: flex; flex-direction: column;
    max-width: 92vw; max-height: 88vh;
    background: rgba(24,24,26,0.98);
    border: 1px solid var(--line-2);
    border-radius: 14px; overflow: hidden;
    box-shadow: var(--shadow);
}
.cv-hid-img {
    flex: 0 1 auto; min-height: 0;
    display: grid; place-items: center;
    background: #0f0f0f;
    overflow: hidden;
}
.cv-hid-img img {
    display: block;
    max-width: min(1000px, 82vw);
    max-height: 66vh;
    object-fit: contain;
}
.cv-hid-img .ph { color: #47474d; }
.cv-hid-info {
    flex: none; padding: 12px 16px 14px;
    border-top: 1px solid var(--line);
    max-width: min(1000px, 82vw);
}
.cv-hid-head { display: flex; align-items: flex-start; gap: 10px; }
.cv-hid-title { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.cv-hid-model { font-size: 13px; color: var(--text); font-weight: 500; }
.cv-hid-meta { font-size: 11.5px; color: var(--text-3); }
.cv-hid-prompt {
    margin-top: 8px; max-height: 128px; overflow-y: auto;
    padding: 8px 10px; border-radius: 8px;
    background: rgba(255,255,255,0.04);
    font-size: 12.5px; line-height: 1.6; color: var(--text-2);
    white-space: pre-wrap; word-break: break-word;
}
.cv-hid-acts { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.cv-hid-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 14px; border-radius: 8px;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--line-2);
    color: var(--text); font-size: 12.5px;
    transition: background .15s, border-color .15s;
}
.cv-hid-btn:hover { background: rgba(255,255,255,0.12); }
.cv-hid-btn.primary {
    background: var(--accent); border-color: transparent; color: #fff;
}
.cv-hid-btn.primary:hover { background: #2f74e0; }

/* ── 图片放大查看（单击画布上已生成的图） ── */
.cv-lightbox {
    position: fixed; inset: 0; z-index: 70;
    display: none; align-items: center; justify-content: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(6px);
    cursor: zoom-out;
}
.cv-lightbox.on { display: flex; animation: cv-lb-in .14s ease-out; }
.cv-lightbox img {
    display: block;
    max-width: 92vw; max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
    background: #111;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
    cursor: default;
}
.cv-lb-close {
    position: absolute; top: 18px; right: 20px;
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--line-2);
    color: var(--text);
    cursor: pointer;
    transition: background .15s;
}
.cv-lb-close:hover { background: rgba(255, 255, 255, 0.2); }
@keyframes cv-lb-in { from { opacity: 0; } to { opacity: 1; } }

/* ── 节点 ── */
.cv-node {
    position: absolute;
    user-select: none;
    cursor: grab;              /* 节点本身＝拖拽把手 */
}
.cv-node-title {
    display: flex; align-items: center; gap: 5px;
    height: 24px; padding: 0 2px;
    font-size: 12px; color: var(--text-3);
    cursor: grab;
}
.cv-node-title svg { color: var(--text-3); }
/* 标题右侧的实际扣费标记（这张图扣了多少钱 / 失败已退费） */
.cv-fee {
    margin-left: auto;
    font-size: 11px; line-height: 1;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.cv-fee.refund { color: #e0a63a; }
.cv-fee.free { color: var(--text-3); }
/* 「参考图 N」：这个节点被 H3 当成第几号参考（跟着标题走，费用标记左边） */
.cv-reftag {
    flex: none; font-size: 10px; font-weight: 800; line-height: 1;
    padding: 3px 6px; border-radius: 5px;
    color: #fff; background: var(--accent);
    white-space: nowrap;
}
.cv-reftag:empty { display: none; }
.cv-node.dragging,
.cv-node.dragging .cv-node-title,
.cv-node.dragging .cv-card { cursor: grabbing; }

.cv-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.cv-node.sel .cv-card {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 4px 20px rgba(59,130,246,0.22);
}

/* ★「接线小圆球」（端口）的悬停描边（2026-10-12 用户要求）
   之前误加在节点卡片上（整卡一圈蓝框），这里已移除，改成给端口小球本身做。
   一律用 outline / box-shadow，不用 border —— 不占布局，20px 的小球不会被挤变形。 */

.cv-media {
    position: relative;
    background: #1e1e1e;
    display: grid; place-items: center;
    overflow: hidden;
}
.cv-media.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.cv-media img {
    width: 100%; height: 100%;
    object-fit: contain; display: block;
    -webkit-user-drag: none;
    cursor: zoom-in;                /* 单击放大查看；按住拖动仍是移动节点 */
}
.cv-media-empty { color: #4a4a50; display: grid; place-items: center; }

/* ═══ 原图 / 新图 悬停对比（图片节点）═══
   ★★ 2026-10-28 17:17 用户改需求：「鼠标放在里面就左右滑动自动切换原图/新图，
   不要点中间的按钮去滑，默认显示新图，用户滑动的时候才对比」。
   所以这层默认完全不可见、也不接收指针（pointer-events:none，绝不影响拖节点）；
   只有 .cv-media.hovcmp 时才淡入分割线。 */
.cv-cmp {
    position: absolute; inset: 0; z-index: 3;
    pointer-events: none;               /* 全部事件交给下面的 media（悬停由 media 监听） */
    opacity: 0; transition: opacity .12s;
}
.cv-media.hovcmp > .cv-cmp { opacity: 1; }
.cv-cmp[hidden] { display: none !important; }
.cv-media .cv-cmp-a {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    /* ★ 2026-10-29：cover 撑满「主图画幅」（.cv-cmp 已由 syncCmpGeom 对齐到主图内容框）——
       原图/新图比例不一致时也同一大小无缝对齐（原来 contain 各自适配 → 原图缩一圈露底）。
       选择器带 .cv-media 前缀：要压过 `.cv-media img { object-fit: contain }`（特异性更高） */
    object-fit: cover; display: block;
    clip-path: inset(0 calc(100% - var(--cp, 50%)) 0 0);
    pointer-events: none;
    -webkit-user-drag: none;
}
.cv-cmp-h {
    position: absolute; top: 0; bottom: 0; left: var(--cp, 50%);
    width: 2px; margin-left: -1px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .28), 0 0 14px rgba(0, 0, 0, .4);
    pointer-events: none;
}
.cv-cmp-h i { display: none; }
.cv-cmp-tag {
    position: absolute; top: 8px;
    font-size: 10.5px; line-height: 1; letter-spacing: .4px;
    padding: 4px 7px; border-radius: 6px;
    background: rgba(0, 0, 0, .58); color: #fff;
    pointer-events: none;
}
.cv-cmp-tl { left: 8px; }
/* 「新图」放右下：右上角是对比开关，两个叠一起看不清（2026-10-25 实测截图暴露） */
.cv-cmp-tr { right: 8px; top: auto; bottom: 8px; }

/* 对比开关：平时半透明不抢镜，鼠标移到图上才亮起来 */
.cv-cmp-btn {
    position: absolute; top: 8px; right: 8px; z-index: 4;
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px;
    font-size: 11px; line-height: 1;
    border-radius: 999px; cursor: pointer;
    background: rgba(18, 18, 20, .62); color: #e9e9ec;
    border: 1px solid rgba(255, 255, 255, .2);
    backdrop-filter: blur(6px);
    opacity: .5; transition: opacity .15s, background .15s;
}
.cv-cmp:hover ~ .cv-cmp-btn,
.cv-media:hover > .cv-cmp-btn,
.cv-cmp-btn:hover,
.cv-cmp-btn.on { opacity: 1; }
.cv-cmp-btn:hover { background: rgba(30, 30, 34, .85); }

.cv-media-gen {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    background: linear-gradient(135deg, #202020, #262626);
    color: var(--text-2); font-size: 12.5px;
}
.cv-spin {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.14);
    border-top-color: var(--accent-2);
    animation: cvspin .8s linear infinite;
}
@keyframes cvspin { to { transform: rotate(360deg); } }
.cv-media-err {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 12px; text-align: center;
    font-size: 12px; color: #f87171; background: rgba(40,20,20,0.6);
}

.cv-try { padding: 12px 14px 14px; }
.cv-try-label { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.cv-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 11px;
    margin: 0 8px 8px 0;
    border-radius: 999px;
    background: var(--card-hi);
    border: 1px solid var(--line);
    color: var(--text-2); font-size: 12.5px;
}
.cv-chip:hover { background: #3a3a3a; color: var(--text); border-color: var(--line-2); }

/* 端口 */
.cv-port {
    position: absolute;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: #1e1e1e;
    border: 1px solid var(--line-2);
    color: var(--text-3);
    opacity: 0;
    transition: opacity .15s, transform .15s, border-color .15s, color .15s;
    z-index: 4;
}
.cv-port-l { left: -10px; }
.cv-port-r { right: -10px; cursor: crosshair; }
/* 一级反馈：鼠标进入节点 → 端口显形 + 一圈淡蓝描边，提示「这里能接线」 */
.cv-node:hover .cv-port, .cv-node.sel .cv-port {
    opacity: 1;
    outline: 1.5px solid rgba(59, 130, 246, .5);
    outline-offset: 1px;
}
/* 二级反馈：鼠标真的停在某一颗端口上 → 描边加粗 + 外扩光晕 + 放大（明确告诉你松手会接到这里）
   ⚠️ 必须带 #cvWorld 提权：`.cv-node:hover .cv-port`（0,3,0）比 `.cv-port:hover`（0,2,0）高，
   不提权的话这里写的 2px 描边会被上面那条一级规则的 1.5px 盖掉（实测 :hover 命中了却只出淡边）。 */
#cvWorld .cv-port:hover {
    border-color: var(--accent);
    color: var(--accent-2);
    transform: scale(1.18);
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(59, 130, 246, .18), 0 0 14px rgba(59, 130, 246, .55);
}

/* 拖连线时把所有连接点显出来，让用户知道「这里能接」 */
#cvWorld.linking .cv-port { opacity: 0.45; }
#cvWorld.linking .cv-node:hover .cv-port { opacity: 1; }

/* 拖连线靠近某个节点：整卡描边 + 连接点亮灯。
   ★ 修 bug：JS 里 .droppable 是加在 .cv-node 上的，而样式以前写成 .cv-port.droppable，
   选择器永远不匹配 → 用户拖线靠近时看不到任何反馈，不知道往哪松手。
   注意带上 #cvWorld 前缀提权，否则压不过上面 `.linking .cv-port{opacity:.45}` 的 id 权重。 */
#cvWorld .cv-node.droppable .cv-card {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent), 0 0 20px rgba(59, 130, 246, 0.35);
}
#cvWorld .cv-node.droppable .cv-port { opacity: 1; }
#cvWorld .cv-node.droppable .cv-port-l {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    transform: scale(1.3);
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.22);
}

/* 缩放柄 */
.cv-resize {
    position: absolute; right: -6px;
    /* ★★ 2026-10-12 22:0x 用 bottom 贴住「卡片真正的底边」，不再由 JS 按 node.h 算 top。
       为什么必须改：image / video 节点的 node.h 只是**媒体区**高度，而卡片实际高度会变 ——
         · peek 展开时下面还会长出 .cv-try + .cv-kf（约 128px）
         · video 节点拿到真实宽高后还会按比例校正 node.h
       原来 top = CARD_TOP + node.h - 6，于是手柄停在「媒体区底部」= 卡片中间，
       用户在右下角怎么拖都拖不到（H3 系列因为 node.h 被 ResizeObserver 同步成实际高度，才侥幸正常）。
       现在 bottom:-6px 相对 .cv-node（position:absolute + 高度 auto）→ 永远贴在真正右下角。
       ⚠️ 因此 JS 里那几处 `rz.style.top = ...` 必须删掉，否则 inline top 与 bottom 同时存在会把元素拉伸。 */
    bottom: -6px;
    width: 12px; height: 12px; border-radius: 3px;
    background: var(--accent); border: 2px solid var(--bg);
    cursor: nwse-resize; display: none; z-index: 5;
}
.cv-node.sel .cv-resize { display: block; }

/* 节点内的提示词面板 */
.cv-panel {
    margin-top: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 10px 12px 8px;
    cursor: grab;              /* 面板空白处也能拖节点，输入框/按钮各自有光标 */
}
.cv-panel-top {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 8px;
}
.cv-ptabs { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: wrap; }
.cv-ptab {
    display: inline-flex; align-items: center; gap: 4px;
    height: 24px; padding: 0 9px; border-radius: 6px;
    color: var(--text-3); font-size: 12px;
}
.cv-ptab:hover { background: rgba(255,255,255,0.07); color: var(--text-2); }
.cv-ptab.on { background: rgba(255,255,255,0.1); color: var(--text); }
.cv-panel-expand { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--text-3); }
.cv-panel-expand:hover { background: rgba(255,255,255,0.08); color: var(--text); }

/* ═══════════ 「只露媒体」预览模式（2026-10-12，即梦 / LibLL 效果）═══════════
   鼠标不在节点上时，只留标题栏 + 「生成出来的视频/图片预览框」；输入框、参考图格子、
   参数、生成按钮全部收起。鼠标移上去（或面板里有焦点 / 有任务在跑）就完整展开。

   适用六种节点（见 canvas.js 的 PEEK_TYPES）：image / video / h3 / h3api / h3long / h3prev。
   ★ 保留不动：.cv-media（图片/视频）、.cv-h3-out（三个 H3 的预览框）、
     .cv-lvp-hd + .cv-lvp-stage + .cv-lvp-prog（长视频预览的画面与进度）。
   ★ 绝不改 node.h：image/video 的 node.h 是媒体区高度；H3 系列内容撑高，卡片变矮会经
     syncFlowNodeBox 的 ResizeObserver 自动同步 node.h 并重画连线。

   ★★ 动画为什么这么做（2026-10-12 用户要求「好看 / 流畅 / 自然 / 不卡」）：
     1) max-height 只能过渡到一个**固定值**。猜 1600px 的话，380px 的面板 24% 时间就长完、
        剩下 76% 静止 → easing 白设，看着就是「嗖一下停住」。现在动画到 JS 实测的
        `--peek-h`（见 canvas.js 的 peekMeasureHeight），easing 才能全程生效。
     2) 收起态写成「`:not(:hover)` 且「节点内没有输入框 / 便签在聚焦」时才生效的一条规则」，而不是
        「hover 时再写一遍展开值」。这样规则一失效，padding / border / margin **自动回到
        各自的自然值** —— 不用为十几种元素逐个写恢复值（写漏一个就多一道缝或少一圈边）。
   ★★ 2026-10-12 21:5x 修正「点过播放器/按钮的节点永不收起」─────────────────
     原来是 `:focus-within` —— 它把**任何**获得焦点的后代都算「展开理由」，
     于是：用户点一下视频播放器、或「截取关键帧 / 画质修复」按钮后，焦点就留在那个
     button/video 上，鼠标移开节点**永远不收**（实测 max-height 卡在 64px 不动）。
     改成由 **JS 打一个 `.cv-peek-typing` 类**（见 canvas.js 的 syncPeekTyping）——
     只有「用户正在输入 / 正在改便签」才撑开，那才是真正怕被打断的场景。
     ⚠️ 为什么不用 CSS 的 `:has(input:focus, ...)`：① 兼容性更窄；
     ② 实测 headless 下 `el.matches(':focus')` 恒为 false（`:focus` 伪类在无窗口焦点时不匹配），
        导致这个选择器根本没法自动化验证 —— 用类名则 JS 侧可精确控制、也测得到。

     3) 分层缓动：盒子用 max-height（ease-out 先快后缓，收尾自然）；内容透明度**延后 60ms**
        淡入 → 先长出容器、内容再显现，有「实体感」。收起时内容先快速淡出（110ms）再缩盒子。
        transform 只做 6px 微移（不缩放，缩放会让文字发虚）；opacity/transform 走合成层。
     4) 展开 .3s、收起 .2s：符合「进来慢、出去快」的自然观感。 */
.cv-node.cv-peek :is(.cv-panel, .cv-try, .cv-kf, .cv-lvp-try, .cv-lvp-fixhint,
                     .cv-h3-sec, .cv-h3-pbar, .cv-h3-pw, .cv-h3-binds,
                     .cv-h3-params, .cv-h3-foot, .cv-lv-inherit, .cv-lv-note),
.cv-node.cv-peek-hold :is(.cv-panel, .cv-try, .cv-kf, .cv-lvp-try, .cv-lvp-fixhint,
                     .cv-h3-sec, .cv-h3-pbar, .cv-h3-pw, .cv-h3-binds,
                     .cv-h3-params, .cv-h3-foot, .cv-lv-inherit, .cv-lv-note) {
    /* ★ 基态也要写 max-height：`none` 无法参与过渡，两端必须都是具体值才能平滑动画。
       --peek-h 由 JS 实测写入；取不到时才退回 1600px。 */
    max-height: var(--peek-h, 1600px);
    transition: max-height .3s cubic-bezier(.22, .61, .36, 1),
                padding-top .3s cubic-bezier(.22, .61, .36, 1),
                padding-bottom .3s cubic-bezier(.22, .61, .36, 1),
                border-top-width .3s cubic-bezier(.22, .61, .36, 1),
                border-bottom-width .3s cubic-bezier(.22, .61, .36, 1),
                margin-top .3s cubic-bezier(.22, .61, .36, 1),
                opacity .2s ease .06s,
                transform .3s cubic-bezier(.22, .61, .36, 1);
}
.cv-node.cv-peek .cv-h3, .cv-node.cv-peek-hold .cv-h3,
.cv-node.cv-peek .cv-lvp-col, .cv-node.cv-peek-hold .cv-lvp-col { transition: row-gap .3s cubic-bezier(.22, .61, .36, 1); }

/* 收起态：只有「鼠标不在上面、里面没有焦点、也没在量高度」时才生效。
   ★★ padding / border 必须一起归零：box-sizing:border-box 下 max-height:0 只能把
      「内容 + padding + border」一起压到 0，而 padding+border 有下限
      （.cv-panel 是 10+8+2 = 20px）→ 不归零会留一道 20px 的缝（实测过）。 */
.cv-node.cv-peek:not(:hover):not(.cv-peek-typing) :is(.cv-panel, .cv-try, .cv-kf, .cv-lvp-try, .cv-lvp-fixhint,
                     .cv-h3-sec, .cv-h3-pbar, .cv-h3-pw, .cv-h3-binds,
                     .cv-h3-params, .cv-h3-foot, .cv-lv-inherit, .cv-lv-note) {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    /* 收起用偏快的标准曲线 + 内容先淡出 → 盒子缩起来利落不拖沓 */
    transition: max-height .2s cubic-bezier(.4, 0, .2, 1),
                padding-top .2s cubic-bezier(.4, 0, .2, 1),
                padding-bottom .2s cubic-bezier(.4, 0, .2, 1),
                border-top-width .2s cubic-bezier(.4, 0, .2, 1),
                border-bottom-width .2s cubic-bezier(.4, 0, .2, 1),
                margin-top .2s cubic-bezier(.4, 0, .2, 1),
                opacity .11s ease,
                transform .2s cubic-bezier(.4, 0, .2, 1);
}
/* 子元素压成 0 高后，flex 的 gap 还会留空隙 → 父容器 row-gap 也归零（展开时自动回 10px / 7px） */
.cv-node.cv-peek:not(:hover):not(.cv-peek-typing) .cv-h3 { row-gap: 0; }
.cv-node.cv-peek:not(:hover):not(.cv-peek-typing) .cv-lvp-col { row-gap: 0; }

/* 收起时给媒体区一点「浮起」感：让它看起来就是一张图 / 一段视频 */
.cv-node.cv-peek:not(:hover):not(.cv-peek-typing) .cv-card { box-shadow: 0 3px 14px rgba(0, 0, 0, .5); }

/* 尊重系统的「减少动效」设置 */
@media (prefers-reduced-motion: reduce) {
    .cv-node.cv-peek :is(.cv-panel, .cv-try, .cv-kf, .cv-lvp-try, .cv-lvp-fixhint,
                         .cv-h3-sec, .cv-h3-pbar, .cv-h3-pw, .cv-h3-binds,
                         .cv-h3-params, .cv-h3-foot, .cv-lv-inherit, .cv-lv-note),
    .cv-node.cv-peek-hold :is(.cv-panel, .cv-try, .cv-kf, .cv-lvp-try, .cv-lvp-fixhint,
                         .cv-h3-sec, .cv-h3-pbar, .cv-h3-pw, .cv-h3-binds,
                         .cv-h3-params, .cv-h3-foot, .cv-lv-inherit, .cv-lv-note) { transition: none; }
    .cv-node.cv-peek .cv-h3, .cv-node.cv-peek-hold .cv-h3,
    .cv-node.cv-peek .cv-lvp-col, .cv-node.cv-peek-hold .cv-lvp-col { transition: none; }
}

/* 参考图 = 可引用对象（2026-10-17 用户明确：引用的不是画布节点，是自己上传的参考图）。
   每张一个胶囊：圆形缩略图 + 「图片N」，点编号 → 在提示词光标处插入 @图片N；悬停出 ×。
   ★ 原先是 42×42 纯缩略图方块（没有编号、不可点）——现在合并成一个控件，避免两排重复。 */
.cv-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cv-refs:empty { display: none; }
.cv-ref {
    display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
    padding: 3px 7px 3px 3px; border-radius: 999px;
    border: 1px solid var(--line-2); background: var(--bg-soft);
    color: var(--text-2); font-size: 11px; font-weight: 500; font-family: inherit;
    cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.cv-ref:hover { border-color: rgba(91,156,255,.6); color: var(--accent); background: rgba(91,156,255,.10); }
.cv-ref img { width: 20px; height: 20px; object-fit: cover; border-radius: 50%; display: block; }
.cv-ref-n { white-space: nowrap; }
.cv-ref-x {
    width: 14px; height: 14px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: 11px; line-height: 1; color: var(--text-3);
    opacity: 0; transition: opacity .15s, background .15s, color .15s;
}
.cv-ref:hover .cv-ref-x { opacity: 1; }
.cv-ref-x:hover { background: rgba(255,255,255,.14); color: var(--text); }
/* ★ 2026-10-20 连线接进来的图：虚线边框区分「不是本节点自己的图」，⤴ 跳到来源节点 */
.cv-ref.cv-ref-link { border-style: dashed; border-color: rgba(91,156,255,.45); }
.cv-ref-jump {
    width: 14px; height: 14px; border-radius: 50%;
    display: grid; place-items: center; font-size: 10px; line-height: 1;
    color: var(--text-3); opacity: 0; transition: opacity .15s, background .15s, color .15s;
}
.cv-ref:hover .cv-ref-jump { opacity: 1; }
.cv-ref-jump:hover { background: rgba(91,156,255,.2); color: var(--accent); }
/* 上传中占位：保持原来的小方块（没有缩略图，胶囊形状反而不协调） */
.cv-ref.cv-ref-busy {
    width: 42px; height: 42px; padding: 0; border-radius: 7px;
    display: grid; place-items: center; cursor: default;
}

.cv-prompt {
    width: 100%; border: none; background: transparent; outline: none;
    resize: none; color: var(--text);
    font-size: 12.5px; line-height: 1.65;
    min-height: 42px; max-height: 1000px;
    padding: 0;
}
.cv-prompt::placeholder { color: var(--text-3); }

.cv-bar {
    display: flex; align-items: center; gap: 5px;
    margin-top: 9px; padding-top: 8px;
    border-top: 1px solid var(--line);
    min-width: 0;
}
.cv-sel {
    appearance: none; -webkit-appearance: none;
    background: transparent; border: none; outline: none;
    color: var(--text-2); font-size: 12px; line-height: 1;
    height: 24px; padding: 0 15px 0 5px; border-radius: 6px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239a9a9f' stroke-width='3' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 2px center;
    /* 允许缩：模型名过长时省略号截断，绝不把右侧「费用 + 生成」顶出去 */
    flex: 0 1 auto; min-width: 0;
    max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cv-sel:hover { background-color: rgba(255,255,255,0.07); color: var(--text); }
.cv-sel option { background: #242424; color: var(--text); }
/* 模型下拉是本行唯一可伸缩项。最长选项「nano-banana-pro · 专业」实测文本 129.2px + 左右内边距 20px
   ≈ 149px，上限给到 160px 留足字体差异余量（真实渲染宽度由最长选项决定，不会因为换了短名字而缩下去） */
.cv-model-sel { max-width: 160px; padding-left: 6px; font-weight: 500; color: var(--text-2); }
/* 比例 / 分辨率 / 张数：不参与收缩，短标签钉在原地，不会因为模型名变化而左右乱跳 */
.cv-ratio-sel { flex: none; }
.cv-res-sel   { flex: none; }
.cv-count-sel { flex: none; }
/* 三个短下拉把左右内边距收紧一点（原生下拉右侧要留箭头位），省下的宽度让给模型名和费用 */
.cv-ratio-sel, .cv-res-sel, .cv-count-sel { padding-left: 4px; padding-right: 13px; }

.cv-bar-txt { font-size: 12px; line-height: 1; color: var(--text-3); white-space: nowrap; flex: none; }
/* 分隔点：只做「分组」提示，比参数文字淡一档（实测 --text-3 再乘 0.8 时既可辨又不抢视线） */
.cv-bar-dot {
    flex: none;
    color: var(--text-3); opacity: 0.8;
    font-size: 11px; line-height: 1;
    margin: 0 1px;
}
.cv-bar-sp { flex: 1 1 auto; min-width: 6px; }
/* 费用：等宽数字 + 不参与收缩，永远完整可见 */
.cv-cost {
    font-variant-numeric: tabular-nums;
    font-size: 11.5px;
    letter-spacing: 0.01em;
}
/* 余额不够这一单时红字提示，不用等到点了生成才报错 */
.cv-cost.warn { color: #f87171; }
/* 管理员：钱数照常显示（方便验证计费展示），颜色淡一档表示不真扣 */
.cv-cost.free { color: var(--text-3); }

.cv-send {
    width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center; flex: none;
    background: #f2f2f3; color: #1a1a1a;
}
.cv-send:hover { background: #fff; }
.cv-send:disabled { background: #3a3a3a; color: #6b6b72; cursor: not-allowed; }

/* 文字便签节点 */
.cv-note {
    background: #2b2b2b; border: 1px solid var(--line);
    border-radius: var(--r); padding: 12px 14px;
    font-size: 12.5px; line-height: 1.7; color: var(--text);
    white-space: pre-wrap; word-break: break-word;
    width: 100%; height: 100%; overflow: hidden;
    outline: none;
    cursor: text;
}
.cv-node.sel .cv-note { border-color: var(--accent); }

/* 连线 */
/* ★ 兜底：所有连线 path 一律不填充 —— 防止某个变体（如 -hd）漏写 fill 时吃到 SVG 默认的黑色填充 */
#cvLinks path { fill: none; }
/* ★ 线的颜色统一走 --lc（line color）变量：同一条线的「实线 / 外发光 / 流动光点」共用它，
   所以「什么颜色的线，就是什么颜色的流动」。新增一种颜色只要加一组 `--lc` 覆盖即可。 */
.cv-link { --lc: var(--accent-2); fill: none; stroke: var(--lc); stroke-width: 2; stroke-linecap: round; }
.cv-link-glow { --lc: var(--accent-2); fill: none; stroke: var(--lc); stroke-width: 7; stroke-linecap: round; opacity: .22; filter: blur(4px); }
/* 正在拖出来的临时线：虚线缓慢爬行，爬的方向 = 你要把线接过去的方向 */
.cv-link-temp { fill: none; stroke: var(--accent-2); stroke-width: 2; stroke-dasharray: 6 6; opacity: .85; animation: cvLinkCrawl .7s linear infinite; }

/* ★★ 连线流动动效（2026-10-12 用户要求：线单调，要有流动感）
   做法：底层实线完全不动，上面叠一条「短 dash + 长 gap」的同色 path 沿路径跑 →
        看起来就是一串光点从源节点流向目标节点（数据流向），而不是整条线变成虚线。
   · dasharray 12 + gap 120 = 周期 132，@keyframes 里 dashoffset 走 -132 → 正好一圈无缝循环；
   · animation-delay 由 JS 按 (from→to) 稳定哈希给**负值**错开相位：每条线起点不同才像各自在流，
     同时重绘不会跳变（哈希稳定 → re-render 后相位不变）；
   · stroke 取 var(--lc) = 本条线的颜色（默认蓝；画质修复线 -hd 是黄），光点颜色自动跟随；
   · pointer-events: none —— 不抢最上面命中层的点击/右键。 */
@keyframes cvLinkFlow { to { stroke-dashoffset: -132; } }
@keyframes cvLinkCrawl { to { stroke-dashoffset: -12; } }
.cv-link-flow {
    --lc: var(--accent-2);
    fill: none; stroke: var(--lc); stroke-width: 2.6; stroke-linecap: round;
    stroke-dasharray: 12 120;
    pointer-events: none;
    filter: drop-shadow(0 0 4px var(--lc));
    animation: cvLinkFlow 2.2s linear infinite;
}
/* ★ 透明加粗命中层：右键点这条线的任意位置就能删（父容器 #cvLinks 是 pointer-events:none，
   这里显式开 stroke，只让描边区域可点，不挡节点拖动） */
/* ★ 2026-10-18：cursor 由 pointer 改 grab —— 这块 16px 热区**只服务右键删线**，左键点下去什么都不做。
   以前显示手指，用户会以为「空气里有个可点东西、点了还没反应」（节点一多、线一密就很容易撞上）。
   改成抓手后，节点外全部区域手感统一；右键删线功能完全不变（另有 nearestLinkAt 26px 就近兜底）。 */
.cv-link-hit { fill: none; stroke: transparent; stroke-width: 16; stroke-linecap: round; pointer-events: stroke; cursor: grab; }
/* 视频画质修复产物 → 源视频 的连线：黄色，一眼看出是哪个视频修出来的。
   ⚠️ 踩坑（2026-10-10）：`cv-link-hd` / `cv-link-glow-hd` 是**独立类名**（不是 `.cv-link.hd`），
   不会继承 `.cv-link` 的 `fill:none` / `stroke-width`。以前这里只写了 stroke →
   `fill` 落到 SVG 默认的**黑色填充**，画布上就是「黄线旁边一条黑乎乎的粗带」。必须写全。 */
.cv-link-hd { --lc: #f5b301; fill: none; stroke: var(--lc); stroke-width: 2; stroke-linecap: round; }
.cv-link-glow-hd { --lc: #f5b301; fill: none; stroke: var(--lc); stroke-width: 7; stroke-linecap: round; opacity: .22; filter: blur(4px); }
/* 黄线的流动光点也必须是黄色。这里用「基础类 + 色变体」双类名（而不是像上面那样写全），
   少写一处属性就不会再犯当年的「漏写 fill → 黑带」事故；
   `--lc` 被 -hd 覆盖（同类特异性、顺序在后者胜）→ 光点自动变黄，其余属性继承 .cv-link-flow。 */
.cv-link-flow-hd { --lc: #f5b301; }

/* ══════════ ★★ 2026-10-14 性能试验：关掉「连线蓝色流光」 ══════════
   用户要求先在本地试试「把线条的蓝色流动光点关掉，会不会流畅很多」。
   为什么它贵：每条连线有 1 个 `.cv-link-flow`，带 **无限 stroke-dashoffset 动画** + **drop-shadow 滤镜**；
   节点一多，浏览器就**永远每帧重绘**（哪怕你不操作）。
   压测（120 节点 = 236 条连线，静置）：基线 46.4fps → **关掉流光 60fps 满帧**；
   而关辉光层 / 关网格 / 关节点投影分别是 47.9 / 47.9 / 43.6 —— 几乎没用。
   ★ 想恢复：删掉下面这一行即可；或改成「只让视口内的连线跑动画」（保留观感，能拿到大部分收益）。 */
.cv-link-flow { display: none !important; }

/* 框选 */
.cv-marquee {
    position: absolute; z-index: 20;
    border: 1px solid var(--accent);
    background: rgba(59,130,246,0.12);
    border-radius: 2px;
    pointer-events: none;
}

/* 提示条 */
.cv-hint {
    position: absolute; left: 50%; top: 58px; transform: translateX(-50%);
    font-size: 12px; color: var(--text-3);
    background: rgba(26,26,26,0.8);
    padding: 5px 12px; border-radius: 999px;
    pointer-events: none; z-index: 20;
    white-space: nowrap;
    transition: opacity .4s;
}
.cv-hint.hide { opacity: 0; }

/* 右键 / 下拉菜单 */
.cv-menu {
    position: absolute; z-index: 60;
    min-width: 168px; padding: 5px;
    background: #2a2a2a;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: none;
}
.cv-menu.on { display: block; }
.cv-menu-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; height: 30px; padding: 0 10px;
    border-radius: 6px; color: var(--text-2); font-size: 12.5px;
    text-align: left;
}
.cv-menu-item:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.cv-menu-item.danger:hover { background: rgba(239,68,68,0.16); color: #fca5a5; }
.cv-menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* Toast */
.cv-toasts {
    position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    z-index: 90; pointer-events: none;
}
.cv-toast {
    background: #2c2c2c; border: 1px solid var(--line-2);
    color: var(--text); font-size: 12.5px;
    padding: 9px 16px; border-radius: 10px;
    box-shadow: var(--shadow);
    max-width: 460px; line-height: 1.6;
}
.cv-toast.error   { border-color: rgba(239,68,68,0.6); }
.cv-toast.success { border-color: rgba(34,197,94,0.5); }

/* 载入遮罩 */
.cv-loading {
    position: absolute; inset: 0; z-index: 80;
    display: grid; place-items: center;
    background-color: var(--bg);
    /* 和画布同一张网格（40px = 缩放 100% 时的格子），载入↔穿梭看起来是同一个空间 */
    background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
    background-size: 40px 40px;
    color: var(--text-3); font-size: 13px;
    overflow: hidden;
}
.cv-loading.hide { display: none; }

/* 中心一团呼吸的蓝光 —— 让黑屏有个「在运转」的焦点 */
.cv-loading::before {
    content: ''; position: absolute; left: 50%; top: 50%;
    width: 640px; height: 640px; margin: -320px 0 0 -320px;
    background: radial-gradient(circle, rgba(91,156,255,.17) 0%, rgba(91,156,255,.055) 42%, transparent 68%);
    animation: cvLoadBreath 2.6s ease-in-out infinite;
    pointer-events: none;
}
/* 缓慢斜扫过的一道亮光 */
.cv-loading::after {
    content: ''; position: absolute; inset: -25%;
    background: linear-gradient(115deg, transparent 42%, rgba(130,180,255,.09) 50%, transparent 58%);
    animation: cvLoadSweep 2.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes cvLoadBreath {
    0%, 100% { opacity: .5; transform: scale(.93); }
    50%      { opacity: 1;  transform: scale(1.07); }
}
@keyframes cvLoadSweep {
    0%   { transform: translateX(-40%); opacity: 0; }
    32%  { opacity: 1; }
    100% { transform: translateX(40%); opacity: 0; }
}

.cv-loading-inner {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center; gap: 15px;
}
.cv-loading-mark {
    position: relative;
    width: 48px; height: 48px; border-radius: 15px;
    display: grid; place-items: center; color: #d5e4ff;
    background: linear-gradient(150deg, #2c4d8d, #1a2740);
    box-shadow: 0 0 0 1px rgba(120,175,255,.26), 0 14px 36px rgba(38,86,182,.36);
    animation: cvLoadFloat 2.2s ease-in-out infinite;
}
/* 转圈的光环：一眼就知道在加载，不用看文字 */
.cv-loading-mark::after {
    content: ''; position: absolute; inset: -8px; border-radius: 22px;
    border: 2px solid transparent;
    border-top-color: rgba(120,175,255,.9);
    border-right-color: rgba(120,175,255,.34);
    animation: cvspin 1.05s linear infinite;
}
@keyframes cvLoadFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}
/* 文字扫光 */
.cv-loading-txt {
    font-size: 13.5px; letter-spacing: .05em; font-weight: 500;
    background: linear-gradient(90deg, var(--text-2) 0%, #eef4ff 42%, var(--text-2) 68%);
    background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    animation: cvLoadShimmer 2.1s linear infinite;
}
@keyframes cvLoadShimmer {
    0%   { background-position: 130% 0; }
    100% { background-position: -70% 0; }
}
/* 细进度条（不确定态来回跑） */
.cv-loading-bar {
    width: 152px; height: 3px; border-radius: 999px;
    background: rgba(255,255,255,.07); overflow: hidden;
}
.cv-loading-bar > i {
    display: block; width: 42%; height: 100%; border-radius: inherit;
    background: linear-gradient(90deg, transparent, #5b9cff, transparent);
    animation: cvLoadBar 1.5s cubic-bezier(.45, .05, .55, .95) infinite;
}
@keyframes cvLoadBar {
    0%   { transform: translateX(-110%); }
    100% { transform: translateX(360%); }
}
/* 手机上把中心光团收小，别糊满整屏 */
@media (max-width: 768px) {
    .cv-loading::before { width: 420px; height: 420px; margin: -210px 0 0 -210px; }
}
@media (prefers-reduced-motion: reduce) {
    .cv-loading::before, .cv-loading::after,
    .cv-loading-mark, .cv-loading-mark::after,
    .cv-loading-txt, .cv-loading-bar > i { animation: none !important; }
    .cv-loading-txt { background: none; color: var(--text-3); -webkit-text-fill-color: var(--text-3); }
    /* 开启「减弱动态效果」时不跑流动光点（保留静态实线，信息不丢） */
    .cv-link-flow, .cv-link-temp { animation: none !important; }
    .cv-link-flow { opacity: 0; }
}

@media (max-width: 720px) {
    .cv-ws { display: none; }
    .cv-balance { display: none; }
}

/* ============================================================
   移动端 / 平板 / 折叠屏 显示修复（追加区块）
   —— 只处理「显示」，不改动任何功能逻辑与既有规则。
   ============================================================ */

/* ① 视口高度用 dvh：手机地址栏伸缩时不再把底部浮层顶出屏幕 */
#cvApp { height: 100vh; height: 100dvh; }

/* ② 触摸设备没有 hover 概念，而以下控件原本只在 :hover 时才现身 →
      手机上历史卡片的「下载 / 复刻」按钮、连接点全都看不见、点不到。
      这里在无 hover 设备上让它们常显。（纯显示层，事件逻辑未动） */
@media (hover: none) {
    .cv-hi-acts { opacity: 1; transform: none; }
    .cv-hi:hover { transform: none; }
    .cv-tab .cv-tab-x { opacity: 1; }
    .cv-ref-x { opacity: 1; }
    .cv-port { opacity: .6; }
    .cv-node:hover .cv-port, .cv-node.sel .cv-port { opacity: 1; }
}

/* ③ 手机 / 折叠屏外屏 / iPad 竖屏（≤768px，与主站断点对齐） */
@media (max-width: 768px) {
    /* 顶部提示条：原来 white-space:nowrap，实测宽 597px，两端被裁到屏幕外 */
    .cv-hint {
        top: 54px; left: 12px; right: 12px;
        transform: none; max-width: none;
        white-space: normal; text-align: center;
        font-size: 11px; line-height: 1.5;
    }

    /* 底部浮层：原来三者叠在一起
       （实测 360 宽下 .cv-bl∩.cv-dock ≈ 8720px²、.cv-dock∩.cv-br ≈ 4160px²，
        390 宽下 ≈ 8280 / 3720，按钮被压住根本点不到）
       改法：工具坞上移一行居中，左下 / 右下收窄后共用最底一行。 */
    .cv-dock {
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        gap: 2px; padding: 4px;
    }
    .cv-dock-btn { width: 30px; height: 30px; }
    .cv-dock-btn svg { width: 14px; height: 14px; }
    .cv-dock-sep { margin: 0 2px; height: 16px; }

    .cv-bl, .cv-br {
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        padding: 3px; gap: 1px;
    }
    .cv-bl { left: calc(8px + env(safe-area-inset-left, 0px)); }
    .cv-br { right: calc(8px + env(safe-area-inset-right, 0px)); }
    .cv-zoomval { min-width: 44px; font-size: 11.5px; }

    /* 历史面板：避开底部两行浮层，高度自适应视口 */
    .cv-hist {
        left: 8px; right: 8px; width: auto; max-width: none;
        bottom: calc(118px + env(safe-area-inset-bottom, 0px));
        max-height: calc(100vh - 180px);
        max-height: calc(100dvh - 180px);
    }

    /* 小地图：缩小并抬到工具坞上方 */
    .cv-minimap {
        right: 8px;
        bottom: calc(122px + env(safe-area-inset-bottom, 0px));
        width: 132px; height: 90px;
    }

    /* 详情弹窗 / 图片放大层：手机上减少留白，尽量把图放大 */
    .cv-hid { padding: 12px; }
    .cv-hid-box { max-width: 100%; max-height: 92vh; max-height: 92dvh; }
    .cv-hid-img img { max-width: 100%; max-height: 56vh; max-height: 56dvh; }
    .cv-hid-info { max-width: 100%; }

    .cv-lightbox { padding: 10px; }
    .cv-lightbox img { max-width: 100%; max-height: 82vh; max-height: 82dvh; }
    .cv-lb-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }

    /* 顶栏：画布标签多时横向滑动，不挤压余额 / 头像 */
    .cv-tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
    .cv-tabs::-webkit-scrollbar { display: none; }
}

/* ④ 超窄屏（≤380px）再压一档，保证最底一行不挤 */
@media (max-width: 380px) {
    .cv-zoomval { display: none; }
    .cv-dock-btn { width: 28px; height: 28px; }
    .cv-bl .cv-icobtn, .cv-br .cv-icobtn { width: 28px; height: 28px; }
}

/* ═══════════ 双指缩放：临时百分比浮标 ═══════════
   手机 / 折叠外屏上 .cv-zoomval 是隐藏的，pinch 时给一个居中的临时读数，松手 0.7s 后淡出。
   元素由 canvas.js 动态创建，pointer-events:none —— 不挡任何点击，也不参与布局。 */
.cv-zoombadge {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    min-width: 84px;
    padding: 10px 18px;
    border-radius: 14px;
    background: rgba(18, 18, 20, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 19px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease, transform 0.16s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 60;
}
.cv-zoombadge.on {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ═══════════════════════════════════════════════════════════════
   图片已过期（照片按保留期清理，生成记录/提示词永久保留）
   —— 对应 canvas.js 的 isHistExpired
   ═══════════════════════════════════════════════════════════════ */

/* 历史卡片缩略图占位 */
.cv-hi-expired {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-3);
    background: repeating-linear-gradient(45deg, #1c1c1c, #1c1c1c 8px, #202020 8px, #202020 16px);
}

.cv-hi-expired svg { opacity: .65; }

/* 过期提示文字 */
.cv-hi-sub.warn { color: #e0a33a; }

/* 详情弹窗里的过期提示块 */
.cv-hid-expired {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 28px;
    text-align: center;
    color: var(--text-3);
}

.cv-hid-expired svg { opacity: .55; }

.cv-hid-expired .cv-hid-e-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.cv-hid-expired span {
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--text-2);
    max-width: 420px;
}

/* 画布节点上的「图片已过期」覆盖层（图片加载失败时出现） */
.cv-media-expired {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    color: var(--text-3);
    background: repeating-linear-gradient(45deg, #1c1c1c, #1c1c1c 8px, #202020 8px, #202020 16px);
    pointer-events: none;
}

.cv-media-expired svg { opacity: .6; }

.cv-media-expired span {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
}

.cv-media-expired small { font-size: 11px; }


/* ═══════════════════════════════════════════════════════════════
   仙宫云 · 一键跑 H3
   —— 顶栏入口 + 两级面板（先连接，连上才出现生成区）
   ═══════════════════════════════════════════════════════════════ */

/* ① 顶栏入口 */
.cv-xgy-entry {
    display: flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: var(--panel);
    color: var(--text-2);
    font-size: 12px; font-weight: 600;
    transition: border-color .18s, color .18s, background .18s;
}
.cv-xgy-entry:hover { border-color: var(--accent); color: var(--text); background: var(--panel-hi); }
.cv-xgy-entry svg { color: var(--accent-2); }
.cv-xgy-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--text-3); flex: none;
    transition: background .2s, box-shadow .2s;
}
.cv-xgy-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.cv-xgy-dot.wait { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }

/* 画质修复/超清锁定模式：点击快捷按钮后面板锁定 —— 输入控件全部隐藏，只剩发送按钮 + 锁定条 */
.cv-panel.cv-locked .cv-panel-top,
.cv-panel.cv-locked .cv-refs,
.cv-panel.cv-locked .cv-prompt,
.cv-panel.cv-locked .cv-prompt-pw,      /* ★ rev2：输入框已换成可编辑镜像层，光藏 textarea 藏不住了 */
.cv-panel.cv-locked .cv-model-sel,
.cv-panel.cv-locked .cv-ratio-sel,
.cv-panel.cv-locked .cv-res-sel,
.cv-panel.cv-locked .cv-count-sel,
.cv-panel.cv-locked .cv-bar-dot,
.cv-panel.cv-locked .cv-cost { display: none !important; }
/* 取消按钮：仅锁定模式显示（发送按钮左边），点击退出锁定/停任务 */
.cv-hd-cancel {
    display: none;
    height: 34px; padding: 0 12px;
    border-radius: 8px;
    background: var(--card-hi, #2a2a2a);
    border: 1px solid var(--line-2);
    color: var(--text-2); font-size: 12.5px;
    font-family: inherit; cursor: pointer;
}
.cv-hd-cancel:hover { color: var(--text); border-color: var(--line-2); background: #3a3a3a; }
.cv-panel.cv-locked .cv-hd-cancel { display: inline-flex; align-items: center; }
.cv-panel .cv-hd-lock {
    display: flex; align-items: center; gap: 6px;
    margin: 0 0 8px; padding: 7px 10px;
    border-radius: 8px;
    background: rgba(91, 156, 255, .12);
    border: 1px solid rgba(91, 156, 255, .35);
    color: var(--text-2);
    font-size: 11.5px; font-weight: 600;
}

/* ①-b 顶栏实时状态胶囊（连上仙宫云后出现：CPU/GPU/显存/内存/硬盘）
   —— 数字 ≥70% 变黄、≥90% 变红，爆显存前一眼能看出来 */.cv-xgy-stats {
    display: flex; align-items: center; gap: 9px;
    height: 26px; padding: 0 11px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line-2);
    font-size: 11px; color: var(--text-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    cursor: default;
}
.cv-xgy-stats[hidden] { display: none; }
.cv-xgy-stats .xgys { display: flex; align-items: center; gap: 4px; }
.cv-xgy-stats .xgys i { font-style: normal; opacity: .75; }
/* ★ 数字固定宽度 + 右对齐：位数变化（7% → 100%、38.9G → 40G）不再把胶囊挤得跳来跳去 */
.cv-xgy-stats .xgys em { font-style: normal; font-weight: 600; color: var(--text-2); text-align: right; }
.cv-xgy-stats .xgys em.pct { min-width: 30px; }
.cv-xgy-stats .xgys em.size { min-width: 88px; }
.cv-xgy-stats .xgys-bar {
    width: 34px; height: 4px; flex: none;
    border-radius: 2px;
    background: rgba(255, 255, 255, .14);
    overflow: hidden;
}
.cv-xgy-stats .xgys-bar b {
    display: block; height: 100%; border-radius: 2px;
    background: var(--accent, #5b9cff);
    transition: width .6s ease, background .3s;
}
.cv-xgy-stats .xgys-bar b.warn { background: #eab308; }
.cv-xgy-stats .xgys-bar b.bad { background: #ef4444; }
/* ComfyUI 掉线徽章（机器还连着但 8188 没响应 —— 引导用户按「重启」） */
.cv-xgy-stats .xgys-off {
    font-style: normal; font-weight: 600;
    color: #ef4444;
    padding-left: 2px;
}

/* 顶栏运维按钮：清理 / 重启 */
.cv-xgy-acts { display: flex; align-items: center; gap: 5px; }
.cv-xgy-acts[hidden] { display: none; }
.cv-xgy-act {
    height: 26px; padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: var(--panel);
    color: var(--text-2);
    font-size: 11.5px; font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .18s, color .18s, background .18s;
}
.cv-xgy-act:hover { border-color: var(--accent); color: var(--text); background: var(--panel-hi); }
.cv-xgy-act:disabled { opacity: .5; cursor: default; }
.cv-xgy-act.busy { color: var(--accent-2); border-color: var(--accent); }
/* 掉线时「重启」红色脉冲，一眼看到救场入口 */
.cv-xgy-act.alert {
    color: #ef4444; border-color: #ef4444;
    animation: cvxgyalert 1.2s ease-in-out infinite;
}
@keyframes cvxgyalert {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, .25); }
}

/* ② 遮罩 + 面板 */
.cv-xgy {
    position: fixed; inset: 0; z-index: 82;
    display: none; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.cv-xgy.on { display: flex; }
.cv-xgy-box {
    width: 620px; max-width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    display: flex; flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line-2);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.cv-xgy-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    flex: none;
}
.cv-xgy-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.cv-xgy-title svg { color: var(--accent-2); }
.cv-xgy-sec { padding: 14px; overflow-y: auto; }
.cv-xgy-sec::-webkit-scrollbar { width: 8px; }
.cv-xgy-sec::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 4px; }

.cv-xgy-tip {
    margin: 0 0 12px; font-size: 12px; line-height: 1.7; color: var(--text-2);
    padding: 10px 12px; border-radius: var(--r-sm);
    background: rgba(59, 130, 246, .08);
    border: 1px solid rgba(59, 130, 246, .22);
}
.cv-xgy-tip b { color: var(--accent-2); }

/* ③ 输入区 */
.cv-xgy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-bottom: 12px; }
.cv-xgy-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-3); font-weight: 600; }
.cv-xgy-grid input {
    height: 32px; padding: 0 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-2);
    background: var(--bg-soft);
    color: var(--text); font-size: 12px;
    outline: none; transition: border-color .16s;
}
.cv-xgy-grid input:focus { border-color: var(--accent); }

/* 连接命令：整条粘贴 → 自动拆成下面四栏 */
.cv-xgy-cmd { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.cv-xgy-cmd > span { font-size: 11px; color: var(--text-3); font-weight: 600; }
.cv-xgy-cmd > span em { font-style: normal; font-weight: 500; opacity: .78; }
.cv-xgy-cmd input {
    height: 34px; padding: 0 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-2);
    background: var(--bg-soft);
    color: var(--text); font-size: 12px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    outline: none; transition: border-color .16s;
}
.cv-xgy-cmd input:focus { border-color: var(--accent); }
.cv-xgy-cmd input.ok { border-color: rgba(34, 197, 94, .6); }

.cv-xgy-btn {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    width: 100%; height: 36px;
    border-radius: var(--r-sm);
    font-size: 13px; font-weight: 700;
    border: 1px solid var(--line-2);
    background: var(--card);
    color: var(--text);
    transition: background .16s, border-color .16s, opacity .16s;
}
.cv-xgy-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.cv-xgy-btn.primary:hover { background: var(--accent-2); }
.cv-xgy-btn:disabled { opacity: .5; cursor: default; }

.cv-xgy-msg { margin-top: 10px; font-size: 12px; line-height: 1.65; color: var(--text-2); white-space: pre-wrap; }
.cv-xgy-msg.err { color: #fca5a5; }
.cv-xgy-msg.ok  { color: var(--ok); }

/* ④ 已连接信息条 */
.cv-xgy-conn {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 11px; margin-bottom: 14px;
    border-radius: var(--r-sm);
    background: var(--bg-soft);
    border: 1px solid var(--line);
}
.cv-xgy-led { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
.cv-xgy-led.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(34,197,94,.16); }
.cv-xgy-conn-txt { flex: 1; min-width: 0; font-size: 11px; color: var(--text-2); line-height: 1.5; word-break: break-all; }
.cv-xgy-mini {
    flex: none; height: 24px; padding: 0 10px;
    border-radius: 999px; border: 1px solid var(--line-2);
    background: transparent; color: var(--text-2);
    font-size: 11px; font-weight: 600;
}
.cv-xgy-mini:hover { border-color: var(--danger); color: #fca5a5; }

/* ⑤ 标签 + 槽位 */
.cv-xgy-lb { display: block; margin: 0 0 7px; font-size: 11px; font-weight: 700; color: var(--text-3); }
.cv-xgy-lb em { font-style: normal; font-weight: 400; color: var(--text-3); opacity: .8; }

.cv-xgy-slots { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cv-xgy-slot {
    position: relative;
    width: 74px; height: 74px;
    border-radius: var(--r-sm);
    border: 1px dashed var(--line-2);
    background: var(--bg-soft);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3); font-size: 11px;
    overflow: hidden; cursor: pointer;
    transition: border-color .16s, color .16s;
}
.cv-xgy-slot:hover { border-color: var(--accent); color: var(--accent-2); }
.cv-xgy-slot.has { border-style: solid; border-color: var(--line-2); }
.cv-xgy-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-xgy-slot .x {
    position: absolute; top: 3px; right: 3px;
    width: 17px; height: 17px; border-radius: 50%;
    background: rgba(0,0,0,.66); color: #fff;
    display: none; align-items: center; justify-content: center;
    font-size: 12px; line-height: 1;
}
.cv-xgy-slot.has .x { display: flex; }
.cv-xgy-slot .tag {
    position: absolute; left: 0; bottom: 0; right: 0;
    padding: 2px 4px; font-size: 9px; text-align: center;
    background: rgba(0,0,0,.62); color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cv-xgy-auds { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cv-xgy-aud {
    flex: 1 1 220px; min-width: 180px;
    display: flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-2);
    background: var(--bg-soft);
}
.cv-xgy-aud span { flex: none; font-size: 10px; font-weight: 700; color: var(--text-3); }
.cv-xgy-aud input {
    flex: 1; min-width: 0; height: 100%;
    border: none; background: transparent; outline: none;
    color: var(--text); font-size: 11px;
}

/* ⑥ 提示词 + 参数行 */
.cv-xgy-prompt {
    width: 100%; padding: 10px 11px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-2);
    background: var(--bg-soft);
    color: var(--text); font-size: 12px; line-height: 1.65;
    resize: vertical; outline: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    margin-bottom: 12px;
}
.cv-xgy-prompt:focus { border-color: var(--accent); }

.cv-xgy-row { display: flex; gap: 10px; margin-bottom: 14px; }
/* ★ min-width:0 必须写：<select> 的 min-content 由最长 option 决定，
   flex 子项默认 min-width:auto 会被它顶住不肯收缩，整行就溢出面板。 */
.cv-xgy-mini-lb {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; gap: 5px;
    font-size: 11px; font-weight: 700; color: var(--text-3);
}
.cv-xgy-mini-lb select, .cv-xgy-mini-lb input {
    height: 32px; padding: 0 8px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-2);
    background: var(--bg-soft);
    color: var(--text); font-size: 12px;
    outline: none; width: 100%; min-width: 0;
    text-overflow: ellipsis;
}
.cv-xgy-mini-lb select:focus, .cv-xgy-mini-lb input:focus { border-color: var(--accent); }

/* ⑦ 进度 */
.cv-xgy-prog {
    display: flex; align-items: center; gap: 8px;
    margin-top: 11px; font-size: 12px; color: var(--text-2);
}
/* ★ 必须写：作者的 display:flex 会盖掉 UA 的 [hidden]{display:none}，
   否则空闲状态下进度条也一直显示「正在提交…」 */
.cv-xgy-prog[hidden] { display: none; }
.cv-xgy-spin {
    width: 13px; height: 13px; flex: none;
    border: 2px solid var(--accent); border-top-color: transparent;
    border-radius: 50%; animation: cvspin .75s linear infinite;
}

/* ⑧ 窄屏 */
@media (max-width: 768px) {
    .cv-xgy-grid { grid-template-columns: 1fr; }
    .cv-xgy-row { flex-direction: column; }
    .cv-xgy-box { max-height: calc(100vh - 24px); }
    .cv-xgy-entry span { display: none; }
    .cv-xgy-entry { padding: 0 8px; }
    .cv-xgy-slot { width: 62px; height: 62px; }
    .cv-xgy-stats { display: none; }   /* 手机顶栏放不下，明细去仙宫云面板看 */
    .cv-xgy-acts { display: none; }
}

/* 视频节点（仙宫云 H3 产物）：同一个媒体位渲染 <video> */
.cv-media-video {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
    border-radius: 6px;
}

/* ═══════════════ 双采 H3 节点 ═══════════════ */
.cv-node.h3 .cv-card,
.cv-node.audio .cv-card,
.cv-node.clip .cv-card { padding: 0; }
.cv-node.h3 .cv-panel, .cv-node.h3 .cv-try, .cv-node.h3 .cv-refs,
.cv-node.audio .cv-panel, .cv-node.audio .cv-try, .cv-node.audio .cv-refs,
.cv-node.clip .cv-panel, .cv-node.clip .cv-try, .cv-node.clip .cv-refs { display: none !important; }

.cv-h3 { display: flex; flex-direction: column; gap: 10px; padding: 11px 12px 12px; }

.cv-h3-out { display: flex; flex-direction: column; gap: 4px; }
.cv-h3-tag { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 800; color: var(--text-3); }
.cv-h3-tag em { font-style: normal; font-weight: 600; opacity: .78; }
.cv-h3-stage { position: relative; border-radius: 9px; overflow: hidden; }
.cv-h3-stage video { width: 100%; max-height: 330px; display: block; background: #000; border-radius: 9px; }
.cv-h3-stage video[hidden] { display: none; }
.cv-h3-ph {
    min-height: 68px; border: 1px dashed var(--line-2); border-radius: 9px; background: var(--bg-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 11.5px; color: var(--text-3); text-align: center; padding: 10px 12px; line-height: 1.45;
}
.cv-h3-ph[hidden] { display: none; }
.cv-h3-ph.err { color: #ff6b6b; border-color: rgba(255, 107, 107, .42); }
/* H3API 源节点：成品落在右侧独立视频节点，这里只给「去哪看」的指引 */
.cv-h3-ph.cv-h3-outbox { flex-direction: column; gap: 9px; }
.cv-h3api-goto {
    padding: 5px 12px; border-radius: 999px; cursor: pointer; font-family: inherit;
    border: 1px solid rgba(91, 156, 255, .45); background: rgba(91, 156, 255, .12);
    color: var(--accent-light); font-size: 11px; font-weight: 600; line-height: 1.2;
    transition: background .15s, border-color .15s;
}
.cv-h3api-goto:hover { background: rgba(91, 156, 255, .24); border-color: rgba(91, 156, 255, .7); }

.cv-h3-sec { display: flex; flex-direction: column; gap: 6px; }
.cv-h3-lb { font-size: 11px; font-weight: 700; color: var(--text-3); }
.cv-h3-lb b { color: var(--accent); }
.cv-h3-lb em { font-style: normal; font-weight: 600; opacity: .7; }

.cv-h3-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.cv-h3-cell {
    position: relative; aspect-ratio: 4 / 3; border-radius: 8px;
    border: 1px dashed var(--line-2); background: var(--bg-soft);
    display: flex; flex-direction: column; overflow: hidden;
}
.cv-h3-cell.has { border-style: solid; }
/* 序号带：压在缩略图上会挡住内容，所以单独占一格顶部（空节点也照样标 1~9） */
.cv-h3-num {
    flex: none; height: 15px; display: flex; align-items: center; justify-content: center;
    font-size: 9.5px; font-weight: 800; letter-spacing: .4px;
    color: var(--text-3); background: rgba(127, 127, 127, .14);
}
.cv-h3-cell.has .cv-h3-num { color: #fff; background: var(--accent); }
.cv-h3-pic { position: relative; flex: 1; min-height: 0; }
.cv-h3-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.cv-h3-aud { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.cv-h3-acell {
    position: relative; height: 42px; border-radius: 8px; border: 1px dashed var(--line-2); background: var(--bg-soft);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    font-size: 10.5px; color: var(--text-3); text-align: center; padding: 0 5px 0 40px; line-height: 1.25;
}
.cv-h3-acell.has { border-style: solid; color: var(--text-2); }
.cv-h3-acell .n {
    position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
    height: 16px; padding: 0 5px; border-radius: 5px;
    background: rgba(91, 156, 255, .88); color: #fff;
    font-size: 9.5px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.cv-h3-acell .t { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-h3-audio { width: 100%; height: 30px; display: block; }

/* ── 一采 / 二采 片段节点：只有「进度条 + 视频」 ── */
.cv-clip { display: flex; flex-direction: column; gap: 8px; padding: 10px 11px 11px; }
.cv-clip-stage { position: relative; border-radius: 9px; overflow: hidden; }
.cv-clip-stage video { width: 100%; display: block; max-height: 330px; background: #000; border-radius: 9px; }
.cv-clip-stage video[hidden] { display: none; }
.cv-clip-ph {
    min-height: 96px; border: 1px dashed var(--line-2); border-radius: 9px; background: var(--bg-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 11.5px; color: var(--text-3); text-align: center; padding: 10px 12px; line-height: 1.45;
}
.cv-clip-ph[hidden] { display: none; }
.cv-clip-ph.err { color: #ff6b6b; border-color: rgba(255, 107, 107, .42); }
.cv-clip-prog { display: flex; flex-direction: column; gap: 5px; }
.cv-clip-prog[hidden] { display: none; }

/* ── 截取关键帧（clip 节点视频下方） ── */
.cv-kf { display: flex; flex-direction: column; }
.cv-kf-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 0; border: 1px dashed var(--line-2); border-radius: 8px; background: transparent;
    color: var(--text-3); font-size: 11.5px; cursor: pointer;
}
.cv-kf-btn:hover { color: var(--text-1); border-color: var(--text-3); }
.cv-kf-btn[hidden] { display: none; }
.cv-kf-panel {
    border: 1px solid var(--line-2); border-radius: 9px; padding: 8px;
    display: flex; flex-direction: column; gap: 7px; background: var(--bg-soft);
}
.cv-kf-panel[hidden] { display: none; }
.cv-kf-cv { width: 100%; display: block; border-radius: 7px; background: #000; min-height: 40px; }
.cv-kf-slider { width: 100%; accent-color: #4c8dff; cursor: pointer; margin: 0; }
.cv-kf-row { display: flex; align-items: center; gap: 8px; }
.cv-kf-time { font-size: 11px; color: var(--text-3); min-width: 52px; font-variant-numeric: tabular-nums; }
.cv-kf-sp { flex: 1; }
.cv-kf-ok {
    padding: 5px 12px; border: none; border-radius: 7px; background: #4c8dff;
    color: #fff; font-size: 11.5px; cursor: pointer;
}
.cv-kf-ok:disabled { opacity: .55; cursor: default; }
.cv-kf-cancel {
    padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 7px;
    background: transparent; color: var(--text-3); font-size: 11.5px; cursor: pointer;
}
.cv-kf-status { font-size: 11px; color: var(--text-3); }
.cv-kf-status.err { color: #ff6b6b; }
.cv-clip-bar { height: 6px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.cv-clip-bar i {
    display: block; height: 100%; width: 0%; border-radius: 99px;
    background: var(--accent); transition: width .35s ease;
}
.cv-clip-bar i.indet { animation: cvClipPulse 1.1s ease-in-out infinite; }
.cv-clip-bar i.bad { background: #ff6b6b; }
@keyframes cvClipPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.cv-clip-ptxt { font-size: 11px; font-weight: 700; color: var(--text-3); }
.cv-h3-ph.ok { color: var(--accent); border-color: rgba(91, 156, 255, .4); }

.cv-h3-prompt {
    width: 100%; box-sizing: border-box; min-height: 56px; overflow-y: auto; overflow-x: hidden;
    padding: 8px 9px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
    background: var(--bg-soft); color: var(--text);
    font-size: 12px; line-height: 1.45; outline: none; font-family: inherit;
}
.cv-h3-prompt:focus { border-color: var(--accent); }

.cv-h3-params { display: grid; grid-template-columns: 0.85fr 1.25fr 1.05fr 1.05fr; gap: 7px; }
.cv-h3-p { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cv-h3-p > span { font-size: 10px; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.cv-h3-p input, .cv-h3-p select {
    width: 100%; min-width: 0; box-sizing: border-box; height: 28px; padding: 0 6px;
    border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg-soft);
    color: var(--text); font-size: 11.5px; outline: none;
}
.cv-h3-p input:focus, .cv-h3-p select:focus { border-color: var(--accent); }

.cv-h3-foot { display: flex; align-items: center; gap: 9px; }
.cv-h3-run, .cv-h3api-run {
    flex: 1; height: 34px; border: 0; border-radius: var(--r-sm);
    background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 800; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.cv-h3-run[hidden], .cv-h3api-run[hidden] { display: none; }
.cv-h3-run:disabled, .cv-h3api-run:disabled { opacity: .55; cursor: default; }
.cv-h3api-run { flex: 1; }
.cv-h3api-prog { flex: 1; min-width: 0; font-size: 11px; color: var(--text-3); line-height: 1.35; word-break: break-all; }
.cv-h3api-prog.err { color: #ff6b6b; font-weight: 600; }
.cv-h3-err { padding: 10px; color: #ff6b6b; font-size: 12px; line-height: 1.5; background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.35); border-radius: var(--r-sm); }
.cv-h3-stage video { display: block; }
.cv-h3-prog { flex: 1; min-width: 0; font-size: 11px; color: var(--text-3); line-height: 1.35; word-break: break-all; }
.cv-h3-prog.err { color: #ff6b6b; }
.cv-h3-prog.ok { color: var(--ok); }
.cv-h3-prog[hidden] { display: none; }
/* 停止按钮：有在跑/排队的组才显示（updateH3Node 控制 hidden） */
.cv-h3-stop {
    height: 34px; padding: 0 12px; border: 1px solid rgba(255, 107, 107, .55); border-radius: var(--r-sm);
    background: rgba(255, 107, 107, .10); color: #ff6b6b;
    font-size: 12px; font-weight: 800; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.cv-h3-stop:hover { background: rgba(255, 107, 107, .2); }
.cv-h3-stop[hidden] { display: none; }

/* ── H3 多组任务 ·「停止哪一组」二级面板（复用 cv-xgy 弹窗的框） ── */
.cv-h3stop .cv-xgy-box { width: 340px; }
#cvH3StopList { display: flex; flex-direction: column; gap: 7px; margin: 4px 0 12px; }
.cv-h3stop-row {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
    background: var(--bg-soft);
}
.cv-h3stop-row .n { font-size: 12px; font-weight: 800; color: var(--text); white-space: nowrap; }
.cv-h3stop-row .s { flex: 1; min-width: 0; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-h3stop-btn {
    height: 26px; padding: 0 10px; border: 1px solid rgba(255, 107, 107, .55); border-radius: 6px;
    background: rgba(255, 107, 107, .10); color: #ff6b6b;
    font-size: 11px; font-weight: 800; cursor: pointer;
}
.cv-h3stop-btn:hover { background: rgba(255, 107, 107, .2); }
.cv-h3stop-allbtn {
    width: 100%; height: 34px; border: 0; border-radius: var(--r-sm);
    background: rgba(255, 107, 107, .16); color: #ff6b6b;
    font-size: 12.5px; font-weight: 800; cursor: pointer;
}
.cv-h3stop-allbtn:hover { background: rgba(255, 107, 107, .26); }

.cv-h3-hint { font-size: 10.5px; color: var(--text-3); line-height: 1.45; }
.cv-h3-hint b { color: var(--accent); }

/* 音频参考节点 */
.cv-aud { display: flex; flex-direction: column; gap: 9px; padding: 12px; }
.cv-aud-drop {
    min-height: 76px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--bg-soft);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    font-size: 11.5px; color: var(--text-3); cursor: pointer; text-align: center; padding: 8px;
}
.cv-aud-drop:hover { border-color: var(--accent); color: var(--text-2); }
.cv-aud audio { width: 100%; height: 34px; display: block; }
.cv-aud-name { font-size: 11px; color: var(--text-2); word-break: break-all; line-height: 1.35; }
.cv-aud audio[hidden], .cv-aud-name[hidden] { display: none; }

/* ═══════════════ 仙宫云面板（瘦身后只剩连接区） ═══════════════ */
.cv-xgy-box > .cv-xgy-conn { margin: 14px 14px 0; }
/* ★ .cv-xgy-conn 自带 display:flex，会盖掉浏览器默认的 [hidden]{display:none}，
   导致「未连接」时那行「已连接 · 断开」也跟着显示出来。必须显式补一条。 */
.cv-xgy-conn[hidden] { display: none; }
.cv-xgy-tip-how {
    margin: 14px;
    background: rgba(148, 163, 184, .07);
    border-color: var(--line);
}
.cv-xgy-tip-how b { color: var(--accent); }

/* H3 提示词引用绑定条：<Picture 1> → 实际图片/音频节点的实时预览徽章 */
.cv-h3-binds { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 2px; }
.cv-bind { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px;
  border-radius: 7px; border: 1px solid var(--line-2); background: var(--bg-soft);
  font-size: 10.5px; line-height: 1.2; cursor: default; max-width: 100%; }
.cv-bind.has { cursor: pointer; }
.cv-bind.has:hover { border-color: var(--accent); }
.cv-bind b { color: var(--accent); font-weight: 700; white-space: nowrap; }
/* ★ 2026-10-19 同上：参考图徽章不再裁切，竖图完整显示 */
.cv-bind img { height: 26px; width: auto; max-width: 42px; object-fit: contain; border-radius: 4px; display: block; background: rgba(0,0,0,.35); }
.cv-bind i { font-style: normal; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.cv-bind.none { opacity: .6; }
.cv-bind.none i { color: var(--danger); }
/* ★ 主体徽章（<Subject N>）：它是主体编号、不是参考图槽位 → 中性样式，永不显示「未绑定」 */
.cv-bind.subj { border-style: solid; }
.cv-bind.subj i { color: var(--text-3); }
.cv-bind.subj i.subj-pic { color: var(--accent); font-weight: 600; }

/* H3 格子拖动换位 */
/* ★ 参考图 / 音频格子「拖动换位」（2026-10-10 由 HTML5 DnD 重写为 pointer 实现：
   原版空格子没有 data-node → 拖过去没反应，用户「切换参考图位置用不了」） */
.cv-h3-cell, .cv-h3-acell { touch-action: none; }   /* 触屏拖动时不要顺带滚动画布 */
/* ★ 格子里的缩略图必须禁止原生拖拽 + 禁止选中，否则拖动会变成「浏览器拖图片」 */
.cv-h3-cell img, .cv-h3-acell img, .cv-cell-ghost img { -webkit-user-drag: none; user-select: none; }
.cv-h3-cell[data-node], .cv-h3-acell[data-node] { cursor: grab; }
.cv-h3-cell.dragging, .cv-h3-acell.dragging { opacity: .3; cursor: grabbing; }
.cv-h3-cell.drop-hint, .cv-h3-acell.drop-hint {
    outline: 2px dashed var(--accent); outline-offset: 1px; border-radius: 4px;
    box-shadow: 0 0 0 3px rgba(91, 156, 255, .2);
}
/* 拖动时跟着指针走的那颗缩略图 */
.cv-cell-ghost {
    position: fixed; z-index: 9999; pointer-events: none;
    width: 66px; height: 66px; margin: -33px 0 0 -33px;
    border-radius: 9px; overflow: hidden;
    background: var(--bg-2, #12141a);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .55);
    transform: scale(1.06); opacity: .93;
    display: grid; place-items: center;
}
.cv-cell-ghost img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cv-cell-ghost .cv-cell-ghost-t { font-size: 22px; }
/* ★ 2026-10-29 收窄作用域：禁选不碰输入框 / 文本域（状态卡死也绝不能废掉打字） */
body.cv-cell-dragging, body.cv-cell-dragging * { cursor: grabbing !important; }
body.cv-cell-dragging :not(input):not(textarea):not(.cv-note) { user-select: none; }

/* ★★ 参考图 / 音频格子上的「移除」按钮（2026-10-10 新增）
   两个入口：这里的小 ✕（悬停高亮、**触屏常显可直接点**）+ 格子右键菜单。
   只删「引用」，来源图片/音频节点仍留在画布上。 */
.cv-h3-x {
    position: absolute; top: 3px; right: 3px; z-index: 4;
    width: 18px; height: 18px; padding: 0; margin: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; line-height: 1; font-weight: 800; font-family: inherit;
    color: #fff; background: rgba(8, 12, 20, .72);
    border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px;
    cursor: pointer; opacity: .62;
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    transition: opacity .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
}
.cv-h3-cell:hover .cv-h3-x,
.cv-h3-acell:hover .cv-h3-x { opacity: 1; }
.cv-h3-x:hover {
    background: #ff4d5e; border-color: #ff4d5e; opacity: 1;
    box-shadow: 0 2px 10px rgba(255, 77, 94, .45); transform: scale(1.1);
}
.cv-h3-x:active { transform: scale(.94); }
/* 音频格子里的 ✕ 垂直居中，并给右侧文字让出位置 */
.cv-h3-acell.has { padding-right: 24px; }
.cv-h3-acell .cv-h3-x { top: 50%; transform: translateY(-50%); }
.cv-h3-acell .cv-h3-x:hover { transform: translateY(-50%) scale(1.1); }
.cv-h3-acell .cv-h3-x:active { transform: translateY(-50%) scale(.94); }
/* 触屏（无 hover）：✕ 常显，保证能直接点到 */
@media (hover: none) {
    .cv-h3-x { opacity: .85; }
}

/* H3 提示词镜像层：底层渲染「文字 + 内嵌 <Picture N> 缩略图徽章」，上层 textarea 文字透明只留光标。
   提交内容永远来自 textarea.value（徽章只是前端视觉，绝不会进 ComfyUI 的 prompt）。 */
.cv-h3-pw { position: relative; }
.cv-h3-pw .cv-h3-mirror {
    position: absolute; left: 0; right: 0; top: 0; overflow: hidden; pointer-events: none;
    padding: 8px 9px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
    background: var(--bg-soft); color: var(--text);
    font-size: 12px; line-height: 1.45; font-family: inherit;
    white-space: pre-wrap; word-break: break-word;
}
.cv-h3-pw textarea.cv-h3-prompt {
    position: relative; background: transparent; color: transparent;
    caret-color: var(--text); border-color: transparent;
    scrollbar-width: none; -ms-overflow-style: none;
}
.cv-h3-pw textarea.cv-h3-prompt::-webkit-scrollbar { display: none; width: 0; }
.cv-h3-pw textarea.cv-h3-prompt::placeholder { color: var(--text-3); }
.cv-h3-pw textarea.cv-h3-prompt::selection { background: rgba(59,130,246,.40); color: transparent; }
.cv-h3-pw textarea.cv-h3-prompt:focus { border-color: transparent; }
/* ★ 聚焦反馈：以前焦点边框是 transparent（等于点了没任何变化），光标又藏在透明文字层里
   → 用户以为没点中提示词框。现在：聚焦时镜像层描蓝边 + 外发光，光标用主题蓝（任何主题下都醒目）。 */
.cv-h3-pw:focus-within .cv-h3-mirror {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(91, 156, 255, .18);
}
.cv-h3-pw textarea.cv-h3-prompt { caret-color: var(--accent); }
.cv-mir-tag { display: inline-flex; align-items: center; gap: 3px; vertical-align: -4px;
  padding: 1px 5px 1px 3px; margin: 0 2px; border-radius: 6px;
  border: 1px solid var(--line-2); background: var(--bg-card, #1c2230); font-size: 10.5px; line-height: 1.2; }
.cv-mir-tag b { color: var(--accent); font-weight: 700; white-space: nowrap; }
/* ★ 2026-10-19 修复：缩略图被 cover 裁成小方块（竖图只剩胸肩）→ 按真实比例完整显示 */
.cv-mir-tag img { height: 18px; width: auto; max-width: 30px; object-fit: contain; border-radius: 3px; display: block; background: rgba(0,0,0,.35); }
.cv-mir-tag i { font-style: normal; color: var(--text-3); white-space: nowrap; }
.cv-mir-tag.none { opacity: .55; border-style: dashed; }
/* ★ <Subject N> 在镜像层同样走中性样式（不是未绑定态） */
.cv-mir-tag.subj { opacity: .92; border-style: solid; }
.cv-mir-ph { color: var(--text-3); }

/* 镜像层与 textarea 统一 22px 行高：防止徽章行撑高造成的逐行累积错位 */
.cv-h3-pw .cv-h3-mirror, .cv-h3-pw textarea.cv-h3-prompt { line-height: 22px; }
.cv-h3-pw .cv-h3-mirror { left: 0; right: 0; top: 0; }   /* 高度由 JS 按内容量取并锁定（h3GrowPrompt） */
.cv-mir-tag img { height: 16px; width: auto; max-width: 28px; }

/* ═══ 图片节点 · 即梦式引用（2026-10-17 rev2）══════════════════════════════
   ★ rev2 为什么推翻 rev1（用户实测反馈「光标跟 @图片2 重叠」「不要蓝色底」）：
     rev1 = 「透明 textarea + 绝对定位镜像」的老办法。徽章里有缩略图，比纯文字宽，
     两层宽度永远对不上 → textarea 的原生光标只能落在「纯文字」的位置上，
     看着就是压在徽章上（引用越多偏得越厉害）。这是机制本身的问题，调 CSS 救不了。
     rev2 = **镜像层自己做编辑器**：缩略图徽章是编辑器内容的一部分，光标天然跟在它后面；
           textarea 降级成「数据影子」（display:none，但仍是唯一数据源）——
           doGenerate / 自动保存 / 风格菜单 / 历史回填全部直接读写 ta.value，一处都不用改。 */
.cv-prompt-pw { position: relative; }
.cv-prompt-pw .cv-prompt-mirror {
    min-height: 42px; max-height: 1000px; overflow-y: auto; overflow-x: hidden;
    border-radius: var(--r-sm); outline: none; cursor: text;
    color: var(--text); user-select: text; -webkit-user-select: text;
    font-size: 12.5px; font-family: inherit; line-height: 22px;
    white-space: pre-wrap; word-break: break-word;
    scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.cv-prompt-pw .cv-prompt-mirror::-webkit-scrollbar { width: 6px; }
.cv-prompt-pw .cv-prompt-mirror::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
/* 空框占位（:empty 不行：contenteditable 里可能残留 <br>，由 JS 打 is-empty 类） */
.cv-prompt-pw .cv-prompt-mirror.is-empty::before { content: attr(data-ph); color: var(--text-3); pointer-events: none; }
.cv-prompt-pw textarea.cv-prompt { display: none; }
/* 聚焦不再加任何底色 / 亮线（用户 2026-10-17：文本框里的蓝色底框不要）——
   光标本身 + 面板边框就是焦点反馈，别再额外画框。 */
.cv-prompt-pw:focus-within .cv-prompt-mirror { outline: none; }
/* @图片N 徽章：**只有缩略图 + 文字**，不要底色/边框/内边距（用户 2026-10-17 明确要求）。
   ⚠️ 只作用于图片节点（.cv-prompt-pw）；H3 的 <Picture N> 徽章样式在 1942 行，别动。 */
.cv-prompt-pw .cv-mir-tag {
    display: inline-flex; align-items: center; gap: 3px; vertical-align: -4px;
    margin: 0 1px; padding: 0; border: 0; background: none;
    font-size: 11px; line-height: 1.2; white-space: nowrap;
}
.cv-prompt-pw .cv-mir-tag b { color: var(--accent); font-weight: 600; white-space: nowrap; }
/* ★ 2026-10-19 图片节点提示词框：同样改成按真实比例完整显示 */
.cv-prompt-pw .cv-mir-tag img { height: 15px; width: auto; max-width: 26px; object-fit: contain; border-radius: 3px; display: block; background: rgba(0,0,0,.35); }
/* 引用不到（图上没这张 / 图上还没出图）：文字转灰 + 虚线下划线，不加框 */
.cv-prompt-pw .cv-mir-tag.none b {
    color: var(--text-3);
    text-decoration: underline dashed rgba(255,255,255,.35);
    text-underline-offset: 3px;
}

/* ═══ AI 助手（即梦式：右下角胶囊入口 + 深色对话卡）═══ */
.cv-asst-fab { position: fixed; right: 124px; bottom: 18px; z-index: 94;
  display: flex; align-items: center; gap: 6px; padding: 9px 16px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: #14171d; color: var(--text); font-size: 12.5px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.5); }
.cv-asst-fab i { font-style: italic; font-weight: 800; color: #4d8dff; font-size: 14px; }
.cv-asst-fab:hover { border-color: #4d8dff; }

/* ═══ 助手面板（二期 2026-10-12）：顶部停靠的大抽屉 ════════════════════════
   用户选型：上边缘贴住顶栏下方（top:48px = .cv-top 的高度，这样顶栏的按钮仍可用）、
   高度撑满到屏幕底部、贴右侧；胶囊 .cv-asst-fab 位置**完全不动**。
   ★ 宽度可切 3 档（`--cv-asst-w`，由标题栏的 ⤢ 按钮循环，存 localStorage）—— 这就是「放大放小」。
   ★ 手机端仍走文件末尾的媒体查询，回到「底部抽屉」（窄屏不适合顶部大抽屉）。
   ★★ 动画要点：不用 display:none 切换（那样没法过渡、收起会「啪」一下消失），
      改用 visibility + opacity + transform，两端都是具体值 → 展开/收起都能动画。
      动画全部是**有限时长**（0.2~0.7s），没有常驻 rAF —— 否则 --screenshot 会停在 opacity:0 假白屏。 */
.cv-asst {
  position: fixed; z-index: 95;
  top: 48px; right: 0; bottom: 0;
  width: var(--cv-asst-w, 660px); max-width: 96vw;
  /* ★ 2026-10-14：由「单列」改成「两列」—— 左=聊天记录(.cv-asst-hist) / 右=聊天(.cv-asst-main)。
     原来的所有直接子块（标题/空状态/消息/步骤/输入）现在都装在 .cv-asst-main 里，规则见文件末尾。 */
  display: flex; flex-direction: row; overflow: hidden;
  border-radius: 18px 0 0 0;
  background: rgba(16,18,22,.90); backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid #262b33; border-right: none; border-bottom: none;
  box-shadow: -14px 0 44px rgba(0,0,0,.55);
  /* ★★ 收起态（2026-10-12 三期重做 —— 用户说「缩放效果很丑，要苹果那种神奇效果」）
     旧版只有 translateY(-14px) scale(.975)：纯位移 + 微缩放，观感就是「一块板子滑下来」。
     新版换成「**模糊 → 清晰的右滑 + 微缩**」：
       · filter: blur(10px) 是高级感最直接的来源（macOS / visionOS 的窗口动效都靠它），
         比单纯位移自然得多 —— 面板像从毛玻璃里「对焦」出来；
       · 位移收敛到 26px（旧版纵向 14px 会有「掉下来」的错觉）；
       · transform-origin 取右上角 → 视觉上是「从右上角长出来」，和停靠位置一致。
     收起时反向播放同一组属性（同一段 transition）→ 进出完全对称。 */
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(26px) scale(.985);
  filter: blur(10px);
  transform-origin: 100% 0;
  transition: opacity .22s ease, transform .3s cubic-bezier(.4,0,.2,1),
              filter .3s ease, width .34s cubic-bezier(.4,0,.2,1), visibility 0s .3s; }
.cv-asst.on {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: none; filter: none;
  /* 展开曲线用 (.16,1,.3,1)：起步快、尾巴长 —— 最接近苹果 spring 的手感。
     ★ width 也在这里过渡：点 ⤢ 换档时面板是「平滑撑开」而不是「啪地跳一下」。 */
  transition: opacity .34s ease, transform .52s cubic-bezier(.16,1,.3,1),
              filter .44s ease, width .34s cubic-bezier(.4,0,.2,1), visibility 0s 0s;
  animation: cvAsstSheen .9s cubic-bezier(.22,1,.36,1) .04s both; }
/* 一次性光带：展开时一道蓝紫光从左侧扫到右侧再消散（有限时长、不常驻 → 不会影响截图与性能） */
.cv-asst::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(100deg, transparent 32%, rgba(120,175,255,.18) 47%,
              rgba(186,150,255,.12) 55%, transparent 70%);
  transform: translateX(-115%); opacity: 0; }
.cv-asst.on::after { animation: cvAsstSheenBand .9s cubic-bezier(.22,1,.36,1) .04s both; }

/* ═══ 聊天背景「蓝色光粒漫动」（2026-10-12 五期）═══════════════════════════════
   用户要「科技感 + 蓝色光粒漫动」。三层叠出来，从静到动：
     ① 细点阵   —— 26px 一格的微弱蓝点网格，缓慢斜向平移（科技底纹，几乎不抢戏）
     ② 呼吸光   —— 两团大范围 radial-gradient，**7.5s 一个完整呼吸周期**（放大提亮 ↔ 缩回压暗，
                    约每分钟 8 次，接近人静息呼吸）—— 这一层就是用户要的「呼吸感」
     ③ 光粒     —— 22 颗（18 小 + 4 柔焦大颗粒）带发光晕，从底部升上去、左右轻摆、途中还一闪一闪
                   ★ 六期提速：细点 10~22s、大颗 18~34s 飘完一趟（≈45~100px/s），肉眼明显能看到流动
                   参数由 canvas.js 的 asstBgSeed() 随机写入 CSS 变量（含**负延迟**错开相位）
   ★★ 全部用 transform / opacity（合成层动画），不用 rAF / Canvas：
      不占主线程、不和画布那边的拖拽缩放抢帧；面板关着时也零开销。
   ★★ 下面必须给内容区加 `position:relative; z-index:1` ——
      .cv-asst-bg 是 z-index:0 的定位元素，会盖在**静态流**内容之上（层叠顺序 6 早于 3），
      不加的话整块文字都会被光粒压在下面。
   ★ 粒子亮度峰值 ≤ .5、尺寸 ≤ 3.7px，且助手气泡另加不透明底（见 .cv-asst-b.a）→ 正文始终清晰。 */
.cv-asst-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
/* ① 细点阵底纹 */
.cv-asst-bg::before {
  content: ''; position: absolute; inset: -25%;
  background-image: radial-gradient(rgba(126, 176, 255, .105) 1px, transparent 1px);
  background-size: 26px 26px;
  animation: cvAsstGrid 22s linear infinite; }
@keyframes cvAsstGrid { to { transform: translate3d(-26px, -26px, 0); } }
/* ② 两团柔和蓝光 + ★「呼吸」脉冲（2026-10-12 六期：这就是用户要的「呼吸感」）
   原来的 cvAsstAura 是 18s 来回 alternate —— 太慢，观感接近静止。
   现在换成 7.5s 一个完整呼吸周期（≈每分钟 8 次，接近人静息呼吸）：
     吸气：光影放大到 1.08、提亮到 1  吸气/呼气之间用 ease-in-out，起收都柔和
     呼气：缩回 .93、压暗到 .5，同时整体轻微位移 → 光团像在「飘着呼吸」
   深浅对比拉到 .5~1，幅度够大才看得出来。 */
.cv-asst-bg::after {
  content: ''; position: absolute; inset: -35%;
  background:
    radial-gradient(38% 30% at 22% 16%, rgba(64, 128, 255, .26), transparent 70%),
    radial-gradient(34% 26% at 82% 74%, rgba(142, 92, 255, .20), transparent 72%);
  animation: cvAsstBreath 7.5s ease-in-out infinite; }
@keyframes cvAsstBreath {
  0%, 100% { transform: translate3d(-1.5%, -1%, 0) scale(.93); opacity: .5; }
  50%      { transform: translate3d(2%, 1.5%, 0)   scale(1.08); opacity: 1; }
}
/* ③ 光粒：从底部升到顶，中途最亮、两端淡出 */
.cv-asst-bg i {
  position: absolute; left: var(--x); bottom: -14px;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: #9cc8ff;
  box-shadow: 0 0 7px rgba(110, 165, 255, .95), 0 0 18px rgba(80, 140, 255, .5);
  filter: blur(var(--bl, 0));        /* 大颗粒用一点模糊 → 景深/柔焦 */
  opacity: 0;
  animation: cvAsstDust var(--d) linear var(--dl) infinite; }
@keyframes cvAsstDust {
  /* ★ 六期：中途加一次「明→暗→明」的起伏 —— 粒子升上去时像在闪，比匀速平移有生气得多。
     calc(var(--o) * .38) 里的 var 在计算值阶段解析，可以正常参与插值。 */
  0%   { opacity: 0;                         transform: translate3d(0, 0, 0) scale(.72); }
  12%  { opacity: var(--o); }
  40%  { opacity: calc(var(--o) * .38); }
  62%  { opacity: var(--o); }
  86%  { opacity: calc(var(--o) * .72); }
  100% { opacity: 0;                         transform: translate3d(var(--sw), -115vh, 0) scale(1.14); }
}
/* 内容压在光粒之上（否则静态流内容会被 z-index:0 的光粒层盖住） */
.cv-asst-main > .cv-asst-top,
.cv-asst-main > .cv-asst-empty,
.cv-asst-main > .cv-asst-msgs,
.cv-asst-main > .cv-asst-foot,
.cv-asst-main > .cv-asst-steps { position: relative; z-index: 1; }
@keyframes cvAsstSheen {
  0%   { box-shadow: -14px 0 44px rgba(0,0,0,.55), inset 0 0 0 1px rgba(77,141,255,0); }
  32%  { box-shadow: -14px 0 44px rgba(0,0,0,.55), inset 0 0 0 1px rgba(77,141,255,.45); }
  100% { box-shadow: -14px 0 44px rgba(0,0,0,.55), inset 0 0 0 1px rgba(77,141,255,0); }
}
@keyframes cvAsstSheenBand {
  0%   { opacity: 0; transform: translateX(-115%); }
  16%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(115%); }
}
/* 内容分层浮现：顶栏 → 主体 → 输入区，各差约 70ms（位移只 8px，不抢戏但整块会「活起来」） */
.cv-asst.on > .cv-asst-main > .cv-asst-top,
.cv-asst.on > .cv-asst-main > .cv-asst-empty,
.cv-asst.on > .cv-asst-main > .cv-asst-msgs,
.cv-asst.on > .cv-asst-main > .cv-asst-foot { animation: cvAsstRise .5s cubic-bezier(.16,1,.3,1) both; }
.cv-asst.on > .cv-asst-main > .cv-asst-top   { animation-delay: .04s; }
.cv-asst.on > .cv-asst-main > .cv-asst-empty { animation-delay: .11s; }
.cv-asst.on > .cv-asst-main > .cv-asst-msgs  { animation-delay: .11s; }
.cv-asst.on > .cv-asst-main > .cv-asst-foot  { animation-delay: .18s; }
@keyframes cvAsstRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* 半透明 → 鼠标进入 / 里面聚焦时变实（放大后不硬挡画布） */
.cv-asst:hover, .cv-asst:focus-within { background: rgba(16,18,22,.985); }
/* 宽度档位按钮 + 顶栏按钮组 */
.cv-asst-top { gap: 2px; }
.cv-asst-top .cv-asst-hd { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }
.cv-asst-wbtn { background: none; border: none; color: var(--text-3); cursor: pointer;
  padding: 3px 5px; border-radius: 7px; display: inline-flex; }
.cv-asst-wbtn:hover { color: #79aaff; background: rgba(77,141,255,.13); }
/* ★★ 2026-10-14 「历史会话」按钮：用户说原来纯图标「难看见」→ 改成**带文字的可见按钮**
   （描边 + 浅底 + 图标 + 文字）；展开时整块变蓝，一眼看出当前状态。 */
.cv-asst-hbtn {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 4px 9px; border-radius: 8px; cursor: pointer;
  font-size: 11.5px; line-height: 1; font-family: inherit; white-space: nowrap;
  border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.055); color: var(--text-2);
  transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.cv-asst-hbtn svg { opacity: .9; flex: none; }
.cv-asst-hbtn:hover { color: #cfe0ff; border-color: rgba(77,141,255,.5); background: rgba(77,141,255,.13); }
.cv-asst-hbtn.active { color: #a8c8ff; border-color: rgba(77,141,255,.62); background: rgba(77,141,255,.2);
  box-shadow: inset 0 0 0 1px rgba(77,141,255,.18); }
@media (prefers-reduced-motion: reduce) {
  .cv-asst.on, .cv-asst.on::after,
  .cv-asst.on > .cv-asst-main > .cv-asst-top, .cv-asst.on > .cv-asst-main > .cv-asst-empty,
  .cv-asst.on > .cv-asst-main > .cv-asst-msgs, .cv-asst.on > .cv-asst-main > .cv-asst-foot { animation: none; }
}
.cv-asst-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.cv-asst-title { font-size: 12.5px; color: var(--text-2); }
.cv-asst-new, .cv-asst-x { background: none; border: none; color: var(--text-3); font-size: 15px; cursor: pointer; padding: 2px 6px; }
.cv-asst-new:hover, .cv-asst-x:hover { color: var(--text); }
/* ═══ 开始页（空状态）—— 2026-10-12 三期：创世纪品牌 + 玩法引导 ══════════════════
   用户反馈：原来只有一行「探索更多专业创作模式」+ 一排小胶囊 —— 太空、也不告诉你该怎么用。
   现在自上而下：品牌区（渐变 logo + 名称 + 副标）→ 渐变主标题 → 一句话定位 →
   分隔小标题 → 5 张模式卡片（2 列网格，最后一张通栏）→ 3 条上手提示。
   ★ overflow-y:auto + justify-content:safe center：面板矮时可滚动、且不会把顶部裁掉。
   ★ 配套 .cv-asst-msgs:empty{display:none}：没有消息时把消息区整个收掉，
     否则两个 flex:1 的兄弟会各占一半，开始页只能挤在上半屏（原来就是这个毛病）。 */
.cv-asst-empty {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; padding: 22px; }
/* ★ 垂直居中用 `margin:auto` 而不是 `justify-content:center`：
   center 在内容超高时会把**顶部裁掉**（滚不上去）；margin:auto 则内容少时居中、
   内容多时从顶部开始正常滚 —— 这是「居中 + 可滚动」最稳的写法。
   （实测：first-try 用的是 justify-content:safe center，在无头 Chrome 里没生效，内容整体偏上。） */
.cv-asst-epage {
  margin: auto; width: 100%; max-width: 560px;
  display: flex; flex-direction: column; align-items: center; gap: 13px; }
.cv-asst-msgs:empty { display: none; }
.cv-asst-brand { display: flex; align-items: center; gap: 10px; }
.cv-asst-logo {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 19px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #4d8dff 0%, #7c5cff 55%, #b46bff 100%);
  box-shadow: 0 6px 20px rgba(77, 141, 255, .4); }
.cv-asst-brandtx { display: flex; flex-direction: column; line-height: 1.3; }
.cv-asst-brandtx b { font-size: 15px; color: var(--text); letter-spacing: 1.5px; }
.cv-asst-brandtx i { font-style: normal; font-size: 10px; color: var(--text-3); letter-spacing: 1.5px; }
.cv-asst-hero {
  font-size: 19px; font-weight: 700; letter-spacing: .4px; line-height: 1.5; text-align: center;
  background: linear-gradient(92deg, #eef2f8 0%, #a8c8ff 46%, #d0bcff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; }
.cv-asst-sub { font-size: 12px; line-height: 1.85; color: var(--text-3); text-align: center; max-width: 440px; }
.cv-asst-sec {
  margin-top: 6px; width: 100%; max-width: 560px; white-space: nowrap;
  display: flex; align-items: center; gap: 10px;
  font-size: 10.5px; color: var(--text-3); letter-spacing: 2px; }
.cv-asst-sec::before, .cv-asst-sec::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, #2b3140, transparent); }
.cv-asst-pills {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px; width: 100%; max-width: 560px; }
.cv-asst-pills button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  padding: 10px 12px; border-radius: 12px; cursor: pointer; font: inherit;
  background: #171a20; border: 1px solid #262b33; color: var(--text);
  transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.cv-asst-pills button:hover { background: #1c2231; border-color: #3b4a6d; transform: translateY(-1px); }
.cv-asst-pills button .n { font-size: 9px; font-weight: 700; letter-spacing: 1.6px; color: #5b95ff; }
.cv-asst-pills button b { font-size: 12.5px; font-weight: 600; }
.cv-asst-pills button i { font-style: normal; font-size: 10.5px; line-height: 1.5; color: var(--text-3); }
/* 最后一张（Context-IR 单步改写）通栏，视觉上收个尾 */
.cv-asst-pills button:last-child { grid-column: 1 / -1; }
.cv-asst-tips { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 560px; margin-top: 2px; }
.cv-asst-tip { display: flex; gap: 8px; align-items: flex-start; font-size: 11px; line-height: 1.65; color: var(--text-3); }
.cv-asst-tip b {
  flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 5px;
  display: grid; place-items: center; font-size: 9px; font-weight: 700;
  background: rgba(77, 141, 255, .15); color: #79aaff; }
/* ═══ 对话气泡（2026-10-12 四期美化：用户右侧渐变胶囊 / 助手带头像的对话行）═══════
   以前两种气泡都是「一整块深灰方框」，用户消息还占满整行 —— 分不出谁在说话，也压得很闷。
   现在：用户消息 = 右对齐蓝色渐变胶囊（右下角收一个小圆角当尾巴）；
        助手消息 = 左侧一枚「创」字头像 + 正文直接落在面板上（不再套一层灰底），
        这样里面的 H3 卡片、错误块、中文对照这些自带底色的组件层次才清楚。
   ★ 助手头像用 ::before 画，**不改 JS 结构** —— 气泡里的 .cv-asst-pre/.cv-asst-card 等仍是块级流。 */
.cv-asst-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 15px; }

.cv-asst-b { font-size: 12.5px; line-height: 1.72; animation: cvAsstBubbleIn .3s cubic-bezier(.16,1,.3,1) both; }
@keyframes cvAsstBubbleIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* 用户消息：右对齐渐变胶囊（七期微调：渐变更饱满 + 顶部内高光 + 细描边 → 有「实体感」） */
.cv-asst-b.u {
  align-self: flex-end; max-width: 82%;
  padding: 10px 15px; border-radius: 18px 18px 6px 18px;
  color: #f2f6ff;
  background-image: linear-gradient(135deg, #3a63b8 0%, #4a7fd8 52%, #5d92ea 100%);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 6px 18px rgba(24, 52, 110, .45), inset 0 1px 0 rgba(255, 255, 255, .16); }

/* 助手消息：左侧头像 + 一层**极淡**的对话卡底（不是原来那种压得很闷的深灰块）
   ★ 底色只有 3% 白，几乎与面板同色 —— 目的是给消息一个「边界」，而不是又变成方框；
     左上角收成 5px 小圆角，正好指向头像，读起来像气泡的小尾巴。
   ★ 里面的 .cv-asst-card（H3 提示词卡）比这层再亮一档，保证层次不倒挂。 */
.cv-asst-b.a {
  align-self: stretch; max-width: 100%; width: 100%;
  position: relative; padding: 11px 14px 11px 46px;
  border-radius: 6px 18px 18px 18px;
  /* ★ 五期：背景加了光粒层，这里就不能再用 3% 半透明白了 —— 光粒会透过正文。
     改成偏实的深色底（≈ 面板色再压一档），文字清晰度优先。
     ★ 七期再加一层**极淡的纵向渐变**（顶亮底暗），比纯色底有体积感，且不抢正文。 */
  background-color: rgba(17, 21, 29, .82);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012));
  border: 1px solid rgba(255, 255, 255, .075);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
  color: var(--text); }
.cv-asst-b.a::before {
  content: '创'; position: absolute; left: 10px; top: 11px;
  width: 28px; height: 28px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #fff; letter-spacing: 0;
  background: linear-gradient(135deg, #4d8dff 0%, #7c5cff 55%, #b46bff 100%);
  box-shadow: 0 3px 10px rgba(77, 141, 255, .34), inset 0 0 0 1px rgba(255, 255, 255, .16); }
.cv-asst-pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; }
.cv-asst-card { background: #1a1f29; border: 1px solid #2b3240; border-radius: 10px; margin-bottom: 8px; }
.cv-asst-card .cv-asst-pre { max-height: 260px; overflow-y: auto; padding: 8px 10px; }
/* ═══ 消息操作条（七期）：图标 + 文字的「幽灵按钮」 ═══════════════════════════
   原来只是一个灰描边小胶囊，字还带 emoji（📋 / ⚡ / ＋），跟新的图标体系不搭。
   现在换成同风格的 12px stroke 图标 + 文字，默认安静、悬停才亮起蓝色。 */
.cv-asst-acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px 0 1px;
  border-top: 1px solid rgba(255,255,255,.07); margin-top: 9px; }
.cv-asst-acts button {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .09);
  color: #a7b1c1; font-size: 11px; padding: 5px 11px; border-radius: 9px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease; }
.cv-asst-acts button svg { width: 12px; height: 12px; opacity: .92; }
.cv-asst-acts button:hover {
  background: rgba(109, 158, 255, .16); border-color: rgba(109, 158, 255, .5);
  color: #cfe0ff; transform: translateY(-1px); }
.cv-asst-steps { display: flex; align-items: center; gap: 4px; padding: 6px 14px; font-size: 10px;
  color: var(--text-3); border-top: 1px solid #1c2129; flex-wrap: wrap; }
.cv-asst-steps .st.cur { color: #4d8dff; font-weight: 700; }
.cv-asst-steps .st.done { color: #4ade80; }
.cv-asst-skillpop { position: absolute; left: 10px; right: 10px; bottom: 86px; z-index: 5;
  background: #171a20; border: 1px solid #262b33; border-radius: 12px; padding: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.55); }
.cv-asst-search { width: 100%; box-sizing: border-box; background: #101216; border: 1px solid #262b33;
  border-radius: 8px; color: var(--text); font-size: 12px; padding: 7px 9px; outline: none; margin-bottom: 6px; }
.cv-asst-slist { max-height: 260px; overflow-y: auto; }
.cv-asst-si { padding: 8px 9px; border-radius: 8px; cursor: pointer; }
.cv-asst-si:hover { background: #1f242d; }
.cv-asst-si b { display: block; font-size: 12px; color: var(--text); margin-bottom: 2px; }
.cv-asst-si i { font-style: normal; font-size: 10.5px; color: var(--text-3);
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ═══ 输入区（2026-10-12 七期重做）：整体一个「输入胶囊」 ═══════════════════════
   以前是「一个裸 textarea 框 + 下面一排裸按钮」，两块割裂、边框也灰暗 → 观感廉价。
   现在把 textarea 和按钮**装进同一个圆角容器 .cv-asst-box**（ChatGPT / Claude 的做法）：
     · 外层负责背景 / 边框 / 投影 / 聚焦光晕；内层 textarea 完全无边框、无背景
     · 聚焦时整块亮起蓝边 + 一圈柔和蓝光（:focus-within），而不是只给 textarea 换边框色
   按钮：静默态（透明底 + 灰图标）→ 悬停才浮出底色；**发送键是唯一的高饱和主按钮**（渐变圆 + 蓝光）。
   ★ class 名一个没改（.cv-asst-pick / -up / -skbtn / -send）—— JS 事件绑定与测试断言全靠它。 */
.cv-asst-foot { padding: 10px 14px 14px; }
.cv-asst-box {
  border-radius: 16px;
  background: rgba(255, 255, 255, .042);
  border: 1px solid rgba(255, 255, 255, .085);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .045);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.cv-asst-box:focus-within {
  background: rgba(255, 255, 255, .058);
  border-color: rgba(109, 158, 255, .55);
  box-shadow: 0 0 0 3px rgba(77, 141, 255, .13), 0 8px 26px rgba(0, 0, 0, .4); }

.cv-asst-in {
  width: 100%; box-sizing: border-box; display: block;
  background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; line-height: 1.7;
  padding: 11px 13px 2px; resize: none; font-family: inherit;
  min-height: 44px; max-height: 160px; overflow-y: auto;
  scrollbar-width: none; -ms-overflow-style: none; }
.cv-asst-in::-webkit-scrollbar { display: none; }
.cv-asst-in::placeholder { color: #5b6472; }

.cv-asst-ctl { display: flex; align-items: center; gap: 4px; padding: 2px 7px 7px 8px; }
.cv-asst-ctl > .cv-asst-pick,
.cv-asst-ctl > .cv-asst-up,
.cv-asst-ctl > .cv-asst-skbtn {
  position: relative; flex: none; width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 9px;
  color: #8a93a3; cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .12s ease; }
.cv-asst-ctl > .cv-asst-pick svg,
.cv-asst-ctl > .cv-asst-up svg,
.cv-asst-ctl > .cv-asst-skbtn svg { width: 16px; height: 16px; }
.cv-asst-ctl > .cv-asst-pick:hover,
.cv-asst-ctl > .cv-asst-up:hover,
.cv-asst-ctl > .cv-asst-skbtn:hover { background: rgba(255, 255, 255, .08); color: #cfd8e8; }
/* 悬停提示气泡：出现在按钮正上方 */
.cv-asst-ctl [data-tip] { position: relative; }
.cv-asst-ctl [data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 7px);
  transform: translateX(-50%); white-space: nowrap; z-index: 9;
  background: #232936; color: #e6e9ef; border: 1px solid #313846;
  font-size: 10.5px; line-height: 1; padding: 5px 8px; border-radius: 7px;
  box-shadow: 0 6px 18px rgba(0,0,0,.5); pointer-events: none;
  animation: cvTipIn .13s ease both; }
@keyframes cvTipIn { from { opacity: 0; transform: translateX(-50%) translateY(3px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
/* 「引用图片」选中态（JS 会加 .on）—— 保持一眼可辨 */
.cv-asst-pick.on { background: rgba(77, 141, 255, .22) !important; color: #8fb8ff !important; }
.cv-asst-quota { margin-left: auto; font-size: 10px; color: #626b7a; padding-right: 7px; white-space: nowrap; }

/* 发送：唯一的实心主按钮（渐变圆 + 蓝光）；悬停微抬、按下回弹 */
.cv-asst-send {
  flex: none; width: 32px; height: 32px; margin-left: 1px;
  border: none; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4d8dff 0%, #6f6bff 55%, #8f5cff 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(70, 120, 240, .45);
  transition: transform .14s ease, box-shadow .18s ease, filter .18s ease; }
.cv-asst-send svg { width: 17px; height: 17px; }
.cv-asst-send:hover { transform: translateY(-1px); box-shadow: 0 7px 20px rgba(70, 120, 240, .6); filter: brightness(1.07); }
.cv-asst-send:active { transform: translateY(0) scale(.94); }
.cv-asst-send:disabled { opacity: .45; cursor: default; box-shadow: none; }

/* （七期：输入框的尺寸/滚动约束已并入上面 .cv-asst-in，这里不再重复定义） */
.cv-asst-in::-webkit-scrollbar { display: none; }

.cv-asst-skillx { margin-left: auto; background: none; border: none; color: var(--danger, #ef4444);
  font-size: 10px; cursor: pointer; padding: 2px 4px; }
.cv-asst-skillx:hover { text-decoration: underline; }

/* 助手面板防御：foot 永远在面板内且在最上层（防溢出内容遮挡发送按钮） */
.cv-asst-foot { position: relative; z-index: 6; background: #101216; }
.cv-asst-in { max-height: 160px !important; overflow-y: auto !important; }
.cv-asst-send { pointer-events: auto; }

/* 历史面板：AI 助手纯文本记录（TXT）—— 缩略图与详情都走文本样式，不走图片占位 */
.cv-hi-txt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 100%; }
.cv-hi-txt b { font-size: 15px; color: var(--text-2); }
.cv-hi-txt i { font-style: normal; font-size: 10px; color: var(--text-3); max-width: 88%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-hid-txt { width: 100%; height: 100%; display: flex; flex-direction: column;
  background: var(--bg-soft); border: 1px solid var(--line-1); border-radius: 10px; overflow: hidden; }
.cv-hid-txt-head { padding: 8px 12px; font-size: 12px; color: var(--text-2); border-bottom: 1px solid var(--line-1); }
.cv-hid-txt pre { flex: 1; min-height: 0; margin: 0; padding: 12px; overflow: auto;
  font-size: 12px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; font-family: inherit; }

/* 步骤条「下一步」按钮 */
.cv-asst-next { margin-left: auto; background: #4d8dff; border: none; color: #fff;
  font-size: 10px; padding: 3px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.cv-asst-next:hover { background: #6ba0ff; }

/* 助手资产卡片标题行 + 快捷回复按钮 */
.cv-asst-card-head { padding: 6px 10px 0; font-size: 11.5px; font-weight: 700; color: #4d8dff; }
.cv-asst-acts button[data-say] { border-color: #4d8dff; color: #4d8dff; }
.cv-asst-acts button[data-imgnode], .cv-asst-acts button[data-newh3] { border-color: #3a9d6b; color: #4ade80; }
.cv-asst-acts button[data-imgnode]:hover, .cv-asst-acts button[data-newh3]:hover { border-color: #4ade80; }

/* ═══ 沉浸式原生控件（数字步进器/下拉弹层/滚动条全暗色）═══
   color-scheme: dark 让浏览器原生 UI 跟随暗色 —— 白白的步进箭头、白色下拉弹层一次治好 */
:root { color-scheme: dark; }

/* 沉浸式滚动条：全画布统一细半透明，悬停加深（替代白色默认滚动条） */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.30); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }

/* 数字步进器（时长/分辨率输入）：箭头改暗色（color-scheme 已生效，此处只微调尺寸） */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { opacity: .45; }
input[type="number"]::-webkit-inner-spin-button:hover,
input[type="number"]::-webkit-outer-spin-button:hover { opacity: .9; }

/* （2026-10-12 二期：原来的「470×自适应更高」已被上面的「顶部停靠抽屉」取代，删掉以免覆盖） */
.cv-asst-b { font-size: 12.5px; line-height: 1.65; }
.cv-asst-msgs { padding: 14px 16px; }

/* ═══ 下拉弹层沉浸式：原生 option 列表统一暗色 + 选中项深色高亮（去掉亮蓝块）═══ */
select { color-scheme: dark; accent-color: #4d8dff; }
select option, select optgroup { background-color: #171a20; color: #e6e9ef; }
/* 选中项：Chrome/Edge 认 background，Firefox 需要 gradient 写法，两者都写 */
select option:checked { background: #2a3040; background: linear-gradient(#2a3040, #2a3040); color: #fff; }
select option:hover { background: #232936; background: linear-gradient(#232936, #232936); }
select option:disabled { color: #6b7280; }

/* 步骤条：右侧按钮组 + 「关闭技能」做成有背景的清晰按钮（原来纯红字又小又难点） */
.cv-asst-steps { padding: 7px 12px; row-gap: 6px; background: #14171d; border-top: 1px solid #1c2129; }
.cv-asst-steps-r { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.cv-asst-steps-r .cv-asst-next { margin-left: 0; }
.cv-asst-skillx { margin-left: 0; background: rgba(239,68,68,.14); border: 1px solid rgba(239,68,68,.42);
  color: #f87171; font-size: 10.5px; line-height: 1; padding: 5px 10px; border-radius: 6px;
  cursor: pointer; min-height: 22px; white-space: nowrap; }
.cv-asst-skillx:hover { background: rgba(239,68,68,.26); border-color: rgba(239,68,68,.65); color: #fca5a5; text-decoration: none; }

/* ═══ 自绘下拉（原生弹层无法圆角 → 自绘圆角深色菜单）═══ */
select.cv-sel-native { position: absolute !important; width: 1px !important; height: 1px !important;
  opacity: 0 !important; pointer-events: none !important; margin: 0 !important; }

.cv-selbtn { display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  background: transparent; border: none; color: var(--text-2); font-family: inherit;
  font-size: 12px; height: 24px; padding: 0 5px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.cv-selbtn:hover { background: rgba(255,255,255,.07); color: var(--text); }
.cv-selbtn svg { flex: none; opacity: .7; }
.cv-selbtn-t { overflow: hidden; text-overflow: ellipsis; }
/* 纯展示下拉（GPU Image 的「原图」比例）：长得就不是按钮 —— 去箭头/去 hover/默认光标 */
.cv-selbtn.as-txt { cursor: default; opacity: .78; }
.cv-selbtn.as-txt svg { display: none; }
.cv-selbtn.as-txt:hover { background: transparent; color: var(--text-2); }

/* H3 参数区 / 仙宫云表单里的下拉原本是「盒式」，按钮保持同样外观 */
.cv-h3-p .cv-selbtn, .cv-xgy-mini-lb .cv-selbtn {
  width: 100%; justify-content: space-between; box-sizing: border-box;
  height: 28px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--bg-soft); color: var(--text); font-size: 11.5px; }
.cv-xgy-mini-lb .cv-selbtn { height: 32px; padding: 0 8px; font-size: 12px; border-radius: var(--r-sm); }
.cv-h3-p .cv-selbtn:hover, .cv-xgy-mini-lb .cv-selbtn:hover { border-color: var(--accent); background: var(--bg-soft); }

/* 弹层本体：圆角深色卡片 */
.cv-selmenu { position: fixed; z-index: 300; background: #171a20; border: 1px solid #2a3040;
  border-radius: 12px; padding: 5px; box-shadow: 0 14px 40px rgba(0,0,0,.62);
  max-height: min(360px, 58vh); overflow-y: auto; }
.cv-selmi { padding: 7px 11px; border-radius: 8px; font-size: 12px; line-height: 1.3;
  color: #cfd3da; cursor: pointer; white-space: nowrap; }
.cv-selmi:hover { background: #232936; color: #fff; }
.cv-selmi.cur { background: #2a3040; color: #fff; font-weight: 600; }
.cv-selmi.dis { color: #6b7280; cursor: default; }
.cv-selmi.dis:hover { background: transparent; }

/* H3 节点：未连接仙宫云的提示态（节点样子/数据不变，只是不能用） */
.cv-h3-ph.warn { color: #fbbf24; }

/* ═══ 对话状态（等待 / 流式输出）2026-10-12 四期美化 ═══════════════════════════
   原来是个「灰转圈 + 灰字」，暗淡到在深色面板上几乎看不见（用户截图里那块几乎是空的）。
   现在：转圈换成**三颗依次跳动的小点**（蓝紫渐变，经典「正在思考」语感），
        文案用一点点呼吸感（透明↔全亮），整行提亮一档。
   ★ 仍然只用 JS 已生成的那个 <span class="cv-asst-spin"> —— 另外两颗点用 ::before/::after 画，
     所以 JS 一行都不用改；.sm 变体（流式输出底部那行）同设计、尺寸更小。 */
.cv-asst-think { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: #9aa4b4; font-size: 12.5px; padding: 2px 0; }
/* ★ 思考过程（推理模型）：正文前实时展示；正文到达后折叠，点标题再展开 */
.cv-asst-reason { flex: 0 0 100%; margin: 7px 0 2px; padding: 8px 10px; font-size: 12px; line-height: 1.65;
  color: #8f9bb0; background: rgba(122,148,196,.08); border-left: 2px solid rgba(122,148,196,.3);
  border-radius: 6px; max-height: 220px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.cv-asst-think.folded { cursor: pointer; }
/* ★ 停止生成：挂在思考行尾，边界明确、不误触（长任务必须能打断） */
.cv-asst-stop { margin-left: auto; font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid rgba(255,110,110,.45); background: rgba(255,80,80,.12); color: #ff8b8b;
  cursor: pointer; white-space: nowrap; }
.cv-asst-stop:hover { background: rgba(255,80,80,.22); color: #ffb0b0; }
.cv-asst-stop:disabled { opacity: .55; cursor: default; }
.cv-asst-think.folded .cv-asst-spin { display: none; }
.cv-asst-think.folded .cv-asst-reason { display: none; }
.cv-asst-spin { position: relative; flex: none; margin: 0 7px;
  width: 5px; height: 5px; border: none; border-radius: 50%;
  background: #6aa2ff;
  animation: cvAsstDot 1.08s ease-in-out infinite; }
.cv-asst-spin::before, .cv-asst-spin::after {
  content: ''; position: absolute; top: 0; width: 5px; height: 5px; border-radius: 50%; background: #6aa2ff; }
.cv-asst-spin::before { left: -7px; animation: cvAsstDot 1.08s ease-in-out infinite .16s; }
.cv-asst-spin::after  { left: 7px;  animation: cvAsstDot 1.08s ease-in-out infinite .32s; }
@keyframes cvAsstDot {
  0%, 100% { opacity: .22; transform: translateY(0) scale(.7); }
  42%      { opacity: 1;   transform: translateY(-3px) scale(1); }
}
.cv-asst-tt { animation: cvfade .5s ease; }
@keyframes cvfade { from { opacity: .35; } to { opacity: 1; } }

/* 流式输出期间：气泡底部一条轻量状态条（左细线把「正文」和「还在生成」分开） */
.cv-asst-gen { display: flex; align-items: center; gap: 6px; margin-top: 9px; padding-top: 9px;
  border-top: 1px dashed rgba(255,255,255,.09); color: #9aa4b4; font-size: 11px; }
.cv-asst-spin.sm { width: 4px; height: 4px; margin: 0 6px; }
.cv-asst-spin.sm::before, .cv-asst-spin.sm::after { width: 4px; height: 4px; }
.cv-asst-spin.sm::before { left: -6px; }
.cv-asst-spin.sm::after  { left: 6px; }
/* 已 interrupted 的标记也提亮一点，别像失效文本 */
.cv-asst-stopped { color: #fca5a5; }

/* 减少动效：跳动点与气泡入场都停掉 */
@media (prefers-reduced-motion: reduce) {
  .cv-asst-spin, .cv-asst-spin::before, .cv-asst-spin::after,
  .cv-asst-b, .cv-asst-tt,
  .cv-asst-bg::before, .cv-asst-bg::after, .cv-asst-bg i { animation: none; }
  .cv-asst-bg i { opacity: .18; }        /* 静止时留一点星点，别整层消失 */
}

/* 助手：生成中「发送」键变红色「停止」（可随时打断）；已停止标记 */
/* （七期：.cv-asst-send.stop 已在上面的输入区块里定义成红色渐变；这里原来的灰版规则已删除） */
.cv-asst-send.stop { background: linear-gradient(135deg, #ef5350 0%, #e0453f 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, .45); }
.cv-asst-send.stop:hover { box-shadow: 0 7px 20px rgba(239, 68, 68, .6); }
.cv-asst-stopped { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #22272f;
  font-size: 10.5px; color: #f87171; }

/* H3 卡片：中文对照折叠 + 缺英文版告警 + 底部「中文对照」开关 */
.cv-asst-cn { border-top: 1px dashed #22272f; }
.cv-asst-cnbtn { width: 100%; text-align: left; background: none; border: none; color: var(--text-3);
  font-size: 10.5px; padding: 5px 10px; cursor: pointer; }
.cv-asst-cnbtn:hover { color: #4d8dff; }
.cv-asst-cnbody { padding: 0 10px 8px; font-size: 11.5px; line-height: 1.6; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto; }
.cv-asst-warn { font-size: 10.5px; color: #fbbf24; padding: 2px 0; }
.cv-asst-cntg { background: #1c2028; border: 1px solid #262b33; color: var(--text-3); font-size: 11px;
  padding: 5px 9px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.cv-asst-cntg.on { background: rgba(77,141,255,.18); border-color: #4d8dff; color: #79aaff; }

/* ★ 助手错误提示（红色块）：生成失败 / 无权限 / 登录失效 ——
   独立元素，不塞进 .cv-asst-pre（等待动效期间 pre 是 display:none，塞进去会看不见）。 */
.cv-asst-err {
    background: rgba(226, 75, 74, .12); border: 1px solid rgba(226, 75, 74, .55);
    border-radius: 9px; padding: 9px 11px; margin-top: 6px;
}
.cv-asst-err b { display: block; color: #ff7a7a; font-size: 12.5px; font-weight: 500; }
.cv-asst-err span { display: block; margin-top: 3px; color: var(--text-3); font-size: 11px; line-height: 1.6; }

/* ★ H3 三段式：①「上传指引」对照条 + ②「中文说明」块 ——
   都渲染在卡片外面 / 上面，只读，不进 data-copy、不进节点。 */
.cv-asst-refbar {
    background: #14181f; border: 1px solid #262b33; border-left: 2px solid #4d8dff;
    border-radius: 9px; padding: 8px 10px; margin-bottom: 8px;
}
.cv-asst-refbar-h { font-size: 10.5px; color: #79aaff; margin-bottom: 5px; }
.cv-asst-refrow { display: flex; gap: 8px; align-items: baseline; font-size: 11.5px; line-height: 1.75; }
.cv-asst-refrow .pic { flex: 0 0 auto; color: #79aaff; font-family: ui-monospace, Menlo, Consolas, monospace; }
.cv-asst-refrow .val { color: var(--text); }
.cv-asst-cnnote {
    background: #14181f; border: 1px solid #262b33; border-left: 2px solid #4ade80;
    border-radius: 9px; padding: 8px 10px; margin-bottom: 8px;
}
.cv-asst-cnnote-h { font-size: 10.5px; color: #4ade80; margin-bottom: 4px; }

/* ════════════════════════════════════════════════════════════
   ✦ 进入画布 ·「景深推进」入场（2026-10-10 v2）
   只有缩放 + 景深：整页从略近处随模糊收焦点归位，网格做视差缩放往后飞。
   （原「放射光带 + 中心亮闪」已移除 —— 用户反馈光束太丑、毫无高级感。）
   ════════════════════════════════════════════════════════════ */
@keyframes cvWarpIn {
    0%   { transform: scale(1.12); opacity: 0; filter: blur(9px) saturate(.72); }
    38%  { opacity: 1; }
    100% { transform: scale(1); opacity: 1; filter: blur(0) saturate(1); }
}
@keyframes cvWarpInSm {
    0%   { transform: scale(1.07); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes cvWarpGrid {
    0%   { transform: scale(2.35); opacity: 0; }
    28%  { opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes cvWarpTop {
    0%   { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: none; }
}

#cvApp.cv-warp { animation: cvWarpIn .9s cubic-bezier(.2, .9, .28, 1) both; }
#cvApp.cv-warp #cvBg { animation: cvWarpGrid 1.05s cubic-bezier(.2, .9, .28, 1) both; }
#cvApp.cv-warp .cv-top { animation: cvWarpTop .5s .16s ease-out both; }

/* 推进期间把网格点提亮一点 —— 网格在缩放，亮点看起来就是在「往后飞」 */
#cvApp.cv-warp #cvBg {
    background-image: radial-gradient(circle, rgba(130, 175, 255, .3) 1.4px, transparent 1.4px);
}

/* 手机上少一点模糊，省性能 */
@media (max-width: 768px) {
    #cvApp.cv-warp { animation-name: cvWarpInSm; }
}
/* 用户关了动效 → 直接静态进画布 */
@media (prefers-reduced-motion: reduce) {
    #cvApp.cv-warp,
    #cvApp.cv-warp #cvBg,
    #cvApp.cv-warp .cv-top { animation: none !important; }
}

/* ═══ ⑨ 移动端适配（新增功能）═══
   之前所有新功能样式都加在文件末尾的媒体查询之外，会盖掉上面的断点规则：
   实测 ≤430px 时助手面板 470px 宽会把左侧裁掉（360 屏裁掉 128px），
   胶囊还会压住左下角按钮组。这里在文件最后统一覆盖（位置最后=优先级最高）。 */
@media (max-width: 768px) {
    /* 助手面板：中等屏靠右、不超宽 */
    .cv-asst {
        left: auto; right: 12px;
        width: min(520px, calc(100vw - 24px));
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        /* 高度留出上方画布可视区（vh 老浏览器兜底 + dvh 处理移动端地址栏收缩） */
        height: min(66vh, calc(100vh - 120px));
        height: min(66vh, calc(100dvh - 120px));
        border-radius: 14px;
    }
    .cv-asst-msgs { padding: 12px 12px; }
    .cv-asst-ctl { flex-wrap: wrap; row-gap: 6px; }
    .cv-asst-quota { order: 9; flex: 1 0 100%; text-align: right; padding-top: 2px; }
    .cv-asst-card .cv-asst-pre { max-height: 210px; }
    .cv-asst-cnbody { max-height: 180px; }
    .cv-asst-in { max-height: 120px !important; }
    .cv-selmenu { max-height: min(300px, 50vh); }
}

/* 手机（≤480px）：面板全宽、胶囊让位到工具坞上方 */
@media (max-width: 480px) {
    .cv-asst {
        left: 8px; right: 8px; width: auto;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        /* 手机：改成半屏抽屉（≈58%），上方留出画布，不再整屏糊满 */
        height: min(58vh, calc(100vh - 160px));
        height: min(58vh, calc(100dvh - 160px));
        border-radius: 14px;
    }
    .cv-asst-top { padding: 9px 12px; }
    .cv-asst-msgs { padding: 10px 10px; }
    .cv-asst-b { font-size: 12px; max-width: 100%; }
    .cv-asst-pills { max-width: 100%; }
    /* 半屏抽屉下收紧内部块高度，保证消息区仍够看 */
    .cv-asst-card .cv-asst-pre { max-height: 140px; }
    .cv-asst-cnbody { max-height: 120px; }
    .cv-asst-in { max-height: 92px !important; }
    .cv-asst-slist { max-height: 200px; }
    .cv-asst-skillpop { bottom: 78px; }
    .cv-asst-fab {
        right: 8px; bottom: calc(122px + env(safe-area-inset-bottom, 0px));
        padding: 8px 13px; font-size: 12px;
    }
    .cv-asst-fab i { font-size: 13px; }
    /* 小地图上移，给胶囊让位（不隐藏，用户仍可用） */
    .cv-minimap { bottom: calc(176px + env(safe-area-inset-bottom, 0px)); }
    /* 左下角去掉「比例」文字，腾出横向空间（缩放按钮组在右下，不受影响） */
    .cv-zoomval { display: none; }
    /* 节点提示词面板内的下拉/参数在窄屏允许换行 */
    .cv-h3-params { flex-wrap: wrap; row-gap: 6px; }
    .cv-hist-body { grid-auto-rows: 210px; }
    .cv-hid-info { font-size: 11.5px; }
}

/* 竖屏小手机（≤380px）再收一档 */
@media (max-width: 380px) {
    .cv-asst {
        left: 6px; right: 6px; bottom: calc(6px + env(safe-area-inset-bottom, 0px));
        height: min(54vh, calc(100vh - 150px));
        height: min(54vh, calc(100dvh - 150px));
    }
    .cv-asst-fab { padding: 7px 11px; font-size: 11.5px; }
    .cv-asst-cntg, .cv-asst-skbtn { font-size: 10.5px; padding: 4px 8px; }
}

/* 视频画质修复按钮区（clip 节点）：有视频才显示（updateClipNode 同步） */
.cv-vtry { padding: 8px 14px 12px; }
.cv-vtry .cv-vhd-btn[disabled] { opacity: .55; cursor: default; }

/* 产物节点弹出动画（画质修复/超清/视频修复/H3）：缩放+上浮淡入 */
@keyframes cvSpawn {
    from { opacity: 0; scale: .9; translate: 0 14px; }
    to   { opacity: 1; scale: 1;  translate: 0 0; }
}
.cv-node.cv-spawn { animation: cvSpawn .5s cubic-bezier(.22, 1, .36, 1) both; }

/* ═══════════ 通用确认弹窗（cvConfirm） ═══════════ */
.cv-confirm .cv-xgy-box { width: 400px; }
.cv-confirm-m b { color: var(--accent-2); }
.cv-confirm-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.cv-confirm-no, .cv-confirm-yes {
    height: 32px; padding: 0 18px; border-radius: 8px;
    font-size: 13px; font-weight: 700; cursor: pointer;
}
.cv-confirm-no { background: rgba(255,255,255,.07); border: 1px solid var(--line-2); color: var(--text-2); }
.cv-confirm-no:hover { background: rgba(255,255,255,.13); }
.cv-confirm-yes { background: var(--accent); border: 1px solid transparent; color: #fff; }
.cv-confirm-yes:hover { filter: brightness(1.12); }
.cv-confirm-yes:focus-visible, .cv-confirm-no:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ═══════════ 视频画质修复「选档」弹窗（普通修复 / 精修） ═══════════ */
.cv-tier .cv-xgy-box { width: 420px; }
.cv-tier-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cv-tier-opt {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    width: 100%; text-align: left; padding: 12px 14px; border-radius: 10px; cursor: pointer;
    background: rgba(255,255,255,.05); border: 1px solid var(--line-2); color: var(--text);
    transition: background .15s, border-color .15s;
}
.cv-tier-opt b { font-size: 13px; font-weight: 700; }
.cv-tier-opt i { font-style: normal; font-size: 12px; color: var(--text-3); }
.cv-tier-opt:hover { background: rgba(255,255,255,.1); border-color: var(--line-1); }
.cv-tier-opt.is-pro { border-color: var(--accent); }
.cv-tier-opt.is-pro b { color: var(--accent-2); }
.cv-tier-opt.is-pro:hover { background: rgba(255,255,255,.12); }
.cv-tier-opt:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* 视频修复中的「取消」按钮 */
.cv-vhd-cancel { border-color: rgba(248,113,113,.5); color: #f87171; }
/* ★ 必须写：.cv-chip 的 display:inline-flex（作者样式）会盖掉 UA 的 [hidden]{display:none}，
   漏了这条取消按钮就永远显示（2026-10-09 实测：修复完成后 ✕ 取消还挂在节点上） */
.cv-vhd-cancel[hidden] { display: none; }

/* ═══════════ H3 提示词润色（¥0.1/次，官方 Context-IR 结构化）═══════════ */
.cv-h3-pbar { display: flex; align-items: center; gap: 6px; padding: 0 2px 6px; }
.cv-h3-polish { display: inline-flex; align-items: center; gap: 4px; background: #1c2028; border: 1px solid #2a3040;
  color: var(--text); font-size: 11.5px; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.cv-h3-polish:hover:not(:disabled) { background: #262c36; border-color: #3a4252; }
.cv-h3-polish:disabled { opacity: .55; cursor: default; }
.cv-h3-polish i { font-style: normal; color: #8b93a7; font-size: 10.5px; }
/* ★ H3API 生成按钮上的调用单价（后端定价自动取，空字符串时不占位） */
.cv-h3api-run .cv-apiprice { font-style: normal; font-weight: 600; font-size: 11px; color: rgba(255, 255, 255, .82); }
.cv-h3-polspin { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #3a4252;
  border-top-color: #8b93a7; display: inline-block; animation: cv-h3-polspin 0.8s linear infinite; }
@keyframes cv-h3-polspin { to { transform: rotate(360deg); } }
.cv-h3-pswitch { display: inline-flex; align-items: center; background: transparent; border: 1px solid #2a3040;
  color: #8b93a7; font-size: 11.5px; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.cv-h3-pswitch:hover { color: var(--text); border-color: #3a4252; background: #1c2028; }
.cv-h3-ptag { margin-left: auto; font-size: 10.5px; color: #5DCAA5; background: rgba(93,202,165,.12);
  border: 1px solid rgba(93,202,165,.35); border-radius: 999px; padding: 2px 8px; }
.cv-vhd-cancel:hover { background: rgba(248,113,113,.16); border-color: rgba(248,113,113,.8); }

/* ═══════════ AI 助手 · 图片引用（多模态提问）═══════════ */
.cv-asst-imgs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 7px; }
.cv-asst-thumb { position: relative; width: 46px; height: 46px; border-radius: 8px; overflow: hidden;
  background: #171a20; border: 1px solid #2a3040; cursor: pointer; }
.cv-asst-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-asst-thumbx { position: absolute; top: 1px; right: 1px; width: 15px; height: 15px; padding: 0;
  border-radius: 50%; border: none; background: rgba(0,0,0,.65); color: #fff; font-size: 9px; line-height: 15px; cursor: pointer; }
.cv-asst-thumbx:hover { background: #f87171; }
/* 上传/压缩中的占位（★ 不能用 <img src="">，会渲染成浏览器裂图图标） */
.cv-asst-thumbph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: #8b93a7; font-size: 14px; background: #1c2028; animation: cv-asst-pulse 1.1s ease-in-out infinite; }
@keyframes cv-asst-pulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
.cv-asst-thumb.bad { border-color: rgba(248,113,113,.6); background: rgba(248,113,113,.12); }
.cv-asst-thumb.bad::after { content: '!'; position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #f87171; font-size: 16px; font-weight: 700; }
.cv-asst-pick, .cv-asst-up { background: #1c2028; border: none; color: var(--text); font-size: 11.5px;
  padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.cv-asst-pick:hover, .cv-asst-up:hover { background: #262c36; }
.cv-asst-pick.on { background: #4d8dff; color: #fff; }          /* 选图模式激活中 */
.cv-asst-bimgs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cv-asst-bimg { width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
  border: 1px solid #2a3040; cursor: zoom-in; }
.cv-asst-bimg:hover { filter: brightness(1.1); }
.cv-asst-in.dropping { border-color: #4d8dff; background: #1b2230; }
/* 选图模式：画布上鼠标变十字，悬停的节点描蓝边，明确告诉用户「点这个」 */
body.asst-picking .cv-node { cursor: crosshair; }
body.asst-picking .cv-node:hover .cv-card { outline: 2px solid #4d8dff; outline-offset: -2px; border-radius: 10px; }

/* ═══════════════ 长视频（MotionContext 分段续写）═══════════════ */
.cv-node.h3long .cv-card, .cv-node.h3prev .cv-card { padding: 0; }
.cv-node.h3long .cv-panel, .cv-node.h3long .cv-try, .cv-node.h3long .cv-refs,
.cv-node.h3prev .cv-panel, .cv-node.h3prev .cv-try, .cv-node.h3prev .cv-refs { display: none !important; }

/* 标题右侧的「链首 / 链尾」小标 */
.cv-lv-badge {
    margin-left: auto; margin-right: 2px; padding: 2px 8px; border-radius: 999px;
    font-size: 9.5px; font-weight: 800; letter-spacing: .3px; white-space: nowrap;
    color: var(--accent-light); background: rgba(91, 156, 255, .14);
    border: 1px solid rgba(91, 156, 255, .32);
}

/* ★ 第 2 段起：只有「画幅 / 分辨率」收起（.cv-lv-seg1）；参考图 / 音频 / 提示词 / 步数 / 时长都可改 */
.cv-node.h3long.lv-seg2 .cv-lv-seg1 { display: none !important; }
/* 参考图 9 格 —— 跟双采 H3 一样走 3 列 */
.cv-h3-params-lv { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 「参数已锁定」提示条（只有第 2 段起出现） */
.cv-lv-note {
    padding: 6px 9px; border-radius: 8px; text-align: center;
    font-size: 10.5px; font-weight: 700;
    color: #ffb84d; background: rgba(255, 184, 77, .10); border: 1px solid rgba(255, 184, 77, .30);
}
.cv-node.h3long .cv-lv-note { display: none; }
.cv-node.h3long.lv-seg2 .cv-lv-note { display: block; }

/* 「继承第 1 段」的只读摘要（只有第 2 段起出现） */
.cv-lv-inherit {
    display: none; flex-direction: column; gap: 5px;
    padding: 9px 10px; border-radius: 8px;
    border: 1px dashed var(--line-2); background: var(--bg-soft);
    font-size: 11px; line-height: 1.5; color: var(--text-3);
}
.cv-node.h3long.lv-seg2 .cv-lv-inherit { display: flex; }
.cv-lv-inherit b { color: var(--text-2); font-weight: 800; }

/* ── 长视频预览节点：左右两栏各自独立（第 1 段只有一节 → 单栏） ── */
.cv-lvp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 11px 12px 12px; }
.cv-node.h3prev.lv-single .cv-lvp { grid-template-columns: 1fr; }
.cv-lvp-col { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.cv-lvp-col[hidden] { display: none !important; }
.cv-lvp-hd { display: flex; align-items: center; gap: 6px; }
.cv-lvp-tag {
    flex: none; padding: 1px 8px; border-radius: 6px;
    font-size: 9.5px; font-weight: 800; white-space: nowrap;
    color: var(--accent-light); background: rgba(91, 156, 255, .16);
    border: 1px solid rgba(91, 156, 255, .30);
}
.cv-lvp-col[data-side="stitch"] .cv-lvp-tag {
    color: #b9a8ff; background: rgba(124, 107, 255, .16); border-color: rgba(124, 107, 255, .32);
}
.cv-lvp-sub { font-size: 10px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-lvp-stage { position: relative; border-radius: 9px; overflow: hidden; }
.cv-lvp-stage video { width: 100%; display: block; max-height: 300px; background: #000; border-radius: 9px; }
.cv-lvp-stage video[hidden] { display: none; }
.cv-lvp-ph {
    min-height: 132px; border: 1px dashed var(--line-2); border-radius: 9px; background: var(--bg-soft);
    display: flex; align-items: center; justify-content: center; padding: 10px 12px;
    font-size: 11px; color: var(--text-3); text-align: center; line-height: 1.45;
}
.cv-lvp-ph[hidden] { display: none; }
.cv-lvp-ph.err { color: #ff6b6b; border-color: rgba(255, 107, 107, .42); }
/* 左栏「本段原始视频」下面的视频修复（只修左边这节，不碰衔接视频） */
.cv-lvp-try { display: flex; align-items: center; gap: 7px; }
.cv-lvp-fixstat { font-size: 10.5px; color: var(--text-3); }
.cv-lvp-fixstat[hidden] { display: none; }
/* ★ 明确「只修左边这段、不生成衔接」——避免用户以为修完会自动并回衔接视频 */
.cv-lvp-fixhint {
    font-size: 10px; line-height: 1.5; color: var(--text-3);
    padding: 6px 8px; border-radius: 7px;
    background: rgba(255, 184, 77, .07); border: 1px dashed rgba(255, 184, 77, .28);
}
.cv-lvp-fixhint b { color: #ffb84d; font-weight: 800; }
.cv-lvp-fixhint[hidden] { display: none; }

/* ═══════════ 画布任务队列（点顶栏「任务」展开）2026-10-11 ═══════════ */
.cv-tq {
    display: flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: var(--panel);
    color: var(--text-2);
    font-size: 12px; font-weight: 600;
    transition: border-color .18s, color .18s, background .18s;
}
.cv-tq:hover { border-color: var(--accent); color: var(--text); background: var(--panel-hi); }
.cv-tq svg { color: var(--text-3); transition: color .18s; }
.cv-tq-n {
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px;
    background: rgba(255,255,255,.10); color: var(--text-2);
    font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center;
    font-variant-numeric: tabular-nums;
}
.cv-tq.on { border-color: rgba(91,156,255,.55); color: var(--text); background: rgba(59,130,246,.14); }
.cv-tq.on svg { color: var(--accent-2); }
.cv-tq.on .cv-tq-n { background: var(--accent); color: #fff; }
/* ★ 有「未认领/卡住」的幽灵任务 → 整颗胶囊变红脉冲，用户一眼看见「有任务挂着」 */
.cv-tq.warn { border-color: rgba(239,68,68,.6); background: rgba(239,68,68,.16); color: #ffd9d9; }
.cv-tq.warn svg { color: #ff7b7b; }
.cv-tq.warn .cv-tq-n { background: var(--danger); color: #fff; }
.cv-tq.warn { animation: cvTqPulse 1.6s ease-in-out infinite; }
@keyframes cvTqPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.42); }
    50%      { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

.cv-tq-panel {
    position: absolute; top: 54px; right: 12px; z-index: 60;
    width: 348px; max-width: calc(100vw - 24px);
    background: #17181c;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.cv-tq-panel[hidden] { display: none; }
.cv-tq-head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 10px 9px 13px;
    border-bottom: 1px solid var(--line);
}
.cv-tq-title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.cv-tq-sub { flex: 1; min-width: 0; font-size: 11px; color: var(--text-3); text-align: right;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-tq-icobtn {
    width: 24px; height: 24px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 7px; color: var(--text-3); font-size: 13px; line-height: 1;
    transition: background .15s, color .15s;
}
.cv-tq-icobtn:hover { background: rgba(255,255,255,.08); color: var(--text); }
.cv-tq-icobtn.spin svg { animation: cvspin .8s linear infinite; }

.cv-tq-body { max-height: min(58vh, 460px); overflow-y: auto; padding: 8px; }
.cv-tq-body::-webkit-scrollbar { width: 8px; }
.cv-tq-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.cv-tq-row {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 9px; border-radius: 9px;
    border: 1px solid transparent;
    cursor: default;
}
.cv-tq-row + .cv-tq-row { margin-top: 4px; }
.cv-tq-row.click { cursor: pointer; }
.cv-tq-row.click:hover { background: var(--panel-hi); border-color: var(--line); }
.cv-tq-idx {
    width: 18px; flex: none; text-align: center;
    font-size: 11px; font-weight: 700; color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.cv-tq-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--text-3); }
.cv-tq-row.run .cv-tq-dot { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(91,156,255,.18); animation: cvTqBlink 1.4s ease-in-out infinite; }
.cv-tq-row.queue .cv-tq-dot { background: #eab308; }
.cv-tq-row.warn .cv-tq-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.cv-tq-row.done .cv-tq-dot { background: var(--text-3); }
@keyframes cvTqBlink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.cv-tq-main { flex: 1; min-width: 0; }
.cv-tq-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-tq-row.warn .cv-tq-name { color: #ff9b9b; }
.cv-tq-meta { margin-top: 2px; font-size: 10.5px; color: var(--text-3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.cv-tq-badge {
    flex: none; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px;
    background: rgba(255,255,255,.08); color: var(--text-3);
}
.cv-tq-row.run  .cv-tq-badge { background: rgba(91,156,255,.16); color: var(--accent-2); }
.cv-tq-row.queue .cv-tq-badge { background: rgba(234,179,8,.16); color: #eab308; }
.cv-tq-row.warn .cv-tq-badge { background: rgba(239,68,68,.18); color: #ff8a8a; }
.cv-tq-act {
    flex: none; height: 24px; padding: 0 9px;
    border-radius: 7px; border: 1px solid var(--line-2);
    background: var(--card-hi, #2a2a2a); color: var(--text-2);
    font-size: 11px; font-weight: 600;
    transition: background .15s, color .15s, border-color .15s;
}
.cv-tq-act:hover { color: var(--text); background: #3a3a3a; }
.cv-tq-act.danger { border-color: rgba(239,68,68,.4); color: #ff8a8a; }
.cv-tq-act.danger:hover { background: rgba(239,68,68,.2); color: #fff; border-color: rgba(239,68,68,.7); }
.cv-tq-empty { padding: 22px 14px; text-align: center; color: var(--text-3); font-size: 12px; line-height: 1.6; }
.cv-tq-foot {
    padding: 8px 12px; border-top: 1px solid var(--line);
    font-size: 11px; color: var(--text-3); line-height: 1.5;
}
.cv-tq-foot[hidden] { display: none; }
.cv-tq-foot b { color: #ff8a8a; font-weight: 700; }

/* 点任务行 → 高亮对应节点（配合 asstRevealNode 平移过去） */
.cv-node.cv-tq-flash > .cv-card { box-shadow: 0 0 0 2px var(--accent-2), 0 0 26px rgba(91,156,255,.5) !important; }

@media (max-width: 760px) {
    .cv-tq span { display: none; }          /* 手机窄屏：只留图标 + 数字 */
    .cv-tq { padding: 0 8px; }
    .cv-tq-panel { right: 8px; left: 8px; width: auto; }
}

/* ═══ ⑩ 聊天记录（助手左栏）· 2026-10-14 ═══
   用户要求：像「任务列表」一样把历史会话列出来、随时接着聊；标题栏点 🕘 展开，
   开着就一直显示（除非自己点收起）。面板由「单列」改成「两列」：
   左 = .cv-asst-hist（记录）/ 右 = .cv-asst-main（聊天，承接原来的全部子块）。
   展开时面板整体加宽 236px → 聊天区宽度不变；窄屏放不下 → 记录栏改成盖住整块的列表视图。 */
/* ★ 让聊天区自成一个合成层：左栏展开时**它的宽度全程不变**（已验证 659→659），
   独立成层后动画期间就不必跟着重绘它内部那一大堆气泡 —— 只有面板外框在变。 */
.cv-asst-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
  position: relative; overflow: hidden; will-change: transform; transform: translateZ(0); }
/* ★★ 2026-10-14 过渡重做（用户反馈「开启很卡顿、很生硬」）：
   原来是 display:none ↔ flex 切换 —— **display 根本无法过渡**，所以是「啪」地跳出来。
   现在改成「宽度 0 ↔ 236 + 左移淡入」，并且：
     · 面板宽度与左栏**同时长**（同一条曲线）→ .cv-asst-main 的宽度**全程不变** → 聊天区不重排；
     · 只有 transform / opacity / 宽度外框在动，走合成层，不逐帧重排内部 DOM；
     · 收起时内容不会瞬间消失（不再是「列表先没了、面板还在慢慢收」那种怪观感）。
   内层 .cv-asst-hist-in 固定 236px 宽 —— 外壳在 0↔236 之间裁切时，列表内容不会被挤变形。
   ★ 曲线用 cubic-bezier(.4,0,.2,1)（Material 标准「加速-减速」）：运动摊在整个 0.34s 里。
     之前用的 (.22,1,.36,1) 是**极度前置**的曲线 —— 前 20% 就走完 80% 的路，观感是
     「啪一下到位、然后半天没动静」，这正是用户说的「生硬」（实测慢放才看出来）。 */
.cv-asst-hist {
  flex: 0 0 0; width: 0; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start;
  position: relative; z-index: 2;
  opacity: 0; transform: translateX(-18px); visibility: hidden; pointer-events: none;
  contain: layout paint;
  transition: flex-basis .34s cubic-bezier(.4,0,.2,1), width .34s cubic-bezier(.4,0,.2,1),
              opacity .24s ease, transform .34s cubic-bezier(.4,0,.2,1), visibility 0s .34s;
}
.cv-asst-hist-in {
  width: 236px; flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.07);
  background: rgba(11,13,17,.5);
}
.cv-asst.hist-open .cv-asst-hist {
  flex-basis: 236px; width: 236px;
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: flex-basis .34s cubic-bezier(.4,0,.2,1), width .34s cubic-bezier(.4,0,.2,1),
              opacity .24s ease, transform .34s cubic-bezier(.4,0,.2,1), visibility 0s 0s;
}
/* ★★ 2026-10-29 修「收起助手后画布出现隐形事件带」（用户：鼠标变手型、滑不动、滚不动、
   鼠标下没有任何节点；一用助手就高频出现）：
   CSS 里**子元素可以覆盖父级**的 pointer-events:none / visibility:hidden ——
   上面这条（hist-open 时 visibility:visible; pointer-events:auto）和
   .cv-asst-send{pointer-events:auto} 都会在面板**收起**（opacity:0 看不见）后，
   仍然把历史栏（236px 宽、贴画布右侧）变成一条隐形命中带，吞掉点击和滚轮
   （滚轮还被助手根节点 wheel→stopPropagation 拦截 → 画布完全没反应）。
   面板收起时统一锁死所有子元素的命中；视觉淡出过渡不受影响。 */
.cv-asst:not(.on),
.cv-asst:not(.on) * { pointer-events: none !important; }
/* 展开时整体加宽（同曲线同步长出去） */
.cv-asst.hist-open { width: calc(var(--cv-asst-w, 660px) + 236px); }
/* ★ 动画的那 ~0.5 秒临时关掉毛玻璃（由 JS 加/去 .hist-anim）——
   宽度在变时毛玻璃每帧都要重算，是「卡顿」的主因；底色 90% 不透明，这点差别看不出来。 */
.cv-asst.hist-anim {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  /* 同理：-14px/44px 的大投影每帧都要重算（实测约 +8ms/帧），动画期间换成更轻的一版。
     0.5 秒内影子只是略收紧一点，正常看几乎察觉不到。 */
  box-shadow: -10px 0 22px rgba(0, 0, 0, .5); }

.cv-asst-hist-hd { display: flex; align-items: center; gap: 2px; padding: 10px 8px 8px 12px; }
.cv-asst-hist-t { font-size: 12.5px; color: var(--text-2); margin-right: auto; letter-spacing: .4px; }
.cv-asst-hist-new, .cv-asst-hist-x { background: none; border: none; color: var(--text-3); cursor: pointer;
  padding: 3px 5px; border-radius: 7px; display: inline-flex; }
.cv-asst-hist-new:hover, .cv-asst-hist-x:hover { color: #79aaff; background: rgba(77,141,255,.13); }

.cv-asst-hist-sb { display: flex; align-items: center; gap: 6px; margin: 0 10px 9px; padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.085); border-radius: 9px; background: rgba(255,255,255,.035);
  transition: border-color .16s ease, background .16s ease; }
.cv-asst-hist-sb:focus-within { border-color: rgba(77,141,255,.5); background: rgba(77,141,255,.07); }
.cv-asst-hist-si { color: var(--text-3); flex: none; }
.cv-asst-hist-q { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text);
  font-size: 12px; font-family: inherit; padding: 0; }
.cv-asst-hist-q::placeholder { color: #5b6472; }
.cv-asst-hist-clr { background: none; border: none; color: var(--text-3); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 2px; }
.cv-asst-hist-clr:hover { color: var(--text); }

.cv-asst-hist-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 6px 10px; }
.cv-asst-hist-list::-webkit-scrollbar { width: 6px; }
.cv-asst-hist-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }
.cv-asst-hist-empty { display: flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--text-3); font-size: 11.5px; padding: 28px 10px; text-align: center; }

.cv-asst-hi { display: flex; align-items: center; gap: 3px; padding: 7px 5px 7px 9px; border-radius: 9px;
  cursor: pointer; border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease; }
.cv-asst-hi:hover { background: rgba(255,255,255,.055); }
.cv-asst-hi.cur { background: rgba(77,141,255,.13); border-color: rgba(77,141,255,.32); }
.cv-asst-hi-b { flex: 1; min-width: 0; }
.cv-asst-hi-t { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-asst-hi-m { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
/* 行内操作：默认半透明常显（用户不喜欢藏起来的东西），悬停 / 当前行才全亮 */
.cv-asst-hi-a { display: inline-flex; gap: 1px; flex: none; opacity: .5; transition: opacity .15s ease; }
.cv-asst-hi:hover .cv-asst-hi-a, .cv-asst-hi.cur .cv-asst-hi-a { opacity: 1; }
.cv-asst-hi-a button { background: none; border: none; color: var(--text-3); cursor: pointer;
  padding: 3px; border-radius: 6px; display: inline-flex; }
.cv-asst-hi-rn:hover { color: #79aaff; background: rgba(77,141,255,.16); }
.cv-asst-hi-del:hover { color: #ff8080; background: rgba(255,90,90,.15); }
.cv-asst-hi-edit { width: 100%; background: rgba(0,0,0,.35); border: 1px solid rgba(77,141,255,.5);
  border-radius: 6px; color: var(--text); font-size: 12px; font-family: inherit; padding: 2px 5px; outline: none; }

/* 窄屏（≤768）：面板放不下两列 → 记录栏改成「盖住整块面板」的列表视图（同样用位移+淡入过渡） */
@media (max-width: 768px) {
    .cv-asst.hist-open { width: min(520px, calc(100vw - 24px)); }
    .cv-asst-hist, .cv-asst.hist-open .cv-asst-hist {
        position: absolute; inset: 0; width: auto; flex: none; align-items: stretch;
        z-index: 6; contain: none; transform: translateX(-14px);
        border-right: none; background: rgba(11,13,17,.965); backdrop-filter: blur(8px); }
    .cv-asst.hist-open .cv-asst-hist { transform: none; }
    .cv-asst-hist-in { width: auto; flex: 1 1 auto; border-right: none; background: none; }
}
@media (max-width: 480px) {
    .cv-asst.hist-open { width: auto; }
}

/* ═══════════ ⑫ 顶栏画布标签：别再「硬切」名字（2026-10-14）═══════════
   现象：手机上标签显示成「长视频演」—— 少了最后一个字、且**没有省略号**，看着像坏了。
   真因：`.cv-tab` 是 flex 容器，空间不够时它被 flex 压扁（默认 shrink:1），
        而里面的 `span` 是 flex 子项、默认 `min-width:auto` **不允许收缩到文字宽度以下** →
        `text-overflow:ellipsis` 永远没有机会生效，超出部分直接被 `.cv-tabs{overflow:hidden}` 硬裁掉。
   修法：① 标签自己**不压缩**（`flex:0 0 auto`，保持自身宽度，最长仍受 `max-width:190px` 约束）；
        ② `.cv-tabs` 负责「放不下就横向滑动」；③ 给 span 补 `min-width:0`，
           这样名字长到超过 190px 时会正常显示成「很长很长的名…」而不是被切一半。 */
.cv-top-l { min-width: 0; }
.cv-tabs { min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.cv-tabs::-webkit-scrollbar { display: none; }
.cv-tab { flex: 0 0 auto; }
.cv-tab span { min-width: 0; }

/* ═══════════ ⑬ 手机顶栏：画布标签不再被「切一半」（2026-10-14）═══════════
   390 宽实测：顶栏左侧「logo + 标签 + 新建 + 已保存」和右侧「仙宫云 + 任务 + 头像」
   加起来把标签挤到只剩 ~50px，而标签自身宽约 102px（< max-width:190 不触发压缩）
   → 于是被 `.cv-tabs` 直接裁掉最后几个字，看起来像「坏了」。两个动作：
     ① 标签允许收缩 + 文字出省略号（点击标签本来就会弹出画布列表，全名看得到）；
     ② 「仙宫云」在手机上只留图标 + 状态点（文字在面板里有），把宽度让给画布名。 */
@media (max-width: 768px) {
    /* tabs 必须「吃掉剩余空间」（flex:1）—— 否则它自己也被压到几十像素，
       标签再怎么样也只能显示「长…」。 */
    .cv-tabs { flex: 1 1 auto; min-width: 0; overflow: hidden; }
    /* 名字优先：手机上收掉标签前的小图标、字号微调、内边距收窄 → 同样宽度能多显示 2~3 个字 */
    .cv-tab { flex: 0 1 auto; min-width: 0; max-width: 160px; font-size: 11.5px; padding: 0 6px; gap: 4px; }
    .cv-tab > svg { display: none; }
    .cv-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .cv-xgy-entry span { display: none; }
    .cv-xgy-entry { padding: 0 9px; }
}

/* ═══════════ ⑭ 图片节点 · 透明底开关（2026-10-14）═══════════
   位置：图片节点底栏「模型 · 比例 · 分辨率 · 张数」之后，紧跟张数。
   显示规则：只有 models.json 里标了 transparent:true 的模型才显示
             （GPT-image-2.5 Plus / Pro 2K / Pro 4K），其余模型走 button[hidden] 自动隐藏。
   视觉：未开 = 灰色小胶囊 + 灰点；已开 = 绿色高亮 + 发光圆点，扫一眼就知道状态。 */
.cv-trans {
    flex: none;
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .03);
    color: var(--text-3);
    font-size: 10.5px; line-height: 1; font-family: inherit;
    cursor: pointer; white-space: nowrap;
    transition: color .16s, border-color .16s, background .16s;
}
.cv-trans[hidden] { display: none; }   /* ★ 必须写：上面的 display:inline-flex 会盖掉 HTML 的 hidden 属性 */
.cv-trans::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: rgba(255, 255, 255, .18); flex: none;
    transition: background .16s, box-shadow .16s;
}
.cv-trans:hover { color: var(--text); border-color: rgba(255, 255, 255, .26); }
.cv-trans.on {
    color: #7fe3c8;
    border-color: rgba(0, 184, 148, .6);
    background: rgba(0, 184, 148, .14);
}
.cv-trans.on::before { background: #00d6a3; box-shadow: 0 0 6px rgba(0, 214, 163, .8); }

/* ═══════════ ⑮ 参考图「上传中」占位（2026-10-14）═══════════
   点「参考」选完文件后，格子里**立刻**出现一个转圈占位（与正常缩略图同为 42×42，
   虚线边框区分），传完逐个变成缩略图 —— 用户一眼就知道"点到了、正在传"，
   不会像以前那样等半天一片空白、怀疑没点中。 */
.cv-ref-busy {
    display: grid; place-items: center;
    /* ★ 必须显式写尺寸 + flex:none —— 它是空内容格子，flex 容器会把它压成 4×4（实测踩过） */
    width: 42px; height: 42px; flex: none;
    background: rgba(120, 170, 255, .07);
    border: 1px dashed rgba(120, 190, 255, .38);
}
.cv-spin {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid rgba(120, 170, 255, .22);
    border-top-color: #5b9cff;
    animation: cvspin .8s linear infinite;
}

/* ═══════════ ⑪ 手机 / 平板 · 触摸体验加固（2026-10-14）═══════════
   三个真实问题（只调「显示 + 命中区」，不动任何功能逻辑；都靠源序在后覆盖）：
     ① **769~1024 整档没有断点** —— iPad Air/Pro 竖屏是 810/820/834，全落在所有
        @media 之外，只能吃桌面样式：历史面板固定 700px 会**压住小地图**（重叠约 80px），
        AI 助手仍按 660px 抽屉展开、占掉 80% 屏。
     ② **顶栏 / 底栏贴边浮层没做安全区** —— canvas.html 用了 viewport-fit=cover，
        平板的屏幕圆角与 Home 指示条会切到左下 / 右下按钮。
     ③ **触摸目标普遍偏小** —— 任务入口 26px、H3 润色 24px、工具按钮 28~30px、
        各种 ✕ 只有 15~18px，手机上容易点空、误删。
   桌面（>1024）与鼠标设备不受影响；env() 在桌面恒为 0，行为与原来完全一致。 */

/* ① 平板竖屏 / 小尺寸平板：给历史面板让出小地图那一侧的空间，助手抽屉按视口收敛 */
@media (min-width: 769px) and (max-width: 1024px) {
    .cv-hist { width: min(660px, calc(100vw - 236px)); }
    .cv-asst { width: min(660px, 72vw); }
    .cv-asst.hist-open { width: min(896px, calc(100vw - 32px)); }
    .cv-tq-panel { width: min(420px, calc(100vw - 32px)); }
    /* ★ 助手入口胶囊：按钮放大到 40px 后工具坞变宽，820 这类宽度下原来 right:124px 的
       胶囊会**压在工具坞右侧按钮上**（实测重叠）。这里把它挪到右下角、工具坞之上。 */
    .cv-asst-fab { right: 14px; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
    /* 画布标签多时可横向滑动（原来只有 ≤768 才有，平板看不到被裁的标签） */
    .cv-tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
    .cv-tabs::-webkit-scrollbar { display: none; }
}

/* ② 安全区（只作用于 769+，≤768 那套已在上面自带 safe-area，别互相覆盖） */
@media (min-width: 769px) {
    .cv-dock { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    .cv-bl, .cv-br { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
    .cv-bl { left: calc(14px + env(safe-area-inset-left, 0px)); }
    .cv-br { right: calc(14px + env(safe-area-inset-right, 0px)); }
    .cv-top { height: calc(48px + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); }
    /* 顶栏变高后，挂在它下面的两个面板跟着下移，否则会盖住顶栏 */
    .cv-asst { top: calc(48px + env(safe-area-inset-top, 0px)); }
    .cv-tq-panel { top: calc(54px + env(safe-area-inset-top, 0px)); }
}

/* ③ 触摸目标：手机 / 平板（≤1024）统一提到好按的尺寸；桌面保持不变 */
@media (max-width: 1024px) {
    /* 任务队列：入口胶囊 + 面板里的刷新/关闭/重试/停止 */
    .cv-tq { height: 40px; padding: 0 13px; }
    .cv-tq-icobtn { width: 40px; height: 40px; }
    .cv-tq-act { height: 38px; padding: 0 15px; }
    /* H3 节点「✨润色」（付费入口，原先只有 24px 高） */
    .cv-h3-polish { min-height: 40px; padding: 8px 14px; }
    /* 画布工具坞 + 顶栏/左右下角图标按钮 */
    .cv-dock-btn { width: 40px; height: 40px; }
    .cv-dock-btn svg { width: 18px; height: 18px; }
    .cv-icobtn { width: 40px; height: 40px; }
    .cv-icobtn svg { width: 17px; height: 17px; }
    /* 助手：入口胶囊 + 面板标题栏/记录栏的按钮 */
    .cv-asst-fab { padding: 12px 18px; }
    .cv-asst-hbtn, .cv-asst-wbtn, .cv-asst-new, .cv-asst-x { min-width: 40px; min-height: 40px; }
    .cv-asst-hist-new, .cv-asst-hist-x { min-width: 40px; min-height: 40px; }
    .cv-asst-hist-hd { padding: 6px 8px 6px 12px; }
    /* 小 ✕（删参考图 / 删缩略图 / 关画布标签 / 移除 H3 引用）：
       视觉放大到 26px，并用不可见的 ::after 把真实命中区补到 40×40 */
    .cv-ref-x, .cv-asst-thumbx { width: 26px; height: 26px; position: relative; }
    .cv-ref-x::after, .cv-asst-thumbx::after,
    .cv-h3-x::after, .cv-tab .cv-tab-x::after {
        content: ''; position: absolute; left: 50%; top: 50%;
        transform: translate(-50%, -50%); width: 40px; height: 40px;
    }
    .cv-h3-x, .cv-tab .cv-tab-x { position: relative; }
    /* 节点序号 / 链首链尾标 / 任务角标：9.5~10px → 11px，手机上才看得清 */
    .cv-h3-num, .cv-lv-badge, .cv-lvp-tag, .cv-tq-badge { font-size: 11px; }
}

/* ══════════ 视频反推 H3（¥2/次）· 结果卡片 ══════════ */
.cv-h3v-prog { font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.cv-h3v-prog.err { color: #ff6b6b; }
.cv-h3v-card { display: block; }
.cv-h3v-hd { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cv-h3v-hd b { font-size: 13px; color: var(--text); }
.cv-h3v-hd span { font-size: 11.5px; color: var(--text-3); }
.cv-h3v-sum { font-size: 12.5px; line-height: 1.65; color: var(--text-2); margin-bottom: 10px; }
.cv-h3v-acts { display: flex; gap: 6px; margin-bottom: 12px; }
.cv-h3v-sec { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--text-3); margin: 12px 0 7px; }
.cv-h3v-seg { display: block;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; background: var(--panel); }
/* ★ 提示词直接摆在卡片里（不再只有一个「建 H3 节点」按钮）：默认 4 行，可展开看全文 */
.cv-h3v-segp { position: relative; margin: 6px 0 0; }
.cv-h3v-segp pre { margin: 0; max-height: 84px; overflow: hidden; white-space: pre-wrap; word-break: break-word;
  font: 11.5px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text-2);
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 7px; padding: 7px 8px;
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.cv-h3v-segp.open pre { max-height: 420px; overflow: auto; -webkit-mask-image: none; mask-image: none; }
.cv-h3v-more { margin-top: 5px; font-size: 11px !important; padding: 3px 8px !important; }
.cv-h3v-sega { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
/* ★ 本段参考图对照条（2026-10-20）：这段要用哪几张图、连到第几格，一眼可见 */
.cv-h3v-segref { margin: 7px 0 0; padding: 6px 7px; border: 1px dashed var(--line); border-radius: 8px;
  background: rgba(120,170,255,.05); }
.cv-h3v-segref > b { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-3); margin-bottom: 5px; }
.cv-h3v-segref-i { display: inline-flex; align-items: center; gap: 6px; margin: 2px 8px 2px 0;
  padding: 3px 8px 3px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  max-width: 100%; }
.cv-h3v-segref-i img { width: 42px; height: 30px; object-fit: cover; border-radius: 5px; cursor: zoom-in; display: block; background: #0d1119; }
.cv-h3v-segref-i em { font-style: normal; font-size: 10px; color: var(--text-3); width: 42px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; background: rgba(255,255,255,.05); }
.cv-h3v-segref-i i { font-style: normal; font-size: 10.5px; color: #8fb6ff; font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }
.cv-h3v-segref-i i b { color: var(--text-2); font-weight: 700; }
.cv-h3v-segref-i u { text-decoration: none; font-size: 10.5px; color: var(--text-3);
  max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-h3v-segref-i.miss { opacity: .65; }
.cv-h3v-legacy pre { margin: 0; max-height: 300px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  font: 11.5px/1.6 ui-monospace, Consolas, monospace; color: var(--text-2); }
.cv-h3v-segt { font-size: 12px; color: var(--text-2); line-height: 1.5; min-width: 0; }
.cv-h3v-segt b { color: var(--text); font-weight: 600; }
.cv-h3v-segt i { font-style: normal; color: var(--text-3); font-size: 11px; }
.cv-h3v-refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.cv-h3v-ref { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
/* ★ 左上角固定「参考图 N」角标 —— 与提示词里的 <Picture N> 同号，用户一眼对上 */
.cv-h3v-refno { position: absolute; top: 6px; left: 6px; z-index: 2; font-size: 10.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; background: rgba(10,14,22,.82); color: #cfe0ff;
  border: 1px solid rgba(120,170,255,.45); backdrop-filter: blur(4px); }
.cv-h3v-reftag { margin-top: 3px; font-size: 10.5px; color: #8fb6ff; font-family: ui-monospace, Consolas, monospace; }
.cv-h3v-ref img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #0d1119; cursor: zoom-in; }
.cv-h3v-refm { padding: 6px 7px; font-size: 11px; color: var(--text-3); line-height: 1.45; }
.cv-h3v-refm b { display: block; color: var(--text-2); font-size: 11.5px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-h3v-refa { display: flex; gap: 5px; padding: 0 7px 7px; }
.cv-h3v-card button { font-size: 11.5px; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.cv-h3v-card button:hover { border-color: var(--accent); color: var(--text); }
.cv-h3v-pickbtn { margin-top: 8px; padding: 6px 14px; border-radius: 9px;
  border: 1px solid var(--accent); background: rgba(76,141,255,.14); color: #cfe0ff;
  font-size: 12.5px; cursor: pointer; }
.cv-h3v-pickbtn:hover { background: rgba(76,141,255,.24); }
.cv-h3v-err { color: #ff6b6b; }

/* ★ 2026-10-20：视频「后台缓存」进度角标（见 canvas.js prefetchResultVideo）
   出片后整段预加载，右上角显示 缓冲中… / 缓存 62% / 已缓存，让用户看得见进度。 */
.cv-vid-buf {
  position: absolute; top: 8px; right: 8px; z-index: 7;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; line-height: 18px; letter-spacing: .2px;
  color: #cfe3ff; background: rgba(10,14,22,.72);
  border: 1px solid rgba(120,170,255,.28);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  pointer-events: none; user-select: none;
  transition: opacity .45s ease, color .3s ease, border-color .3s ease;
}
.cv-vid-buf.done { color: #9fe6b0; border-color: rgba(90,220,140,.38); }
.cv-vid-buf.fade { opacity: 0; }

/* ★ 2026-10-20（B 方案）：视频反推「每批读到了什么」卡片
   后端每批识别完推 batch_done，前端在思考块里插一张可折叠卡片；
   默认只露 3~4 行（底部渐隐），点「展开」看完整笔记。 */
.cv-h3v-bnotes { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 2px; flex: 0 0 100%; }
.cv-h3v-bnote { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.03); padding: 6px 8px; }
.cv-h3v-bnote-h { display: flex; align-items: baseline; gap: 8px; font-size: 11px; color: var(--text-3); }
.cv-h3v-bnote-h b { color: var(--text-2); font-weight: 600; }
.cv-h3v-bnote-h i { font-style: normal; color: var(--text-3); }
.cv-h3v-bnote-x { margin-left: auto; cursor: pointer; color: var(--accent); font-size: 11px; user-select: none; }
.cv-h3v-bnote pre {
  margin: 4px 0 0; max-height: 62px; overflow: hidden; white-space: pre-wrap; word-break: break-word;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text-2);
  -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent);
}
.cv-h3v-bnote.open pre { max-height: 340px; overflow: auto;
  -webkit-mask-image: none; mask-image: none; }

/* ★ 2026-10-20：分段标题里直接写「本段 N 秒」，用户不用自己减 */
.cv-h3v-segt .cv-h3v-segdur {
  color: #9fe6b0; font-weight: 600; font-size: 11px;
  margin-left: 4px; padding: 0 6px; border-radius: 6px;
  background: rgba(90, 220, 140, .10); border: 1px solid rgba(90, 220, 140, .22);
}

/* ★ 2026-10-20：润色小气泡（浮在节点右上角，随节点拖动；见 canvas.js h3PolishBadgeSync） */
/* ★ 2026-10-20 改版：视觉完全对齐 AI 助手的思考框（.cv-asst-reason 同款），
   位置保持在节点左侧（用户指定）。思考区不再用等宽字体/黑底，就是助手那套灰蓝。 */
.cv-h3-pbubble {
  position: absolute; top: 34%; right: calc(100% + 14px); z-index: 30;
  width: 290px; max-width: 40vw;
  display: flex; flex-direction: column; gap: 7px;
  padding: 9px 11px; border-radius: 6px;
  color: #8f9bb0; font-size: 12px; line-height: 1.65;
  background: rgba(122, 148, 196, .08); border-left: 2px solid rgba(122, 148, 196, .3);
  pointer-events: none; user-select: none;
}
.cv-h3-pbubble-h { display: flex; align-items: center; gap: 0; color: #aeb9cf; }
.cv-h3-pbubble-spin { position: relative; flex: none; margin: 0 7px;
  width: 5px; height: 5px; border: none; border-radius: 50%; background: #6aa2ff;
  animation: cvAsstDot 1.08s ease-in-out infinite; }
.cv-h3-pbubble-spin::before, .cv-h3-pbubble-spin::after {
  content: ''; position: absolute; top: 0; width: 5px; height: 5px; border-radius: 50%; background: #6aa2ff; }
.cv-h3-pbubble-spin::before { left: -7px; animation: cvAsstDot 1.08s ease-in-out infinite .16s; }
.cv-h3-pbubble-spin::after  { left: 7px;  animation: cvAsstDot 1.08s ease-in-out infinite .32s; }
/* ★ 2026-10-20 用户要求：纯预览，不给滚动条 —— 永远自动滚到最新，只看不摸 */
.cv-h3-pbubble-r {
  margin: 0; max-height: 210px; overflow: hidden; white-space: pre-wrap; word-break: break-word;
  color: #8f9bb0; font-size: 12px; line-height: 1.65;
}
.cv-h3-pbubble-spin {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid rgba(120, 170, 255, .25); border-top-color: #7fa8ff;
  animation: cvSpin 0.9s linear infinite;
}
@keyframes cvSpin { to { transform: rotate(360deg); } }

/* ★ 2026-10-22 渲染性能：视口外的节点挂起绘制（DOM/尺寸保留，滑回即恢复）
   缩到全局视野（<50%）时不加这个类 —— 那时要能看见全部节点。 */
.cv-node.cv-cull { content-visibility: hidden; }


/* ═══ 2026-10-25 Qwen 图像编辑节点 ═══
   ★ 骨架直接复用图片节点（.cv-card / .cv-media / .cv-try / .cv-panel / .cv-bar），
     这里只补它自己的几个部件（遮罩层、对比层、优化提示词条、运行按钮）。
     皮肤 / 圆角 / 阴影 / 间距全部继承，永远跟图片节点一致 —— 不用再单独「适配」。 */
/* ★★ [hidden] 必须真的藏起来：节点内的图片层 / chips / 对比层都写了 display:flex|block，
   属性选择器优先级低于类选择器 → 不加这句，JS 里 .hidden = true 完全无效
   （2026-10-25 用户报「点了清除遮罩，图上的遮罩还在」就是这个原因）。 */
.cv-node.qwen [hidden] { display: none !important; }

.cv-node.qwen .cv-media { position: relative; }
.cv-node.qwen .cv-qw-orig,
.cv-node.qwen .cv-qw-mp,
.cv-node.qwen .cv-qw-res {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; display: block;
  -webkit-user-drag: none; user-select: none;
}
.cv-node.qwen .cv-qw-orig { cursor: default; }
.cv-node.qwen .cv-qw-mp,
.cv-node.qwen .cv-qw-res { pointer-events: none; }
.cv-node.qwen .cv-qw-res { z-index: 2; }
.cv-node.qwen .cv-qw-mp { opacity: .55; }

.cv-node.qwen .cv-media.cv-qw-empty::after {
  content: '文生图节点：在下面写画面内容，点右下角运行';
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--text-3); font-size: 12.5px;
}

.cv-node.qwen .cv-qw-hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  padding: 3px 10px; border-radius: 999px; z-index: 3;
  background: rgba(0,0,0,.45); color: #fff; font-size: 11px;
  pointer-events: none; white-space: nowrap;
  opacity: 0; transition: opacity .15s ease;       /* 平时不挡图，鼠标进来才提示 */
}
.cv-node.qwen .cv-media:hover .cv-qw-hint { opacity: 1; }

/* 对比层 */
.cv-node.qwen .cv-qw-cmp { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.cv-node.qwen .cv-qw-cmp-badge {
  position: absolute; top: 10px; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; background: rgba(0,0,0,.5); color: #fff;
}
.cv-node.qwen .cv-qw-badge-l { left: 10px; }
.cv-node.qwen .cv-qw-badge-r { right: 10px; }
.cv-node.qwen .cv-qw-handle {
  position: absolute; top: 0; bottom: 0; width: 2px; left: 50%;
  background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.45);
}

/* 快捷 chips：涂抹按钮激活态 */
.cv-node.qwen .cv-qw-paint.on {
  border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,.1);
}
.cv-node.qwen .cv-qw-paint svg { flex: none; }

/* 面板顶部：标题 + 遮罩状态 */
.cv-node.qwen .cv-qw-plabel { font-size: 12px; color: var(--text-3); }
.cv-node.qwen .cv-qw-maskinfo { font-size: 11.5px; color: #ef4444; white-space: nowrap; }

/* 输入区：编辑节点按「改写指令」的量给高度（图片节点是整段创意，这里 3 行够） */
.cv-node.qwen .cv-prompt-pw .cv-prompt-mirror { min-height: 66px; }

/* 优化后提示词：跟面板同一族的信息条 */
.cv-node.qwen .cv-qw-opt {
  display: flex; flex-direction: column; gap: 5px; align-items: stretch;
  margin: 10px 0 10px; padding: 7px 9px; border-radius: 8px;
  background: var(--card-hi); border: 1px solid var(--line);
  font-size: 12px; line-height: 1.55; color: var(--text-2);
}
.cv-node.qwen .cv-qw-opt[hidden] { display: none; }
/* 头行：标签 + 字数 + 优化按钮。★ 必须是 flex，否则按钮被挤到框外看不见（2026-10-25 用户反馈「没有优化入口」的真因） */
.cv-node.qwen .cv-qw-opt-head {
  display: flex; align-items: center; gap: 6px; min-height: 18px;
}
.cv-node.qwen .cv-qw-opt-tag {
  flex: none; padding: 0 6px; border-radius: 5px; font-size: 11px;
  background: rgba(124,140,255,.16); color: #8b95d6;
}
.cv-node.qwen .cv-qw-opt-src {
  flex: 0 1 auto; min-width: 0; margin-left: auto; font-size: 10.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cv-node.qwen .cv-qw-opt-text {
  min-width: 0; max-height: 96px; overflow: auto; word-break: break-word;
}
/* 优化中：标签呼吸，让人知道它在跑，而不是卡死 */
.cv-node.qwen .cv-qw-opt.is-busy .cv-qw-opt-tag { animation: cvQwPulse 1.2s ease-in-out infinite; }
@keyframes cvQwPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.cv-node.qwen .cv-qw-opt.is-empty { opacity: .62; }
.cv-node.qwen .cv-qw-opt.is-empty .cv-qw-opt-tag { background: rgba(255,255,255,.08); color: var(--text-3); }
.cv-node.qwen .cv-qw-opt.is-empty .cv-qw-opt-text { color: var(--text-3); }

/* 底栏（模型 / 比例 / 尺寸 / 费用）：编辑节点也要能直接走在线 API。
   它比图片节点窄 → 模型名上限 124px、分隔点省掉、下拉不许被挤压（flex:none），
   否则「GPU Image / 原图 / 自动 / 不计费」会全部显示成省略号。 */
.cv-node.qwen .cv-bar { gap: 4px; }
.cv-node.qwen .cv-bar .cv-sel { flex: none; padding-left: 4px; padding-right: 13px; }
.cv-node.qwen .cv-qw-model-sel { max-width: 124px; }
.cv-node.qwen .cv-bar-dot { display: none; }
.cv-node.qwen .cv-qw-cost { flex: none; }
/* ★★ 2026-10-28 用户截图「按钮出框了」：底栏是单行 flex，状态文案一长（旧文案
   「排队中（云端可能正忙）… 19s」）就把右侧运行键顶出节点外。
   现在：状态文字自己可收缩 + 省略号（不换行、不挤别人），其余控件和运行键都 flex:none。 */
.cv-node.qwen .cv-bar { flex-wrap: nowrap; overflow: hidden; }
.cv-node.qwen .cv-qw-stat {
  flex: 1 1 0; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 底栏宽度不足时，让「费用」先让位（可省略），运行键永远留在框内 */
.cv-node.qwen .cv-qw-cost { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* GPU Image 模式没有「张数」：原生 select 和它的换皮按钮一起藏（按钮可能是后生成的，用类兜底） */
.cv-node.qwen.gpu-mode .cv-qw-count-sel { display: none !important; }

/* ★ 附加参考图（多图拼接）：缩略图一行，× 移除；整行拦截指针事件不透传给画布 */
/* ★★ 2026-10-28 17:15 用户嫌「那么丑、不明显」。重做：
   · 58px 正方 + object-fit:cover 把竖图裁成一条，根本认不出是哪张 → 改 76px 高、contain 完整显示（不变形不裁切）
   · @imageN 从底部黑条改成左上胶囊角标（深色底 + 细边 + 等宽字），一眼能看到编号
   · 上面加一行标题「参考图 N 张 · 点缩略图插入 @imageN」，让用户知道能点、也知道一共几张 */
.cv-node.qwen .cv-qw-refs { padding: 0 10px 9px; }
.cv-node.qwen .cv-qw-refs[hidden] { display: none; }
.cv-node.qwen .cv-qw-refs-hd {
  display: flex; align-items: baseline; gap: 7px; margin: 0 0 6px;
  font-size: 11px; color: var(--text-3);
}
.cv-node.qwen .cv-qw-refs-t { color: var(--text-2); font-weight: 600; }
.cv-node.qwen .cv-qw-refs-hint { opacity: .75; }
.cv-node.qwen .cv-qw-refs-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* ★ 2026-10-28 17:15 用户反馈「缩略图太丑」：原来 76px 黑底 + contain 留黑边 + 编号挤左上。
   改成铺满裁切的方形卡（cover，不再露黑边），编号做成底部渐变条里的胶囊，× 只在悬停出现。 */
.cv-node.qwen .cv-qw-refthumb {
  position: relative; width: 84px; height: 84px;
  border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  cursor: pointer; background: #14151b;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 2px 8px rgba(0,0,0,.32);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.cv-node.qwen .cv-qw-refthumb:hover {
  border-color: rgba(124,140,255,.9);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,.45);
}
.cv-node.qwen .cv-qw-refthumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .2s;
}
.cv-node.qwen .cv-qw-refthumb:hover img { transform: scale(1.03); }
/* 编号角标：底部整条渐变，@imageN —— N 就是工作流里的图像槽号（主图=image1，附加从 image2 起） */
.cv-node.qwen .cv-qw-refn {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 9px 4px 4px; text-align: center;
  font: 600 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-style: normal; letter-spacing: .2px; color: #fff;
  background: linear-gradient(to top, rgba(6,7,12,.9), rgba(6,7,12,.55) 55%, rgba(6,7,12,0));
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  pointer-events: none;
}
.cv-node.qwen .cv-qw-refdel {
  position: absolute; top: 5px; right: 5px; width: 19px; height: 19px;
  display: flex; align-items: center; justify-content: center;
  font: 700 12px/1 system-ui; font-style: normal; color: #fff;
  background: rgba(8,9,14,.72); border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%; cursor: pointer;
  opacity: 0; transform: scale(.85);
  transition: opacity .12s, transform .12s, background .12s;
  backdrop-filter: blur(3px);
}
.cv-node.qwen .cv-qw-refthumb:hover .cv-qw-refdel { opacity: 1; transform: scale(1); }
.cv-node.qwen .cv-qw-refdel:hover { background: rgba(205,60,60,.95); }

/* 状态 + 运行按钮（与图片节点的 .cv-send 完全同款：28px 白圆 + 深色图标） */
.cv-node.qwen .cv-qw-stat { font-size: 12px; color: var(--text-3); }
.cv-node.qwen .cv-qw-stat.err { color: #f87171; }
.cv-node.qwen .cv-qw-compare {
  height: 24px; padding: 0 10px; border-radius: 999px; cursor: pointer; flex: none;
  background: var(--card-hi); border: 1px solid var(--line);
  color: var(--text-2); font-size: 12px; font-family: inherit;
}
.cv-node.qwen .cv-qw-compare:hover { color: var(--text); border-color: var(--line-2); }
.cv-node.qwen .cv-qw-run {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  border: 0; background: #f2f2f3; color: #1a1a1a;
}
.cv-node.qwen .cv-qw-run:hover { background: #fff; }
.cv-node.qwen .cv-qw-run:disabled { background: #3a3a3a; color: #6b6b72; cursor: not-allowed; }


/* ═══ 全屏遮罩编辑器（照 ComfyUI MaskEditor 的整套交互：全屏 + 顶部工具条 + 大图涂抹）═══
   ★ 2026-10-25 重写：旧版 DOM 与 CSS 完全没对上（.cv-qwe-top/.cv-qwe-stage/.cv-qwe-view
     全无规则），导致画布不在图上叠着 → 笔刷画不出、按钮溢出视口点不到。
     这一版 DOM 里的每个 class 下面都有对应规则，改结构时必须同步改这里。 */
.cv-qwe {
  position: fixed; inset: 0; z-index: 99998;
  display: flex; flex-direction: column;
  background: #0a0c10;
  font-family: inherit;
  opacity: 0; transition: opacity .14s ease;
  overscroll-behavior: contain;
  /* ★ 2026-10-29 防御（同「助手隐形事件带」的病根）：opacity:0 期间绝不挡事件 ——
     关闭动画那 170ms、或万一 DOM 清理被打断，全屏层绝不能变成隐形事件黑洞 */
  pointer-events: none;
}
.cv-qwe.on { opacity: 1; pointer-events: auto; }

/* ── 顶部工具条 ── */
.cv-qwe-top {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; min-height: 46px; box-sizing: border-box;
  background: #12151b; border-bottom: 1px solid #232833;
  flex-wrap: wrap;
}
.cv-qwe-seg {
  display: inline-flex; padding: 2px; gap: 2px;
  background: #1b1f27; border-radius: 9px;
}
.cv-qwe-mode {
  height: 28px; padding: 0 13px; border-radius: 7px; cursor: pointer;
  border: 0; background: transparent; color: #97a1b2;
  font-size: 12px; font-family: inherit; white-space: nowrap;
}
.cv-qwe-mode:hover { color: #e8eaee; }
.cv-qwe-mode.on { background: #3b82f6; color: #fff; }
.cv-qwe-lab { font-size: 11px; color: #7c8698; flex: none; }
.cv-qwe-size {
  font-size: 11px; color: #c8d0dc; min-width: 30px; flex: none;
  font-variant-numeric: tabular-nums;
}
.cv-qwe-brush {
  width: 170px; height: 4px; flex: none; cursor: pointer;
  accent-color: #3b82f6;
}
.cv-qwe-tip { font-size: 11px; color: #5f6878; flex: none; }

/* ── 顶部 / 底部通用按钮 ── */
.cv-qwe-btn {
  height: 30px; padding: 0 13px; border-radius: 8px; cursor: pointer; flex: none;
  border: 1px solid #2a3140; background: #1d222b; color: #dfe4ec;
  font-size: 12px; font-family: inherit; white-space: nowrap;
}
.cv-qwe-btn:hover { border-color: #3b82f6; color: #fff; }
.cv-qwe-ok {
  background: #3b82f6 !important; border-color: #3b82f6 !important; color: #fff !important;
  font-weight: 600;
}
.cv-qwe-ok:hover { background: #2f74e8 !important; }
.cv-qwe-x {
  width: 30px; padding: 0; font-size: 13px; line-height: 1;
  color: #97a1b2;
}
.cv-qwe-x:hover { border-color: #ef4444; color: #ef4444; }

/* ── 中间画布区：pad 严格包住图，canvas 绝对铺满 pad（笔刷落点就在 canvas 上）── */
.cv-qwe-stage {
  flex: 1; min-height: 0; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; box-sizing: border-box;
  background:
    linear-gradient(45deg, #13161c 25%, transparent 25%) 0 0/24px 24px,
    linear-gradient(-45deg, #13161c 25%, transparent 25%) 0 12px/24px 24px,
    linear-gradient(45deg, transparent 75%, #13161c 75%) 12px -12px/24px 24px,
    linear-gradient(-45deg, transparent 75%, #13161c 75%) -12px 0/24px 24px,
    #0e1116;
}
.cv-qwe-pad {
  position: relative; flex: none; line-height: 0;
  box-shadow: 0 6px 34px rgba(0,0,0,.55);
}
.cv-qwe-img {
  display: block; user-select: none; -webkit-user-drag: none;
  pointer-events: none;
}
.cv-qwe-view {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  touch-action: none; cursor: crosshair; display: block;
}
.cv-qwe-view.erasing { cursor: cell; }

/* ── 底部条 ── */
.cv-qwe-foot {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; min-height: 48px; box-sizing: border-box;
  background: #12151b; border-top: 1px solid #232833;
  flex-wrap: wrap;
}
.cv-qwe-hint { font-size: 11px; color: #7c8698; }
.cv-qwe-hint b { color: #ef4444; font-weight: 600; }
.cv-qwe-count {
  font-size: 11px; color: #5f6878; flex: none;
  font-variant-numeric: tabular-nums;
}
.cv-qw-mp { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
