        /* ── Ki·to 字体 & 色彩令牌 ── */
        :root {
            --font-serif: Georgia, 'Times New Roman', serif;
            --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
            --font-mono: "SF Mono", "Fira Code", Consolas, "Courier New", monospace;

            --color-void:    #0b0b0b;
            --color-surface: #141414;
            --color-cream:   #ececec;
            --color-stone:   #c1c1c1;
            --color-ash:     #464646;
            --color-ember:   #696969;
            --color-border:  rgba(255,255,255,0.06);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            width: 100%;
            height: 100%;
            overflow: hidden;
            font-family: var(--font-sans);
            --color: rgba(114, 114, 114, 0.3);
            background-color: #1a1a1a;
            background-image: linear-gradient(0deg, transparent 24%, var(--color) 25%, var(--color) 26%, transparent 27%,transparent 74%, var(--color) 75%, var(--color) 76%, transparent 77%,transparent),
                linear-gradient(90deg, transparent 24%, var(--color) 25%, var(--color) 26%, transparent 27%,transparent 74%, var(--color) 75%, var(--color) 76%, transparent 77%,transparent);
            background-size: 55px 55px;
            color: #e4e4e4;
            user-select: none;
        }
        
        /* 左上角悬浮品牌区 */
        .floating-brand {
            position: fixed;
            left: 18px;
            top: 18px;
            max-width: calc(100vw - 36px);
            padding: 10px 13px;
            background: rgba(15, 15, 15, 0.88);
            backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            display: flex;
            align-items: center;
            z-index: 100;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
        }
        
        .floating-brand-main {
            display: flex;
            align-items: center;
            gap: 11px;
            min-width: 0;
        }

        .floating-brand-copy {
            display: flex;
            align-items: center;
            gap: 9px;
            min-width: 0;
        }
        
        .canvas-back-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex: 0 0 26px;
            width: 26px;
            height: 26px;
            padding: 0;
            border: 0;
            border-radius: 6px;
            background: transparent;
            color: #a6a6a6;
            cursor: pointer;
            transition: color .15s ease, background .15s ease;
        }
        .canvas-back-button:hover { color: #fff; background: rgba(255,255,255,.07); }
        .canvas-back-button:focus-visible { outline: 1px solid #aaa; outline-offset: 2px; }
        .canvas-back-button:disabled { opacity: .4; cursor: wait; }
        .canvas-back-button svg { flex-shrink: 0; }

        .logo {
            display: flex;
            align-items: center;
            line-height: 1;
        }

        .logo-word {
            font-size: 22px;
            font-weight: 400;
            color: #ececec;
            letter-spacing: -0.8px;
            font-family: Georgia, 'Times New Roman', serif;
            line-height: 1;
        }

        .logo-dot {
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: #696969;
            margin: 0 2px;
            position: relative;
            top: -6px;
            flex-shrink: 0;
        }
        
        .divider {
            width: 1px;
            height: 20px;
            background: rgba(255, 255, 255, 0.1);
        }
        
        .project-name {
            font-size: 13px;
            color: var(--color-ash);
            font-weight: 400;
            max-width: 240px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .save-status {
            font-size: 12px;
            color: var(--color-ash);
            padding: 4px 10px;
            border-radius: 6px;
            transition: all 0.2s;
            font-family: var(--font-sans);
        }

        .save-status.dirty {
            color: #c1c1c1;
            background: rgba(193, 193, 193, 0.1);
        }

        .save-status.saving {
            color: #9c9c9c;
            background: rgba(156, 156, 156, 0.1);
        }

        .save-status.saved {
            color: #b8b8b8;
            background: rgba(184, 184, 184, 0.1);
        }

        .save-status.error {
            color: #696969;
            background: rgba(105, 105, 105, 0.1);
            cursor: pointer;
        }

        .save-status.error:hover {
            background: rgba(105, 105, 105, 0.15);
        }

        .topbar-right {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .top-btn {
            padding: 8px 16px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            color: #e4e4e4;
            font-size: 0.9em;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .top-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.15);
        }
        
        .icon-btn {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            color: #a2a2a2;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .icon-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #e4e4e4;
        }
        
        .vip-btn {
            background: linear-gradient(135deg, #939393 0%, #767676 100%);
            border: none;
            color: white;
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 0.9em;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .credit-btn {
            position: relative;
            background: linear-gradient(135deg, #c1c1c1 0%, #a6a6a6 100%);
            border: none;
            color: #1a1a1a;
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 0.9em;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .credit-btn::before {
            content: '限时37�?;
            position: absolute;
            top: -10px;
            right: -8px;
            background: #c1c1c1;
            color: #1a1a1a;
            font-size: 0.65em;
            padding: 2px 6px;
            border-radius: 8px;
            white-space: nowrap;
        }
        
        /* 画布容器 */
        .canvas-container {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            overflow: visible;
            background: #0a0a0a;
            cursor: default;
        }

        /* 拖拽文件覆盖�?*/
        .canvas-container.drag-over::after {
            content: '松开鼠标即可加载图片 / 视频到此位置';
            position: absolute;
            inset: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            font-weight: 600;
            color: #bdbdbd;
            background: rgba(129, 129, 129, 0.08);
            border: 2px dashed rgba(153, 153, 153, 0.7);
            border-radius: 12px;
            pointer-events: none;
            z-index: 50;
            backdrop-filter: blur(2px);
        }
        
        /* 网格背景 */
        .canvas {
            position: absolute;
            width: 1000000px;
            height: 1000000px;
            top: 0;
            left: 0;
            /* 静态深灰点阵：与空画布同为18px间距，亮度保持克制。 */
            --color: rgba(140, 140, 140, 0.234);
            background-color: #0c0c0c;
            /* 只绘制小圆点，不添加动画或动态光晕；沿用画布平移缩放。 */
            background-image: radial-gradient(circle, var(--color) .7px, transparent 1.2px);
            background-size: 18px 18px;
            transform-origin: 0 0;
        }

        /* 缩放手势进行中：把整块画布提升为一张显卡图层，让显卡缩现成的图，
           不要每格滚轮把所有节点按新比例重画一遍。停手后类移除 → 重新光栅化变清晰。 */
        .canvas.zooming {
            will-change: transform;
        }
        
        /* 左侧工具�?*/
        .sidebar {
            position: fixed;
            left: -48px;
            top: 50%;
            transform: translateY(-50%);
            background: #1a1a1a;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 8px;
            display: flex;
            flex-direction: column;
            gap: 4px;
            z-index: 50;
            transition: left 0.3s ease, opacity 0.3s ease;
            opacity: 0.3;
        }

        .sidebar:hover {
            left: 16px;
            opacity: 1;
        }
        
        .sidebar-btn {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: none;
            border-radius: 8px;
            color: #a2a2a2;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }
        
        .sidebar-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #e4e4e4;
        }
        
        .sidebar-btn.primary {
            background: #ffffff;
            color: #1a1a1a;
        }
        
        .sidebar-btn.primary:hover {
            background: #e4e4e4;
        }
        
        .sidebar-btn svg {
            width: 20px;
            height: 20px;
        }
        
        /* 节点添加菜单 */
        .add-menu {
            position: absolute;
            background: #1a1a1a;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            padding: 16px;
            min-width: 260px;
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
            z-index: 200;
            display: none;
            animation: fadeInScale 0.15s ease-out;
        }
        
        .add-menu.show {
            display: block;
        }
        
        @keyframes fadeInScale {
            from {
                opacity: 0;
                transform: scale(0.95);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }
        
        .menu-title {
            font-size: 11px;
            color: var(--color-ash);
            padding: 8px 12px;
            font-weight: 400;
            letter-spacing: 0.1em;
            text-transform: uppercase;
        }
        
        .menu-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s;
        }
        
        .menu-item:hover {
            background: rgba(255, 255, 255, 0.06);
        }
        
        .menu-icon {
            width: 36px;
            height: 36px;
            background: rgba(255, 255, 255, 0.06);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1em;
        }
        
        .menu-icon svg {
            width: 18px;
            height: 18px;
            stroke: currentColor;
            flex-shrink: 0;
        }
        
        .menu-label {
            font-size: 13px;
            color: var(--color-stone);
            font-weight: 400;
            flex: 1;
        }

        .menu-badge {
            font-size: 11px;
            color: var(--color-ash);
            padding: 2px 8px;
            background: rgba(255, 255, 255, 0.04);
            border-radius: 6px;
            font-family: var(--font-mono);
            letter-spacing: 0.03em;
        }

        /* 搜索�?*/
        .menu-search {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            margin-bottom: 6px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            transition: border-color 0.15s, background 0.15s;
        }
        .menu-search:focus-within {
            border-color: rgba(255, 255, 255, 0.18);
            background: rgba(255, 255, 255, 0.06);
        }
        .menu-search-icon {
            width: 14px;
            height: 14px;
            color: var(--color-ash);
            flex-shrink: 0;
        }
        .menu-search-input {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: var(--color-cream);
            font-size: 13px;
            font-family: var(--font-sans);
            padding: 0;
            min-width: 0;
        }
        .menu-search-input::placeholder {
            color: var(--color-ash);
        }

        /* 菜单内容容器（让子菜单可以溢出向右展开�?*/
        .menu-body {
            overflow: visible;
        }
        .menu-empty {
            padding: 8px 12px;
            font-size: 12px;
            color: var(--color-ash);
        }

        /* 一级分组触发项（带 �?箭头�?*/
        .menu-group {
            position: relative;
        }
        .menu-trigger {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-radius: 8px;
            cursor: default;
            transition: background 0.15s;
        }
        .menu-group:hover > .menu-trigger {
            background: rgba(255, 255, 255, 0.08);
        }
        .menu-trigger-icon {
            width: 36px;
            height: 36px;
            background: rgba(255, 255, 255, 0.06);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--color-stone);
            flex-shrink: 0;
        }
        .menu-trigger-icon svg {
            width: 18px;
            height: 18px;
            stroke: currentColor;
        }
        .menu-trigger-label {
            flex: 1;
            font-size: 13px;
            color: var(--color-stone);
            font-weight: 400;
        }
        .menu-trigger-arrow {
            width: 10px;
            height: 10px;
            color: var(--color-ash);
            flex-shrink: 0;
            transition: color 0.15s, transform 0.15s;
        }
        .menu-group:hover .menu-trigger-arrow {
            color: var(--color-cream);
            transform: translateX(2px);
        }

        /* 二级面板（hover 触发，从右侧弹出�?*/
        .menu-submenu {
            position: absolute;
            left: calc(100% + 4px);
            top: -8px;
            background: #1a1a1a;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 8px;
            min-width: 220px;
            box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
            z-index: 1;
            display: none;
            animation: submenuFadeIn 0.12s ease-out;
        }
        /* �?trigger �?submenu 之间桥接，避免鼠标在 4px gap 处丢�?hover */
        .menu-submenu::before {
            content: '';
            position: absolute;
            left: -8px;
            top: 0;
            bottom: 0;
            width: 8px;
        }
        .menu-group:hover > .menu-submenu {
            display: block;
        }
        @keyframes submenuFadeIn {
            from { opacity: 0; transform: translateX(-4px); }
            to   { opacity: 1; transform: translateX(0); }
        }
        .menu-submenu-empty {
            padding: 10px 12px;
            font-size: 12px;
            color: var(--color-ash);
            text-align: center;
        }

        /* 提示浮层 */
        .menu-toast {
            position: fixed;
            top: 24px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.85);
            color: var(--color-cream);
            padding: 8px 16px;
            border-radius: 6px;
            font-size: 12px;
            white-space: nowrap;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
            pointer-events: none;
            z-index: 9999;
            animation: menuToastFade 1.6s ease forwards;
        }
        @keyframes menuToastFade {
            0%   { opacity: 0; transform: translateX(-50%) translateY(-8px); }
            15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
            85%  { opacity: 1; transform: translateX(-50%) translateY(0); }
            100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
        }

        /* 节点样式 */
        .node {
            position: absolute;
            left: 0;
            top: 0;
            background: transparent;
            border: none;
            border-radius: 16px;
            padding: 0;
            min-width: 380px;
            cursor: default;
            z-index: 10;
            /* 不给静止节点贴 will-change：否则缩小后屏幕上几百个节点会各自被显卡拎成一张独立图层，
               显存爆、合成器忙不过来 → 掉帧。拖动那一个节点时由 .node.dragging 临时提升即可（学 Wuli）。 */
            transform-origin: center;
            contain: layout;
            /* 视口外的节点跳过渲染/布局/绘制；auto 关键字让浏览器记住上次实测的尺寸�?
               下次滚回视口时复用，避免节点首次滚回时跳一�?*/
            content-visibility: auto;
            contain-intrinsic-size: auto 380px 320px;
        }
        
        /* 只有正在拖动的节点临时成为独立图层，拖完即摘 —— 拖动顺滑但不长期占显存 */
        .node.dragging {
            will-change: transform;
        }

        .node:hover {
            /* 移除边框变化 */
        }

        .node.selected {
            /* 选中状态添加柔和发光效�?*/
        }

        .node.selected .node-preview {
            box-shadow: 0 0 0 2px rgba(129, 129, 129, 0.6),
                        0 0 20px rgba(129, 129, 129, 0.3),
                        0 4px 16px rgba(0, 0, 0, 0.3);
            transition: box-shadow 0.2s ease;
        }

        .node.selected:hover {
            /* 移除边框变化 */
        }

        /* 选中状态：静态高亮，不做无限 filter 动画（多�?N �?= N 个重绘循环）�?
           视觉效果已通过 .node.selected .node-preview �?box-shadow 提供�?*/
        
        .node-base {
            position: relative;
            transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.4, 1.2);
            transform-style: preserve-3d;
            /* 左右各让�?32px 给端口槽�? 端口宽度）�?
               端口完全落在 .node 内（不被 content-visibility �?paint 裁切），
               又完全在卡片�?node-preview）外�?
               端口紧贴卡片边缘，连线端点延到端口靠卡片那一侧，视觉上线直接抵达卡片�?*/
            padding: 0 32px;
        }

        /* 连线拖拽时，鼠标悬停的目标节点：3D hover 反馈 */
        /* 拖线到目标节点：�?wuli —�?干净地高亮（不做 3D 翻转），重点靠端口浮�?*/
        /* 多选框架与拖线反馈 */
        .multi-selection-frame { position: fixed; z-index: 12; border: 1px solid rgba(235,235,235,.45); border-radius: 24px; pointer-events: none; }
        .multi-selection-frame[hidden], .multi-selection-toolbar[hidden] { display: none !important; }
        .multi-selection-toolbar { position: fixed; z-index: 80; display: flex; align-items: center; gap: 3px; padding: 5px 7px; border: 1px solid rgba(255,255,255,.10); border-radius: 11px; background: rgba(30,30,30,.94); box-shadow: 0 10px 30px #0008; color: #ddd; font-size: 12px; pointer-events: auto; white-space: nowrap; }
        .multi-selection-toolbar button { border: 0; border-radius: 7px; padding: 6px 8px; background: transparent; color: #c9c9c9; cursor: pointer; font: inherit; }
        .multi-selection-toolbar button:hover:not(:disabled) { background: rgba(255,255,255,.10); color: #fff; }
        .multi-selection-toolbar button:disabled { opacity: .35; cursor: not-allowed; }
        .multi-selection-count { padding: 0 8px 0 4px; color: #aaa; }
        .multi-selection-port { position: absolute; right: -13px; top: 50%; width: 24px; height: 24px; transform: translate(50%,-50%); border: 1px solid #ddd; border-radius: 50%; background: #171717; color: #eee; font: 19px/20px Arial; pointer-events: auto; cursor: crosshair; }
        .multi-selection-port:hover { background: #eee; color: #111; }
        .marquee-selecting .node-toolbar, .connection-dragging .node-toolbar { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
        .connection-dragging .multi-selection-frame, .connection-dragging .multi-selection-toolbar { display: none !important; }
        .node.link-dimmed { opacity: .24 !important; filter: saturate(.35); transition: opacity .12s ease, filter .12s ease; }
        .node.connection-drop-target { opacity: 1 !important; filter: none !important; transition: opacity .12s ease, filter .12s ease; }
        .selection-box.link-sweep { border-style: solid; border-color: rgba(180,180,180,.68); background: rgba(180,180,180,.08); }

        .node.connection-drop-target .node-base {
            transform: scale(1.01);
            transition: transform 0.18s ease;
        }
        .node.connection-drop-target .node-preview {
            box-shadow:
                0 0 0 2px rgba(222, 222, 222, 0.6),
                0 8px 24px rgba(0, 0, 0, 0.45);
            border-color: rgba(222, 222, 222, 0.5);
        }
        .node.connection-drop-target--disabled-3d .node-header span {
            color: #fff;
            transform: translateZ(50px);
            transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.4, 1);
            text-shadow: -1px -1px 0 #000,
                1px -1px 0 #000,
                -1px 1px 0 #000,
                1px 1px 0 #000;
        }

        .node-controls {
            display: none;
            overflow: hidden;
            max-height: 0;
            opacity: 0;
            transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                        opacity 0.3s ease,
                        margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .node.selected .node-controls {
            display: block;
            max-height: 1000px;
            opacity: 1;
            margin-top: 12px;
            background: rgba(15, 15, 15, 0.6);
            border-radius: 12px;
            padding: 12px;
        }
        
        /* 全局悬浮面板样式 */
        .floating-panel {
            position: fixed;
            display: none;
            background: #1a1a1a;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 16px;
            padding: 0;
            width: 560px;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
            z-index: 1000;
            opacity: 0;
            transform: scale(0.95);
            transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .floating-panel.active {
            display: block;
            opacity: 1;
            transform: scale(1);
        }

        .floating-panel.dragging {
            opacity: 0;
        }
        
        @keyframes panelSlideIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            background: rgba(30, 30, 30, 0.5);
            border-radius: 14px 14px 0 0;
        }
        
        .panel-title {
            font-size: 17px;
            font-weight: 400;
            color: var(--color-cream);
            font-family: var(--font-serif);
            letter-spacing: -0.3px;
        }
        
        .panel-close {
            width: 28px;
            height: 28px;
            background: transparent;
            border: none;
            border-radius: 6px;
            color: #a2a2a2;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1em;
        }
        
        .panel-close:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #e4e4e4;
        }
        
        .panel-content {
            padding: 16px;
        }

        /* 面板放大按钮 */
        .panel-expand-btn {
            position: absolute;
            top: 12px;
            right: 12px;
            width: 32px;
            height: 32px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            color: #a2a2a2;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10;
        }

        .panel-expand-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #e4e4e4;
        }

        /* 全屏遮罩 */
        .panel-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            z-index: 999;
            display: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .panel-overlay.active {
            display: block;
            opacity: 1;
        }

        /* 面板放大状�?*/
        .floating-panel.expanded {
            position: fixed !important;
            top: 50% !important;
            left: 50% !important;
            transform: translate(-50%, -50%) !important;
            width: 800px !important;
            max-width: 90vw;
            z-index: 1001;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* 模型下拉菜单 */
        .model-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 8px;
            background: #1a1a1a;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            min-width: 160px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
            display: none;
            z-index: 100;
        }

        .model-dropdown.show {
            display: block;
            animation: fadeInDown 0.2s ease;
        }

        /* 分辨率下拉菜�?*/
        .resolution-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 8px;
            background: #1a1a1a;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 16px;
            min-width: 320px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
            display: none;
            z-index: 100;
        }

        .resolution-dropdown.show {
            display: block;
            animation: fadeInDown 0.2s ease;
        }

        .resolution-section {
            margin-bottom: 16px;
        }

        .resolution-section:last-child {
            margin-bottom: 0;
        }

        .resolution-label {
            font-size: 11px;
            color: var(--color-ash);
            letter-spacing: 0.1em;
            text-transform: uppercase;
            margin-bottom: 8px;
            padding-left: 4px;
        }

        .resolution-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 8px;
        }

        .resolution-item {
            padding: 12px 8px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            color: #a2a2a2;
            cursor: pointer;
            transition: all 0.15s;
            text-align: center;
            font-size: 0.85em;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .resolution-item:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.15);
            color: #e4e4e4;
        }

        .resolution-item.selected {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.2);
            color: #e4e4e4;
        }

        .resolution-item.option-disabled {
            opacity: 0.3;
            cursor: not-allowed;
            pointer-events: none;
            background: rgba(255, 255, 255, 0.02);
            border-color: rgba(255, 255, 255, 0.04);
            color: #535353;
            position: relative;
        }
        .resolution-item.option-disabled::after {
            content: "";
            position: absolute;
            left: 6px;
            right: 6px;
            top: 50%;
            height: 1px;
            background: rgba(255, 255, 255, 0.25);
            transform: rotate(-12deg);
        }

        .resolution-icon {
            width: 20px;
            height: 20px;
            border: 1.5px solid currentColor;
            border-radius: 4px;
            flex-shrink: 0;
        }

        .resolution-icon.ratio-1-1 {
            width: 20px;
            height: 20px;
        }

        .resolution-icon.ratio-9-16 {
            width: 12px;
            height: 20px;
        }

        .resolution-icon.ratio-16-9 {
            width: 20px;
            height: 12px;
        }

        .resolution-icon.ratio-3-4 {
            width: 15px;
            height: 20px;
        }

        .resolution-icon.ratio-4-3 {
            width: 20px;
            height: 15px;
        }

        .resolution-icon.ratio-3-2 {
            width: 20px;
            height: 13px;
        }

        .resolution-icon.ratio-2-3 {
            width: 13px;
            height: 20px;
        }

        .resolution-icon.ratio-4-5 {
            width: 16px;
            height: 20px;
        }

        .resolution-icon.ratio-5-4 {
            width: 20px;
            height: 16px;
        }

        .resolution-icon.ratio-21-9 {
            width: 20px;
            height: 9px;
        }

        .resolution-icon.ratio-2-1 {
            width: 20px;
            height: 10px;
        }

        @keyframes fadeInDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .dropdown-item {
            padding: 10px 14px;
            color: var(--color-stone);
            cursor: pointer;
            transition: background 0.15s;
            font-size: 13px;
        }

        .dropdown-item:first-child {
            border-radius: 8px 8px 0 0;
        }

        .dropdown-item:last-child {
            border-radius: 0 0 8px 8px;
        }

        .dropdown-item:hover {
            background: rgba(255, 255, 255, 0.08);
        }

        .dropdown-trigger {
            position: relative;
            cursor: pointer;
        }

        .node-header {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            color: #ffffff;
            letter-spacing: 0.05em;
            margin-bottom: 0;
            padding: 0 0 10px 4px;
            cursor: move;
            user-select: none;
            min-height: 32px;
            background: transparent;
        }

        .node-header svg {
            flex-shrink: 0;
            vertical-align: middle;
        }

        .node-resolution {
            margin-left: auto;
            font-size: 11px;
            color: #ffffff;
            font-family: var(--font-mono);
            font-variant-numeric: tabular-nums;
            letter-spacing: 0.05em;
            padding: 2px 8px;
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.1);
            border: 0.5px solid rgba(255, 255, 255, 0.2);
        }

        .node-resolution:empty {
            display: none;
        }

        .node-header:active {
            cursor: grabbing;
        }

        /* ── 画布缩放时保持节点上文字/按钮的视觉可读�?──
           --inv-scale �?JS �?#canvas 上设置为 1/canvasState.scale�?
           --inv-clamped 把反缩系数限制在 [0.6, 2]：画�?>167% �?<50% 时停止反缩，
           避免极端缩放下文字撑爆节点或过小不可读�?
           只调整字�?SVG/按钮尺寸/间距，不动盒模型与定位�?*/
        #canvas { --inv-scale: 1; --inv-clamped: clamp(0.6, var(--inv-scale), 2); }

        .node-header {
            /* 表头用「恒定尺寸」，跟随画布整体缩放（学 wuli），不做反向缩放：
               ① 盒高恒为 32px → offsetHeight = 32 + 卡片高 恒定 → 端口/连线不跳；
               ② 不放大渲染 → 不会溢出节点盒被 .node 的 content-visibility 裁掉（标题/分辨率不再被剪）。
               代价：缩得很小时标题也跟着变小（与 wuli 一致，缩远了本就看不清，可接受）。 */
            font-size: 11px;
            gap: 6px;
            min-height: 32px;
            padding: 0 0 10px 4px;
        }
        /* header �?SVG 图标使用 em，会自动跟随上面放大�?font-size */
        .node-header svg {
            width: 1.4em;
            height: 1.4em;
        }
        .node-resolution {
            /* 恒定尺寸，跟随画布整体缩放（同表头），盒高不变、不溢出 */
            font-size: 11px;
            padding: 2px 8px;
        }
        .node-toolbar {
            font-size: calc(13px * var(--inv-clamped));
            gap: calc(4px * var(--inv-clamped));
            padding: calc(6px * var(--inv-clamped)) calc(8px * var(--inv-clamped));
            /* top 保持原始 -48px（在 .node-toolbar 基础规则里），不做反向补偿，
               让面板像标题一样贴着节点顶部随画布一起缩放位�?*/
        }
        .node-toolbar-btn {
            width: calc(32px * var(--inv-clamped));
            height: calc(32px * var(--inv-clamped));
        }
        .node-toolbar-btn svg {
            width: calc(18px * var(--inv-clamped));
            height: calc(18px * var(--inv-clamped));
        }
        .node-toolbar-divider {
            height: calc(20px * var(--inv-clamped));
            margin: 0 calc(4px * var(--inv-clamped));
        }
        .node-toolbar-dropdown-btn {
            padding: 0 calc(10px * var(--inv-clamped));
            gap: calc(4px * var(--inv-clamped));
        }
        
        .node-header > * {
            pointer-events: none;
        }
        
        .node-preview {
            background: #1a1a1a;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 16px;
            min-height: 240px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #535353;
            font-size: 3em;
            overflow: hidden;
            position: relative;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
            contain: layout paint;
            transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .node:hover .node-preview {
            transform: scale(1.02);
        }

        /* 生成占位：星点阵列承载黑白灰光流，边缘淡出；不显示读秒。 */
        .gen-skeleton {
            --gen-phase: 0s;
            --gen-point-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cdefs%3E%3CradialGradient%20id%3D%22halo%22%3E%3Cstop%20stop-color%3D%22white%22%20stop-opacity%3D%22.42%22/%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22white%22%20stop-opacity%3D%220%22/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%223.8%22%20fill%3D%22url%28%23halo%29%22/%3E%3Cpath%20d%3D%22M16%2013Q16.6%2015.4%2019%2016Q16.6%2016.6%2016%2019Q15.4%2016.6%2013%2016Q15.4%2015.4%2016%2013Z%22%20fill%3D%22white%22%20fill-opacity%3D%22.82%22/%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%22.85%22%20fill%3D%22white%22/%3E%3C/svg%3E");
            position: absolute;
            inset: 0;
            border-radius: inherit;
            display: none;
            overflow: hidden;
            isolation: isolate;
            contain: paint;
            z-index: 6;
            background: #101010;
            pointer-events: none;
        }
        .gen-skeleton.active { display: block; }
        .gen-skeleton::before {
            content: "";
            position: absolute;
            inset: 0;
            background:
                radial-gradient(ellipse at 25% 35%, rgba(80,80,80,.12), transparent 65%),
                radial-gradient(ellipse at 78% 72%, rgba(64,64,64,.10), transparent 60%),
                repeating-linear-gradient(0deg, transparent 0 4px, rgba(130,130,130,.025) 4px 5px);
        }
        .gen-dots {
            position: absolute;
            inset: 0;
            overflow: hidden;
            background: rgba(150,150,150,.12);
            -webkit-mask-image: var(--gen-point-mask);
            mask-image: var(--gen-point-mask);
            -webkit-mask-size: 20px 20px;
            mask-size: 20px 20px;
            -webkit-mask-position: center;
            mask-position: center;
            -webkit-mask-repeat: repeat;
            mask-repeat: repeat;
        }
        .gen-dots::before,
        .gen-dots::after {
            content: "";
            position: absolute;
            inset: -45%;
            pointer-events: none;
        }
        .gen-dots::before {
            background:
                radial-gradient(ellipse at 30% 40%, rgba(235,235,235,.95) 0%, rgba(174,174,174,.85) 12%, rgba(100,100,100,.35) 25%, transparent 43%),
                radial-gradient(ellipse at 75% 65%, rgba(184,184,184,.82) 0%, rgba(96,96,96,.36) 20%, transparent 40%);
            animation: gen-dot-current 8s cubic-bezier(.45,0,.55,1) infinite;
            animation-delay: var(--gen-phase);
        }
        .gen-dots::after {
            background:
                linear-gradient(108deg, transparent 27%, rgba(140,140,140,.18) 40%, rgba(245,245,245,.7) 49%, rgba(148,148,148,.26) 57%, transparent 71%),
                radial-gradient(ellipse at 45% 62%, rgba(142,142,142,.28), transparent 45%);
            animation: gen-dot-ribbon 11s cubic-bezier(.45,0,.55,1) infinite;
            animation-delay: calc(var(--gen-phase) - 4s);
        }
        .gen-skeleton::after {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background: radial-gradient(ellipse at center, transparent 22%, rgba(16,16,16,.22) 57%, rgba(16,16,16,.88) 100%);
            box-shadow: inset 0 0 0 1px rgba(164,164,164,.1);
            pointer-events: none;
        }
        @keyframes gen-dot-current {
            0%, 100% { transform: translate3d(-14%, -5%, 0) rotate(-12deg) scale(1.06); }
            35% { transform: translate3d(9%, 7%, 0) rotate(8deg) scale(1.12, .96); }
            70% { transform: translate3d(16%, -8%, 0) rotate(17deg) scale(.98, 1.1); }
        }
        @keyframes gen-dot-ribbon {
            0%, 100% { transform: translate3d(19%, 5%, 0) rotate(9deg); opacity: .5; }
            45% { transform: translate3d(-18%, -6%, 0) rotate(-13deg); opacity: 1; }
            75% { transform: translate3d(-5%, 9%, 0) rotate(-3deg); opacity: .7; }
        }
        @media (prefers-reduced-motion: reduce) {
            .gen-dots::before,
            .gen-dots::after { animation: none; }
        }

        /* 进度数字覆层 */
        @keyframes progress-tick {
            0%   { transform: scale(1); }
            45%  { transform: scale(1.18); }
            100% { transform: scale(1); }
        }
        .node-progress-overlay {
            position: absolute;
            bottom: 12px;
            right: 12px;
            z-index: 10;
            background: rgba(0,0,0,0.55);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 8px;
            padding: 3px 9px;
            font-size: 12px;
            font-weight: 600;
            color: #e4e4e4;
            letter-spacing: 0.04em;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.25s ease;
        }
        .node-progress-overlay.visible { opacity: 1; }
        .node-progress-overlay.tick { animation: progress-tick 0.18s ease-out; }

        /* ===== 金字塔加载动�?- From Uiverse.io by andrew-demchenk0 ===== */
        .pyramid-loader {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) rotateX(-20deg);
            width: 300px;
            height: 300px;
            display: none;
            transform-style: preserve-3d;
            z-index: 5;
        }

        .pyramid-loader.active {
            display: block;
        }

        .wrapper {
            position: relative;
            width: 100%;
            height: 100%;
            transform-style: preserve-3d;
            animation: pyramidSpin 4s linear infinite;
        }

        @keyframes pyramidSpin {
            100% {
                transform: rotateY(360deg);
            }
        }

        .pyramid-loader .wrapper .side {
            width: 70px;
            height: 70px;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            margin: auto;
            transform-origin: center top;
            clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
        }

        .pyramid-loader .wrapper .side1 {
            transform: rotateZ(-30deg) rotateY(90deg);
            background: conic-gradient(#b4b4b4, #626262, #d0d0d0, #2e2e2e);
        }

        .pyramid-loader .wrapper .side2 {
            transform: rotateZ(30deg) rotateY(90deg);
            background: conic-gradient(#2e2e2e, #d0d0d0, #626262, #b4b4b4);
        }

        .pyramid-loader .wrapper .side3 {
            transform: rotateX(30deg);
            background: conic-gradient(#2e2e2e, #d0d0d0, #626262, #b4b4b4);
        }

        .pyramid-loader .wrapper .side4 {
            transform: rotateX(-30deg);
            background: conic-gradient(#b4b4b4, #626262, #d0d0d0, #2e2e2e);
        }

        .pyramid-loader .wrapper .shadow {
            width: 60px;
            height: 60px;
            background: #6d6d6d;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            margin: auto;
            transform: rotateX(90deg) translateZ(-40px);
            filter: blur(12px);
        }

        .node-media {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border-radius: 16px;
            z-index: 1;  /* 确保在控制条之下 */
        }
        .node-media > svg {
            color: rgba(162, 162, 162, 0.3);
            transition: color 0.3s ease, transform 0.3s ease;
        }
        .node:hover .node-media > svg {
            color: rgba(162, 162, 162, 0.5);
            transform: scale(1.05);
        }
        .node-media img,
        .node-media video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            background: #0a0a0a;
            transition: filter 0.5s ease;
        }
        /* 全景节点：阳光滑块用 CSS 亮度实时预览，必须关�?filter 渐变才跟�?*/
        .node[data-node-type="panorama"] .node-media img {
            transition: none;
        }

        /* 文本节点内置 contenteditable 编辑�?*/
        .node-text-editor {
            position: absolute;
            inset: 0;
            padding: 16px 18px;
            font-size: 14px;
            line-height: 1.6;
            color: #e4e4e4;
            background: transparent;
            border-radius: 16px;
            overflow: auto;
            white-space: pre-wrap;
            word-break: break-word;
            outline: none;
            cursor: text;
            text-align: left;
            font-family: inherit;
            font-weight: 400;
            display: none; /* 默认隐藏，双击后激�?*/
            transform: scale(var(--text-scale, 1));
            transform-origin: top left;
        }
        .node-text-editor:focus {
            box-shadow: inset 0 0 0 1px rgba(85, 85, 85, 0.45);
        }
        /* 编辑模式：显示编辑器，隐藏展示层 */
        .node[data-text-editing="true"] .node-text-editor {
            display: block;
        }
        .node[data-text-editing="true"] .node-text-display {
            display: none;
        }

        /* 文本节点展示层（非编辑态） */
        .node-text-display {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            color: rgba(162, 162, 162, 0.5);
            pointer-events: none;
            border-radius: 16px;
        }
        .node-text-display.has-text {
            align-items: flex-start;
            justify-content: flex-start;
            padding: 16px 18px;
            color: #e4e4e4;
            font-size: 14px;
            line-height: 1.6;
            overflow: hidden;
            white-space: pre-wrap;
            word-break: break-word;
            display: block;
            transform: scale(var(--text-scale, 1));
            transform-origin: top left;
        }
        .node-text-display-hint {
            font-size: 12px;
            letter-spacing: 0.02em;
        }


        .node[data-node-type="text"] .node-media,
        .node[data-node-type="prompt"] .node-media {
            background: #1a1a1a;
            cursor: default;
        }
        .node[data-node-type="text"] .node-preview,
        .node[data-node-type="prompt"] .node-preview {
            font-size: 1em;
            cursor: default;
        }
        /* 编辑模式下文�?/ 提示词节点显示文字光�?*/
        .node[data-text-editing="true"][data-node-type="text"] .node-media,
        .node[data-text-editing="true"][data-node-type="text"] .node-preview,
        .node[data-text-editing="true"][data-node-type="prompt"] .node-media,
        .node[data-text-editing="true"][data-node-type="prompt"] .node-preview {
            cursor: text;
        }

        /* ===== 文本 / 提示词节点：固定盒子 + 右下角手柄调尺寸 =====
           盒子尺寸不再随文字自动变化，完全由右下角手柄拖动决定（宽 / 高）�?
           固定宽度让文字按此宽度换行；文字超出盒子时在框内纵向滚动，保持可读�?
           只作用于 text / prompt 节点，图�?视频节点照旧�?*/
        .node[data-node-type="text"],
        .node[data-node-type="prompt"] {
            width: 380px;           /* 默认宽度，手柄拖动后由内�?width 覆盖 */
        }
        .node[data-node-type="text"] .node-text-display.has-text,
        .node[data-node-type="prompt"] .node-text-display.has-text {
            overflow-y: auto;       /* 文字超出固定盒子时，框内滚动而不是被剪掉 */
            pointer-events: auto;   /* 展示层默�?none，这里恢复，鼠标滚轮/滚动条才能用 */
        }
        /* 细滚动条（Firefox�?*/
        .node[data-node-type="text"] .node-text-display.has-text,
        .node[data-node-type="prompt"] .node-text-display.has-text,
        .node[data-node-type="text"] .node-text-editor,
        .node[data-node-type="prompt"] .node-text-editor {
            scrollbar-width: thin;
            scrollbar-color: rgba(153, 153, 153, 0.45) transparent;
        }
        /* 细滚动条（Chrome / Edge / Safari�?*/
        .node[data-node-type="text"] .node-text-display.has-text::-webkit-scrollbar,
        .node[data-node-type="prompt"] .node-text-display.has-text::-webkit-scrollbar,
        .node[data-node-type="text"] .node-text-editor::-webkit-scrollbar,
        .node[data-node-type="prompt"] .node-text-editor::-webkit-scrollbar {
            width: 4px;
        }
        .node[data-node-type="text"] .node-text-display.has-text::-webkit-scrollbar-track,
        .node[data-node-type="prompt"] .node-text-display.has-text::-webkit-scrollbar-track,
        .node[data-node-type="text"] .node-text-editor::-webkit-scrollbar-track,
        .node[data-node-type="prompt"] .node-text-editor::-webkit-scrollbar-track {
            background: transparent;
        }
        .node[data-node-type="text"] .node-text-display.has-text::-webkit-scrollbar-thumb,
        .node[data-node-type="prompt"] .node-text-display.has-text::-webkit-scrollbar-thumb,
        .node[data-node-type="text"] .node-text-editor::-webkit-scrollbar-thumb,
        .node[data-node-type="prompt"] .node-text-editor::-webkit-scrollbar-thumb {
            background: rgba(153, 153, 153, 0.35);
            border-radius: 3px;
        }
        .node[data-node-type="text"] .node-text-display.has-text::-webkit-scrollbar-thumb:hover,
        .node[data-node-type="prompt"] .node-text-display.has-text::-webkit-scrollbar-thumb:hover,
        .node[data-node-type="text"] .node-text-editor::-webkit-scrollbar-thumb:hover,
        .node[data-node-type="prompt"] .node-text-editor::-webkit-scrollbar-thumb:hover {
            background: rgba(153, 153, 153, 0.65);
        }

        /* 全局兜底细滚动条（与提示词节点一致）�?
           用最低优先级�?* 选择器，确保任何"漏网"的默认滚动条（含图片/视频节点那根�?
           都被统一成紫色细条；而显�?scrollbar-width:none 的局部规则优先级更高，仍保持隐藏�?
           节点元素自身也单独点名，避免它是滚动容器时被 * 后代选择器漏掉�?*/
        *::-webkit-scrollbar,
        .node::-webkit-scrollbar {
            width: 4px;
            height: 4px;
        }
        *::-webkit-scrollbar-track,
        .node::-webkit-scrollbar-track {
            background: transparent;
        }
        *::-webkit-scrollbar-thumb,
        .node::-webkit-scrollbar-thumb {
            background: rgba(153, 153, 153, 0.35);
            border-radius: 4px;
        }
        *::-webkit-scrollbar-thumb:hover,
        .node::-webkit-scrollbar-thumb:hover {
            background: rgba(153, 153, 153, 0.65);
        }
        /* 去掉默认滚动条两端的上下箭头按钮（截图里那对箭头�?*/
        *::-webkit-scrollbar-button,
        .node::-webkit-scrollbar-button {
            display: none;
            width: 0;
            height: 0;
        }
        html {
            scrollbar-width: thin;
            scrollbar-color: rgba(153, 153, 153, 0.45) transparent;
        }

        /* 生成结束后，结果图片柔和显现。 */

        @keyframes img-appear {
            from { opacity: 0; transform: scale(1.04); filter: blur(6px); }
            to   { opacity: 1; transform: scale(1);    filter: blur(0px); }
        }
        .node-media img.img-fade-in {
            animation: img-appear 0.5s cubic-bezier(0.2, 0, 0, 1) both;
        }
        

        /* ── 节点工具�?── */
        .node-toolbar {
            position: absolute;
            top: -48px;
            left: 50%;
            transform: translateX(-50%);
            display: none;
            align-items: center;
            gap: 4px;
            background: rgba(15, 15, 15, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 6px 8px;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
            z-index: 15;
            opacity: 0;
            transition: opacity 0.2s ease, transform 0.2s ease;
        }

        .node.selected .node-toolbar {
            display: flex;
            opacity: 1;
        }

        /* 选中态临时关�?content-visibility �?paint 裁剪，让节点上方 -48px 的工具条完整显示�?
           未交互的节点继续享受视口外不渲染的性能优化�?
           注意：不要在 :hover 上切 content-visibility —�?hover 是高频瞬时状态，
           来回�?auto↔visible 会强制反复重绘，鼠标快速划过时背景会闪烁（已修）�?*/
        .node.selected {
            content-visibility: visible;
        }

        .node-toolbar-btn {
            width: 32px;
            height: 32px;
            background: transparent;
            border: none;
            border-radius: 8px;
            color: rgba(228, 228, 228, 0.7);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            padding: 0;
        }

        .node-toolbar-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: rgba(228, 228, 228, 1);
            transform: scale(1.05);
        }

        .node-toolbar-btn:active {
            transform: scale(0.95);
        }

        .node-toolbar-btn svg {
            width: 18px;
            height: 18px;
        }

        .node-toolbar-divider {
            width: 1px;
            height: 20px;
            background: rgba(255, 255, 255, 0.1);
            margin: 0 4px;
        }

        /* ── 工具栏下拉菜�?── */
        .node-toolbar-dropdown {
            position: relative;
        }

        .node-toolbar-dropdown-btn {
            padding: 0 10px;
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 13px;
            width: auto !important;        /* 覆盖 .node-toolbar-btn �?32px,避免文字换行 */
            min-width: auto;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .node-toolbar-dropdown-btn > span {
            white-space: nowrap;
        }

        .node-toolbar-dropdown-btn .dropdown-arrow {
            width: 12px;
            height: 12px;
            transition: transform 0.2s ease;
        }

        .node-toolbar-dropdown.active .dropdown-arrow {
            transform: rotate(180deg);
        }

        .node-toolbar-dropdown-menu {
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: -2px;          /* 与触发按钮无缝衔接，避免 onmouseleave 闪烁 */
            min-width: 96px;
            background: rgba(15, 15, 15, 0.98);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 10px;
            padding: 8px 4px 4px;       /* 上方�?4px 内边距充当视觉间距且保持 hit-area */
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
            display: none;
            z-index: 20;
            opacity: 0;
            transform: translateY(-6px);
            transition: opacity 0.2s ease, transform 0.2s ease;
            flex-direction: column;
            gap: 2px;
            white-space: nowrap;
        }
        .node-toolbar-dropdown-menu .node-toolbar-dropdown-item {
            width: 100%;
            justify-content: flex-start;
        }

        .node-toolbar-dropdown.active .node-toolbar-dropdown-menu {
            display: flex;
            opacity: 1;
            transform: translateY(0);
        }

        .node-toolbar-dropdown-item {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 10px;
            font-size: 12px;
            color: rgba(228, 228, 228, 0.8);
            background: transparent;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.15s ease;
            text-align: left;
            white-space: nowrap;
        }

        .node-toolbar-dropdown-item:hover {
            background: rgba(255, 255, 255, 0.1);
            color: rgba(228, 228, 228, 1);
        }

        .node-toolbar-dropdown-item.active {
            background: rgba(255, 255, 255, 0.15);
            color: rgba(228, 228, 228, 1);
        }

        .node-toolbar-dropdown-item svg {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }

        /* ── 放大查看模态（图片 / 视频通用�?── */
        .lightbox {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.78);
            backdrop-filter: blur(0px);
            -webkit-backdrop-filter: blur(0px);
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 4vh 4vw;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.25s ease, backdrop-filter 0.25s ease, -webkit-backdrop-filter 0.25s ease;
        }
        .lightbox.active {
            opacity: 1;
            pointer-events: auto;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        .lightbox-container {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 16px;
            background: transparent;
            box-shadow: none;
            overflow: visible;
            transform: scale(0.94) translateY(8px);
            opacity: 0;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
        }
        .lightbox.active .lightbox-container {
            transform: scale(1) translateY(0);
            opacity: 1;
        }

        .lightbox-close {
            opacity: 0;
            transform: scale(0.9);
            transition: opacity 0.25s ease 0.05s, transform 0.25s ease 0.05s, background 0.2s;
        }
        .lightbox.active .lightbox-close {
            opacity: 1;
            transform: scale(1);
        }

        /* 灯箱：全景球面预览切换按�?*/
        .lightbox-pano-toggle {
            position: fixed;
            bottom: 40px;
            left: 50%;
            transform: translateX(-50%);
            padding: 10px 24px;
            font-size: 14px;
            font-weight: 500;
            color: #fff;
            background: rgba(153, 153, 153, 0.85);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 12px;
            cursor: pointer;
            z-index: 10002;
            backdrop-filter: blur(8px);
            transition: background 0.2s, transform 0.2s;
            display: none;
        }
        .lightbox-pano-toggle:hover {
            background: rgba(153, 153, 153, 1);
            transform: translateX(-50%) scale(1.05);
        }

        /* 灯箱：全景球面画�?*/
        .lightbox-pano-sphere {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            display: none;
            cursor: grab;
            background: #1a1a1a;
        }
        .lightbox-pano-sphere:active { cursor: grabbing; }

        /* 灯箱：全景控制条 */
        .lightbox-pano-controls {
            position: fixed;
            left: 50%;
            bottom: 80px;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 14px;
            border-radius: 12px;
            background: rgba(20, 20, 20, 0.85);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.12);
            z-index: 10002;
            opacity: 1;
            transition: opacity 0.2s;
            white-space: nowrap;
        }

        .lightbox-image {
            max-width: min(90vw, 1400px);
            max-height: 90vh;
            object-fit: contain;
            display: none;
            border-radius: 16px;
            transition: transform 0.1s ease-out;
            transform-origin: center center;
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
        }
        .lightbox-image.active { display: block; }

        .lightbox-video {
            width: min(90vw, 1280px);
            height: min(85vh, 720px);
            display: none;
            background: #000;
            border-radius: 16px;
            overflow: hidden;
        }
        .lightbox-video.active { display: block; }

        .lightbox-close {
            position: fixed;
            top: 20px;
            right: 20px;
            width: 40px;
            height: 40px;
            background: rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 10px;
            color: #fff;
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            z-index: 10001;
        }
        .lightbox-close:hover {
            background: rgba(255, 255, 255, 0.16);
            transform: scale(1.05);
        }

        /* ── 文字节点全屏编辑模态框 ── */
        .text-editor-modal {
            position: fixed;
            inset: 0;
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }
        .text-editor-modal.active {
            opacity: 1;
            pointer-events: auto;
        }
        .text-editor-backdrop {
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.75);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }
        .text-editor-modal-container {
            position: relative;
            width: 90%;
            max-width: 900px;
            max-height: 85vh;
            background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            display: flex;
            flex-direction: column;
            transform: scale(0.95) translateY(20px);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .text-editor-modal.active .text-editor-modal-container {
            transform: scale(1) translateY(0);
        }
        .text-editor-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px 24px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        .text-editor-modal-header h3 {
            margin: 0;
            font-size: 18px;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.95);
        }
        .text-editor-modal-close {
            background: none;
            border: none;
            color: rgba(255, 255, 255, 0.6);
            font-size: 28px;
            line-height: 1;
            cursor: pointer;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            transition: all 0.2s ease;
        }
        .text-editor-modal-close:hover {
            background: rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.9);
        }
        .text-editor-modal-textarea {
            flex: 1;
            padding: 24px;
            background: rgba(0, 0, 0, 0.2);
            border: none;
            color: rgba(255, 255, 255, 0.95);
            font-size: 16px;
            line-height: 1.8;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            resize: none;
            outline: none;
            min-height: 400px;
            border-radius: 0 0 16px 16px;
        }
        .text-editor-modal-textarea::placeholder {
            color: rgba(255, 255, 255, 0.3);
        }

        /* ── 覆盖确认模�?── */
        .confirm-modal {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.65);
            backdrop-filter: blur(0);
            -webkit-backdrop-filter: blur(0);
            z-index: 10100;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.22s ease, backdrop-filter 0.22s ease, -webkit-backdrop-filter 0.22s ease;
        }
        .confirm-modal.active {
            opacity: 1;
            pointer-events: auto;
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
        }
        .confirm-modal-card {
            background: var(--color-surface);
            border: 1px solid var(--color-border);
            border-radius: 14px;
            padding: 24px 24px 18px;
            width: 360px;
            max-width: 90vw;
            box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
            transform: scale(0.94) translateY(8px);
            opacity: 0;
            transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease;
        }
        .confirm-modal.active .confirm-modal-card {
            transform: scale(1) translateY(0);
            opacity: 1;
        }
        .confirm-modal-title {
            margin: 0 0 10px;
            font-size: 16px;
            font-weight: 600;
            color: var(--color-cream);
        }
        .confirm-modal-message {
            margin: 0 0 6px;
            font-size: 13px;
            color: var(--color-stone);
            line-height: 1.6;
        }
        .confirm-modal-note {
            margin: 0 0 20px;
            font-size: 12px;
            color: #858585;
            font-style: italic;
            letter-spacing: 0.02em;
        }
        .confirm-modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }
        .confirm-modal-btn {
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 13px;
            font-family: inherit;
            cursor: pointer;
            border: 1px solid transparent;
            transition: all 0.15s;
        }
        .confirm-modal-btn--secondary {
            background: transparent;
            border-color: var(--color-border);
            color: var(--color-stone);
        }
        .confirm-modal-btn--secondary:hover {
            background: rgba(255, 255, 255, 0.05);
            color: var(--color-cream);
            border-color: rgba(255, 255, 255, 0.12);
        }
        .confirm-modal-btn--primary {
            background: var(--color-ember);
            color: #fff;
            border-color: var(--color-ember);
        }
        .confirm-modal-btn--primary:hover {
            background: #797979;
            border-color: #797979;
        }
        
        .node-toolbar {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }
        
        .node-tool {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            padding: 8px 12px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 10px;
            color: #a2a2a2;
            font-size: 0.8em;
            cursor: pointer;
            transition: all 0.2s;
            flex-direction: column;
            min-width: 50px;
        }
        
        .node-tool:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #e4e4e4;
        }
        
        .node-tool-icon {
            font-size: 1.1em;
        }
        
        .node-prompt {
            background: transparent;
            border: none;
            border-radius: 0;
            padding: 0;
            margin-bottom: 16px;
        }

        .node-prompt textarea,
        .node-prompt .ce-prompt {
            width: 100%;
            background: transparent;
            border: none;
            color: var(--color-stone);
            font-size: 13px;
            outline: none;
            resize: none;
            min-height: 120px;
            font-family: var(--font-sans);
            line-height: 1.7;
        }

        .node-prompt .ce-prompt {
            white-space: pre-wrap;
            word-wrap: break-word;
            overflow-wrap: break-word;
            max-height: 360px;
            overflow-y: auto;
        }

        .node-prompt textarea::placeholder {
            color: #535353;
        }

        .node-prompt .ce-prompt:empty::before {
            content: attr(data-placeholder);
            color: #535353;
            pointer-events: none;
        }

        /* 提示词中�?图片N"引用做成一个原子小方块 */
        .prompt-chip {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 2px 8px 2px 3px;
            margin: 0 4px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 6px;
            color: #e4e4e4;
            font-size: 0.9em;
            line-height: 1.2;
            vertical-align: -3px;
            user-select: none;
            cursor: grab;
            transition: background 0.15s ease, border-color 0.15s ease, outline 0.15s ease;
            outline: 2px solid transparent;
            outline-offset: 1px;
        }

        /* 芯片被选中时的样式（通过 JS 检测选区添加 class�?*/
        .prompt-chip.selected-by-range {
            background: rgba(129, 129, 129, 0.4);
            border-color: rgba(129, 129, 129, 0.9);
            outline: 2px solid rgba(129, 129, 129, 0.6);
            color: #fff;
        }

        .prompt-chip:hover {
            background: rgba(129, 129, 129, 0.18);
            border-color: rgba(129, 129, 129, 0.55);
        }

        .prompt-chip img {
            width: 18px;
            height: 18px;
            border-radius: 3px;
            object-fit: cover;
            display: block;
            flex-shrink: 0;
            background: #0f0f0f;
        }

        .prompt-chip .prompt-chip-label {
            white-space: nowrap;
        }

        /* 悬停时显示的删除按钮 */
        .prompt-chip-close {
            position: absolute;
            top: -7px;
            right: -7px;
            width: 16px;
            height: 16px;
            background: #686868;
            color: #fff;
            border: none;
            border-radius: 50%;
            font-size: 10px;
            line-height: 16px;
            text-align: center;
            cursor: pointer;
            padding: 0;
            display: none;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
            user-select: none;
        }

        .prompt-chip:hover .prompt-chip-close {
            display: block;
        }

        .prompt-chip-close:hover {
            background: #4d4d4d;
        }

        /* 芯片拖拽状�?*/
        .prompt-chip[data-dragging="true"] {
            opacity: 0.4;
            cursor: grabbing;
            pointer-events: none;
        }

        .prompt-chip:active {
            cursor: grabbing;
        }

        /* 拖拽插入位置指示�?*/
        .chip-drop-indicator {
            display: inline-block;
            width: 2px;
            height: 1.2em;
            background: rgba(129, 129, 129, 1);
            vertical-align: middle;
            margin: 0 1px;
            box-shadow: 0 0 4px rgba(129, 129, 129, 0.8);
            animation: chip-indicator-pulse 0.8s ease-in-out infinite;
        }

        @keyframes chip-indicator-pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        /* 芯片被选区选中时的样式 */
        .prompt-chip::selection {
            background: rgba(129, 129, 129, 0.3);
        }

        /* 参考图缩略图条（图生图/图生视频�?*/
        .ref-images-bar {
            display: none;
            align-items: center;
            gap: 8px;
            padding: 6px 2px 10px 2px;
            margin-bottom: 8px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            flex-wrap: wrap;
            position: relative;
        }

        .ref-images-bar.has-items {
            display: flex;
        }

        /* �?bar 内拖动重新排序时的插入位置指示线 */
        .ref-drop-indicator {
            position: absolute;
            width: 2px;
            height: 44px;
            top: 6px;
            left: 0;
            background: rgba(129, 129, 129, 0.95);
            border-radius: 1px;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.1s ease, left 0.08s ease;
            box-shadow: 0 0 6px rgba(129, 129, 129, 0.7);
        }
        .ref-drop-indicator.show {
            opacity: 1;
        }
        /* 拖动中的缩略图变�?*/
        .ref-thumb[data-dragging="true"] {
            opacity: 0.35;
        }

        .ref-images-bar-label {
            font-size: 11px;
            color: var(--color-ash);
            letter-spacing: 0.05em;
            margin-right: 2px;
            user-select: none;
        }

        .ref-thumb {
            position: relative;
            width: 44px;
            height: 44px;
            border-radius: 8px;
            overflow: visible;
            cursor: pointer;
            flex-shrink: 0;
        }

        .ref-thumb-inner {
            width: 100%;
            height: 100%;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.1);
            background: #0f0f0f;
            transition: border-color 0.15s ease, transform 0.15s ease;
        }

        .ref-thumb:hover .ref-thumb-inner {
            border-color: rgba(129, 129, 129, 0.8);
            transform: translateY(-1px);
        }

        .ref-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .ref-thumb-badge {
            position: absolute;
            top: -6px;
            right: -6px;
            min-width: 18px;
            height: 18px;
            padding: 0 5px;
            background: #181818;
            border: 1px solid rgba(255, 255, 255, 0.18);
            color: #e4e4e4;
            border-radius: 9px;
            font-size: 11px;
            line-height: 16px;
            font-weight: 600;
            text-align: center;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
            pointer-events: none;
            transition: opacity 0.15s ease;
        }

        .ref-thumb-remove {
            position: absolute;
            top: -7px;
            right: -7px;
            width: 18px;
            height: 18px;
            background: #686868;
            color: #fff;
            border: none;
            border-radius: 50%;
            font-size: 11px;
            line-height: 18px;
            text-align: center;
            cursor: pointer;
            padding: 0;
            display: none;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
        }

        .ref-thumb:hover .ref-thumb-remove {
            display: block;
        }

        .ref-thumb:hover .ref-thumb-badge {
            opacity: 0;
        }

        .ref-thumb-remove:hover {
            background: #4d4d4d;
        }

        /* 悬浮放大预览 */
        .ref-thumb-preview {
            position: absolute;
            bottom: calc(100% + 10px);
            left: 50%;
            transform: translateX(-50%) scale(0.92);
            transform-origin: bottom center;
            max-width: 240px;
            max-height: 240px;
            padding: 4px;
            background: #181818;
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 10px;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
            z-index: 1100;
        }

        .ref-thumb-preview img {
            display: block;
            max-width: 232px;
            max-height: 232px;
            width: auto;
            height: auto;
            border-radius: 6px;
            object-fit: contain;
        }

        .ref-thumb:hover .ref-thumb-preview {
            opacity: 1;
            transform: translateX(-50%) scale(1);
        }

        /* 拖动参考图时跟随鼠标的浮动标签（仅文字，居中于鼠标�?*/
        .drag-ghost {
            position: fixed;
            top: 0;
            left: 0;
            padding: 4px 10px;
            background: rgba(28, 28, 28, 0.96);
            border: 1px solid rgba(129, 129, 129, 0.7);
            border-radius: 6px;
            color: #e4e4e4;
            font-size: 13px;
            line-height: 1.2;
            white-space: nowrap;
            pointer-events: none;
            user-select: none;
            z-index: 2000;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
            will-change: transform;
        }

        /* 拖入提示词时的高�?*/
        .node-prompt.drop-active textarea {
            background: rgba(129, 129, 129, 0.08);
            outline: 1px dashed rgba(129, 129, 129, 0.6);
            outline-offset: -2px;
            border-radius: 6px;
        }

        /* @ 引用弹窗 */
        .mention-popup {
            position: fixed;
            min-width: 180px;
            max-width: 240px;
            max-height: 260px;
            overflow-y: auto;
            background: #1f1f1f;
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 10px;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
            padding: 4px;
            z-index: 1200;
            display: none;
        }

        .mention-popup.show {
            display: block;
        }

        /* 隐藏 @ 弹窗滚动条（保留滚动能力�?*/
        .mention-popup { scrollbar-width: none; }
        .mention-popup::-webkit-scrollbar { display: none; }

        /* 来源 Tab：分段控件，区分「连接图」与「资源池」（�?wuli�?*/
        .mention-popup-tabs {
            position: sticky; top: 0; z-index: 1;
            display: flex; gap: 3px;
            padding: 3px;
            margin: 0 0 5px;
            background: #161616;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 8px;
        }
        .mention-popup-tab {
            flex: 1; display: inline-flex; align-items: center; justify-content: center;
            padding: 6px 4px; border-radius: 6px;
            background: none; border: none; cursor: pointer;
            color: #959595; line-height: 0;
            transition: background 0.12s ease, color 0.12s ease;
        }
        .mention-popup-tab svg { flex: 0 0 auto; opacity: 0.85; }
        .mention-popup-tab:hover { color: #e3e3e3; }
        .mention-popup-tab.active { background: #2c2c2c; color: #ececec; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
        .mention-popup-tab.active svg { opacity: 1; }
        .mention-popup-tab.empty { color: #565656; }

        /* @ 弹窗：悬停项的右侧小预览 */
        .mention-img-preview {
            position: fixed; z-index: 1300; display: none;
            width: 160px; height: 160px;
            border-radius: 10px; overflow: hidden;
            border: 1px solid rgba(255,255,255,0.14); background: #0f0f0f;
            box-shadow: 0 12px 32px rgba(0,0,0,0.6); pointer-events: none;
        }
        .mention-img-preview img, .mention-img-preview video {
            width: 100%; height: 100%; object-fit: contain; display: block; background: #000;
        }

        /* 提示词节点：被它控制的生成节点，提示词框只读 + 来源徽标 */
        .global-prompt.prompt-locked { opacity: 0.7; cursor: not-allowed; }
        .node-prompt.prompt-locked { position: relative; }
        .prompt-lock-badge {
            display: inline-flex; align-items: center; justify-content: center;
            margin-top: 6px; color: #696969;
            background: rgba(105, 105, 105,0.12); border: 0.5px solid rgba(105, 105, 105,0.35);
            border-radius: 6px; padding: 4px; width: fit-content;
        }

        /* ========== 生成日志（右上角图标 + 模态，沿用原功能） ========== */
        .gen-log-toggle {
            position: fixed; right: 18px; top: 18px; z-index: 8500;
            display: inline-flex; align-items: center; gap: 6px;
            width: 38px; height: 38px; justify-content: center;
            padding: 0; border-radius: 10px; cursor: pointer;
            background: rgba(19, 19, 19,0.9); border: 0.5px solid #282828;
            color: #c1c1c1; font-size: 12px;
            backdrop-filter: blur(10px);
            transition: background 0.15s ease, color 0.15s ease;
        }
        .gen-log-toggle:hover { background: rgba(38, 38, 38,0.95); color: #ececec; }

        @media (max-width: 600px) {
            .floating-brand-copy {
                align-items: flex-start;
                flex-direction: column;
                gap: 2px;
            }

            .project-name {
                max-width: min(190px, calc(100vw - 128px));
            }
        }

        .gen-log-badge {
            min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
            background: #696969; color: #fff; font-size: 10px; line-height: 16px; text-align: center;
        }
        .gen-log-modal {
            position: fixed; inset: 0; z-index: 9100; display: none;
            background: rgba(0,0,0,0.45); backdrop-filter: blur(2px);
            align-items: flex-start; justify-content: flex-end;
        }
        .gen-log-modal.open { display: flex; }
        .gen-log-panel {
            width: 380px; max-width: calc(100vw - 24px);
            margin: 56px 16px 16px; max-height: calc(100vh - 80px);
            display: flex; flex-direction: column;
            background: #131313; border: 0.5px solid #282828; border-radius: 14px;
            box-shadow: 0 24px 64px rgba(0,0,0,0.6); overflow: hidden;
        }
        .gen-log-head {
            display: flex; align-items: center; justify-content: space-between;
            padding: 13px 16px; border-bottom: 0.5px solid #1c1c1c; flex: 0 0 auto;
        }
        .gen-log-title { display: flex; align-items: center; gap: 8px; color: #ececec; font-size: 15px; font-family: Georgia, 'Times New Roman', serif; }
        .gen-log-actions { display: flex; align-items: center; gap: 8px; }
        .gen-log-clear {
            background: none; border: 0.5px solid #282828; border-radius: 6px;
            color: #848484; font-size: 12px; padding: 4px 10px; cursor: pointer;
            display: inline-flex; align-items: center; gap: 5px;
        }
        .gen-log-clear:hover { color: #696969; border-color: #696969; }
        .gen-log-clear[disabled] { opacity: 0.4; cursor: default; pointer-events: none; }
        .gen-log-close { background: none; border: none; color: #656565; font-size: 16px; cursor: pointer; padding: 2px 6px; }
        .gen-log-close:hover { color: #ececec; }
        .gen-log-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 14px; scrollbar-width: none; }
        .gen-log-list::-webkit-scrollbar { display: none; }
        .gen-log-empty { padding: 48px 16px; text-align: center; color: #464646; font-size: 13px; }
        .gen-log-item {
            border: 0.5px solid #212121; border-radius: 10px;
            padding: 10px 12px; margin-bottom: 8px; background: #0e0e0e;
        }
        .gen-log-item.failed { border-color: rgba(105, 105, 105,0.4); }
        .gen-log-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
        .gen-log-chip {
            font-size: 11px; padding: 1px 7px; border-radius: 6px;
            background: rgba(255,255,255,0.07); color: #c1c1c1;
        }
        .gen-log-chip.st-ok { background: rgba(137, 137, 137,0.18); color: #b5b5b5; }
        .gen-log-chip.st-fail { background: rgba(105, 105, 105,0.2); color: #a3a3a3; }
        .gen-log-sub { margin-top: 6px; font-size: 11px; color: #656565; }
        /* 报错"翻译"：人话原因 + 怎么办，比原始报错更醒目（暖黄提示色） */
        .gen-log-hint {
            margin-top: 6px; font-size: 12px; color: #cdcdcd; line-height: 1.6;
            background: rgba(205, 205, 205,0.12); border-left: 2px solid #aeaeae;
            border-radius: 6px; padding: 6px 9px;
        }
        .gen-log-hint b { color: #dcdcdc; font-weight: 600; }
        .gen-log-error {
            margin-top: 6px; font-size: 11px; color: #a3a3a3; line-height: 1.5;
            background: rgba(105, 105, 105,0.1); border-radius: 6px; padding: 5px 8px;
            max-height: 4.5em; overflow: hidden; cursor: pointer;
        }
        .gen-log-error:hover { background: rgba(105, 105, 105,0.18); }
        .gen-log-error.copied { color: #b5b5b5; }
        .gen-log-prompt {
            margin-top: 6px; font-size: 12px; color: #c9c9c9; line-height: 1.5;
            cursor: pointer; border-radius: 6px; padding: 4px 6px;
            display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
        }
        .gen-log-prompt:hover { background: rgba(255,255,255,0.05); }
        .gen-log-prompt.copied { color: #b5b5b5; }
        .gen-log-thumbs { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
        .gen-log-thumbs img, .gen-log-thumbs video {
            width: 54px; height: 54px; object-fit: cover; border-radius: 6px;
            border: 0.5px solid #212121; cursor: pointer; background: #000;
        }
        .gen-log-thumbs img:hover, .gen-log-thumbs video:hover { border-color: #696969; }

        .mention-popup-empty {
            padding: 10px 12px;
            font-size: 12px;
            color: #727272;
            text-align: center;
        }

        .mention-popup-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 6px 8px;
            border-radius: 6px;
            cursor: pointer;
            user-select: none;
        }

        .mention-popup-item:hover,
        .mention-popup-item.active {
            background: rgba(129, 129, 129, 0.18);
        }

        .mention-popup-thumb {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            overflow: hidden;
            background: #0f0f0f;
            border: 1px solid rgba(255, 255, 255, 0.08);
            flex-shrink: 0;
        }

        .mention-popup-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .mention-popup-text {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            line-height: 1.1;
        }

        .mention-popup-name {
            font-size: 13px;
            color: var(--color-stone);
        }

        .mention-popup-alias {
            font-size: 11px;
            color: var(--color-ash);
            margin-top: 2px;
        }

        .node-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            font-size: 0.8em;
            color: #a2a2a2;
            flex-wrap: wrap;
        }
        
        .node-footer-group {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        /* 视频模型名过长时省略，避免把工具条挤爆（后端 label 可能很长） */
        #selected-video-model {
            display: inline-block;
            max-width: 170px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            vertical-align: middle;
        }

        /* 批次数量按钮：定�?dropdown 用；紧贴生成按钮（覆�?.node-footer �?gap�?*/
        #batch-count-group { position: relative; margin-left: auto; margin-right: -4px; }
        #batch-count-dropdown {
            min-width: 96px;
            padding: 4px 0;
            top: auto;
            bottom: 100%;
            margin-bottom: 8px;
            margin-top: 0;
        }
        #batch-count-dropdown .dropdown-item {
            padding: 8px 14px;
            cursor: pointer;
            font-size: 12px;
            color: #e4e4e4;
            transition: background 0.15s;
        }
        #batch-count-dropdown .dropdown-item:hover {
            background: rgba(255,255,255,0.08);
        }
        #batch-count-dropdown .dropdown-item.selected {
            background: rgba(129, 129, 129, 0.2);
            color: #fff;
        }
        
        .node-option {
            padding: 6px 10px;
            background: rgba(255, 255, 255, 0.04);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 4px;
            white-space: nowrap;
        }

        /* 视频时长滑块 */
        .video-slider {
            -webkit-appearance: none;
            appearance: none;
            width: 100%;
            height: 6px;
            background: linear-gradient(to right,
                rgba(129, 129, 129, 0.6) 0%,
                rgba(129, 129, 129, 0.6) var(--slider-progress, 50%),
                rgba(255, 255, 255, 0.08) var(--slider-progress, 50%),
                rgba(255, 255, 255, 0.08) 100%);
            border-radius: 6px;
            outline: none;
            margin-top: 4px;
            transition: height 0.2s ease;
        }
        .video-slider:hover {
            height: 8px;
        }
        .video-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            background: linear-gradient(135deg, #818181 0%, #5a5a5a 100%);
            border-radius: 50%;
            cursor: grab;
            box-shadow: 0 2px 8px rgba(129, 129, 129, 0.4),
                        0 0 0 3px rgba(129, 129, 129, 0.15);
            transition: all 0.2s ease;
        }
        .video-slider::-webkit-slider-thumb:hover {
            transform: scale(1.15);
            box-shadow: 0 3px 12px rgba(129, 129, 129, 0.6),
                        0 0 0 4px rgba(129, 129, 129, 0.25);
        }
        .video-slider::-webkit-slider-thumb:active {
            cursor: grabbing;
            transform: scale(1.05);
        }
        .video-slider::-moz-range-thumb {
            width: 18px;
            height: 18px;
            background: linear-gradient(135deg, #818181 0%, #5a5a5a 100%);
            border-radius: 50%;
            cursor: grab;
            border: none;
            box-shadow: 0 2px 8px rgba(129, 129, 129, 0.4);
            transition: all 0.2s ease;
        }
        .video-slider::-moz-range-thumb:hover {
            transform: scale(1.15);
            box-shadow: 0 3px 12px rgba(129, 129, 129, 0.6);
        }
        .video-slider::-moz-range-thumb:active {
            cursor: grabbing;
            transform: scale(1.05);
        }
        .video-slider::-moz-range-track {
            background: transparent;
        }

        /* 视频音频切换 */
        .video-audio-toggle-group {
            display: flex;
            gap: 8px;
            margin-top: 6px;
        }
        .video-audio-btn {
            flex: 1;
            padding: 8px 0;
            text-align: center;
            font-size: 12px;
            color: #d4d4d4;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.18s;
        }
        .video-audio-btn:hover {
            background: rgba(255, 255, 255, 0.08);
        }
        .video-audio-btn.active {
            background: rgba(255, 255, 255, 0.95);
            color: #181818;
            border-color: #fff;
        }

        .video-help {
            display: inline-flex;
            width: 14px; height: 14px;
            border-radius: 50%;
            background: rgba(255,255,255,0.1);
            color: #a2a2a2;
            font-size: 10px;
            align-items: center; justify-content: center;
            margin-left: 4px;
            cursor: help;
        }

        /* 视频模式选择�?*/
        .video-mode-bar {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 2px 10px 2px;
            margin-bottom: 8px;
            flex-wrap: wrap;
        }

        .video-mode-option {
            padding: 6px 14px;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.18);
            color: #e4e4e4;
            background: rgba(255, 255, 255, 0.03);
            font-size: 12px;
            cursor: pointer;
            user-select: none;
            transition: all 0.18s ease;
            white-space: nowrap;
        }

        .video-mode-option:hover:not(.disabled):not(.active) {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.35);
        }

        .video-mode-option.active {
            background: rgba(255, 255, 255, 0.95);
            border-color: rgba(255, 255, 255, 1);
            color: #181818;
            font-weight: 500;
        }

        .video-mode-option.disabled {
            opacity: 0.4;
            cursor: not-allowed;
            color: #727272;
            border-color: rgba(255, 255, 255, 0.08);
        }

        /* 接景节点专属：面板顶部的 模式 + 比例 条 */
        .matte-mode-bar {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 2px 10px 2px;
            margin-bottom: 8px;
            flex-wrap: wrap;
        }
        .matte-mode-bar .matte-seg {
            display: inline-flex;
            border: 1px solid rgba(255, 255, 255, 0.18);
            border-radius: 999px;
            overflow: hidden;
        }
        .matte-mode-bar .matte-seg-btn {
            padding: 6px 16px;
            border: none;
            background: rgba(255, 255, 255, 0.03);
            color: #e4e4e4;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.18s ease;
            white-space: nowrap;
        }
        .matte-mode-bar .matte-seg-btn:hover:not(.active) {
            background: rgba(255, 255, 255, 0.08);
        }
        .matte-mode-bar .matte-seg-btn.active {
            background: rgba(255, 255, 255, 0.95);
            color: #181818;
            font-weight: 500;
        }
        .matte-mode-bar .matte-aspect {
            padding: 6px 10px;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.18);
            background: rgba(255, 255, 255, 0.03);
            color: #e4e4e4;
            font-size: 12px;
            cursor: pointer;
            outline: none;
        }
        .matte-mode-bar .matte-aspect option { background: #151515; color: #e4e4e4; }
        .matte-mode-bar .matte-mode-status {
            font-size: 11px;
            color: #c1c1c1;
            opacity: 0;
            transition: opacity 0.18s;
            white-space: nowrap;
        }
        .matte-mode-bar .matte-mode-status.show { opacity: 1; }
        /* 独立的地平线开关按钮：单独成丸，区别于分段控件 */
        .matte-mode-bar .matte-horizon-btn {
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.18);
        }

        .node-option .resolution-icon {
            flex-shrink: 0;
        }

        .node-option:hover {
            background: rgba(255, 255, 255, 0.08);
        }
        
        .node-submit {
            width: 32px;
            height: 32px;
            background: rgba(255, 255, 255, 0.08);
            border: none;
            border-radius: 8px;
            color: #e4e4e4;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        
        .node-submit:hover {
            background: linear-gradient(135deg, #818181 0%, #5a5a5a 100%);
            color: white;
        }
        
        .node-submit.loading {
            background: rgba(129, 129, 129, 0.3);
            cursor: not-allowed;
        }

        /* From Uiverse.io by andrew-manzyk - 生成中循环动�?*/
        .node-submit .loader {
            --fill-color: #ffffff;
            --shine-color: #ffffff55;
            transform: scale(0.18);            /* 适配 32px 按钮 */
            width: 100px;
            height: 100px;
            position: relative;
            filter: drop-shadow(0 0 10px var(--shine-color));
            pointer-events: none;
        }
        /* �?.node-submit 内含 loader 时也能撑住绝对定位的子元�?*/
        .node-submit { position: relative; overflow: hidden; }

        .loader #pegtopone {
            position: absolute;
            top: 0; left: 0;
            animation: flowe-one 1s linear infinite;
        }
        .loader #pegtoptwo {
            position: absolute;
            top: 0; left: 0;
            opacity: 0;
            transform: scale(0) translateY(-200px) translateX(-100px);
            animation: flowe-two 1s linear infinite;
            animation-delay: 0.3s;
        }
        .loader #pegtopthree {
            position: absolute;
            top: 0; left: 0;
            opacity: 0;
            transform: scale(0) translateY(-200px) translateX(100px);
            animation: flowe-three 1s linear infinite;
            animation-delay: 0.6s;
        }
        .loader svg { width: 100px; height: 100px; display: block; }
        .loader svg g path:first-child { fill: var(--fill-color); }

        @keyframes flowe-one {
            0%   { transform: scale(0.5) translateY(-200px); opacity: 0; }
            25%  { transform: scale(0.75) translateY(-100px); opacity: 1; }
            50%  { transform: scale(1) translateY(0px); opacity: 1; }
            75%  { transform: scale(0.5) translateY(50px); opacity: 1; }
            100% { transform: scale(0) translateY(100px); opacity: 0; }
        }
        @keyframes flowe-two {
            0%   { transform: scale(0.5) rotateZ(-10deg) translateY(-200px) translateX(-100px); opacity: 0; }
            25%  { transform: scale(1) rotateZ(-5deg) translateY(-100px) translateX(-50px); opacity: 1; }
            50%  { transform: scale(1) rotateZ(0deg) translateY(0px) translateX(-25px); opacity: 1; }
            75%  { transform: scale(0.5) rotateZ(5deg) translateY(50px) translateX(0px); opacity: 1; }
            100% { transform: scale(0) rotateZ(10deg) translateY(100px) translateX(25px); opacity: 0; }
        }
        @keyframes flowe-three {
            0%   { transform: scale(0.5) rotateZ(10deg) translateY(-200px) translateX(100px); opacity: 0; }
            25%  { transform: scale(1) rotateZ(5deg) translateY(-100px) translateX(50px); opacity: 1; }
            50%  { transform: scale(1) rotateZ(0deg) translateY(0px) translateX(25px); opacity: 1; }
            75%  { transform: scale(0.5) rotateZ(-5deg) translateY(50px) translateX(0px); opacity: 1; }
            100% { transform: scale(0) rotateZ(-10deg) translateY(100px) translateX(-25px); opacity: 0; }
        }
        
        /* 节点连接�?*/
        /* ===== 端口：抄 wuli —�?14px 小圆，深填充+浅灰边，骑在卡片边缘，默认隐藏，crosshair ===== */
        .node-port {
            position: absolute;
            top: 50%;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #1a1a1a;                  /* 卡片色填�?*/
            border: 1.8px solid #dedede;          /* 浅灰边（wuli 深色主题 --strong�?*/
            transform: translateY(-50%);
            z-index: 6;
            cursor: crosshair;
            opacity: 0;
            pointer-events: none;
            transition: opacity .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
        }

        /* 扩大可抓取区域（透明），但不改变视觉大小 */
        .node-port::before {
            content: '';
            position: absolute;
            inset: -7px;
            border-radius: 50%;
            background: transparent;
        }

        /* 14px 圆心正好落在卡片�?右边缘（卡片边缘 = 节点�?PORT_SLOT=32 处） */
        .node-port.input { left: 25px; }
        .node-port.output { right: 25px; }

        /* 悬浮节点 / 选中节点 / 拖线目标节点 时显示端�?*/
        .node:hover .node-port,
        .node.selected .node-port,
        .node.connection-drop-target .node-port,
        .canvas.linking .node-port {
            opacity: 1;
            pointer-events: auto;
        }

        /* 端口本体悬浮 / 拖线激活：填充变亮、放�?*/
        .node-port:hover,
        .node-port.is-active {
            background: #dedede;
            transform: translateY(-50%) scale(1.22);
            box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
        }
        
        /* 连线SVG */
        .connections-svg {
            position: absolute;
            top: 0;
            left: 0;
            width: 1000000px;
            height: 1000000px;
            pointer-events: none;
            z-index: 1;
            /* SVG 默认 overflow:hidden，会把超�?width/height �?path 裁掉�?
               用户把画布拖到极远处时（如世界坐�?500 万）连线就会消失 �?必须 visible�?*/
            overflow: visible;
        }
        
        /* ===== 连线：抄 wuli —�?石板灰细�?===== */
        .connection-path {
            fill: none;
            stroke: rgba(161, 161, 161, 0.434);   /* wuli flow 线色 */
            stroke-width: 2;  /* 普通连线减细20%，选中与悬停高亮保留 */
            stroke-linecap: round;
            transition: stroke 0.15s ease;
        }

        /* 鼠标悬停连线（命中区在上层捕�?hover，连同组里的可视线一起加粗高亮） */
        .connection-group:hover .connection-path {
            stroke-width: 3.5;
            stroke: rgba(212, 212, 212, 0.95);
        }

        /* 连线终点小圆点（wuli 在入线端画一个点�?*/
        .connection-endpoint {
            fill: rgba(161, 161, 161, 0.66);
            pointer-events: none;
        }
        .connection-group:hover .connection-endpoint,
        .connection-group.selected .connection-endpoint {
            fill: rgba(212, 212, 212, 0.95);
        }

        .connection-path.temp {
            stroke-dasharray: 5, 5;
            opacity: 0.6;
            animation: dashAnimation 0.5s linear infinite;
        }

        /* 选中节点时：关联连线高亮、其余淡化（能看见即可） */
        .connection-group.conn-dimmed { opacity: 0.18; transition: opacity 0.15s ease; }
        .connection-group.conn-linked .connection-path {
            stroke: rgba(180, 180, 180, 0.68);
            stroke-width: 2;
        }
        .connection-group.conn-linked .connection-endpoint {
            fill: rgba(255, 255, 255, 0.95);
        }

        @keyframes dashAnimation {
            to {
                stroke-dashoffset: -10;
            }
        }

        /* 多选连接时的动画效�?*/
        .connection-path.multi-connecting {
            stroke-width: 4;
            animation: connectionPulse 0.6s ease-out;
        }

        @keyframes connectionPulse {
            0% {
                stroke-width: 6;
                opacity: 0.5;
            }
            100% {
                stroke-width: 3;
                opacity: 1;
            }
        }
        
        /* 底部缩放控制�?*/
        .canvas-view-dock {
            position: fixed;
            right: 14px;
            bottom: 14px;
            width: 164px;
            z-index: 50;
        }
        .zoom-controls {
            height: 34px;
            width: 100%;
            padding: 3px;
            display: flex;
            align-items: center;
            gap: 4px;
            background: rgba(15,15,15,.94);
            border: 1px solid rgba(255,255,255,.06);
            border-radius: 8px;
        }
        .zoom-btn {
            width: 26px;
            height: 26px;
            flex: 0 0 26px;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: none;
            border-radius: 5px;
            color: #707070;
            cursor: pointer;
            transition: background .15s ease, color .15s ease;
        }
        .zoom-btn:hover, .zoom-btn[aria-pressed="true"] {
            background: #232323;
            color: #ddd;
        }
        .zoom-btn:focus-visible { outline: 1px solid #888; outline-offset: 1px; }
        .zoom-btn svg { width: 14px; height: 14px; pointer-events: none; }
        .zoom-level {
            flex: 1;
            padding: 0 3px;
            margin-left: 3px;
            border-left: 1px solid #242424;
            font-size: 10px;
            line-height: 15px;
            color: #858585;
            font-family: var(--font-mono);
            text-align: center;
        }
        .minimap {
            width: 100%;
            height: 116px;
            padding: 6px;
            margin-bottom: 4px;
            background: #1c1c1c;
            border: 1px solid rgba(255,255,255,.07);
            border-radius: 8px;
            cursor: crosshair;
            overflow: hidden;
        }
        .minimap[hidden] { display: none; }
        .minimap:hover { border-color: rgba(255,255,255,.15); }
        body.canvas-connections-hidden #connectionsSvg { visibility: hidden; }
        body.canvas-connections-hidden #connectionsSvg * { pointer-events: none !important; }

        .minimap-content {
            position: relative;
            width: 100%;
            height: 100%;
        }
        /* 缩略的节点方�?*/
        .minimap-node {
            position: absolute;
            background: rgba(153, 153, 153, 0.55);
            border-radius: 2px;
            min-width: 2px;
            min-height: 2px;
        }
        .minimap-node.selected {
            background: #999999;
        }
        /* 当前视野�?*/
        .minimap-viewport {
            position: absolute;
            border: 1.5px solid rgba(154, 154, 154, 0.9);
            background: rgba(154, 154, 154, 0.08);
            border-radius: 2px;
            pointer-events: none;
        }
        .minimap-empty {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #535353;
            font-size: 11px;
            pointer-events: none;
        }

        /* 提示文字 */
        .hint {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #404040;
            font-size: 0.95em;
            pointer-events: none;
            text-align: center;
            z-index: 5;
        }
        
        .hint.hidden {
            display: none;
        }
        
        .hint-key {
            display: inline-block;
            padding: 2px 8px;
            background: rgba(255, 255, 255, 0.04);
            border: 0.5px solid rgba(255, 255, 255, 0.08);
            border-radius: 4px;
            font-family: var(--font-mono);
            font-size: 12px;
            color: var(--color-ash);
            margin: 0 2px;
        }
        
        /* 节点结果展示 */
        .node-result {
            margin-top: 8px;
            padding: 8px;
            background: rgba(129, 129, 129, 0.08);
            border: 1px solid rgba(129, 129, 129, 0.2);
            border-radius: 8px;
            font-size: 0.8em;
            color: #b6b6b6;
            display: none;
        }
        
        .node-result.show {
            display: block;
        }

        /* Task actions below a media card must remain visible and clickable. */
        .node:has(> .node-result.show) {
            content-visibility: visible;
        }
        
        .node-result.error {
            background: rgba(104, 104, 104, 0.08);
            border-color: rgba(104, 104, 104, 0.2);
            color: #b7b7b7;
        }

        /* 框选矩�?*/
        .selection-box {
            position: absolute;
            border: 1px solid rgba(129, 129, 129, 0.9);
            background: rgba(129, 129, 129, 0.08);
            pointer-events: none;
            z-index: 1000;
            display: none;
            border-radius: 4px;
            will-change: transform;
        }

        .selection-box.active {
            display: block;
        }

        /* 甩动断线动画 */
        @keyframes shake {
            0%, 100% {
                transform: translateX(0);
            }
            25% {
                transform: translateX(-8px);
            }
            75% {
                transform: translateX(8px);
            }
        }

        /* 连线选中 - 热区与高�?*/
        .connections-svg {
            pointer-events: none;
        }

        .connection-hit {
            fill: none;
            stroke: transparent;
            stroke-width: 18;  /* 固定命中区宽度，像wuli一�?*/
            stroke-linecap: round;
            pointer-events: stroke;
            cursor: pointer;
        }

        .connection-path.selected {
            stroke: rgba(212, 212, 212, 0.95);
            stroke-width: 3.5;
        }

        /* 连线中点�?剪刀/�?删除按钮：抄 wuli —�?常驻半透明(.55)，悬浮变�?1)，点一下删掉这条线 */
        .connection-cut {
            opacity: 0.55;
            pointer-events: auto;
            cursor: pointer;
            transition: opacity 0.14s ease;
        }
        .connection-cut:hover,
        .connection-group:hover .connection-cut,
        .connection-group.selected .connection-cut {
            opacity: 1;
        }
        .connection-cut circle {
            fill: #1a1a1a;
            stroke: rgba(161, 161, 161, 0.85);
            stroke-width: 1.4;
        }
        .connection-cut path {
            stroke: rgba(161, 161, 161, 0.95);
            stroke-width: 1.6;
            stroke-linecap: round;
        }
        .connection-cut:hover circle {
            fill: rgba(161, 161, 161, 0.95);
        }
        .connection-cut:hover path {
            stroke: #1a1a1a;
        }

        /* 节点 resize handle - 隐藏 */
        .node-resize-handle {
            position: absolute;
            right: -2px;
            bottom: -2px;
            width: 16px;
            height: 16px;
            cursor: nwse-resize;
            display: none !important;
            z-index: 4;
            background: linear-gradient(135deg, transparent 50%, rgba(153, 153, 153, 0.8) 50%);
            border-radius: 0 0 12px 0;
        }

        .node.selected .node-resize-handle {
            display: none !important;
        }

        .node-resize-handle:hover {
            background: linear-gradient(135deg, transparent 50%, #999999 50%);
        }

        /* 文本 / 提示词节点：右下角尺寸手柄（拖动改宽+高，锚定左上角，不移动节点） */
        .node-text-resize {
            position: absolute;
            right: 6px;
            bottom: 6px;
            width: 16px;
            height: 16px;
            cursor: nwse-resize;
            z-index: 7;
            opacity: 0;
            transition: opacity 0.15s ease;
            border-radius: 4px;
            background: rgba(20, 20, 20, 0.6);
            border: 1px solid rgba(153, 153, 153, 0.5);
            /* 右下角斜纹，提示可拖�?*/
            background-image: linear-gradient(-45deg, transparent 50%, rgba(153, 153, 153, 0.9) 50%);
        }
        .node[data-node-type="text"]:hover .node-text-resize,
        .node[data-node-type="prompt"]:hover .node-text-resize,
        .node[data-node-type="panorama"]:hover .node-text-resize,
        .node[data-node-type="image"]:hover .node-text-resize,
        .node[data-node-type="video"]:hover .node-text-resize,
        .node.selected .node-text-resize {
            opacity: 1;
        }
        .node-text-resize:hover {
            border-color: #999999;
            background-image: linear-gradient(-45deg, transparent 50%, #999999 50%);
        }

        /* ===== 全景 HDR 节点 ===== */
        /* 可拖动球面预览：盖在平面图之上，切换时显�?*/
        .pano-sphere {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            display: none;
            z-index: 4;
            cursor: grab;
            background: #2a2a2a;
        }
        .pano-sphere:active { cursor: grabbing; }

        /* 底部控制条：球面切换 + 阳光滑块 */
        .pano-controls {
            position: absolute;
            left: 50%;
            bottom: 10px;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 6px 10px;
            border-radius: 10px;
            background: rgba(20, 20, 20, 0.72);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            z-index: 6;
            opacity: 0.35;
            transition: opacity 0.18s;
            white-space: nowrap;
        }
        .node:hover .pano-controls,
        .node.selected .pano-controls { opacity: 1; }

        .pano-btn {
            font-size: 11px;
            line-height: 1;
            padding: 5px 9px;
            border-radius: 7px;
            border: 1px solid rgba(153, 153, 153, 0.4);
            background: rgba(153, 153, 153, 0.16);
            color: #d0d0d0;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s, color 0.15s;
        }
        .pano-btn:hover {
            background: rgba(153, 153, 153, 0.32);
            border-color: rgba(153, 153, 153, 0.7);
            color: #fff;
        }
        /* 下载按钮：HDR 就绪后点亮成绿色 */
        .pano-dl {
            border-color: rgba(255, 255, 255, 0.18);
            background: rgba(255, 255, 255, 0.06);
            color: rgba(255, 255, 255, 0.45);
        }
        .pano-dl.ready {
            border-color: rgba(184, 184, 184, 0.6);
            background: rgba(184, 184, 184, 0.18);
            color: #e7e7e7;
        }
        .pano-dl.ready:hover {
            background: rgba(184, 184, 184, 0.3);
            color: #fff;
        }

        /* 平面区无法显示真 .hdr 时的提示占位 */
        .pano-hdr-hint {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            color: rgba(208, 208, 208, 0.7);
            text-align: center;
            pointer-events: none;
        }
        .pano-hdr-hint span { font-size: 13px; color: rgba(255, 255, 255, 0.85); }
        .pano-hdr-hint em { font-size: 11px; font-style: normal; color: rgba(255, 255, 255, 0.45); }

        .pano-sun {
            display: flex;
            align-items: center;
            gap: 6px;
            color: #d0d0d0;
            font-size: 11px;
        }
        .pano-sun-ico { font-size: 13px; filter: drop-shadow(0 0 3px rgba(213, 213, 213, 0.6)); }
        .pano-sun-val { min-width: 30px; text-align: right; color: rgba(255, 255, 255, 0.7); }

        .pano-sun-range {
            -webkit-appearance: none;
            appearance: none;
            width: 88px;
            height: 4px;
            border-radius: 2px;
            background: linear-gradient(90deg, rgba(153, 153, 153, 0.25), rgba(213, 213, 213, 0.85));
            outline: none;
            cursor: pointer;
        }
        .pano-sun-range::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 13px;
            height: 13px;
            border-radius: 50%;
            background: #fff;
            border: 2px solid #999999;
            cursor: pointer;
        }
        .pano-sun-range::-moz-range-thumb {
            width: 13px;
            height: 13px;
            border-radius: 50%;
            background: #fff;
            border: 2px solid #999999;
            cursor: pointer;
        }

        /* 阳光强度重置按钮：滑条末端的小圆钮，点一下回到默�?20× */
        .pano-reset {
            width: 20px;
            height: 20px;
            flex: 0 0 auto;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            font-size: 13px;
            line-height: 1;
            border-radius: 50%;
            border: 1px solid rgba(255, 255, 255, 0.18);
            background: rgba(255, 255, 255, 0.06);
            color: rgba(255, 255, 255, 0.65);
            cursor: pointer;
            transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.25s;
        }
        .pano-reset:hover {
            background: rgba(153, 153, 153, 0.25);
            border-color: rgba(153, 153, 153, 0.6);
            color: #fff;
            transform: rotate(-90deg);
        }

        /* 顶部小状态条：转 HDR 进度提示 */
        .pano-status {
            position: absolute;
            top: 8px;
            left: 50%;
            transform: translateX(-50%);
            padding: 4px 10px;
            border-radius: 8px;
            font-size: 11px;
            color: #fff;
            background: rgba(20, 20, 20, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.1);
            z-index: 7;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s;
        }
        .pano-status.show { opacity: 1; }
        .pano-status.busy::after {
            content: '';
            display: inline-block;
            width: 8px;
            height: 8px;
            margin-left: 6px;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top-color: #fff;
            vertical-align: -1px;
            animation: pano-spin 0.7s linear infinite;
        }
        @keyframes pano-spin { to { transform: rotate(360deg); } }

        /* ===== Matte Painting（背景接景）节点控件 ===== */
        .matte-controls {
            position: absolute;
            left: 50%;
            bottom: 10px;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 10px;
            border-radius: 10px;
            background: rgba(20, 20, 20, 0.72);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            z-index: 6;
            opacity: 0.35;
            transition: opacity 0.18s;
            white-space: nowrap;
        }
        .node:hover .matte-controls,
        .node.selected .matte-controls { opacity: 1; }

        /* 模式切换：接景 / 天空（分段按钮） */
        .matte-seg {
            display: inline-flex;
            border: 1px solid rgba(153, 153, 153, 0.4);
            border-radius: 7px;
            overflow: hidden;
        }
        .matte-seg-btn {
            font-size: 11px;
            line-height: 1;
            padding: 5px 9px;
            border: none;
            background: rgba(153, 153, 153, 0.10);
            color: #c3c3c3;
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
        }
        .matte-seg-btn:hover { background: rgba(153, 153, 153, 0.28); color: #fff; }
        .matte-seg-btn.active { background: rgba(153, 153, 153, 0.5); color: #fff; }

        /* 比例下拉 */
        .matte-aspect {
            font-size: 11px;
            line-height: 1;
            padding: 5px 6px;
            border-radius: 7px;
            border: 1px solid rgba(153, 153, 153, 0.4);
            background: rgba(153, 153, 153, 0.16);
            color: #d0d0d0;
            cursor: pointer;
            outline: none;
        }
        .matte-aspect option { background: #151515; color: #d0d0d0; }

        /* 提示气泡（与 pano-status 同款行为） */
        .matte-status {
            position: absolute;
            top: 8px;
            left: 50%;
            transform: translateX(-50%);
            padding: 4px 10px;
            border-radius: 8px;
            font-size: 11px;
            color: #fff;
            background: rgba(20, 20, 20, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.1);
            z-index: 7;
            opacity: 0;
            transition: opacity 0.18s;
            white-space: nowrap;
            pointer-events: none;
        }
        .matte-status.show { opacity: 1; }
        .matte-status.busy::after {
            content: '';
            display: inline-block;
            width: 8px;
            height: 8px;
            margin-left: 6px;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top-color: #fff;
            vertical-align: -1px;
            animation: pano-spin 0.7s linear infinite;
        }

        /* 图片/视频节点的缩放控制点 */
        .node-scale-handles {
            position: absolute;
            inset: -8px;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s;
            z-index: 5;
        }

        .node.selected .node-scale-handles,
        .node-scale-handles.active {
            opacity: 1;
        }

        .node-scale-handle {
            position: absolute;
            width: 12px;
            height: 12px;
            background: rgba(153, 153, 153, 0.9);
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            pointer-events: auto;
            transition: all 0.15s;
        }

        .node-scale-handle:hover {
            background: #999999;
            transform: scale(1.3);
            border-color: rgba(255, 255, 255, 0.6);
        }

        .node-scale-handle.top-left {
            top: 0;
            left: 0;
            cursor: nwse-resize;
        }

        .node-scale-handle.top-right {
            top: 0;
            right: 0;
            cursor: nesw-resize;
        }

        .node-scale-handle.bottom-left {
            bottom: 0;
            left: 0;
            cursor: nesw-resize;
        }

        .node-scale-handle.bottom-right {
            bottom: 0;
            right: 0;
            cursor: nwse-resize;
        }

        .node-scale-handle.top {
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            cursor: ns-resize;
        }

        .node-scale-handle.bottom {
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            cursor: ns-resize;
        }

        .node-scale-handle.left {
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            cursor: ew-resize;
        }

        .node-scale-handle.right {
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            cursor: ew-resize;
        }

        /* 右键上下文菜�?*/
        .context-menu {
            position: fixed;
            background: #1a1a1a;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 6px;
            min-width: 180px;
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
            z-index: 1500;
            display: none;
            animation: fadeInScale 0.12s ease-out;
        }

        .context-menu.show {
            display: block;
        }

        .context-menu-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            border-radius: 8px;
            cursor: pointer;
            color: var(--color-stone);
            font-size: 13px;
            transition: background 0.15s;
        }

        .context-menu-item:hover {
            background: rgba(255, 255, 255, 0.08);
        }

        .context-menu-item.danger {
            color: #b7b7b7;
        }

        .context-menu-item.danger:hover {
            background: rgba(104, 104, 104, 0.15);
        }

        .context-menu-item.disabled {
            opacity: 0.4;
            pointer-events: none;
        }

        .context-menu-divider {
            height: 1px;
            background: rgba(255, 255, 255, 0.08);
            margin: 4px 6px;
        }

        .context-menu-shortcut {
            margin-left: auto;
            font-size: 11px;
            color: var(--color-ash);
            font-family: var(--font-mono);
            letter-spacing: 0.03em;
        }

        /* ========== 项目工作�?========== */
        .dashboard {
            position: fixed;
            inset: 0;
            z-index: 9000;
            background:
                radial-gradient(1200px 600px at 80% -10%, rgba(105, 105, 105, 0.10), transparent 60%),
                radial-gradient(900px 500px at -10% 110%, rgba(122, 122, 122, 0.08), transparent 60%),
                #0b0b0b;
            display: none;
            flex-direction: column;
            color: var(--color-cream);
            font-family: var(--font-sans);
            overflow: hidden;
        }
        .dashboard.show { display: flex; }
        .dashboard-topbar {
            height: 64px;
            padding: 0 32px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid var(--color-border);
            backdrop-filter: blur(12px);
            background: rgba(11, 11, 11, 0.7);
        }
        .dashboard-topbar .logo { gap: 0; }
        .dashboard-greet {
            font-size: 13px;
            color: var(--color-ash);
            margin-left: 16px;
        }
        .dashboard-topbar-right { display: flex; align-items: center; gap: 10px; }
        .dash-icon-btn {
            width: 36px; height: 36px;
            display: inline-flex; align-items: center; justify-content: center;
            background: rgba(255,255,255,0.04);
            border: 1px solid var(--color-border);
            border-radius: 8px;
            color: var(--color-stone);
            cursor: pointer;
            transition: all .15s;
        }
        .dash-icon-btn:hover { background: rgba(255,255,255,0.08); color: var(--color-cream); }

        .dashboard-body {
            flex: 1;
            overflow: auto;
            padding: 32px 48px 64px;
        }
        .dashboard-header {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            margin-bottom: 28px;
            gap: 16px;
            flex-wrap: wrap;
        }
        .dashboard-title {
            font-family: var(--font-serif);
            font-size: 32px;
            letter-spacing: -0.5px;
            color: var(--color-cream);
            line-height: 1.1;
        }
        .dashboard-subtitle {
            font-size: 13px;
            color: var(--color-ash);
            margin-top: 6px;
        }
        .dashboard-controls {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .dash-search {
            position: relative;
            display: flex;
            align-items: center;
        }
        .dash-search input {
            width: 260px;
            padding: 9px 12px 9px 34px;
            background: rgba(255,255,255,0.04);
            border: 1px solid var(--color-border);
            border-radius: 8px;
            color: var(--color-cream);
            font-size: 13px;
            outline: none;
            font-family: inherit;
        }
        .dash-search input:focus {
            border-color: rgba(105, 105, 105, 0.5);
            box-shadow: 0 0 0 3px rgba(105, 105, 105, 0.15);
        }
        .dash-search svg {
            position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
            color: var(--color-ash);
        }
        .dash-select {
            padding: 9px 12px;
            background: rgba(255,255,255,0.04);
            border: 1px solid var(--color-border);
            border-radius: 8px;
            color: var(--color-cream);
            font-size: 13px;
            outline: none;
            cursor: pointer;
            font-family: inherit;
        }
        .dash-btn {
            padding: 9px 14px;
            border-radius: 8px;
            font-size: 13px;
            border: 1px solid var(--color-border);
            background: rgba(255,255,255,0.04);
            color: var(--color-cream);
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-family: inherit;
            transition: all .15s;
        }
        .dash-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            box-shadow: 0 0 8px rgba(255, 255, 255, 0.04);
        }
        .dash-btn.primary {
            background: #696969;
            border-color: transparent;
            color: #ececec;
        }
        .dash-btn.primary:hover { background: #737373; }

        .project-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 20px;
        }
        .project-card {
            background: rgba(255, 255, 255, 0.03);
            backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 14px;
            overflow: hidden;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            transition: transform .2s, border-color .2s, box-shadow .2s;
            position: relative;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.15);
        }
        .project-card:hover {
            border-color: rgba(255, 255, 255, 0.25);
            transform: translateY(-3px);
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
        }
        .project-cover {
            aspect-ratio: 16 / 10;
            background: linear-gradient(135deg, #181818 0%, #0b0b0b 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(255,255,255,0.08);
            overflow: hidden;
            position: relative;
        }
        .project-cover img {
            width: 100%; height: 100%; object-fit: cover; display: block;
        }
        .project-cover .placeholder {
            font-family: var(--font-serif);
            font-size: 42px;
            color: rgba(236, 236, 236, 0.25);
            letter-spacing: 0.04em;
            position: relative;
            z-index: 1;
        }
        .project-cover .placeholder::before {
            content: '';
            position: absolute;
            inset: -100px;
            background: linear-gradient(135deg, rgba(105, 105, 105, 0.06), rgba(122, 122, 122, 0.06));
            z-index: -1;
        }
        .project-info {
            padding: 14px 16px 16px;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .project-name-text {
            font-size: 14px;
            color: var(--color-cream);
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .project-meta {
            font-size: 11px;
            color: var(--color-ash);
            font-family: var(--font-mono);
            letter-spacing: 0.02em;
        }
        .project-card-menu {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 28px;
            height: 28px;
            border-radius: 7px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(11, 11, 11, 0.5);
            backdrop-filter: blur(8px);
            color: var(--color-stone);
            border: 1px solid var(--color-border);
            opacity: 0;
            transition: opacity .15s;
            cursor: pointer;
        }
        .project-card:hover .project-card-menu { opacity: 1; }
        .project-card-menu:hover {
            background: rgba(11, 11, 11, 0.8);
            backdrop-filter: blur(8px);
            color: var(--color-cream);
        }

        .project-card.new-card {
            background: rgba(255, 255, 255, 0.03);
            backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 220px;
            color: var(--color-ash);
            transition: all .2s;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.15);
        }
        .project-card.new-card:hover {
            border-color: rgba(105, 105, 105, 0.4);
            color: var(--color-cream);
            transform: translateY(-3px);
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
        }
        .project-card.new-card .plus {
            width: 44px; height: 44px;
            border-radius: 50%;
            border: 1px solid currentColor;
            display: flex; align-items: center; justify-content: center;
            margin-bottom: 10px;
        }
        .project-card.new-card .new-label {
            font-size: 13px;
            letter-spacing: 0.04em;
        }

        .dashboard-empty {
            text-align: center;
            padding: 80px 20px;
            color: var(--color-ash);
        }
        .dashboard-empty h3 {
            font-family: var(--font-serif);
            font-size: 22px;
            color: var(--color-cream);
            margin-bottom: 8px;
            font-weight: 400;
        }
        .dashboard-empty p { font-size: 13px; margin-bottom: 20px; }

        /* 简�?modal */
        .dash-modal {
            position: fixed;
            inset: 0;
            background: rgba(7, 7, 7, 0.7);
            backdrop-filter: blur(10px);
            z-index: 10000;
            display: none;
            align-items: center;
            justify-content: center;
        }
        .dash-modal.show { display: flex; }
        .dash-modal-box {
            background: #0d0d0d;
            border: 1px solid #1c1c1c;
            border-radius: 14px;
            padding: 28px;
            width: 380px;
            box-shadow: 0 24px 64px rgba(0,0,0,0.6);
        }
        .dash-modal-box h3 {
            font-family: var(--font-serif);
            font-size: 20px;
            color: var(--color-cream);
            margin-bottom: 6px;
            font-weight: 400;
        }
        .dash-modal-box p {
            color: var(--color-ash);
            font-size: 13px;
            margin-bottom: 18px;
        }
        .dash-modal-box input, .dash-modal-box textarea {
            width: 100%;
            background: #090909;
            border: 1px solid #282828;
            border-radius: 8px;
            padding: 10px 12px;
            color: var(--color-cream);
            font-size: 13px;
            outline: none;
            box-sizing: border-box;
            font-family: inherit;
            margin-bottom: 10px;
        }
        .dash-modal-box textarea { resize: vertical; min-height: 70px; }
        .dash-modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            margin-top: 8px;
        }

        /* 卡片菜单 popover */
        .card-popover {
            position: fixed;
            z-index: 9500;
            background: #181818;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 10px;
            padding: 6px;
            min-width: 160px;
            box-shadow: 0 12px 30px rgba(0,0,0,0.5);
            display: none;
        }
        .card-popover.show { display: block; }
        .card-popover .item {
            padding: 8px 10px;
            border-radius: 6px;
            font-size: 13px;
            color: var(--color-stone);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .card-popover .item:hover { background: rgba(255,255,255,0.06); color: var(--color-cream); }
        .card-popover .item.danger { color: #b7b7b7; }
        .card-popover .item.danger:hover { background: rgba(104, 104, 104,0.15); }

        /* 批量选择 */
        .batch-bar {
            display: none;
            align-items: center;
            justify-content: space-between;
            padding: 12px 20px;
            margin: 16px 0 20px;
            background: rgba(255, 255, 255, 0.04);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 10px;
            gap: 16px;
            opacity: 0;
            transform: translateY(-8px);
            transition: opacity .2s, transform .2s;
        }
        .batch-bar.show {
            display: flex;
            opacity: 1;
            transform: translateY(0);
        }
        .batch-info {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--color-cream);
            font-size: 13px;
        }
        .batch-info svg {
            color: var(--color-ember);
        }
        .batch-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .project-card-checkbox {
            position: absolute;
            top: 10px;
            left: 10px;
            width: 22px;
            height: 22px;
            border-radius: 6px;
            background: rgba(11, 11, 11, 0.5);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.12);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            opacity: 0;
            transition: opacity .15s, background .15s, border-color .15s;
            z-index: 10;
        }
        .project-card:hover .project-card-checkbox {
            opacity: 1;
        }
        .project-card-checkbox.checked {
            opacity: 1;
            background: var(--color-ember);
            border-color: var(--color-ember);
        }
        .project-card-checkbox svg {
            width: 14px;
            height: 14px;
            color: var(--color-cream);
            opacity: 0;
            transition: opacity .15s;
        }
        .project-card-checkbox.checked svg {
            opacity: 1;
        }
        .project-card.selected {
            border: 1.5px solid var(--color-ember);
            box-shadow: 0 4px 12px rgba(105, 105, 105, 0.2);
        }
        .project-grid.has-selection .project-card:not(.selected):not(.new-card) {
            opacity: 0.7;
            transition: opacity .2s;
        }
        .project-grid.has-selection .project-card:not(.selected):not(.new-card):hover {
            opacity: 1;
        }


        /* 顶栏返回按钮 */
        .topbar .back-to-dashboard {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: var(--color-stone);
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 6px;
        }
        .topbar .back-to-dashboard:hover {
            background: rgba(255,255,255,0.06);
            color: var(--color-cream);
        }

        /* ── Video.js v10 容器集成 ── */
        .node-media video-player,
        .node-media media-container {
            width: 100%;
            height: 100%;
            border-radius: 16px;
            overflow: hidden;
        }
        .node-media video-player video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            background: #0a0a0a;
        }
        /* video-player 已由 .node.generating .node-media 父级 filter 覆盖，无需重复 */

        /* pending 节点旋转动画 */
        @keyframes redraw-spin {
            from { transform: rotate(0deg); }
            to   { transform: rotate(360deg); }
        }

        /* ========== 重绘/扩图/擦除 面板 ========== */
        .redraw-panel {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 1500;
            background: rgba(8, 8, 8, 0.92);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            flex-direction: column;
            align-items: center;
            justify-content: center;
            user-select: none;
        }
        .redraw-panel.active {
            display: flex;
        }
        .redraw-panel-header {
            position: absolute;
            top: 16px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 13px;
            color: rgba(228, 228, 228, 0.65);
            letter-spacing: 1px;
        }
        .redraw-canvas-wrap {
            position: relative;
            max-width: 80vw;
            max-height: 70vh;
            box-shadow: 0 12px 48px rgba(0,0,0,0.5);
            background: #0a0a0a;
            border-radius: 6px;
            overflow: hidden;
            touch-action: none;
        }
        .redraw-canvas-wrap img {
            display: block;
            max-width: 80vw;
            max-height: 70vh;
            user-select: none;
            -webkit-user-drag: none;
            pointer-events: none;
        }
        .redraw-mask-canvas,
        .redraw-overlay-canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }
        .redraw-overlay-canvas {
            pointer-events: auto;
            cursor: crosshair;
        }
        .redraw-mask-canvas {
            mix-blend-mode: normal;
            opacity: 0.55;
        }

        /* 底部工具�?*/
        .redraw-toolbar {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 6px 10px;
            background: rgba(18, 18, 18, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 14px;
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
        }
        .redraw-tool-btn {
            width: 34px;
            height: 34px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: none;
            border-radius: 8px;
            color: rgba(228, 228, 228, 0.75);
            cursor: pointer;
            transition: all 0.15s ease;
            padding: 0;
        }
        .redraw-tool-btn:hover {
            background: rgba(255,255,255,0.08);
            color: #fff;
        }
        .redraw-tool-btn.active {
            background: rgba(130, 130, 130, 0.25);
            color: #fff;
        }
        .redraw-tool-btn svg {
            width: 18px;
            height: 18px;
        }
        .redraw-tool-btn:disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }
        .redraw-tool-btn.exit-btn {
            color: rgba(228, 228, 228, 0.9);
            gap: 4px;
            width: auto;
            padding: 0 10px;
            font-size: 13px;
        }
        .redraw-tool-divider {
            width: 1px;
            height: 22px;
            background: rgba(255,255,255,0.1);
            margin: 0 4px;
        }
        .redraw-size-wrap {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 0 8px;
        }
        .redraw-size-wrap svg {
            width: 16px;
            height: 16px;
            color: rgba(228, 228, 228,0.7);
        }
        .redraw-size-slider {
            -webkit-appearance: none;
            appearance: none;
            width: 110px;
            height: 6px;
            background: linear-gradient(to right,
                rgba(153, 153, 153, 0.5) 0%,
                rgba(153, 153, 153, 0.5) var(--slider-progress, 50%),
                rgba(255, 255, 255, 0.08) var(--slider-progress, 50%),
                rgba(255, 255, 255, 0.08) 100%);
            border-radius: 6px;
            outline: none;
            transition: height 0.2s ease;
        }
        .redraw-size-slider:hover {
            height: 8px;
        }
        .redraw-size-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: linear-gradient(135deg, #999999 0%, #999999 100%);
            cursor: grab;
            border: none;
            box-shadow: 0 2px 8px rgba(153, 153, 153, 0.5),
                        0 0 0 3px rgba(153, 153, 153, 0.2);
            transition: all 0.2s ease;
        }
        .redraw-size-slider::-webkit-slider-thumb:hover {
            transform: scale(1.15);
            box-shadow: 0 3px 12px rgba(153, 153, 153, 0.7),
                        0 0 0 4px rgba(153, 153, 153, 0.3);
        }
        .redraw-size-slider::-webkit-slider-thumb:active {
            cursor: grabbing;
            transform: scale(1.05);
        }
        .redraw-size-slider::-moz-range-thumb {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: linear-gradient(135deg, #999999 0%, #999999 100%);
            cursor: grab;
            border: none;
            box-shadow: 0 2px 8px rgba(153, 153, 153, 0.5);
            transition: all 0.2s ease;
        }
        .redraw-size-slider::-moz-range-thumb:hover {
            transform: scale(1.15);
            box-shadow: 0 3px 12px rgba(153, 153, 153, 0.7);
        }
        .redraw-size-slider::-moz-range-thumb:active {
            cursor: grabbing;
            transform: scale(1.05);
        }
        .redraw-size-slider::-moz-range-track {
            background: transparent;
        }
        .redraw-size-value {
            font-size: 12px;
            color: rgba(228, 228, 228,0.7);
            min-width: 22px;
            text-align: center;
        }

        /* 框选子菜单 */
        .redraw-tool-group {
            position: relative;
        }
        .redraw-tool-submenu {
            position: absolute;
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            display: none;
            flex-direction: row;
            gap: 2px;
            padding: 4px;
            background: rgba(18, 18, 18, 0.98);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 10px;
            box-shadow: 0 6px 20px rgba(0,0,0,0.45);
            backdrop-filter: blur(20px);
        }
        .redraw-tool-group.open .redraw-tool-submenu,
        .redraw-tool-group:hover .redraw-tool-submenu {
            display: flex;
        }

        /* 右侧 prompt + 生成�?*/
        .redraw-side {
            position: absolute;
            right: 20px;
            top: 50%;
            transform: translateY(-50%);
            width: 280px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            padding: 14px;
            background: rgba(18, 18, 18, 0.95);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            box-shadow: 0 8px 28px rgba(0,0,0,0.5);
        }
        .redraw-side h4 {
            margin: 0 0 4px;
            font-size: 13px;
            color: #fff;
            font-weight: 500;
            letter-spacing: 0.5px;
        }
        .redraw-side textarea {
            width: 100%;
            min-height: 90px;
            resize: vertical;
            background: rgba(0,0,0,0.35);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 8px;
            color: #e4e4e4;
            font-size: 13px;
            padding: 8px 10px;
            font-family: inherit;
            box-sizing: border-box;
        }
        .redraw-side textarea:focus {
            outline: none;
            border-color: rgba(153, 153, 153, 0.5);
        }
        .redraw-side .redraw-submit {
            background: linear-gradient(135deg, #818181, #5a5a5a);
            border: none;
            color: #fff;
            font-size: 13px;
            padding: 10px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 500;
            letter-spacing: 0.5px;
            transition: opacity 0.2s;
        }
        .redraw-side .redraw-submit:hover { opacity: 0.92; }
        .redraw-side .redraw-submit:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }
        /* 次按钮：低对比度边框样式，与主按钮做出层级区�?*/
        .redraw-side .redraw-submit-secondary {
            background: transparent;
            border: 1px solid rgba(153, 153, 153, 0.35);
            color: rgba(228, 228, 228, 0.88);
            margin-top: 6px;
        }
        .redraw-side .redraw-submit-secondary:hover {
            background: rgba(153, 153, 153, 0.10);
            border-color: rgba(153, 153, 153, 0.55);
            opacity: 1;
        }
        .redraw-side .redraw-hint {
            font-size: 11px;
            color: rgba(228, 228, 228,0.5);
            line-height: 1.5;
        }

        /* 扩图方向手柄 */
        .redraw-expand-handles {
            position: absolute;
            inset: 0;
            pointer-events: none;
        }
        .redraw-expand-handle {
            position: absolute;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(153, 153, 153, 0.85);
            color: #fff;
            border-radius: 6px;
            font-size: 11px;
            padding: 4px 8px;
            pointer-events: auto;
            cursor: pointer;
            user-select: none;
            border: 1px solid rgba(255,255,255,0.2);
            box-shadow: 0 4px 14px rgba(0,0,0,0.4);
        }
        .redraw-expand-handle:hover { background: rgba(153, 153, 153, 1); }
        .redraw-expand-handle.h-top    { top: -34px; left: 50%; transform: translateX(-50%); }
        .redraw-expand-handle.h-bottom { bottom: -34px; left: 50%; transform: translateX(-50%); }
        .redraw-expand-handle.h-left   { left: -64px; top: 50%; transform: translateY(-50%); }
        .redraw-expand-handle.h-right  { right: -64px; top: 50%; transform: translateY(-50%); }

        /* 扩图模式：隐藏画笔工具栏，侧边描述框初始隐藏 */
        .redraw-panel.expand-mode [data-tool="brush"],
        .redraw-panel.expand-mode #redrawMarqueeGroup,
        .redraw-panel.expand-mode [data-tool="eraser"],
        .redraw-panel.expand-mode .redraw-size-wrap,
        .redraw-panel.expand-mode #redrawUndoBtn,
        .redraw-panel.expand-mode #redrawRedoBtn,
        .redraw-panel.expand-mode .redraw-tool-divider {
            display: none !important;
        }
        .redraw-panel.expand-mode .redraw-side {
            visibility: hidden;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.25s ease, visibility 0.25s;
        }
        .redraw-panel.expand-mode.expand-ready .redraw-side {
            visibility: visible;
            opacity: 1;
            pointer-events: auto;
        }

        /* ========== 扩图内联工具�?========== */
        .expand-bar {
            position: absolute;
            left: 50%;
            bottom: -52px;
            transform: translateX(-50%);
            display: none;
            align-items: center;
            gap: 6px;
            padding: 6px 8px;
            background: rgba(18, 18, 18, 0.96);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 14px;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            z-index: 30;
            white-space: nowrap;
        }
        .expand-bar.active { display: flex; }

        .expand-bar-close {
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: none;
            border-radius: 8px;
            color: rgba(228, 228, 228, 0.75);
            cursor: pointer;
            padding: 0;
            transition: all 0.15s ease;
        }
        .expand-bar-close:hover { background: rgba(255,255,255,0.08); color: #fff; }
        .expand-bar-close svg { width: 16px; height: 16px; }

        .expand-bar-divider {
            width: 1px;
            height: 18px;
            background: rgba(255, 255, 255, 0.12);
            margin: 0 2px;
        }

        .expand-bar-control {
            position: relative;
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 4px 22px 4px 8px;
            border-radius: 8px;
            transition: background 0.15s ease;
        }
        .expand-bar-control:hover { background: rgba(255,255,255,0.05); }
        .expand-bar-control-icon {
            width: 14px;
            height: 14px;
            color: rgba(228, 228, 228, 0.7);
            flex-shrink: 0;
        }
        .expand-bar-select {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background: transparent;
            border: none;
            color: rgba(228, 228, 228, 0.9);
            font-size: 13px;
            cursor: pointer;
            padding: 0;
            outline: none;
            font-family: inherit;
        }
        .expand-bar-select option {
            background: #1a1a1a;
            color: #e4e4e4;
        }
        .expand-bar-chevron {
            position: absolute;
            right: 6px;
            width: 12px;
            height: 12px;
            color: rgba(228, 228, 228, 0.6);
            pointer-events: none;
        }

        .expand-bar-submit {
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.92);
            color: #181818;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            margin-left: 2px;
            transition: all 0.15s ease;
        }
        .expand-bar-submit:hover { background: #fff; }
        .expand-bar-submit:disabled { opacity: 0.5; cursor: not-allowed; }
        .expand-bar-submit svg { width: 16px; height: 16px; }

        /* ========== 扩图分辨率悬浮下�?========== */
        .expand-bar-dropdown {
            position: relative;
            display: flex;
            align-items: center;
        }
        .expand-bar-dropdown-btn {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 4px 8px;
            border-radius: 8px;
            cursor: pointer;
            color: rgba(228, 228, 228, 0.9);
            font-size: 13px;
            transition: background 0.15s ease;
            user-select: none;
        }
        .expand-bar-dropdown:hover .expand-bar-dropdown-btn { background: rgba(255,255,255,0.06); }
        .expand-bar-dropdown-value {
            font-variant-numeric: tabular-nums;
            min-width: 22px;
            text-align: center;
        }
        .expand-bar-dropdown-menu {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            margin-top: 0;             /* 与按钮无缝衔接，避免 hover 闪烁 */
            padding-top: 6px;          /* 把视觉间距塞�?menu 内部，保�?hit-area */
            display: flex;
            flex-direction: column;
            gap: 2px;
            pointer-events: none;      /* �?hover 时不响应；下�?:hover 规则会启�?*/
            opacity: 0;
            transform: translateY(-4px);
            transition: opacity 0.15s ease, transform 0.15s ease;
            z-index: 35;
        }
        .expand-bar-dropdown-menu::before {
            /* 真正的菜单背景，�?padding-top 之下开�?*/
            content: '';
            position: absolute;
            top: 6px;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(15, 15, 15, 0.98);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 10px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
            z-index: -1;
        }
        .expand-bar-dropdown:hover .expand-bar-dropdown-menu {
            pointer-events: auto;
            opacity: 1;
            transform: translateY(0);
        }
        /* 选中后短暂屏�?hover，避免菜�?赖在那不�? */
        .expand-bar-dropdown.locked:hover .expand-bar-dropdown-menu {
            pointer-events: none;
            opacity: 0;
            transform: translateY(-4px);
        }
        .expand-bar-dropdown-item {
            position: relative;
            display: block;
            width: 100%;
            padding: 6px 10px;
            margin: 0 4px;
            font-size: 12px;
            font-family: inherit;
            color: rgba(228, 228, 228, 0.85);
            background: transparent;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            text-align: center;
            transition: background 0.15s ease, color 0.15s ease;
            font-variant-numeric: tabular-nums;
        }
        .expand-bar-dropdown-item:first-child { margin-top: 4px; }
        .expand-bar-dropdown-item:last-child { margin-bottom: 4px; }
        .expand-bar-dropdown-item:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }
        .expand-bar-dropdown-item.active {
            background: rgba(153, 153, 153, 0.18);
            color: rgba(153, 153, 153, 1);
        }

        .expand-bar-dims {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 4px 8px;
            font-size: 12px;
            font-variant-numeric: tabular-nums;
            color: rgba(228, 228, 228, 0.85);
            white-space: nowrap;
        }
        .expand-bar-dims-src { color: rgba(228, 228, 228, 0.6); }
        .expand-bar-dims-dst { color: rgba(153, 153, 153, 0.95); font-weight: 500; }
        .expand-bar-dims-arrow {
            width: 12px;
            height: 12px;
            color: rgba(228, 228, 228, 0.45);
            flex-shrink: 0;
        }
        .video-poster {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            background-size: contain;
            background-position: center;
            background-repeat: no-repeat;
            background-color: #1a1a1a;
        }
        .video-poster-play {
            border: none;
            background: rgba(0, 0, 0, 0.45);
            border-radius: 50%;
            width: 64px;
            height: 64px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background 0.15s ease, transform 0.15s ease;
        }
        .video-poster-play:hover {
            background: rgba(0, 0, 0, 0.7);
            transform: scale(1.08);
        }

        /* ========== 资源池（底部抽屉 · 每个项目自带的素材库�?========= */
        .asset-pool-toggle {
            position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
            z-index: 8500;
            display: flex; flex-direction: row; align-items: center; gap: 7px;
            padding: 6px 18px;
            background: rgba(19, 19, 19,0.9);
            border: 0.5px solid #282828; border-bottom: none;
            border-radius: 10px 10px 0 0;
            color: #c1c1c1; font-size: 11px; cursor: pointer;
            transition: bottom 0.26s cubic-bezier(0.2,0.8,0.3,1), background 0.15s ease, color 0.15s ease;
        }
        .asset-pool-toggle span { letter-spacing: 2px; }
        .asset-pool-toggle:hover { background: rgba(38, 38, 38,0.95); color: #ececec; }
        .asset-pool-toggle.active { color: #696969; bottom: var(--ap-panel-h, 200px); }

        .asset-pool-panel {
            position: fixed; left: 0; right: 0; bottom: 0; height: var(--ap-panel-h, 200px);
            z-index: 8400;
            background: rgba(13, 13, 13,0.97);
            border-top: 0.5px solid #1c1c1c;
            transform: translateY(100%);
            transition: transform 0.26s cubic-bezier(0.2,0.8,0.3,1);
            display: flex; flex-direction: column;
            box-shadow: 0 -16px 48px rgba(0,0,0,0.42);
        }
        .asset-pool-panel.open { transform: translateY(0); }

        /* 顶部可拖拽边框：按住往上拉 = 资源池变高 */
        .asset-pool-resizer {
            position: absolute; top: -3px; left: 0; right: 0; height: 8px;
            cursor: ns-resize; z-index: 10;
        }
        .asset-pool-resizer::after {
            content: ''; position: absolute; left: 50%; top: 3px;
            transform: translateX(-50%);
            width: 44px; height: 3px; border-radius: 3px;
            background: #373737; transition: background 0.15s ease;
        }
        .asset-pool-resizer:hover::after { background: #696969; }
        /* 拖拽中：关掉过渡，面板与开关跟手不延迟 */
        body.ap-resizing .asset-pool-panel,
        body.ap-resizing .asset-pool-toggle { transition: none !important; }
        body.ap-resizing { cursor: ns-resize; user-select: none; }
        .asset-pool-head {
            display: flex; align-items: center; gap: 12px;
            padding: 9px 18px 7px; flex: 0 0 auto;
        }
        .asset-pool-title { display: flex; align-items: center; gap: 8px; color: #ececec; font-size: 14px; font-family: Georgia, 'Times New Roman', serif; }
        .asset-pool-subhint { color: #464646; font-size: 11px; margin-left: auto; margin-right: 8px; }
        .asset-pool-close { background: none; border: none; color: #656565; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
        .asset-pool-close:hover { color: #ececec; }
        /* 底部网格：横向铺满、换行往下排、上下滚轮翻页，隐藏滚动�?*/
        .asset-pool-grid {
            --ap-cell: 86px;                /* 卡片边长，由左下角滑块控�?*/
            flex: 1; min-height: 0;
            overflow-y: auto; overflow-x: hidden;
            padding: 2px 18px 14px;
            display: grid; grid-template-columns: repeat(auto-fill, var(--ap-cell));
            grid-auto-rows: var(--ap-cell);  /* 行高跟随，确定的正方形，不塌不挤 */
            justify-content: start; gap: 8px; align-content: start;
            scrollbar-width: none;          /* Firefox 隐藏滚动�?*/
        }
        .asset-pool-grid::-webkit-scrollbar { display: none; }   /* Chrome / Edge 隐藏滚动�?*/
        .asset-pool-cell {
            position: relative; width: var(--ap-cell); height: var(--ap-cell);
            border-radius: 8px; overflow: hidden;
            background: #090909; border: 0.5px solid #212121; cursor: pointer;
        }
        .asset-pool-cell:hover { border-color: #696969; }
        /* 左下角：卡片缩放滑块 */
        .asset-pool-zoom {
            display: flex; align-items: center; gap: 7px;
            color: #656565; flex: 0 0 auto;
        }
        .asset-pool-zoom svg { flex: 0 0 auto; }
        .asset-pool-zoom input[type=range] {
            width: 96px; height: 3px; cursor: pointer;
            accent-color: #696969; background: transparent;
        }
        /* 清理未使用素材按�?*/
        .asset-pool-purge {
            flex: 0 0 auto; margin-left: 12px;
            display: inline-flex; align-items: center; gap: 5px;
            background: none; border: 0.5px solid #282828; border-radius: 6px;
            color: #848484; font-size: 11px; padding: 4px 9px; cursor: pointer;
            transition: border-color 0.15s ease, color 0.15s ease;
        }
        .asset-pool-purge:hover { border-color: #696969; color: #696969; }
        /* 分类筛选条：全部 / 图片 / 视频 */
        .asset-pool-filter {
            display: flex; align-items: center; gap: 6px;
            padding: 0 18px 8px; flex: 0 0 auto;
        }
        .ap-filter-btn {
            background: none; border: 0.5px solid #282828; border-radius: 6px;
            color: #848484; font-size: 12px; padding: 4px 14px; cursor: pointer;
            transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
        }
        .ap-filter-btn:hover { border-color: #464646; color: #c1c1c1; }
        .ap-filter-btn.active { background: #696969; border-color: #696969; color: #fff; }
        /* 自定义确认框（替代原�?confirm，深色同款） */
        .asset-pool-confirm-mask {
            position: fixed; inset: 0; z-index: 9200; display: none;
            background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
            align-items: center; justify-content: center;
            opacity: 0; transition: opacity 0.15s ease;
        }
        .asset-pool-confirm-mask.show { display: flex; opacity: 1; }
        .asset-pool-confirm {
            width: 330px; max-width: calc(100vw - 40px);
            background: #131313; border: 0.5px solid #282828; border-radius: 14px;
            box-shadow: 0 24px 64px rgba(0,0,0,0.6);
            padding: 22px 22px 16px; color: #e3e3e3;
            transform: translateY(8px) scale(0.98); transition: transform 0.18s cubic-bezier(0.2,0.8,0.3,1);
        }
        .asset-pool-confirm-mask.show .asset-pool-confirm { transform: translateY(0) scale(1); }
        .asset-pool-confirm h4 { margin: 0 0 9px; font-size: 16px; font-family: Georgia, 'Times New Roman', serif; color: #ececec; }
        .asset-pool-confirm p { margin: 0 0 20px; font-size: 13px; line-height: 1.7; color: #848484; }
        .asset-pool-confirm p b { color: #696969; font-weight: 600; }
        .asset-pool-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
        .asset-pool-confirm-actions button {
            font-size: 13px; padding: 7px 16px; border-radius: 8px; cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
        }
        .ap-btn-cancel { background: none; border: 0.5px solid #282828; color: #b1b1b1; }
        .ap-btn-cancel:hover { border-color: #464646; color: #ececec; }
        .ap-btn-ok { background: #696969; border: none; color: #fff; }
        .ap-btn-ok:hover { background: #797979; }
        .asset-pool-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
        .asset-pool-badge {
            position: absolute; left: 6px; bottom: 6px;
            background: rgba(0,0,0,0.6); color: #fff; font-size: 9px;
            padding: 1px 5px; border-radius: 4px; pointer-events: none;
        }
        .asset-pool-del {
            position: absolute; top: 4px; right: 4px;
            width: 20px; height: 20px; border-radius: 50%;
            background: rgba(9, 9, 9,0.7); color: #c1c1c1;
            border: none; cursor: pointer; font-size: 14px; line-height: 1;
            display: none; align-items: center; justify-content: center;
        }
        .asset-pool-cell:hover .asset-pool-del { display: flex; }
        .asset-pool-del:hover { background: #696969; color: #fff; }
        .asset-pool-empty { padding: 40px 24px; text-align: center; color: #464646; font-size: 13px; line-height: 1.8; }
        .asset-pool-empty small { color: #303030; font-size: 11px; }
        .asset-pool-count { color: #656565; font-size: 11px; font-weight: 400; margin-left: 2px; }
        /* 悬停放大预览（浮在资源池正上方居中）*/
        .asset-pool-preview {
            position: fixed; bottom: 210px; left: 50%; transform: translateX(-50%);
            z-index: 8600; display: none;
            max-width: 380px; max-height: 60vh;
            border-radius: 12px; overflow: hidden;
            border: 0.5px solid #282828; background: #090909;
            box-shadow: 0 24px 64px rgba(0,0,0,0.6); pointer-events: none;
        }
        .asset-pool-preview img, .asset-pool-preview video { display: block; max-width: 380px; max-height: 60vh; object-fit: contain; }
        /* 拖拽虚影 */
        .asset-pool-ghost {
            position: fixed; z-index: 9000; display: none; width: 96px; height: 96px;
            border-radius: 8px; overflow: hidden; pointer-events: none;
            border: 1px solid #696969; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
            opacity: 0.92; transform: rotate(-2deg);
        }
        .asset-pool-ghost img, .asset-pool-ghost video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* ========== Matte Painting �ڵ���ʽ���Ż��棩========== */
.matte-controls {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(31, 31, 31, 0.95) 0%, rgba(20, 20, 20, 0.95) 100%);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(153, 153, 153, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 6;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.node:hover .matte-controls,
.node.selected .matte-controls {
    opacity: 1;
    transform: translateY(0);
}

.matte-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.matte-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.matte-select {
    flex: 1;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(153, 153, 153, 0.3);
    background: rgba(153, 153, 153, 0.12);
    color: #d0d0d0;
    cursor: pointer;
    transition: all 0.15s;
}
.matte-select:hover {
    background: rgba(153, 153, 153, 0.2);
    border-color: rgba(153, 153, 153, 0.5);
}
.matte-select:focus {
    outline: none;
    border-color: rgba(153, 153, 153, 0.7);
}

.matte-preset-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 7px;
    border: 1px solid rgba(153, 153, 153, 0.4);
    background: rgba(153, 153, 153, 0.16);
    color: #d0d0d0;
    cursor: pointer;
    transition: all 0.15s;
}
.matte-preset-btn:hover {
    background: rgba(153, 153, 153, 0.32);
    border-color: rgba(153, 153, 153, 0.7);
    color: #fff;
}
.matte-preset-btn svg {
    width: 14px;
    height: 14px;
}

.matte-status {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    z-index: 7;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.matte-status.show { opacity: 1; }
.matte-status.busy::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 8px;
    border: 2px solid rgba(153, 153, 153, 0.3);
    border-top-color: #999999;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.matte-preset-menu {
    max-height: 400px;
    overflow-y: auto;
}
.matte-preset-menu::-webkit-scrollbar {
    width: 6px;
}
.matte-preset-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
.matte-preset-menu::-webkit-scrollbar-thumb {
    background: rgba(153, 153, 153, 0.3);
    border-radius: 3px;
}
.matte-preset-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(153, 153, 153, 0.5);
}

/* Matte Painting ��ǿ��ʽ */
.matte-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.matte-select {
    flex: 1;
    font-size: 11px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(153, 153, 153, 0.3);
    background: linear-gradient(135deg, rgba(153, 153, 153, 0.15) 0%, rgba(113, 113, 113, 0.1) 100%);
    color: #dcdcdc;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.matte-select:hover {
    background: linear-gradient(135deg, rgba(153, 153, 153, 0.25) 0%, rgba(113, 113, 113, 0.2) 100%);
    border-color: rgba(153, 153, 153, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(153, 153, 153, 0.2);
}
.matte-select:focus {
    outline: none;
    border-color: rgba(153, 153, 153, 0.8);
    box-shadow: 0 0 0 3px rgba(153, 153, 153, 0.15);
}

.matte-preset-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(153, 153, 153, 0.4);
    background: linear-gradient(135deg, rgba(153, 153, 153, 0.2) 0%, rgba(113, 113, 113, 0.15) 100%);
    color: #dcdcdc;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}
.matte-preset-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}
.matte-preset-btn:hover::before {
    left: 100%;
}
.matte-preset-btn:hover {
    background: linear-gradient(135deg, rgba(153, 153, 153, 0.35) 0%, rgba(113, 113, 113, 0.25) 100%);
    border-color: rgba(153, 153, 153, 0.7);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(153, 153, 153, 0.3);
}
.matte-preset-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(153, 153, 153, 0.2);
}

.matte-preset-menu {
    background: linear-gradient(135deg, rgba(31, 31, 31, 0.98) 0%, rgba(20, 20, 20, 0.98) 100%);
    backdrop-filter: blur(16px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.matte-preset-item > div:first-child {
    font-weight: 600;
    color: #dcdcdc;
}

/* ========== Agent 执行动画 ========== */
.agent-executing {
    box-shadow: 0 0 0 3px rgba(147, 147, 147, 0.5), 0 0 20px rgba(147, 147, 147, 0.3) !important;
    animation: agent-pulse 0.8s ease-in-out;
}

@keyframes agent-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.agent-executing .node-preview {
    border-color: rgba(147, 147, 147, 0.8) !important;
}

/* ============================================================
   Pinterest ��¼����
   ========================================================== */

/* ȫ������ */
.pin-overlay {
    position: fixed;
    inset: 0;
    z-index: 10200;
    background: rgba(9, 9, 9, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pinFadeIn 0.2s ease;
}

@keyframes pinFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ��¼��Ƭ */
.pin-login-card {
    color-scheme: light;
    accent-color: #E60023;
    width: 420px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: pinSlideUp 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes pinSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ͷ�� */
.pin-login-header {
    padding: 32px 32px 24px;
    text-align: center;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
}

.pin-logo {
    margin-bottom: 16px;
}

.pin-login-title {
    font-size: 24px;
    font-weight: 600;
    color: #211922;
    margin: 0 0 8px;
}

.pin-login-subtitle {
    font-size: 14px;
    color: #767676;
    margin: 0;
}

/* �������� */
.pin-login-body {
    padding: 24px 32px 32px;
}

/* ������ʾ */
.pin-login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #dc2626;
    font-size: 14px;
    line-height: 1.5;
}

/* ������� */
.pin-input-group {
    margin-bottom: 20px;
}

.pin-input-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #211922;
    margin-bottom: 8px;
}

.pin-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    color: #211922;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.pin-input:focus {
    outline: none;
    border-color: #E60023;
    box-shadow: 0 0 0 3px rgba(230, 0, 35, 0.1);
}

.pin-input::placeholder {
    color: #b0b0b0;
}

/* �������ʾ���� */
.pin-input-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #767676;
    line-height: 1.5;
}

.pin-input-hint a {
    color: #E60023;
    text-decoration: none;
}

.pin-input-hint a:hover {
    text-decoration: underline;
}

/* ��ť���� */
.pin-login-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

/* ͨ�ð�ť��ʽ */
.pin-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* ����ť��Pinterest �죩 */
.pin-btn-primary {
    background: #E60023;
    color: #ffffff;
}

.pin-btn-primary:hover {
    background: #cc001f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 0, 35, 0.3);
}

.pin-btn-primary:active {
    transform: translateY(0);
}

.pin-btn-primary:disabled {
    background: #ffb3c1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ��Ҫ��ť */
.pin-btn-secondary {
    background: #efefef;
    color: #211922;
}

.pin-btn-secondary:hover {
    background: #e0e0e0;
}

.pin-btn-secondary:active {
    background: #d0d0d0;
}

/* 登录加载提示 */
.pin-login-loading-hint {
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    color: #767676;
    line-height: 1.5;
}

/* ============================================================
   Pinterest �����������
   ========================================================== */

/* ������������ */
.pin-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 10200;
    background: rgba(9, 9, 9, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pinFadeIn 0.2s ease;
}

/* �������� */
.pin-search-container {
    width: 90vw;
    max-width: 1200px;
    height: 85vh;
    max-height: 900px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pinSlideUp 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* ͷ�� */
.pin-search-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
}

.pin-search-header-left {
    flex: 1;
}

.pin-search-title {
    font-size: 20px;
    font-weight: 600;
    color: #1b1b1b;
    margin: 0 0 4px;
}

.pin-search-subtitle {
    font-size: 13px;
    color: #767676;
    margin: 0;
}

.pin-search-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #767676;
    transition: color 0.2s ease;
    border-radius: 8px;
}

.pin-search-close:hover {
    color: #1b1b1b;
    background: #f0f0f0;
}

/* �������� */
.pin-search-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Loading ״̬ */
.pin-search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #767676;
}

.pin-search-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #333333;
    border-radius: 50%;
    animation: pinSpin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes pinSpin {
    to {
        transform: rotate(360deg);
    }
}

.pin-search-loading p {
    font-size: 15px;
    margin: 0;
}

/* ����״̬ */
.pin-search-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #4d4d4d;
    text-align: center;
}

.pin-search-error p {
    font-size: 15px;
    margin: 0 0 20px;
    max-width: 400px;
}

/* �ս�� */
.pin-search-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #767676;
    font-size: 15px;
    text-align: center;
}

.pin-search-empty p {
    margin: 0;
}

/* ����ٲ��� */
.pin-search-results {
    column-count: 4;
    column-gap: 16px;
}

@media (max-width: 1024px) {
    .pin-search-results {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .pin-search-results {
        column-count: 2;
    }
}

/* �����Ƭ */
.pin-result-card {
    break-inside: avoid;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    cursor: move;
    cursor: grab;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #f9f9f9;
}

.pin-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.pin-result-card:active {
    cursor: grabbing;
}

.pin-result-card.dragging {
    opacity: 0.5;
}

.pin-result-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* ��Դ������ǩ */
.pin-result-domain {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.pin-result-card:hover .pin-result-domain {
    opacity: 1;
}

/* 拖拽时浮层穿透 */
.pin-search-overlay.pin-overlay-dragging {
    pointer-events: none;
    opacity: 0.15;
    transition: opacity 0.12s;
}

.pin-search-overlay.pin-overlay-dragging .pin-result-card.dragging {
    visibility: hidden;
}

/* ============================================================
   Pinterest 右侧常驻工作面板 - Eagle 式灵感工作台
   ========================================================== */

:root {
    --pinterest-panel-width: 720px;  /* 默认宽度，可被 localStorage 覆盖 */
}

#pinterestPanel {
    position: fixed;
    top: 56px;
    right: 0;
    bottom: 0;
    width: var(--pinterest-panel-width);
    z-index: 9000;
    background: rgba(18, 18, 18, 0.97);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

#pinterestPanel.open {
    transform: translateX(0);
}

/* 左边缘 resize handle */
.pinterest-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: ew-resize;
    z-index: 10;
    transition: background 0.2s;
}

.pinterest-resize-handle:hover {
    background: rgba(153, 153, 153, 0.3);
}

body.pinterest-resizing {
    cursor: ew-resize;
    user-select: none;
}

body.pinterest-resizing #pinterestPanel {
    transition: none;  /* 拖拽时关闭过渡，跟手不延迟 */
}

.pinterest-panel-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pinterest-panel-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #ececec;
    font-family: var(--font-sans);
}

.pinterest-panel-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a2a2a2;
    cursor: pointer;
    transition: all 0.2s;
}

.pinterest-panel-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e4e4e4;
}

.pinterest-panel-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: row;
}

/* ========== 左侧搜索源缩略带 ========== */
.pinterest-source-strip {
    width: 72px;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.2);
    scrollbar-width: none;  /* Firefox */
}

.pinterest-source-strip::-webkit-scrollbar {
    display: none;  /* Chrome/Safari */
}

.pinterest-source-item {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
}

.pinterest-source-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pinterest-source-item:hover {
    border-color: rgba(153, 153, 153, 0.5);
    transform: scale(1.08);
}

.pinterest-source-item.active {
    border-color: rgba(153, 153, 153, 1);
    box-shadow: 0 0 0 2px rgba(153, 153, 153, 0.3);
}

/* 框选搜索按钮（hover 显示）*/
.pinterest-source-crop-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 4px;
    color: #181818;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, transform 0.15s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.pinterest-source-item:hover .pinterest-source-crop-btn {
    opacity: 1;
}

.pinterest-source-crop-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

/* 删除按钮（hover 显示）*/
.pinterest-source-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(104, 104, 104, 0.95);
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, transform 0.15s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.pinterest-source-item:hover .pinterest-source-delete-btn {
    opacity: 1;
}

.pinterest-source-delete-btn:hover {
    background: rgba(77, 77, 77, 1);
    transform: scale(1.1);
}

/* ========== 中栏：选中图 + 内联裁剪（240px）========== */
.pinterest-middle-pane {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.pinterest-middle-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow: auto;
}

.pinterest-middle-image-box {
    position: relative;
    display: inline-block;
    line-height: 0;
    max-width: 100%;
    max-height: 100%;
}

.pinterest-middle-image-box img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    user-select: none;
}

.pinterest-middle-crop-selection {
    position: absolute;
    border: 2px solid rgba(153, 153, 153, 1);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    min-width: 30px;
    min-height: 30px;
    /* 三分网格线 (rule of thirds) */
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.3) 1px, transparent 1px),
        linear-gradient(to right, rgba(255,255,255,0.3) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.3) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.3) 1px, transparent 1px);
    background-size:
        100% 100%,
        100% 100%,
        100% 100%,
        100% 100%;
    background-position:
        33.33% 0,
        66.67% 0,
        0 33.33%,
        0 66.67%;
    background-repeat: no-repeat;
}

/* 拖动中去除性能杀手（巨型阴影 + 背景网格） */
.pinterest-middle-crop-selection.cropping {
    box-shadow: none !important;
    background-image: none !important;
}

.pinterest-middle-actions {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.pinterest-middle-btn {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.pinterest-middle-btn-whole {
    background: rgba(255, 255, 255, 0.08);
    color: #e4e4e4;
}

.pinterest-middle-btn-whole:hover {
    background: rgba(255, 255, 255, 0.12);
}

.pinterest-middle-btn-crop {
    background: linear-gradient(135deg, #818181, #5a5a5a);
    color: #fff;
}

.pinterest-middle-btn-crop:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* ========== 右侧内容区（结果瀑布流）========== */
.pinterest-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

/* 搜索中态 - 即时反馈 */
.pinterest-content.pinterest-searching .pinterest-waterfall-manual {
    opacity: 0.4;
    filter: blur(2px);
    pointer-events: none;
    transition: opacity 0.15s, filter 0.15s;
}

.pinterest-content.pinterest-searching::before {
    content: '';
    position: sticky;
    top: 0;
    left: 0;
    display: block;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(153, 153, 153,1), transparent);
    background-size: 200% 100%;
    animation: pinterest-progress 1.2s linear infinite;
    z-index: 10;
}

@keyframes pinterest-progress {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Loading 状态 */
.pinterest-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #a2a2a2;
    gap: 16px;
}

.pinterest-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #999999;
    border-radius: 50%;
    animation: pinSpin 0.8s linear infinite;
}

.pinterest-loading p {
    font-size: 13px;
    text-align: center;
    line-height: 1.6;
    max-width: 280px;
}

/* 错误状态 */
.pinterest-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    gap: 16px;
}

.pinterest-error p {
    font-size: 13px;
    color: #686868;
    margin: 0;
    line-height: 1.6;
    max-width: 280px;
}

.pinterest-retry-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #e4e4e4;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.pinterest-retry-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

/* 空结果 */
.pinterest-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #727272;
    font-size: 13px;
    text-align: center;
    line-height: 1.6;
}

/* ========== 瀑布流结果（JS 手动分列）========== */
.pinterest-waterfall-manual {
    display: flex;
    gap: 12px;
    width: 100%;
}

.pinterest-waterfall-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pinterest-result-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.pinterest-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.pinterest-result-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 悬浮遮罩层 */
.pinterest-result-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 10px;
    pointer-events: none; /* 不挡住底层 img 的 click/dblclick */
}

.pinterest-result-card:hover .pinterest-result-overlay {
    opacity: 1;
}

/* "用这张图搜索"按钮 */
.pinterest-search-this-btn {
    pointer-events: auto; /* 按钮仍可点 */
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 8px;
    color: #181818;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pinterest-search-this-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* "查看来源页面"按钮（外链图标）*/
.pinterest-source-link-btn {
    position: absolute;
    top: 8px;
    right: 48px;  /* 在搜索按钮左侧 */
    pointer-events: auto; /* 按钮仍可点 */
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 8px;
    color: #181818;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pinterest-source-link-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pinterest-result-domain {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 90px);  /* 给两个按钮留空间 */
}

/* ========== Quick Look 空格放大预览 ========== */
.pinterest-quicklook-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pinterest-quicklook-overlay.show {
    opacity: 1;
}

.pinterest-quicklook-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.pinterest-quicklook-img {
    max-width: 100%;
    max-height: calc(90vh - 50px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.pinterest-quicklook-hint {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* ========== 无限滚动相关 ========== */
.pinterest-scroll-sentinel {
    height: 1px;
    width: 100%;
    pointer-events: none;
}

.pinterest-loadmore-hint {
    text-align: center;
    padding: 16px;
    color: #a2a2a2;
    font-size: 13px;
}

/* ========== 图片裁剪区域框选 ========== */
.pinterest-crop-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pinterest-crop-container {
    display: flex;
    flex-direction: column;
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    max-height: 800px;
    background: rgba(24, 24, 24, 0.98);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.pinterest-crop-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.pinterest-crop-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #ececec;
}

.pinterest-crop-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a2a2a2;
    cursor: pointer;
    transition: all 0.2s;
}

.pinterest-crop-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e4e4e4;
}

.pinterest-crop-body {
    flex: 1;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pinterest-crop-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pinterest-crop-image-wrapper img {
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    display: block;
    user-select: none;
    pointer-events: none;
}

.pinterest-crop-selection {
    position: absolute;
    border: 2px solid rgba(153, 153, 153, 1);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    min-width: 50px;
    min-height: 50px;
}

.pinterest-crop-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid rgba(153, 153, 153, 1);
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* 角手柄 */
.pinterest-crop-handle.nw {
    top: -5px;
    left: -5px;
    cursor: nw-resize;
}

.pinterest-crop-handle.ne {
    top: -5px;
    right: -5px;
    cursor: ne-resize;
}

.pinterest-crop-handle.sw {
    bottom: -5px;
    left: -5px;
    cursor: sw-resize;
}

.pinterest-crop-handle.se {
    bottom: -5px;
    right: -5px;
    cursor: se-resize;
}

/* 边中点手柄 */
.pinterest-crop-handle.n {
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: n-resize;
}

.pinterest-crop-handle.s {
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: s-resize;
}

.pinterest-crop-handle.w {
    top: 50%;
    left: -5px;
    transform: translateY(-50%);
    cursor: w-resize;
}

.pinterest-crop-handle.e {
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    cursor: e-resize;
}

.pinterest-crop-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.pinterest-crop-cancel-btn,
.pinterest-crop-search-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pinterest-crop-cancel-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e4e4e4;
}

.pinterest-crop-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.pinterest-crop-search-btn {
    background: linear-gradient(135deg, #818181, #5a5a5a);
    border: none;
    color: #fff;
}

.pinterest-crop-search-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(129, 129, 129, 0.3);
}
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pinterest-search-this-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pinterest-result-domain {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 50px);
}

/* 图片节点中的 Skill 选择器：工作流入口跟随生成框，不再使用独立画布助手。 */
.node-skill-bar {
    min-height: 38px;
    padding: 6px 16px 2px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.node-skill-label {
    color: rgba(255, 255, 255, 0.42);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.node-skill-select {
    max-width: 190px;
    min-width: 112px;
    height: 28px;
    padding: 0 28px 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: #262626;
    color: #e8e8e8;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.node-skill-select:focus {
    border-color: rgba(113, 113, 113, 0.75);
    box-shadow: 0 0 0 2px rgba(113, 113, 113, 0.14);
}

.node-skill-select:disabled {
    cursor: default;
    opacity: 0.48;
}

.node-skill-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.node-skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 5px 0 8px;
    border: 1px solid rgba(113, 113, 113, 0.52);
    border-radius: 999px;
    background: rgba(113, 113, 113, 0.14);
    color: #d0d0d0;
    font-size: 11px;
}

.node-skill-remove {
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.56);
    line-height: 16px;
    cursor: pointer;
}

.node-skill-remove:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.node-skill-status {
    flex: 1 1 160px;
    min-width: 0;
    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-skill-status.error {
    color: #909090;
}

/* GPT-Image-2.5 专项参数 */
#gpt25-advanced select, #gpt25-advanced input[type=number] { background:#232323; color:#eee; border:1px solid #555; border-radius:5px; padding:5px; max-width:130px; }
#gpt25-quality-buttons button { color:inherit; background:#232323; border:1px solid #555; border-radius:7px; padding:8px; }
#gpt25-quality-buttons button.selected { border-color:#ddd; background:#3b3b3b; }
#gpt25-advanced label { font-size:12px; display:flex; align-items:center; justify-content:space-between; gap:8px; }
#gpt25-advanced[hidden], #gpt25-quality[hidden] { display:none; }

/* 视频参数保持紧凑，不继承整行宽度；分辨率使用完整的两列按钮。 */
#video-options-dropdown { width: 320px; min-width: 0 !important; box-sizing: border-box; animation: none; }
#video-resolution-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#video-resolution-grid .resolution-item { width: auto; min-height: 38px; }
#selected-video-options { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
#video-options-label { white-space: nowrap; }

#video-ratio-grid.reference-ratio-note { display: block; white-space: nowrap; color: #c5c5c5; font-size: 12px; }

#mj-trial-controls select { color:#e4e4e4; background:#252525; border:1px solid #444; border-radius:7px; padding:6px 10px; outline:none; font-size:12px; }

.mj-group-button { position:absolute;right:42px;top:72px;z-index:12;color:white;background:rgba(17,17,17,.86);border:1px solid #555;border-radius:8px;padding:5px 8px;cursor:pointer;transition:background .16s ease,border-color .16s ease,transform .16s ease; }
.mj-group-button:hover { background:rgba(45,45,45,.95);border-color:#888;transform:translateY(-1px); }
#mj-gallery-overlay {position:fixed;inset:0;z-index:20000;background:transparent;pointer-events:none;opacity:1;}
#mj-gallery-overlay .mj-gallery-panel {transform:translateY(8px) scale(.985);opacity:0;transition:transform .22s cubic-bezier(.2,.8,.2,1),opacity .18s ease;}
#mj-gallery-overlay.mj-gallery-ready {opacity:1;}
#mj-gallery-overlay.mj-gallery-ready .mj-gallery-panel {transform:none;opacity:1;}
.mj-gallery-panel {width:min(680px,90vw);max-height:90vh;overflow:auto;padding:16px 18px;border-radius:18px;background:#1b1b1b;box-shadow:0 16px 60px #0008;color:#ddd;pointer-events:auto;}
.mj-gallery-panel header,.mj-gallery-panel footer {display:flex;gap:10px;align-items:center;padding:0 0 14px;}
.mj-gallery-panel header button {margin-left:auto;}
.mj-gallery-panel footer {padding:14px 0 0;font-size:12px;}
.mj-gallery-panel button {background:#292929;color:#eee;border:1px solid #444;border-radius:7px;padding:6px 9px;cursor:pointer;}
.mj-gallery-panel button:disabled {opacity:.35;cursor:default;}
.mj-gallery-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
.mj-gallery-tile {position:relative;border:2px solid transparent;border-radius:10px;overflow:hidden;}
.mj-gallery-tile.selected {border-color:#a7a7a7;}
.mj-gallery-panel .mj-gallery-pick {display:block;width:100%;padding:0;border:0;background:#111;}
.mj-gallery-pick img {display:block;width:100%;aspect-ratio:1;object-fit:contain;}
.mj-gallery-actions {position:absolute;right:6px;top:6px;display:flex;gap:4px;}
.mj-gallery-actions button {background:#111d;font-size:11px;}
.mj-current {position:absolute;left:8px;bottom:8px;background:#111d;padding:4px 7px;border-radius:5px;font-size:12px;pointer-events:none;}

.mj-group-button {pointer-events:auto;}

/* 图组展开挂在原画布节点，不改节点坐标或相机。 */
.node.image-group-open {content-visibility:visible!important;contain:none!important;overflow:visible!important;z-index:500!important;}
.image-group-open > .node-base {visibility:hidden;}
.image-group-open > #mj-gallery-overlay {position:absolute;inset:auto;left:32px;top:28px;width:600px;pointer-events:auto;background:transparent;z-index:20;}
.image-group-open #mj-gallery-overlay .mj-gallery-panel {position:relative;width:600px;max-height:none;box-sizing:border-box;transform:none;opacity:1;transition:none;}

body.image-gallery-active #global-node-panel {visibility:hidden;pointer-events:none;}

/* Canvas chrome is neutral; never filter the canvas or media containers. */
body.canvas-monochrome {
    color-scheme: dark;
    accent-color: #bdbdbd;
}
body.canvas-monochrome ::selection {
    color: #fff;
    background: #606060;
}
/* Backdrops are sibling decorations, not parents of image/video nodes. */
body.canvas-monochrome .backdrop {
    filter: grayscale(1);
}

/* Editable labels keep header height and connection anchors unchanged. */
.canvas-monochrome .floating-brand { max-width: calc(100vw - 90px); }
.canvas-monochrome .project-name { color: #c1c1c1; cursor: text; }
.node-header .node-name {
    pointer-events: auto;
    min-width: 0;
    flex: 0 1 auto;
    max-width: calc(100% - 30px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: text;
    border-radius: 3px;
}
.node-name:hover, .project-name:hover { background: rgba(255,255,255,.06); }
.node-name:focus-visible, .project-name:focus-visible {
    outline: 1px solid #aaa;
    outline-offset: 2px;
}
.node-header .node-name.is-renaming { flex: 1; }
.project-name.is-renaming { width: 220px; }
.inline-name-input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 20px;
    padding: 1px 3px;
    border: 1px solid #8c8c8c;
    border-radius: 3px;
    outline: none;
    background: #202020;
    color: #fff;
    font: inherit;
    letter-spacing: inherit;
    user-select: text;
}
/* Persistent equal-width slices create a soft light band without hard steps. */
.connection-flow { opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.connection-group.conn-linked .connection-flow { opacity: 1; }
.connection-flow path {
    fill: none;
    stroke: #ccc;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-dasharray: 1.6 118.4;
    pointer-events: none;
    animation: connection-soft-travel 4.8s linear infinite;
    animation-play-state: paused;
}
.connection-group.conn-linked .connection-flow path { animation-play-state: running; }
body.canvas-connections-hidden .connection-flow path { animation-play-state: paused; }
@keyframes connection-soft-travel {
    from { stroke-dashoffset: 20px; }
    to { stroke-dashoffset: -100px; }
}
@media (prefers-reduced-motion: reduce) {
    .connection-flow path { animation-duration: 14.4s; }
}
