        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
            background-size: 400% 400%;
            /* 移除动画，避免影响性能和造成视觉干扰 */
            /* animation: gradientShift 15s ease infinite; */
            height: 100vh;
            overflow: hidden;
        }

        .left-panel {
            display: none !important;
        }

        @keyframes gradientShift {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        .app-container {
            display: flex;
            height: 100vh;
            width: 100vw;
        }

        /* 左侧控制面板 */
        .left-panel {
            width: 400px;
            background: rgba(26, 26, 26, 0.95);
            backdrop-filter: blur(20px);
            display: flex;
            flex-direction: column;
            box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
            z-index: 100;
            border-right: 1px solid rgba(255, 255, 255, 0.1);
            position: relative;
            overflow: hidden;
        }

        .left-panel::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
            pointer-events: none;
        }

        .panel-header {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);

.panel-header h1 {
    font-size: 2em;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffffff 0%, #f093fb 50%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(240, 147, 251, 0.5);
    animation: textGlow 3s ease-in-out infinite alternate;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateZ(0);
    backface-visibility: hidden;
}
            backface-visibility: hidden;
        }

        /* 添加发光按钮效果 */
        .glow-button {
            position: relative;
            overflow: hidden;
        }

        .glow-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s;
        }

        .glow-button:hover::before {
            left: 100%;
        }

        /* 🐒 悟空提示系统 - 画布左上角 */
        .wukong-notification {
            position: fixed;
            top: 20px;
            left: 20px;
            max-width: 400px;
            padding: 16px 20px;
            border-radius: 16px;
            font-size: 14px;
            font-weight: 500;
            z-index: 10000;
            display: none;
            backdrop-filter: blur(20px);
            border: 2px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            animation: slideInFromLeft 0.4s ease-out;
            transform: translateX(-100%);
        }

        .wukong-notification.show {
            display: block;
            transform: translateX(0);
        }

        .wukong-notification.success {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(22, 163, 74, 0.9) 100%);
            color: white;
            border-color: rgba(34, 197, 94, 0.3);
        }

        .wukong-notification.error {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
            color: white;
            border-color: rgba(239, 68, 68, 0.3);
        }

        .wukong-notification.info {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(37, 99, 235, 0.9) 100%);
            color: white;
            border-color: rgba(59, 130, 246, 0.3);
        }

        .wukong-notification::before {
            content: '🐒';
            font-size: 18px;
            margin-right: 8px;
            animation: bounce 2s ease-in-out infinite;
        }

        @keyframes slideInFromLeft {
            0% {
                transform: translateX(-100%);
                opacity: 0;
            }
            100% {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes bounce {
            0%, 100% { transform: scale(1) rotate(0deg); }
            25% { transform: scale(1.1) rotate(-5deg); }
            75% { transform: scale(1.1) rotate(5deg); }
        }

        .panel-header p {
            font-size: 0.75em;
            opacity: 0.5;
            letter-spacing: 1px;
            text-transform: uppercase;
            color: #888;
        }

        .panel-content {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

        /* 自定义滚动条 */
        .panel-content::-webkit-scrollbar {
            width: 8px;
        }

        .panel-content::-webkit-scrollbar-track {
            background: #0a0a0a;
        }

        .panel-content::-webkit-scrollbar-thumb {
            background: #333;
            border-radius: 4px;
        }

        .panel-content::-webkit-scrollbar-thumb:hover {
            background: #444;
        }

        /* 文件浏览侧边栏 */
        .file-browser-sidebar {
            width: 450px;
            background: rgba(26, 26, 26, 0.95);
            backdrop-filter: blur(20px);
            display: flex;
            flex-direction: column;
            box-shadow: -4px 0 30px rgba(0, 0, 0, 0.3);
            z-index: 99;
            border-left: 1px solid rgba(255, 255, 255, 0.1);
            position: relative;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .file-browser-sidebar.collapsed {
            width: 0;
            transform: translateX(450px);
        }

        .file-browser-header {
            background: linear-gradient(135deg, rgba(79, 172, 254, 0.8) 0%, rgba(102, 126, 234, 0.8) 100%);
            color: white;
            padding: 15px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .file-browser-header h3 {
            font-size: 1.1em;
            font-weight: 600;
            margin: 0;
        }

        .file-browser-toggle {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 32px;
            height: 32px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
            font-size: 16px;
        }

        .file-browser-toggle:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }

        .file-browser-path {
            padding: 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .path-input-group {
            display: flex;
            gap: 8px;
        }

        .path-input {
            flex: 1;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 13px;
            transition: all 0.3s;
        }

        .path-input:focus {
            outline: none;
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(79, 172, 254, 0.5);
        }

        .path-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        .browse-btn {
            background: linear-gradient(135deg, #4facfe 0%, #667eea 100%);
            border: none;
            color: white;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.3s;
            white-space: nowrap;
        }

        .browse-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
        }

        .file-browser-content {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 10px;
            /* 🚀 滚动性能优化 */
            will-change: scroll-position;
            -webkit-overflow-scrolling: touch;
            /* 移除 smooth 滚动，使用原生滚动更流畅 */
            scroll-behavior: auto;
            /* 强制硬件加速 */
            transform: translate3d(0, 0, 0);
            -webkit-transform: translate3d(0, 0, 0);
        }

        .file-browser-content::-webkit-scrollbar {
            width: 8px;
        }

        .file-browser-content::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
        }

        .file-browser-content::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
        }

        .file-browser-content::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .file-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            transition: all 0.3s;
            /* 🚀 GPU加速 */
            transform: translateZ(0);
            backface-visibility: hidden;
        }

        /* 缩略图尺寸变体 */
        .file-grid.size-small {
            grid-template-columns: repeat(5, 1fr);
            gap: 8px;
        }

        .file-grid.size-medium {
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
        }

        .file-grid.size-large {
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }

        .file-item {
            background: rgba(255, 255, 255, 0.05);
            border: 2px solid transparent;
            border-radius: 8px;
            padding: 8px;
            cursor: grab;
            /* 只对 transform 和 opacity 做动画，更流畅 */
            transition: transform 0.2s, opacity 0.2s, border-color 0.2s;
            position: relative;
            overflow: hidden;
            /* 🚀 性能优化 */
            contain: layout style paint;
            will-change: transform;
            /* 强制硬件加速 */
            transform: translateZ(0);
            -webkit-transform: translateZ(0);
        }

        .file-grid.size-small .file-item {
            padding: 6px;
        }

        .file-grid.size-large .file-item {
            padding: 12px;
        }

        .file-item:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(79, 172, 254, 0.5);
            /* 使用 translate3d 而不是 translateY */
            transform: translate3d(0, -2px, 0);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .file-item.dragging {
            opacity: 0.5;
            cursor: grabbing;
        }

        .file-thumbnail {
            width: 100%;
            aspect-ratio: 1;
            object-fit: cover;
            border-radius: 4px;
            background: rgba(0, 0, 0, 0.3);
            display: block;
            /* 🚀 图片加载优化 */
            image-rendering: auto;
            /* 强制硬件加速 */
            transform: translate3d(0, 0, 0);
            -webkit-transform: translate3d(0, 0, 0);
            /* 防止图片闪烁 */
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            /* 使用 GPU 渲染 */
            -webkit-font-smoothing: antialiased;
        }

        .file-name {
            color: rgba(255, 255, 255, 0.9);
            font-size: 11px;
            margin-top: 6px;
            text-align: center;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .file-grid.size-small .file-name {
            font-size: 10px;
            margin-top: 4px;
        }

        .file-grid.size-large .file-name {
            font-size: 13px;
            margin-top: 8px;
        }

        .file-browser-empty {
            text-align: center;
            padding: 40px 20px;
            color: rgba(255, 255, 255, 0.5);
        }

        .file-browser-empty-icon {
            font-size: 48px;
            margin-bottom: 16px;
            opacity: 0.3;
        }

        .file-browser-empty-text {
            font-size: 14px;
            line-height: 1.6;
        }

        /* 缩略图尺寸控制 */
        .thumbnail-size-control {
            padding: 10px 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .thumbnail-size-label {
            color: rgba(255, 255, 255, 0.7);
            font-size: 12px;
            flex-shrink: 0;
        }

        .thumbnail-size-buttons {
            display: flex;
            gap: 6px;
            flex: 1;
        }

        .thumbnail-size-btn {
            flex: 1;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: rgba(255, 255, 255, 0.7);
            padding: 6px 8px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 11px;
            transition: all 0.3s;
            text-align: center;
        }

        .thumbnail-size-btn:hover {
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(79, 172, 254, 0.5);
            color: rgba(255, 255, 255, 0.9);
        }

        .thumbnail-size-btn.active {
            background: linear-gradient(135deg, #4facfe 0%, #667eea 100%);
            border-color: rgba(79, 172, 254, 0.8);
            color: white;
            font-weight: 500;
        }

        /* 文件夹历史记录 */
        .folder-history {
            padding: 10px 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .folder-history-label {
            color: rgba(255, 255, 255, 0.7);
            font-size: 12px;
            margin-bottom: 6px;
        }

        .folder-history-select {
            width: 100%;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .folder-history-select:hover {
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(79, 172, 254, 0.5);
        }

        .folder-history-select option {
            background: #2a2a2a;
            color: white;
        }

        /* 文件夹项样式 */
        .folder-item {
            background: rgba(79, 172, 254, 0.1);
            border: 2px solid rgba(79, 172, 254, 0.3);
            border-radius: 8px;
            padding: 12px;
            cursor: pointer;
            transition: transform 0.2s, background 0.2s, border-color 0.2s;
            grid-column: 1 / -1;
            display: flex;
            align-items: center;
            gap: 10px;
            /* 性能优化 */
            will-change: transform;
            transform: translateZ(0);
        }

        .folder-item:hover {
            background: rgba(79, 172, 254, 0.2);
            border-color: rgba(79, 172, 254, 0.5);
            transform: translate3d(4px, 0, 0);
        }

        .folder-item-icon {
            font-size: 24px;
            transition: transform 0.3s;
        }

        .folder-item.collapsed .folder-item-icon {
            transform: rotate(-90deg);
        }

        .folder-item-name {
            flex: 1;
            color: rgba(255, 255, 255, 0.9);
            font-size: 14px;
            font-weight: 500;
        }

        .folder-item-count {
            color: rgba(255, 255, 255, 0.6);
            font-size: 12px;
        }

        /* 收起按钮（当侧边栏收起时显示） */
        .file-browser-expand-btn {
            position: fixed;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(79, 172, 254, 0.9);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 98;
            transition: all 0.3s;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            font-size: 20px;
        }

        .file-browser-expand-btn.visible {
            display: flex;
        }

        .file-browser-expand-btn:hover {
            background: rgba(79, 172, 254, 1);
            transform: translateY(-50%) scale(1.1);
            box-shadow: 0 6px 16px rgba(79, 172, 254, 0.4);
        }
        
        /* 当侧边栏展开时，隐藏展开按钮 */
        .file-browser-sidebar:not(.collapsed) ~ .canvas-container .file-browser-expand-btn {
            display: none !important;
        }

        /* 右侧无限画布 */
        .canvas-container {
            flex: 1;
            position: relative;
            background: rgba(10, 10, 10, 0.3);
            overflow: hidden;
        }

        #infiniteCanvas {
            width: 100%;
            height: 100%;
            position: absolute;
            cursor: grab;
            background-color: rgba(10, 10, 10, 0.2);
            /* 🔑 使画布可以获得焦点，这样才能接收粘贴事件 */
            outline: none;
        }

        /* 网格背景层 - 独立渲染 */
        #canvasGrid {
            position: absolute;
            top: -10000px;
            left: -10000px;
            width: 20000px;
            height: 20000px;
            pointer-events: none;
            background-image: 
                linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
            background-size: 50px 50px;
            background-position: 0 0;
            background-repeat: repeat;
            z-index: 0;
        }

        /* 图像容器层 */
        #canvasContent {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            transform-origin: 0 0;
            z-index: 1;
            /* 🚀 GPU加速优化 */
            will-change: transform;
            transform: translateZ(0);
            /* 🔧 高质量缩放渲染 - 防止画布缩小时模糊 */
            -webkit-font-smoothing: subpixel-antialiased;
            -moz-osx-font-smoothing: grayscale;
            /* 确保子元素使用硬件加速 */
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
        }

        #infiniteCanvas.dragging {
            cursor: grabbing;
        }

        .canvas-image {
            position: absolute;
            border-radius: 4px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
            cursor: move;
            transition: box-shadow 0.3s;
            /* 🔧 透明背景 - 支持PNG透明通道 */
            background: transparent;
            user-select: none;
            /* 优化缩放渲染质量 */
            will-change: transform;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
        }

        .canvas-image:hover {
            box-shadow: 0 12px 48px rgba(255, 255, 255, 0.1);
            z-index: 10;
        }

        .canvas-image.latest-result {
            box-shadow: 0 0 0 3px #ff8800, 0 12px 48px rgba(255, 136, 0, 0.3) !important;
        }

        .canvas-image.selected {
            box-shadow: 0 0 0 5px #ff0000, 0 12px 48px rgba(255, 0, 0, 0.5) !important;
            z-index: 20;
        }

        /* 确保 hover 不覆盖 latest-result 和 selected */
        .canvas-image.latest-result:hover {
            box-shadow: 0 0 0 3px #ff8800, 0 12px 48px rgba(255, 136, 0, 0.5) !important;
        }

        .canvas-image.selected:hover {
            box-shadow: 0 0 0 6px #ff0000, 0 16px 64px rgba(255, 0, 0, 0.6) !important;
        }

        .canvas-image-label {
            position: absolute;
            top: 0;
            left: 0;
            background: rgba(0, 0, 0, 0.8);
            color: #fff;
            padding: 4px 8px;
            font-size: 0.75em;
            font-weight: 600;
            border-radius: 4px 0 4px 0;
            pointer-events: none;
            z-index: 1000;  /* ✨ 确保序号标签始终在最上层 */
            /* 只在颜色变化时启用过渡，避免缩放时闪烁 */
            transition: background-color 0.2s ease, color 0.2s ease;
            transform-origin: top left;
            /* 🔧 优化文字渲染 - 确保缩放时清晰 */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        .canvas-image.selected .canvas-image-label {
            background: rgba(255, 0, 0, 0.9);
            color: #fff;
        }

        .canvas-image-size {
            position: absolute;
            top: 100%;  /* ✨ 改用top: 100%，始终在图片底部 */
            margin-top: 4px;  /* 固定间距 */
            left: 0;
            color: #fff;
            font-size: 0.7em;
            font-weight: 500;
            pointer-events: none;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
            white-space: nowrap;
            transform-origin: top left;  /* ✨ 从顶部左侧缩放 */
            z-index: 1000;  /* ✨ 确保尺寸标签始终在最上层 */
            /* 🔧 优化文字渲染 - 确保缩放时清晰 */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        /* 缩放控制器 */
        .canvas-image-scale {
            position: absolute;
            top: 0;
            right: 0;
            background: rgba(0, 0, 0, 0.8);
            color: #fff;
            padding: 4px 8px;
            font-size: 0.7em;
            font-weight: 600;
            border-radius: 0 4px 0 4px;
            cursor: pointer;
            z-index: 2;
            pointer-events: auto;
            transition: all 0.2s ease;
            user-select: none;
            transform-origin: top right;
            /* 🔧 优化文字渲染 - 确保缩放时清晰 */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        .canvas-image-scale:hover {
            background: rgba(0, 0, 0, 0.95);
            transform: scale(1.1);
        }

        /* 缩放菜单 */
        .scale-menu {
            position: absolute;
            top: 100%;
            right: 0;
            background: rgba(26, 26, 26, 0.98);
            border: 1px solid #444;
            border-radius: 4px;
            margin-top: 4px;
            display: none;
            flex-direction: column;
            min-width: 80px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
            z-index: 1000;
        }

        .scale-menu.active {
            display: flex;
        }

        .scale-menu-item {
            padding: 6px 12px;
            color: #fff;
            font-size: 0.85em;
            cursor: pointer;
            transition: background 0.2s;
        }

        .scale-menu-item:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .scale-menu-item.current {
            background: rgba(100, 150, 255, 0.3);
            color: #6af;
        }

        /* 缩放手柄 */
        .scale-handle {
            position: absolute;
            width: 40px;
            height: 40px;
            background: #fff;
            border: 5px solid #000;
            border-radius: 50%;
            opacity: 0;
            transition: all 0.2s;
            pointer-events: auto;
            z-index: 3;
        }

        .canvas-image:hover .scale-handle {
            opacity: 1;
        }

        .scale-handle:hover {
            transform: scale(1.2);
            background: #4facfe;
            border-color: #667eea;
            box-shadow: 0 0 15px rgba(79, 172, 254, 0.9);
        }

        .scale-handle.nw {
            top: -20px;
            left: -20px;
            cursor: nw-resize;
        }

        .scale-handle.ne {
            top: -20px;
            right: -20px;
            cursor: ne-resize;
        }

        .scale-handle.sw {
            bottom: -20px;
            left: -20px;
            cursor: sw-resize;
        }

        .scale-handle.se {
            bottom: -20px;
            right: -20px;
            cursor: se-resize;
        }

        .canvas-image img {
            width: 100%;
            height: 100%;
            display: block;
            border-radius: 8px;
            pointer-events: none;
            /* 🔧 优化：使用高质量的图像缩放算法 - 在缩小时保持清晰 */
            /* 优先使用高质量渲染模式 */
            image-rendering: -webkit-optimize-contrast;
            image-rendering: high-quality;
            /* 备选：平滑渲染 */
            -ms-interpolation-mode: bicubic;
            /* 硬件加速 - 提高渲染性能 */
            backface-visibility: hidden;
            transform: translateZ(0);
            -webkit-backface-visibility: hidden;
            -webkit-transform: translateZ(0);
            /* 🔧 防止缩放时的抗锯齿导致模糊 */
            image-rendering: optimizeQuality;
        }

        /* 缩小时也保持高质量渲染 */
        .canvas-image.optimized img {
            image-rendering: -webkit-optimize-contrast;
            image-rendering: high-quality;
        }

        /* 隐藏旧的工具栏 */
        .canvas-controls {
            display: none !important;
        }
        
        /* PS风格竖向悬浮工具栏 - 精简美化版 */
        .ps-toolbar {
            position: absolute;
            left: 20px;  /* 默认位置，会被localStorage覆盖 */
            top: 80px;   /* 默认位置，会被localStorage覆盖 */
            width: 140px;
            max-height: calc(100vh - 24px);
            display: flex;
            flex-direction: column;
            background: linear-gradient(145deg, #2a2a2a 0%, #1f1f1f 100%);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            padding: 8px;
            box-shadow: 
                0 10px 40px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
            z-index: 100;
            cursor: move;
            user-select: none;
        }
        
        /* 🔧 修复：确保工具栏可以拖动，子元素保持可交互 */
        .ps-toolbar > * {
            pointer-events: auto;
        }
        
        .ps-toolbar-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 10px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 10px;
            margin-bottom: 8px;
            cursor: move;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
        }
        
        .ps-toolbar-title {
            color: #ffffff;
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 1.2px;
            text-transform: uppercase;
            text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
        }
        
        .ps-toolbar-collapse {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 10px;
            line-height: 1;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .ps-toolbar-collapse:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }
        
        .ps-toolbar.collapsed .ps-toolbar-collapse {
            transform: rotate(-90deg);
        }
        
        .ps-toolbar-content {
            transition: all 0.3s ease;
            flex: 1;
            overflow-x: hidden;
            overflow-y: auto;
            max-height: none;
            padding-right: 2px;
        }

        .ps-toolbar-content::-webkit-scrollbar {
            width: 8px;
        }

        .ps-toolbar-content::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.35);
            border-radius: 8px;
        }

        .ps-toolbar-content::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.18);
            border-radius: 8px;
        }

        .ps-toolbar-content::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.26);
        }
        
        .ps-toolbar.collapsed .ps-toolbar-content {
            max-height: 0;
            opacity: 0;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
        
        .ps-tool-group {
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            padding-bottom: 4px;
            margin-bottom: 4px;
        }
        
        .ps-tool-group:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
        }
        
        .ps-tool-btn {
            width: 100%;
            background: transparent;
            border: none;
            color: #c7cad1;
            padding: 6px 8px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 11px;
            font-weight: 600;
            transition: all 0.12s ease;
            display: flex;
            align-items: center;
            gap: 6px;
            line-height: 1.1;
            text-align: left;
        }

        .ps-tool-label {
            flex: 1;
            text-align: left;
            font-size: 11px;
            line-height: 1.1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .ps-tool-btn:last-child {
            margin-bottom: 0;
        }
        
        .ps-tool-btn:hover {
            background: rgba(102, 126, 234, 0.18);
            color: #ffffff;
        }
        
        .ps-tool-btn:active {
            background: rgba(102, 126, 234, 0.25);
        }
        
        .ps-tool-btn.active {
            background: rgba(102, 126, 234, 0.28);
            color: #ffffff;
        }
        
        .ps-tool-icon {
            font-size: 18px;
            width: 22px;
            text-align: center;
            filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
        }
        
        .ps-tool-label {
            flex: 1;
            text-align: left;
            font-size: 11px;
            line-height: 1.1;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        /* 画布比例选择器样式 */
        .ps-tool-select {
            width: 100%;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 6px;
            color: #c7cad1;
            padding: 8px 10px;
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.12s ease;
            outline: none;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c7cad1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 8px center;
            padding-right: 28px;
        }
        
        .ps-tool-select:hover {
            background-color: rgba(102, 126, 234, 0.18);
            border-color: rgba(102, 126, 234, 0.4);
            color: #ffffff;
        }
        
        .ps-tool-select:focus {
            background-color: rgba(102, 126, 234, 0.25);
            border-color: rgba(102, 126, 234, 0.6);
            color: #ffffff;
        }
        
        .ps-tool-select option {
            background: #2a2a2a;
            color: #c7cad1;
            padding: 8px;
        }
        
        /* 内联图像编辑工具栏 */
        /* 🔧 修复：确保编辑器工具栏可以拖动 */
        .inline-editor-toolbar > * {
            pointer-events: auto;
        }
        
        .inline-editor-toolbar {
            position: absolute;
            right: 20px;  /* 默认位置，会被localStorage覆盖 */
            top: 80px;    /* 默认位置，会被localStorage覆盖 */
            width: 140px;
            background: linear-gradient(145deg, #2a2a2a 0%, #1f1f1f 100%);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            padding: 12px;
            box-shadow: 
                0 10px 40px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
            z-index: 99;
            cursor: move;
            user-select: none;
            display: none;
        }
        
        .inline-editor-toolbar.active {
            display: block;
        }
        
        .inline-editor-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px;
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            border-radius: 10px;
            margin-bottom: 12px;
            cursor: move;
            box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
        }
        
        .inline-editor-title {
            color: #ffffff;
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 1px;
            text-transform: uppercase;
            text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
        }
        
        .inline-editor-collapse {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 10px;
            line-height: 1;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .inline-editor-collapse:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }
        
        .inline-editor-toolbar.collapsed .inline-editor-collapse {
            transform: rotate(-90deg);
        }
        
        .inline-editor-content {
            transition: all 0.3s ease;
            overflow: hidden;
        }
        
        .inline-editor-toolbar.collapsed .inline-editor-content {
            max-height: 0;
            opacity: 0;
            margin: 0;
            padding: 0;
        }
        
        .inline-editor-tool {
            width: 100%;
            background: transparent;
            border: none;
            color: #c7cad1;
            padding: 11px 10px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 12.5px;
            font-weight: 600;
            transition: all 0.12s ease;
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 4px;
            text-align: left;
        }
        
        .inline-editor-tool:last-child {
            margin-bottom: 0;
        }
        
        .inline-editor-tool:hover {
            background: rgba(245, 158, 11, 0.18);
            color: #ffffff;
        }
        
        .inline-editor-tool.active {
            background: rgba(245, 158, 11, 0.28);
            color: #ffffff;
        }
        
        .inline-editor-tool-icon {
            font-size: 18px;
            width: 22px;
            text-align: center;
            filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
        }
        
        .inline-editor-tool-label {
            flex: 1;
            text-align: left;
            font-size: 11.5px;
            font-weight: 600;
            letter-spacing: 0.3px;
        }
        
        /* 颜色选择器 */
        .inline-color-picker {
            padding: 8px 10px;
            margin-bottom: 8px;
        }
        
        .inline-color-input {
            width: 100%;
            height: 36px;
            border: 2px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            cursor: pointer;
        }
        
        /* 画笔大小滑块 */
        .inline-brush-size {
            padding: 8px 10px;
            margin-bottom: 8px;
        }
        
        .inline-brush-label {
            color: #c7cad1;
            font-size: 10px;
            font-weight: 600;
            margin-bottom: 6px;
            display: block;
        }
        
        .inline-brush-slider {
            width: 100%;
            height: 4px;
            border-radius: 2px;
            background: rgba(255, 255, 255, 0.1);
            outline: none;
            appearance: none;
            -webkit-appearance: none;
        }
        
        .inline-brush-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
        }
        
        /* 画布编辑层 */
        .canvas-edit-layer {
            position: absolute;
            top: 0;
            left: 0;
            pointer-events: none;
            z-index: 50;
            cursor: crosshair;
        }
        
        .canvas-edit-layer.active {
            pointer-events: auto;
        }
        
        /* 画笔工具光标 */
        .canvas-edit-layer.brush-cursor {
            cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="6" fill="none" stroke="white" stroke-width="2"/><circle cx="12" cy="12" r="1" fill="white"/></svg>') 12 12, crosshair;
        }
        
        /* 橡皮擦工具光标 */
        .canvas-edit-layer.eraser-cursor {
            cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect x="6" y="6" width="12" height="12" fill="none" stroke="white" stroke-width="2"/></svg>') 12 12, crosshair;
        }
        
        /* 裁剪工具光标 */
        .canvas-edit-layer.crop-cursor {
            cursor: crosshair;
        }
        
        /* 裁剪遮罩层 */
        .inline-crop-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: none;
            z-index: 60;
            pointer-events: none;
        }
        
        .inline-crop-overlay.active {
            display: block;
        }
        
        /* 裁剪框 */
        .inline-crop-box {
            position: absolute;
            border: 2px solid #fff;
            box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
            cursor: move;
            pointer-events: auto;
        }
        
        /* 裁剪手柄 */
        .inline-crop-handle {
            position: absolute;
            width: 12px;
            height: 12px;
            background: #fff;
            border: 2px solid #000;
            pointer-events: auto;
        }
        
        .inline-crop-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
        .inline-crop-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
        .inline-crop-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
        .inline-crop-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }
        .inline-crop-handle.n { top: -6px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
        .inline-crop-handle.s { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
        .inline-crop-handle.w { left: -6px; top: 50%; transform: translateY(-50%); cursor: w-resize; }
        .inline-crop-handle.e { right: -6px; top: 50%; transform: translateY(-50%); cursor: e-resize; }
        
        /* Toast动画 */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.9);
            }
            to {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1);
            }
        }
        
        @keyframes fadeOut {
            from {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1);
            }
            to {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.9);
            }
        }

        .canvas-btn {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
            color: #1a1a1a;
            border: 2px solid rgba(102, 126, 234, 0.2);
            padding: 12px 18px;
            border-radius: 12px;
            cursor: pointer;
            font-size: 0.85em;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 
                0 4px 16px rgba(102, 126, 234, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
            position: relative;
            overflow: hidden;
        }

        .canvas-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
            transition: left 0.5s;
        }

        .canvas-btn:hover {
            background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
            border-color: rgba(102, 126, 234, 0.4);
            transform: translateY(-3px);
            box-shadow: 
                0 8px 24px rgba(102, 126, 234, 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
        }

        .canvas-btn:hover::before {
            left: 100%;
        }

        .canvas-btn:active {
            transform: translateY(-1px);
            box-shadow: 
                0 4px 16px rgba(102, 126, 234, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
        }

        /* 特殊按钮样式 */
        .canvas-btn[style*="background: #4CAF50"] {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
            color: white !important;
            border-color: rgba(16, 185, 129, 0.3) !important;
            box-shadow: 
                0 4px 16px rgba(16, 185, 129, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
        }

        .canvas-btn[style*="background: #4CAF50"]:hover {
            background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
            border-color: rgba(16, 185, 129, 0.5) !important;
            box-shadow: 
                0 8px 24px rgba(16, 185, 129, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
        }

        .canvas-btn[style*="background: #4CAF50"]::before {
            background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.2), transparent) !important;
        }

        .canvas-info {
            position: absolute;
            bottom: 20px;
            right: 20px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
            color: #1a1a1a;
            padding: 12px 18px;
            border-radius: 12px;
            font-size: 0.8em;
            font-weight: 500;
            border: 2px solid rgba(102, 126, 234, 0.2);
            box-shadow: 
                0 8px 32px rgba(102, 126, 234, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
            transition: all 0.3s ease;
        }

        .canvas-info:hover {
            transform: translateY(-2px);
            box-shadow: 
                0 12px 40px rgba(102, 126, 234, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
        }

        /* 小地图样式美化 */
        .canvas-minimap {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%) !important;
            border: 2px solid rgba(102, 126, 234, 0.3) !important;
            border-radius: 12px !important;
            backdrop-filter: blur(20px) !important;
            box-shadow: 
                0 8px 32px rgba(102, 126, 234, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
            transition: all 0.3s ease !important;
        }

        .canvas-minimap:hover {
            transform: translateY(-2px) !important;
            box-shadow: 
                0 12px 40px rgba(102, 126, 234, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
        }

        .canvas-minimap canvas {
            border-radius: 8px !important;
        }

        .form-group {
            margin-bottom: 25px;
        }

        .form-group label {
            display: block;
            font-weight: 600;
            margin-bottom: 8px;
            color: #e0e0e0;
            font-size: 0.95em;
        }

        .form-group input[type="text"],
        .form-group input[type="number"],
        .form-group textarea,
        .form-group select {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #333;
            border-radius: 4px;
            font-size: 0.9em;
            transition: all 0.3s;
            background: #0a0a0a;
            color: #e0e0e0;
        }

        .form-group input[type="password"] {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #333;
            border-radius: 4px;
            font-size: 0.9em;
            transition: all 0.3s;
            background: #000000;
            color: #e0e0e0;
        }

        .form-group input[type="password"]:focus {
            outline: none;
            border-color: #555;
            background: #000000;
        }

        .form-group input:focus,
        .form-group textarea:focus,
        .form-group select:focus {
            outline: none;
            border-color: #555;
            background: #151515;
        }

        .form-group textarea {
            resize: vertical;
            min-height: 100px;
            font-family: inherit;
        }

        .upload-area {
            border: 1px dashed #333;
            border-radius: 4px;
            padding: 30px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            background: #0a0a0a;
        }

        .upload-area:hover {
            background: #151515;
            border-color: #444;
        }

        .upload-area.dragover {
            background: #1a1a1a;
            border-color: #555;
        }

        .upload-icon {
            font-size: 2.5em;
            margin-bottom: 10px;
        }

        .upload-text {
            font-size: 0.9em;
            color: #a0a0a0;
        }

        .image-preview {
            margin-top: 15px;
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .preview-item {
            position: relative;
            width: 80px;
            height: 80px;
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
            border: 1px solid #333;
        }

        .preview-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .preview-item .remove-btn {
            position: absolute;
            top: 3px;
            right: 3px;
            background: rgba(255, 0, 0, 0.9);
            color: white;
            border: none;
            border-radius: 50%;
            width: 22px;
            height: 22px;
            cursor: pointer;
            font-size: 1em;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
            line-height: 1;
        }

        .preview-item .remove-btn:hover {
            background: rgba(255, 0, 0, 1);
            transform: scale(1.1);
        }

        .btn {
            background: #3a3a3a;
            color: #e0e0e0;
            border: none;
            padding: 12px 30px;
            font-size: 0.9em;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
            font-weight: 500;
            width: 100%;
        }

        .btn:hover {
            background: #4a4a4a;
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
        }

        .btn:active {
            transform: translateY(0);
        }

        .btn:disabled {
            background: #333;
            color: #666;
            cursor: not-allowed;
            transform: none;
            opacity: 0.6;
        }


        .loading {
            display: none;
            text-align: center;
            padding: 30px;
            background: rgba(10, 10, 10, 0.95);
            border-radius: 4px;
            margin-top: 15px;
            border: 1px solid #333;
        }

        .loading.active {
            display: block;
        }

        .spinner {
            border: 3px solid #333;
            border-top: 3px solid #fff;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 0 auto 15px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .loading-text {
            font-size: 0.95em;
            color: #a0a0a0;
            font-weight: 500;
        }

        .error-message {
            background: rgba(220, 38, 38, 0.15);
            border: 2px solid rgba(220, 38, 38, 0.5);
            color: #fca5a5;
            padding: 12px;
            border-radius: 6px;
            margin-top: 15px;
            display: none;
            font-size: 0.9em;
        }

        .error-message.active {
            display: block;
        }

        .success-message {
            background: rgba(34, 197, 94, 0.15);
            border: 2px solid rgba(34, 197, 94, 0.5);
            color: #86efac;
            padding: 12px;
            border-radius: 6px;
            margin-top: 15px;
            display: none;
            font-size: 0.9em;
        }

        .success-message.active {
            display: block;
        }

        .row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }

        .info-box {
            background: rgba(255, 255, 255, 0.03);
            border-left: 2px solid #333;
            padding: 12px;
            margin-bottom: 15px;
            border-radius: 4px;
        }

        .info-box p {
            margin: 4px 0;
            color: #666;
            font-size: 0.8em;
            line-height: 1.5;
        }

        .info-box strong {
            color: #999;
        }

        /* 单选按钮样式 */
        .radio-group {
            display: flex;
            gap: 20px;
            margin-top: 8px;
        }

        .radio-option {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            color: #e0e0e0;
            font-size: 0.9em;
        }

        .radio-option input[type="radio"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: #fff;
        }

        .radio-option:hover {
            color: #fff;
        }

        /* 框选框样式 */
        .selection-box {
            position: fixed;
            border: 2px dashed rgba(102, 126, 234, 0.8);
            background: rgba(102, 126, 234, 0.05);
            pointer-events: none;
            z-index: 1000;
            display: none;
            box-shadow: 0 0 0 1px rgba(102, 126, 234, 0.3);
        }

        .selection-box.active {
            display: block;
        }

        /* 右键菜单 */
        .context-menu {
            position: fixed;
            background: #1a1a1a;
            border: 1px solid #333;
            border-radius: 4px;
            padding: 8px 0;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
            z-index: 1000;
            display: none;
            min-width: 150px;
        }

        .context-menu.active {
            display: block;
        }

        .context-menu-item {
            padding: 10px 20px;
            color: #e0e0e0;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.85em;
        }

        .context-menu-item:hover {
            background: #2a2a2a;
            color: white;
        }

        .context-menu-divider {
            height: 1px;
            background: #333;
            margin: 5px 0;
        }


        /* 🔧 画布底部固定提示词面板 */
        .floating-prompt-box {
            position: absolute;
            left: 50%;
            bottom: 20px;
            transform: translateX(-50%);
            z-index: 1000; /* 🔧 低于选中的 ComfyUI 节点 (1001) */
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: stretch;
            background: rgba(26, 26, 26, 0.96);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 14px;
            padding: 12px 16px;
            box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(10px);
            min-width: 620px;
            max-width: 900px;
        }

        .floating-prompt-header-row {
            display: flex;
            justify-content: center; /* 折叠按钮居中 */
            align-items: center;
            margin-bottom: 4px;
        }

        .floating-prompt-toggle {
            width: 26px;
            height: 18px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.5);
            background: rgba(15, 23, 42, 0.95);
            color: #e5e7eb;
            cursor: pointer;
            font-size: 11px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.4);
        }

        .floating-prompt-toggle:hover {
            background: rgba(30, 64, 175, 0.98);
            border-color: rgba(191, 219, 254, 0.9);
        }

        .floating-prompt-top-row {
            display: flex;
            justify-content: flex-start; /* 缩略图靠左 */
            gap: 8px;
            align-items: center;
            margin-bottom: 6px;
        }

        .floating-prompt-main {
            width: 100%;
            flex: 1;
        }

        .floating-prompt-controls {
            display: flex;
            gap: 8px;
            align-items: center;
            width: 100%; /* 让整排控件撑满面板宽度，方便开始按钮贴右侧 */
        }

        .floating-prompt-box.collapsed .floating-prompt-main,
        .floating-prompt-box.collapsed .floating-prompt-top-row,
        .floating-prompt-box.collapsed .floating-prompt-controls {
            display: none !important; /* 强制完全隐藏内部内容，避免被其它样式覆盖 */
        }

        .floating-prompt-box.collapsed {
            padding-top: 4px;
            padding-bottom: 4px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
        }

        .floating-prompt-controls select,
        #floatingPromptCount {
            height: 40px;
            padding: 4px 10px;
            border-radius: 8px;
            border: 1px solid rgba(148, 163, 184, 0.8);
            background: #0f172a;
            color: #e5e7eb;
            font-size: 0.85em;
        }

        .bottom-banana-row {
            display: flex;
            gap: 6px;
            align-items: center;
        }

        #bottomBananaModel,
        #bottomBananaSize {
            min-width: 110px;
        }

        #floatingPromptCount {
            width: 72px;
        }

        .floating-prompt-input {
            flex: 1;
            width: 100%;
            padding: 16px 20px;
            border: 2px solid rgba(102, 126, 234, 0.3);
            border-radius: 16px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
            color: #1a1a1a;
            font-size: 0.95em;
            resize: none;
            min-height: 96px; /* 高度约为原来的两倍 */
            max-height: 220px;
            overflow-y: auto;
            font-family: inherit;
            line-height: 1.5;
            transition: all 0.3s ease;
            backdrop-filter: blur(20px);
            box-shadow: 
                0 8px 32px rgba(102, 126, 234, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
        }

        .floating-prompt-input:focus {
            outline: none;
            border-color: rgba(102, 126, 234, 0.6);
            background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
            box-shadow: 
                0 0 0 4px rgba(102, 126, 234, 0.2),
                0 8px 32px rgba(102, 126, 234, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
        }

        /* 美化滚动条 */
        .floating-prompt-input::-webkit-scrollbar {
            width: 8px;
        }

        .floating-prompt-input::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.05);
            border-radius: 4px;
            margin: 4px;
        }

        .floating-prompt-input::-webkit-scrollbar-thumb {
            background: rgba(102, 126, 234, 0.3);
            border-radius: 4px;
        }

        .floating-prompt-input::-webkit-scrollbar-thumb:hover {
            background: rgba(102, 126, 234, 0.5);
        }

        .floating-prompt-send-btn {
            width: 52px;
            height: 52px;
            border: none;
            border-radius: 16px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2em;
            transition: all 0.3s ease;
            box-shadow: 
                0 8px 32px rgba(102, 126, 234, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
            flex-shrink: 0;
            position: relative;
            overflow: hidden;
            margin-left: auto; /* 将生成按钮推到最右侧 */
        }

        .floating-prompt-send-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s;
        }

        .floating-prompt-send-btn:hover {
            background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
            transform: translateY(-3px);
            box-shadow: 
                0 12px 40px rgba(102, 126, 234, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
        }

        .floating-prompt-send-btn:hover::before {
            left: 100%;
        }

        .floating-prompt-send-btn:disabled {
            background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
            color: rgba(255, 255, 255, 0.6);
            cursor: not-allowed;
            transform: none;
            box-shadow: 0 4px 16px rgba(156, 163, 175, 0.2);
        }

        .bottom-prompt-send-btn:disabled::before {
            display: none;
        }

        /* 选中图像缩略图显示区域（嵌入到底部提示词面板右侧） */
        .selected-images-preview {
            display: none;
            flex-shrink: 0;
            min-width: 96px;
            max-width: 150px;
            height: 72px;
            border-radius: 12px;
            background: rgba(15, 23, 42, 0.95);
            padding: 4px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
            overflow-x: auto;
            overflow-y: hidden;
        }

        .selected-images-preview.active {
            display: flex;
        }

        .selected-images-preview::-webkit-scrollbar {
            height: 6px;
        }

        .selected-images-preview::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.3);
            border-radius: 3px;
        }

        .selected-images-preview::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.3);
            border-radius: 3px;
        }

        .preview-image-item {
            position: relative;
            width: 60px;
            height: 60px;
            border-radius: 8px;
            overflow: hidden;
            flex-shrink: 0;
            border: 2px solid rgba(255, 255, 255, 0.3);
            transition: all 0.2s;
        }

        .preview-image-item:hover {
            transform: scale(1.1);
            border-color: rgba(255, 255, 255, 0.6);
        }

        .preview-image-item img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            background: rgba(0, 0, 0, 0.3);
        }

        .preview-image-count {
            position: absolute;
            bottom: 4px;
            left: 4px;
            background: rgba(0, 0, 0, 0.8);
            color: #fff;
            font-size: 0.7em;
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: 600;
        }

        .preview-image-close {
            position: absolute;
            top: 4px;
            right: 4px;
            width: 18px;
            height: 18px;
            border-radius: 999px;
            background: rgba(0, 0, 0, 0.85);
            color: #fff;
            font-size: 11px;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            border: 1px solid rgba(248, 250, 252, 0.6);
            box-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
        }

        .preview-image-item:hover .preview-image-close {
            background: rgba(248, 113, 113, 0.95);
            border-color: rgba(254, 202, 202, 1);
        }

        /* 模板添加按钮 */
        .template-add-btn {
            width: 36px;
            height: 36px;
            background: #3a3a3a;
            color: #e0e0e0;
            border: 1px solid #333;
            border-radius: 4px;
            cursor: pointer;
            font-size: 1.2em;
            font-weight: bold;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .template-add-btn:hover {
            background: #4a4a4a;
            border-color: #444;
            transform: scale(1.05);
        }

        /* 模板管理弹窗 */
        .template-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            backdrop-filter: blur(5px);
        }

        .template-modal.active {
            display: flex;
        }

        .template-modal-content {
            background: #1a1a1a;
            border: 1px solid #333;
            border-radius: 8px;
            width: 90%;
            max-width: 600px;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
        }

        .template-modal-header {
            padding: 20px;
            border-bottom: 1px solid #333;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .template-modal-header h2 {
            color: #e0e0e0;
            font-size: 1.3em;
            margin: 0;
        }

        .template-modal-close {
            background: none;
            border: none;
            color: #888;
            font-size: 1.5em;
            cursor: pointer;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .template-modal-close:hover {
            background: #2a2a2a;
            color: #fff;
        }

        .template-modal-body {
            padding: 20px;
            overflow-y: auto;
            flex: 1;
        }

        .template-modal-body::-webkit-scrollbar {
            width: 8px;
        }

        .template-modal-body::-webkit-scrollbar-track {
            background: #0a0a0a;
        }

        .template-modal-body::-webkit-scrollbar-thumb {
            background: #333;
            border-radius: 4px;
        }

        .api-key-settings-btn {
            position: absolute;
            top: 12px;
            left: 12px;
            width: 38px;
            height: 38px;
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(26, 26, 26, 0.78);
            color: rgba(255, 255, 255, 0.9);
            cursor: pointer;
            z-index: 120;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(10px);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
        }

        .api-key-settings-btn:hover {
            background: rgba(26, 26, 26, 0.92);
        }

        .api-key-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.75);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 2000;
            backdrop-filter: blur(5px);
        }

        .api-key-modal.active {
            display: flex;
        }

        .api-key-modal-content {
            background: #1a1a1a;
            border: 1px solid #333;
            border-radius: 8px;
            width: 520px;
            max-width: 90vw;
            max-height: 80vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
        }

        .api-key-modal-header {
            padding: 20px;
            border-bottom: 1px solid #333;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .api-key-modal-header h2 {
            color: #e0e0e0;
            font-size: 1.3em;
            margin: 0;
        }

        .api-key-modal-close {
            background: none;
            border: none;
            color: #888;
            font-size: 24px;
            cursor: pointer;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .api-key-modal-close:hover {
            background: #2a2a2a;
            color: #fff;
        }

        .api-key-modal-body {
            padding: 20px;
            overflow-y: auto;
            flex: 1;
        }

        .api-key-modal-footer {
            padding: 16px 20px;
            border-top: 1px solid #333;
            display: flex;
            justify-content: flex-end;
            gap: 12px;
        }

        .api-key-modal-footer button {
            padding: 10px 24px;
            border-radius: 6px;
            font-size: 14px;
            cursor: pointer;
            border: none;
            transition: all 0.2s;
            font-weight: 500;
        }

        .api-key-modal-footer .btn-secondary {
            background: #2a2a2a;
            color: #e0e0e0;
        }

        .api-key-modal-footer .btn-secondary:hover {
            background: #333;
        }

        .api-key-modal-footer .btn-primary {
            background: #4a9eff;
            color: #fff;
        }

        .api-key-modal-footer .btn-primary:hover {
            background: #5aa9ff;
        }

        .quota-display {
            margin-top: 20px;
            padding: 16px;
            background: rgba(74, 158, 255, 0.08);
            border: 1px solid rgba(74, 158, 255, 0.2);
            border-radius: 8px;
        }

        .quota-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .quota-label {
            color: #e0e0e0;
            font-size: 14px;
            font-weight: 600;
        }

        .quota-text {
            color: #4a9eff;
            font-size: 14px;
            font-weight: 600;
        }

        .quota-progress-container {
            width: 100%;
            height: 8px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: 12px;
        }

        .quota-progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #4a9eff, #5aa9ff);
            border-radius: 4px;
            transition: width 0.3s ease;
            width: 0%;
        }

        .quota-refresh-btn {
            width: 100%;
            padding: 8px;
            background: rgba(74, 158, 255, 0.15);
            border: 1px solid rgba(74, 158, 255, 0.3);
            border-radius: 6px;
            color: #4a9eff;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .quota-refresh-btn:hover {
            background: rgba(74, 158, 255, 0.25);
            border-color: rgba(74, 158, 255, 0.5);
        }

        .quota-refresh-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .template-form {
            margin-bottom: 30px;
            padding: 20px;
            background: rgba(255, 255, 255, 0.03);
            border-radius: 6px;
            border: 1px solid #2a2a2a;
        }

        .template-form h3 {
            color: #e0e0e0;
            font-size: 1em;
            margin-bottom: 15px;
        }

        .template-form-row {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
        }

        .template-form input {
            flex: 1;
            padding: 10px 12px;
            border: 1px solid #333;
            border-radius: 4px;
            background: #0a0a0a;
            color: #e0e0e0;
            font-size: 0.9em;
        }

        .template-form input:focus {
            outline: none;
            border-color: #555;
            background: #151515;
        }

        .template-form textarea {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #333;
            border-radius: 4px;
            background: #0a0a0a;
            color: #e0e0e0;
            font-size: 0.9em;
            resize: vertical;
            min-height: 80px;
            font-family: inherit;
            margin-bottom: 10px;
        }

        .template-form textarea:focus {
            outline: none;
            border-color: #555;
            background: #151515;
        }

        .template-form button {
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9em;
            transition: all 0.3s;
            font-weight: 500;
        }

        .template-add-submit-btn {
            background: #3a3a3a;
            color: #e0e0e0;
        }

        .template-add-submit-btn:hover {
            background: #4a4a4a;
            transform: translateY(-2px);
        }

        .template-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .template-list h3 {
            color: #e0e0e0;
            font-size: 1em;
            margin-bottom: 10px;
        }

        .template-item {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid #2a2a2a;
            border-radius: 6px;
            padding: 15px;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 15px;
            transition: all 0.2s;
        }

        .template-item:hover {
            background: rgba(255, 255, 255, 0.05);
            border-color: #333;
        }

        .template-item-content {
            flex: 1;
            min-width: 0;
        }

        .template-item-name {
            color: #e0e0e0;
            font-weight: 600;
            font-size: 0.95em;
            margin-bottom: 6px;
        }

        .template-item-prompt {
            color: #888;
            font-size: 0.85em;
            line-height: 1.4;
            word-break: break-word;
        }

        .template-item-delete {
            background: rgba(220, 38, 38, 0.2);
            color: #fca5a5;
            border: 1px solid rgba(220, 38, 38, 0.3);
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.85em;
            transition: all 0.2s;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .template-item-delete:hover {
            background: rgba(220, 38, 38, 0.3);
            border-color: rgba(220, 38, 38, 0.5);
        }

        .template-empty {
            text-align: center;
            color: #666;
            padding: 40px 20px;
            font-size: 0.9em;
        }

        /* ========== Python状态提示区域 ========== */
        .python-status {
            position: fixed;
            top: 20px;
            left: 20px;
            background: rgba(0,0,0,0.8);
            color: white;
            padding: 12px 20px;
            border-radius: 8px;
            font-weight: 600;
            font-size: 14px;
            z-index: 10000;
            display: none;
            border: 1px solid rgba(255,255,255,0.3);
            box-shadow: 0 4px 12px rgba(0,0,0,0.5);
        }
        
        .python-status.success {
            background: rgba(34, 197, 94, 0.9);
            border-color: rgba(34, 197, 94, 1);
        }
        
        .python-status.error {
            background: rgba(239, 68, 68, 0.9);
            border-color: rgba(239, 68, 68, 1);
        }
        
        .python-status.loading {
            background: rgba(59, 130, 246, 0.9);
            border-color: rgba(59, 130, 246, 1);
        }

        /* ========== 节点工作流样式 ========== */
        
        /* SVG 连线层 */
        #connectionLayer {
            position: absolute;
            top: 0;
            left: 0;
            width: 20000px;
            height: 20000px;
            pointer-events: none;
            z-index: 1;
            overflow: visible;
        }

        /* 连接点 */
        .connection-point {
            position: absolute;
            width: 40px;
            height: 40px;
            background: #fff;
            border: 5px solid #0a0a0a;
            border-radius: 50%;
            cursor: pointer;
            opacity: 0;
            transition: all 0.2s;
            z-index: 20;
            /* 增大触发范围 */
            padding: 12px;
            margin: -12px;
            pointer-events: auto; /* 确保可以接收鼠标事件 */
        }

        .canvas-image:hover .connection-point,
        .canvas-video:hover .connection-point,
        .canvas-video-wrapper:hover .connection-point,
        .process-node .connection-point {
            opacity: 1;
        }

        .connection-point:hover {
            transform: scale(1.3);
            background: #4facfe;
            border-color: #667eea;
            box-shadow: 0 0 20px rgba(79, 172, 254, 0.9);
        }

        .connection-point.output {
            right: -20px;
            top: 50%;
            transform: translateY(-50%);
        }

        .connection-point.output:hover {
            transform: translateY(-50%) scale(1.3);
        }

        /* 普通输入连接点 - 上方位置，蓝色 */
        .connection-point.input:not(.remix-input):not(.character-input),
        .connection-point[data-type="input"]:not([data-type="remix"]):not([data-type="character"]) {
            left: -20px;
            top: 30%;
            transform: translateY(-50%);
            background: #4facfe !important;
            border-color: #667eea !important;
        }

        .connection-point.input:not(.remix-input):not(.character-input):hover,
        .connection-point[data-type="input"]:not([data-type="remix"]):not([data-type="character"]):hover {
            transform: translateY(-50%) scale(1.3);
            background: #6ec1ff !important;
            box-shadow: 0 0 20px rgba(79, 172, 254, 0.9) !important;
        }
        
        /* 视频续作连接点 - 中间位置，橙色 */
        .connection-point.remix-input,
        .connection-point[data-type="remix"] {
            left: -20px;
            top: 50%;
            transform: translateY(-50%);
            background: #ff9800 !important;
            border-color: #f57c00 !important;
        }
        
        .connection-point.remix-input:hover,
        .connection-point[data-type="remix"]:hover {
            transform: translateY(-50%) scale(1.3);
            background: #ffb74d !important;
            box-shadow: 0 0 20px rgba(255, 152, 0, 0.9) !important;
        }
        
        /* 角色视频连接点 - 下方位置，紫色 */
        .connection-point.character-input,
        .connection-point[data-type="character"] {
            left: -20px;
            top: 70%;
            transform: translateY(-50%);
            background: #9c27b0 !important;
            border-color: #7b1fa2 !important;
        }
        
        .connection-point.character-input:hover,
        .connection-point[data-type="character"]:hover {
            transform: translateY(-50%) scale(1.3);
            background: #ba68c8 !important;
            box-shadow: 0 0 20px rgba(156, 39, 176, 0.9) !important;
        }

        .connection-point[data-type="prompt"] {
            left: -20px;
            top: 15%;
            transform: translateY(-50%);
            background: #00c853 !important;
            border-color: #00a843 !important;
            box-shadow: 0 0 12px rgba(0, 200, 83, 0.45);
        }

        .connection-point[data-type="prompt"]:hover {
            transform: translateY(-50%) scale(1.3);
            background: #69f0ae !important;
            box-shadow: 0 0 20px rgba(0, 200, 83, 0.85) !important;
        }

        .connection-point.active {
            opacity: 1;
            background: #ff6b6b;
            animation: pulse 1s infinite;
        }

        @keyframes pulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
            50% { box-shadow: 0 0 0 8px rgba(255, 107, 107, 0); }
        }

        /* 连线 */
        .connection-line {
            stroke: #fff;
            stroke-width: 2;
            fill: none;
            pointer-events: stroke;
            cursor: pointer;
        }

        .connection-line:hover {
            stroke: #ddd;
            stroke-width: 3;
        }

        .connection-line.temp {
            stroke: #ccc;
            stroke-dasharray: 5, 5;
            animation: dash 0.5s linear infinite;
        }

        @keyframes dash {
            to { stroke-dashoffset: -10; }
        }

        /* 处理节点 - 炫酷渐变设计 */
        .process-node {
            position: absolute;
            background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
            border: 6px solid transparent;
            background-clip: padding-box;
            border-radius: 36px;
            padding: 60px;
            min-width: 960px;
            box-shadow: 
                0 36px 144px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(255, 255, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
            z-index: 15;
            overflow: hidden;
            /* 🚀 优化缩放清晰度 - 使用矢量优化而非位图优化 */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
            backface-visibility: hidden;
            transform: translateZ(0);
            will-change: transform;
            /* 强制硬件加速，提升缩放质量 */
            transform-style: preserve-3d;
            -webkit-transform-style: preserve-3d;
            /* 🔧 关键修复：强制使用高质量缩放 */
            image-rendering: -webkit-optimize-contrast;
            image-rendering: crisp-edges;
            /* 确保文字在缩放时保持清晰 */
            -webkit-text-stroke: 0.1px transparent;
            /* 使用 GPU 加速渲染 */
            -webkit-backface-visibility: hidden;
            -webkit-perspective: 1000;
            perspective: 1000;
        }

        .process-node::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
            pointer-events: none;
            z-index: -1;
        }

        /* 🔧 节点选中状态样式 */
        .process-node.selected {
            border: 6px solid #ff0000 !important;
            box-shadow: 
                0 0 0 5px #ff0000,
                0 36px 144px rgba(255, 0, 0, 0.3),
                0 0 40px rgba(255, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
            z-index: 20;
        }

        .process-node.selected::before {
            background: linear-gradient(135deg, rgba(255, 0, 0, 0.05) 0%, rgba(255, 0, 0, 0.05) 100%);
        }

        .process-node-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 45px;
            cursor: move;
            padding-bottom: 30px;
            border-bottom: 3px solid rgba(0, 0, 0, 0.1);
        }

        .process-node-title {
            color: #1a1a1a;
            font-size: 3.5em;
            font-weight: 800;
            /* 优化文本清晰度 */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        .process-node-close {
            background: rgba(239, 68, 68, 0.1);
            border: 2px solid rgba(239, 68, 68, 0.3);
            color: #ef4444;
            font-size: 3.6em;
            cursor: pointer;
            width: 72px;
            height: 72px;
            border-radius: 12px;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .process-node-close:hover {
            background: rgba(239, 68, 68, 0.2);
            border-color: rgba(239, 68, 68, 0.5);
            color: #fff;
            transform: scale(1.05);
            box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
        }

        .process-node-body {
            display: flex;
            flex-direction: column;
            gap: 36px;
        }

        .process-node-input {
            width: 100%;
            padding: 30px 36px;
            border: 3px solid rgba(0, 0, 0, 0.1);
            border-radius: 18px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
            color: #1a1a1a;
            font-size: 2.7em;
            resize: vertical;
            min-height: 240px;
            font-family: inherit;
            transition: all 0.3s ease;
            /* 优化文本清晰度 */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        .process-node-input:focus {
            outline: none;
            border-color: rgba(102, 126, 234, 0.5);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
            box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
        }

        .process-node-row {
            display: flex;
            gap: 30px;
            align-items: center;
        }

        .process-node-label {
            color: rgba(0, 0, 0, 0.7);
            font-size: 2.55em;
            min-width: 240px;
            font-weight: 500;
            text-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            /* 优化文本清晰度 */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
            /* 🔧 缩放时保持清晰 */
            transform: translateZ(0);
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
        }

        .process-node-number {
            flex: 1;
            padding: 24px 36px;
            border: 3px solid rgba(0, 0, 0, 0.1);
            border-radius: 18px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
            color: #1a1a1a;
            font-size: 2.7em;
            transition: all 0.3s ease;
            /* 优化文本清晰度 */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        .process-node-number:focus {
            outline: none;
            border-color: rgba(102, 126, 234, 0.5);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
            box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
        }

        .process-node-aspect-ratio {
            flex: 1;
            padding: 24px 36px;
            border: 3px solid rgba(0, 0, 0, 0.1);
            border-radius: 18px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
            color: #1a1a1a;
            font-size: 2.7em;
            transition: all 0.3s ease;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%231a1a1a' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 36px center;
            padding-right: 84px;
            /* 优化文本清晰度 */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        .process-node-aspect-ratio:hover {
            border-color: rgba(102, 126, 234, 0.3);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
        }

        .process-node-aspect-ratio:focus {
            outline: none;
            border-color: rgba(102, 126, 234, 0.5);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
            box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
        }

        .process-node-aspect-ratio option {
            background: #ffffff;
            color: #1a1a1a;
            padding: 12px;
            font-size: 1em;
        }

        /* 🍌 Banana 模型和图像大小选择器 - 使用和画幅比例一样的样式 */
        .process-node-banana-model,
        .process-node-image-size {
            flex: 1;
            padding: 24px 36px;
            border: 3px solid rgba(0, 0, 0, 0.1);
            border-radius: 18px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
            color: #1a1a1a;
            font-size: 2.7em;
            transition: all 0.3s ease;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%231a1a1a' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 36px center;
            padding-right: 84px;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        .process-node-banana-model:hover,
        .process-node-image-size:hover {
            border-color: rgba(102, 126, 234, 0.3);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
        }

        .process-node-banana-model:focus,
        .process-node-image-size:focus {
            outline: none;
            border-color: rgba(102, 126, 234, 0.5);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
            box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
        }

        .process-node-banana-model option,
        .process-node-image-size option {
            background: #ffffff;
            color: #1a1a1a;
            padding: 12px;
            font-size: 1em;
        }

        /* 视频时长和清晰度选择框 - 使用和画幅比例一样的样式 */
        .process-node-duration,
        .process-node-size {
            flex: 1;
            padding: 24px 36px;
            border: 3px solid rgba(0, 0, 0, 0.1);
            border-radius: 18px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
            color: #1a1a1a;
            font-size: 2.7em;
            transition: all 0.3s ease;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%231a1a1a' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 36px center;
            padding-right: 84px;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        .process-node-duration:hover,
        .process-node-size:hover {
            border-color: rgba(102, 126, 234, 0.3);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
        }

        .process-node-duration:focus,
        .process-node-size:focus {
            outline: none;
            border-color: rgba(102, 126, 234, 0.5);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
            box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
        }

        .process-node-duration option,
        .process-node-size option {
            background: #ffffff;
            color: #1a1a1a;
            padding: 12px;
            font-size: 1em;
        }

        /* API Key 输入框 - 使用统一的白色背景样式 */
        .process-node-api-key {
            flex: 1;
            padding: 24px 36px;
            border: 3px solid rgba(0, 0, 0, 0.1);
            border-radius: 18px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
            color: #1a1a1a;
            font-size: 2.7em;
            transition: all 0.3s ease;
            font-family: inherit;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        .process-node-api-key::placeholder {
            color: rgba(26, 26, 26, 0.5);
        }

        .process-node-api-key:hover {
            border-color: rgba(102, 126, 234, 0.3);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
        }

        .process-node-api-key:focus {
            outline: none;
            border-color: rgba(102, 126, 234, 0.5);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
            box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
        }

        .process-node-button {
            width: 100%;
            padding: 30px 60px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 18px;
            font-size: 2.7em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: visible;
            /* 优化文本清晰度 */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        .process-node-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s;
        }

        .process-node-button:hover {
            background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
            transform: translateY(-6px);
            box-shadow: 0 12px 36px rgba(102, 126, 234, 0.4);
        }

        .process-node-button:hover::before {
            left: 100%;
        }

        .process-node-button:disabled {
            background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
            color: rgba(255, 255, 255, 0.5);
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .process-node-button:disabled::before {
            display: none;
        }

        /* 循环生成按钮 - 放大3倍，放在图像底部 */
        .regenerate-btn {
            position: absolute;
            bottom: 5px;
            left: 50%;
            transform: translateX(-50%);
            background: #555;
            color: white;
            border: 6px solid #666;
            border-radius: 60px;
            padding: 24px 48px;
            font-size: 42px;
            cursor: pointer;
            opacity: 0;
            transition: all 0.3s;
            z-index: 25;
            display: flex;
            align-items: center;
            gap: 18px;
            white-space: nowrap;
            font-weight: 600;
        }

        .canvas-image:hover .regenerate-btn {
            opacity: 1;
        }

        .regenerate-btn:hover {
            background: #666;
            transform: translateX(-50%) translateY(-6px);
            box-shadow: 0 12px 36px rgba(85, 85, 85, 0.6);
        }

        .regenerate-btn:active {
            transform: translateX(-50%) translateY(0);
        }

        /* 🔧 生成进度条样式 */
        .generate-progress-container {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 8px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 0 0 8px 8px;
            overflow: hidden;
            opacity: 0;
            transition: opacity 0.3s ease;
            z-index: 10;
        }

        .generate-progress-container.active {
            opacity: 1;
        }

        .generate-progress-bar {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
            background-size: 200% 100%;
            transition: width 0.3s ease;
            animation: progressShimmer 2s linear infinite;
            border-radius: 0 0 8px 8px;
        }

        @keyframes progressShimmer {
            0% {
                background-position: 200% 0;
            }
            100% {
                background-position: -200% 0;
            }
        }

        .generate-progress-text {
            position: absolute;
            top: -28px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.8);
            color: #fff;
            padding: 6px 14px;
            border-radius: 12px;
            font-size: 13px;
            white-space: nowrap;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .generate-progress-container.active .generate-progress-text {
            opacity: 1;
        }

        /* 生成按钮添加相对定位以容纳进度条 */
        #generateBtn.btn {
            position: relative !important;
            overflow: visible !important;
        }

        /* 生成按钮在运行时的样式 */
        .btn.generating {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            cursor: not-allowed;
            animation: buttonPulse 2s ease-in-out infinite;
        }

        /* 节点按钮在运行时的样式 */
        .process-node-button.generating {
            cursor: not-allowed;
            animation: buttonPulse 2s ease-in-out infinite;
        }

        /* 节点进度条容器样式 - 显示在按钮下方 */
        .node-progress-container {
            width: 100%;
            margin-top: 12px;
            padding: 12px;
            background: rgba(0, 0, 0, 0.05);
            border-radius: 12px;
            border: 1px solid rgba(102, 126, 234, 0.2);
            position: relative;
            overflow: hidden;
            display: none;
            transition: all 0.3s ease;
        }

        .node-progress-container.active {
            display: block;
        }

        .node-progress-bar {
            height: 8px;
            width: 0%;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
            background-size: 200% 100%;
            transition: width 0.3s ease;
            animation: progressShimmer 2s linear infinite;
            border-radius: 4px;
            margin-top: 8px;
        }

        .node-progress-text {
            color: #667eea;
            font-size: 14px;
            font-weight: 500;
            text-align: center;
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        @keyframes buttonPulse {
            0%, 100% {
                box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
            }
            50% {
                box-shadow: 0 4px 25px rgba(102, 126, 234, 0.6);
            }
        }

        /* 🎬 视频加载对话框样式 */
        .video-load-dialog {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }

        .video-load-dialog h3 {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .video-load-dialog input[type="number"] {
            transition: all 0.3s ease;
        }

        .video-load-dialog input[type="number"]:focus {
            outline: none;
            border-color: rgba(102, 126, 234, 0.6);
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        .video-load-dialog button {
            transition: all 0.3s ease;
        }

        .video-load-dialog button:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .video-load-dialog button:active {
            transform: translateY(0);
        }

        #videoLoadConfirm:hover {
            background: linear-gradient(135deg, #7c8ef5 0%, #8a5cb8 100%);
        }

        #videoLoadCancel:hover {
            background: rgba(255, 255, 255, 0.15);
        }

/* 瑙嗛鎾斁鍣ㄦ牱寮?*/
.canvas-video-wrapper { position: absolute; border: 2px solid rgba(74, 144, 226, 0.5); border-radius: 10px; overflow: hidden; background: #000; transition: border-color 0.2s, box-shadow 0.2s; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
.canvas-video-wrapper:hover { border-color: rgba(74, 144, 226, 0.8); box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4); }
.canvas-video-wrapper.dragging { border-color: #4A90E2; box-shadow: 0 8px 24px rgba(74, 144, 226, 0.6); }
.canvas-video { display: block; width: 100%; height: auto; background: #000; }

/* 画布拖拽视觉反馈 */
#infiniteCanvas.drag-over {
    outline: 3px dashed #4A90E2;
    outline-offset: -3px;
    background-color: rgba(74, 144, 226, 0.1);
    transition: all 0.2s ease;
}

/* ============================================
   组（Group）样式
   ============================================ */

/* 组容器 - 深色半透明背景 */
.canvas-group {
    position: absolute;
    background: rgba(30, 30, 40, 0.6);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(102, 126, 234, 0.4);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    pointer-events: auto;
    z-index: 0 !important; /* 始终在底层 */
}

.canvas-group:hover {
    background: rgba(30, 30, 40, 0.7);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.3);
}

/* 组标题栏 */
.canvas-group-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;  /* 增加高度从32px到40px */
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6) 0%, rgba(118, 75, 162, 0.6) 100%);
    backdrop-filter: blur(10px);
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;  /* 增加左右内边距 */
    cursor: move !important; /* 强制显示移动光标，确保整个标题栏都可以拖动 */
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.canvas-group-header:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
    cursor: move !important; /* 悬停时也保持移动光标 */
}

/* 确保标题栏的所有子元素（除了按钮）都继承 move 光标 */
.canvas-group-header > * {
    cursor: inherit; /* 继承父元素的 move 光标 */
}

/* 按钮保持自己的光标 */
.canvas-group-header .canvas-group-collapse,
.canvas-group-header .canvas-group-lock,
.canvas-group-header .canvas-group-ungroup {
    cursor: pointer !important; /* 按钮显示指针光标 */
}

/* 组折叠按钮 */
.canvas-group-collapse {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    margin-right: 8px;
}

.canvas-group-collapse:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.canvas-group-collapse:active {
    transform: scale(0.95);
}

/* 组标题文字 */
.canvas-group-title {
    color: #fff;
    font-size: 13px;  /* 增加字体大小 */
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    flex: 1; /* 让标题占据剩余空间 */
    white-space: nowrap; /* 不换行 */
    overflow: hidden; /* 隐藏溢出 */
    text-overflow: ellipsis; /* 显示省略号 */
    margin-right: 8px; /* 与右侧按钮保持间距 */
    cursor: move !important; /* 强制显示移动光标，可以拖动整个组 */
    pointer-events: auto; /* 确保可以接收事件 */
}

/* 标题悬停提示 */
.canvas-group-title:hover {
    color: rgba(255, 255, 255, 0.9);
    /* 不改变光标，保持 move 光标以便拖动 */
}

/* 组标题编辑输入框 */
.canvas-group-title-input {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 2px solid rgba(102, 126, 234, 0.8) !important;
    border-radius: 4px !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 4px 8px !important;
    outline: none !important;
    flex: 1 !important;
    margin-right: 8px !important;
}

.canvas-group-title-input:focus {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(102, 126, 234, 1) !important;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5) !important;
}

.canvas-group-title-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* 🔒 锁定组按钮 */
.canvas-group-lock {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    margin-right: 8px;
}

.canvas-group-lock:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.canvas-group-lock:active {
    transform: scale(0.95);
}

/* 组锁定状态的视觉反馈 */
.canvas-group.locked {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(40, 30, 30, 0.7);
}

.canvas-group.locked:hover {
    border-color: rgba(239, 68, 68, 0.8);
}

/* 解散组按钮 */
.canvas-group-ungroup {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.canvas-group-ungroup:hover {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

.canvas-group-ungroup:active {
    transform: scale(0.95);
}

/* 组拖动时的视觉效果 */
.canvas-group.dragging {
    border-color: rgba(102, 126, 234, 0.9);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.5);
}

/* 组折叠状态 */
.canvas-group.collapsed {
    height: 40px !important;
    width: 280px !important; /* 折叠时固定宽度，所有组标题栏长度一致 */
    overflow: hidden;
    background: rgba(30, 30, 40, 0.9); /* 折叠时背景更深 */
    min-width: 280px !important;
    max-width: 280px !important;
}

.canvas-group.collapsed .canvas-group-header {
    border-radius: 10px; /* 折叠时上下圆角一致 */
    width: 100%; /* 标题栏占满组框宽度 */
}

/* 组内元素的特殊标记（可选） */
.canvas-image.in-group,
.process-node.in-group {
    /* 可以在这里添加特殊样式来标识组内元素 */
    opacity: 1;
}

/* 组的调整大小控制点（右下角） */
.canvas-group-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 0 0 10px 0;
    cursor: nwse-resize;
    transition: all 0.2s ease;
    opacity: 0;
}

.canvas-group:hover .canvas-group-resize-handle {
    opacity: 1;
}

.canvas-group-resize-handle:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 1) 0%, rgba(118, 75, 162, 1) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.2);
}

.canvas-group-resize-handle::before {
    content: '';
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(255, 255, 255, 0.8);
    border-bottom: 2px solid rgba(255, 255, 255, 0.8);
}

/* 组正在调整大小时的样式 */
.canvas-group.resizing {
    border-color: rgba(102, 126, 234, 0.9);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.5);
}

.canvas-group.resizing .canvas-group-resize-handle {
    opacity: 1;
    transform: scale(1.3);
}

/* ComfyUI 节点样式 */
.comfyui-node {
    position: absolute;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98) 0%, rgba(20, 20, 20, 0.98) 100%);
    border: 2px solid rgba(102, 126, 234, 0.6);
    border-radius: 16px;
    padding: 0;
    width: 500px;
    min-width: 500px;
    max-width: 500px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 10;
    cursor: default;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    will-change: transform, left, top;
    transform: translateZ(0) scale(1);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0) scale(1);
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

.comfyui-node:hover {
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 
        0 25px 80px rgba(102, 126, 234, 0.2),
        0 0 0 1px rgba(102, 126, 234, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.comfyui-node.selected {
    border-color: #ff0000 !important;
    box-shadow: 
        0 0 0 3px #ff0000,
        0 30px 100px rgba(255, 0, 0, 0.3),
        0 0 40px rgba(255, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    z-index: 1001 !important; /* 🔧 确保高于悬浮提示词框 (1000) */
}

.comfyui-node-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    padding: 16px 20px;
    border-radius: 14px 14px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comfyui-node-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 10px rgba(102, 126, 234, 0.5);
}

.comfyui-node-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.comfyui-node-close:hover {
    background: rgba(255, 59, 48, 0.8);
    transform: scale(1.1);
}

.comfyui-node-body {
    padding: 20px;
}

.comfyui-node-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 16px;
}

.comfyui-node-status .status-indicator {
    font-size: 12px;
}

.comfyui-node-status .status-text {
    color: #ccc;
    font-size: 13px;
}

.comfyui-node-section {
    margin-bottom: 16px;
}

.comfyui-node-label {
    display: block;
    color: #aaa;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 500;
}

.comfyui-node-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.comfyui-node-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 🔧 ComfyUI 节点内的下拉框样式 */
.comfyui-node select,
.comfyui-node-body select {
    width: 100%;
    padding: 10px 12px;
    padding-right: 36px;
    background: rgba(30, 30, 30, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff !important;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    transition: all 0.2s ease;
}

.comfyui-node select:focus,
.comfyui-node-body select:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: rgba(30, 30, 30, 0.95) !important;
}

/* 🔧 下拉框选项样式 - 使用 !important 强制覆盖浏览器默认样式 */
.comfyui-node select option,
.comfyui-node-body select option {
    background: rgba(30, 30, 30, 0.98) !important;
    color: #fff !important;
    padding: 10px 12px !important;
}

.comfyui-node select option:hover,
.comfyui-node-body select option:hover {
    background: rgba(102, 126, 234, 0.3) !important;
    color: #fff !important;
}

.comfyui-node select option:checked,
.comfyui-node-body select option:checked {
    background: rgba(102, 126, 234, 0.5) !important;
    color: #fff !important;
}

.comfyui-node select option:focus,
.comfyui-node-body select option:focus {
    background: rgba(102, 126, 234, 0.4) !important;
    color: #fff !important;
}

.comfyui-workflow-input {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    resize: vertical;
    transition: all 0.2s ease;
}

.comfyui-workflow-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 预设模板样式 */
.comfyui-preset-container {
    width: 100%;
}

.comfyui-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
}

.comfyui-preset-block {
    position: relative;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.comfyui-preset-block:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.comfyui-preset-block.active {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.4);
}

.comfyui-preset-block-title {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.comfyui-preset-block-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    padding: 0;
    background: rgba(245, 87, 108, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.comfyui-preset-block:hover .comfyui-preset-block-delete {
    opacity: 1;
}

.comfyui-preset-block-delete:hover {
    background: rgba(245, 87, 108, 0.9);
    transform: scale(1.1);
}

.comfyui-preset-actions-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.comfyui-preset-actions-bar .comfyui-preset-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
}

.comfyui-file-input {
    display: none;
}

.comfyui-preset-btn {
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.5);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.comfyui-preset-btn:hover {
    background: rgba(102, 126, 234, 0.5);
    border-color: rgba(102, 126, 234, 0.7);
}

.comfyui-preset-btn.delete-preset-btn {
    background: rgba(245, 87, 108, 0.3);
    border-color: rgba(245, 87, 108, 0.5);
}

.comfyui-preset-btn.delete-preset-btn:hover {
    background: rgba(245, 87, 108, 0.5);
    border-color: rgba(245, 87, 108, 0.7);
}

.comfyui-preset-editor {
    margin-top: 10px;
}

.comfyui-preset-title {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    margin-bottom: 10px;
}

.comfyui-preset-title::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.comfyui-preset-title:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.comfyui-preset-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.comfyui-preset-save-btn,
.comfyui-preset-cancel-btn {
    flex: 1;
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.5);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.comfyui-preset-save-btn:hover {
    background: rgba(102, 126, 234, 0.5);
    border-color: rgba(102, 126, 234, 0.7);
}

.comfyui-preset-cancel-btn {
    background: rgba(128, 128, 128, 0.3);
    border-color: rgba(128, 128, 128, 0.5);
}

.comfyui-preset-cancel-btn:hover {
    background: rgba(128, 128, 128, 0.5);
    border-color: rgba(128, 128, 128, 0.7);
}

.comfyui-node-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.comfyui-node-button {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comfyui-node-button.connect-btn {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.8) 0%, rgba(48, 176, 199, 0.8) 100%);
    color: white;
}

.comfyui-node-button.connect-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(52, 199, 89, 1) 0%, rgba(48, 176, 199, 1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 199, 89, 0.3);
}

.comfyui-node-button.execute-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
    color: white;
}

.comfyui-node-button.execute-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 1) 0%, rgba(118, 75, 162, 1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.comfyui-node-button.interrupt-btn {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.8) 0%, rgba(255, 149, 0, 0.8) 100%);
    color: white;
}

.comfyui-node-button.interrupt-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(255, 59, 48, 1) 0%, rgba(255, 149, 0, 1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 59, 48, 0.3);
}

.comfyui-node-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.comfyui-node-progress {
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.comfyui-node-progress .progress-bar-container {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.comfyui-node-progress .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(102, 126, 234, 1) 0%, rgba(118, 75, 162, 1) 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* 不确定进度条动画（用于没有具体进度的节点） */
.comfyui-node-progress .progress-bar.indeterminate {
    width: 100% !important;
    background: linear-gradient(
        90deg,
        rgba(102, 126, 234, 0.3) 0%,
        rgba(102, 126, 234, 1) 50%,
        rgba(102, 126, 234, 0.3) 100%
    );
    background-size: 200% 100%;
    animation: indeterminate-progress 1.5s ease-in-out infinite;
}

@keyframes indeterminate-progress {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.comfyui-node-progress .progress-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    font-weight: 600;
    margin-bottom: 4px;
}

.comfyui-node-progress .progress-node-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    font-weight: 500;
    margin-top: 4px;
}

/* ComfyUI 节点连接点 */
.comfyui-node .connection-point {
    position: absolute;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    cursor: crosshair;
    transition: all 0.2s ease;
    z-index: 20;
}

.comfyui-node .connection-point.input {
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
}

.comfyui-node .connection-point.output {
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
}

.comfyui-node .connection-point:hover {
transform: translateY(-50%) scale(1.3);
box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
}

.multiangle-camera-node {
width: 900px;
border-radius: 14px;
overflow: hidden;
background: rgba(255, 255, 255, 0.96);
box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.multiangle-camera-node .process-node-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 12px;
background: linear-gradient(135deg, rgba(79, 172, 254, 0.18) 0%, rgba(233, 61, 130, 0.14) 100%);
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.multiangle-camera-node .process-node-title {
font-size: 20px;
line-height: 1.15;
font-weight: 800;
letter-spacing: 0.5px;
margin: 0;
}

.multiangle-camera-node .multiangle-header-actions {
display: flex;
gap: 8px;
align-items: center;
}

.multiangle-camera-node .multiangle-copy {
border: 1px solid rgba(0, 0, 0, 0.12);
background: rgba(255, 255, 255, 0.75);
padding: 6px 10px;
border-radius: 10px;
cursor: pointer;
font-size: 12px;
font-weight: 600;
}

.multiangle-camera-node .multiangle-copy:hover {
background: rgba(255, 255, 255, 0.92);
}

.multiangle-camera-node .process-node-close {
width: 30px;
height: 30px;
border-radius: 10px;
border: 1px solid rgba(239, 68, 68, 0.28);
background: rgba(239, 68, 68, 0.10);
color: #ef4444;
font-size: 18px;
line-height: 1;
}

.multiangle-camera-node .process-node-close:hover {
background: rgba(239, 68, 68, 0.18);
border-color: rgba(239, 68, 68, 0.42);
}

.multiangle-camera-node .process-node-body {
padding: 12px;
}

.multiangle-camera-node .multiangle-viewport {
width: 100%;
height: 520px;
border-radius: 12px;
overflow: hidden;
background: #0a0a0f;
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
margin-bottom: 12px;
}

.multiangle-camera-node .multiangle-prompt-row {
display: flex;
gap: 10px;
align-items: center;
margin-bottom: 10px;
    margin-bottom: 10px;
}

.multiangle-camera-node .multiangle-prompt-row .process-node-label {
    min-width: 74px;
    font-weight: 600;
    opacity: 0.8;
}

.multiangle-camera-node .multiangle-prompt {
    flex: 1;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.9);
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
}

.multiangle-camera-node .multiangle-control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.multiangle-camera-node .multiangle-control-row .process-node-label {
    min-width: 74px;
    font-weight: 600;
    opacity: 0.85;
}

.multiangle-camera-node .multiangle-control-row input[type="range"] {
    flex: 1;
}

.multiangle-camera-node input[type="range"] {
    accent-color: #4facfe;
    height: 18px;
}

.multiangle-camera-node input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.10);
}

.multiangle-camera-node input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #4facfe;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 18px rgba(79, 172, 254, 0.35);
    margin-top: -4px;
}

.multiangle-camera-node input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.05);
}

.multiangle-camera-node .multiangle-hv,
.multiangle-camera-node .multiangle-vv,
.multiangle-camera-node .multiangle-zv {
    min-width: 56px;
    text-align: right;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.multiangle-camera-node .multiangle-presets {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 10px 0 6px;
}

.multiangle-camera-node .multiangle-presets .process-node-label {
    min-width: 74px;
    font-weight: 600;
    opacity: 0.85;
}

.multiangle-camera-node .multiangle-presets select {
    flex: 1;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.9);
    font-size: 12px;
}

.multiangle-camera-node .multiangle-presets select:focus,
.multiangle-camera-node .multiangle-prompt:focus {
    outline: none;
    border-color: rgba(79, 172, 254, 0.65);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.18);
}

.multiangle-camera-node .multiangle-reset {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.75);
    cursor: pointer;
}

.multiangle-camera-node .multiangle-reset:hover {
    background: rgba(255, 255, 255, 0.92);
}

.multiangle-camera-node .multiangle-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.multiangle-camera-node .multiangle-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
}

.multiangle-camera-node .multiangle-preview-hint {
    font-size: 12px;
    opacity: 0.7;
}

.multiangle-camera-node .multiangle-prompt-preview {
    margin-top: 10px;
    height: 86px;
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: rgba(245, 247, 255, 0.9);
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    padding: 10px;
}

/* ComfyUI 参数面板 */
.comfyui-params-toggle-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comfyui-params-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.4);
    color: #fff;
}

.comfyui-params-panel {
    margin-top: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.params-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.param-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.param-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.param-label {
    color: #888;
    font-size: 12px;
    font-weight: 500;
}

.param-input {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    transition: all 0.2s ease;
}

.param-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.param-input[type="number"] {
    appearance: textfield;
}

.param-input[type="number"]::-webkit-inner-spin-button,
.param-input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.param-seed-row {
    display: flex;
    gap: 8px;
}

.param-seed-row .param-input {
    flex: 1;
}

.param-random-btn {
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.param-random-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    transform: rotate(90deg);
}

.comfyui-apply-params-btn {
    margin-top: 8px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.8) 0%, rgba(52, 199, 89, 0.8) 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comfyui-apply-params-btn:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 1) 0%, rgba(52, 199, 89, 1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
}

/* 参数提示样式 */
.param-hint {
    padding: 10px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-left: 3px solid rgba(102, 126, 234, 0.5);
    border-radius: 4px;
    color: #aaa;
    font-size: 12px;
    line-height: 1.5;
}

/* Primitive 节点控件样式 */
.primitive-controls-container {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 165, 0, 0.05);
    border: 1px solid rgba(255, 165, 0, 0.2);
    border-radius: 8px;
}

.param-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #ffa500;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 165, 0, 0.2);
}

.primitive-controls-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.param-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* 连线显示/隐藏控制样式 */
#connectionLayer {
    transition: opacity 0.3s ease;
}

/* 隐藏连线状态 */
.connections-hidden #connectionLayer {
    opacity: 0;
    pointer-events: none;
}

/* 连线按钮状态样式 */
#toggleConnectionsBtn:not(.active) {
    opacity: 0.5;
    background: rgba(255, 107, 107, 0.2) !important;
}

#toggleConnectionsBtn:not(.active) .ps-tool-label::after {
    content: " (已隐藏)";
    font-size: 10px;
    opacity: 0.7;
}

#toggleConnectionsBtn.active {
    background: rgba(76, 175, 80, 0.2) !important;
}

/* ========================================
   📍 标注功能样式
   ======================================== */

/* 标注画布层 */
.annotation-canvas-layer {
    position: absolute;
    pointer-events: auto;  /* 需要接收事件才能拖拽、双击、删除 */
    z-index: 999;
    cursor: default;
    display: none;
}

.annotation-canvas-layer.active {
    display: block;
}

/* 标注提示信息 */
.annotation-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.annotation-hint.show {
    opacity: 1;
}

.annotation-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    background: #555;
    border: 1px solid #777;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
    margin: 0 2px;
}

/* 🎨 生成占位符样式 */
.generating-placeholder {
    background: linear-gradient(135deg, rgba(100, 100, 255, 0.1), rgba(200, 100, 255, 0.1));
    border: 2px dashed rgba(150, 150, 255, 0.5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: placeholderPulse 2s ease-in-out infinite;
}

@keyframes placeholderPulse {
    0%, 100% {
        border-color: rgba(150, 150, 255, 0.5);
        background: linear-gradient(135deg, rgba(100, 100, 255, 0.1), rgba(200, 100, 255, 0.1));
    }
    50% {
        border-color: rgba(150, 150, 255, 0.8);
        background: linear-gradient(135deg, rgba(100, 100, 255, 0.2), rgba(200, 100, 255, 0.2));
    }
}

.placeholder-content {
    text-align: center;
    color: #fff;
    width: 100%;
    padding: 20px;
}

.placeholder-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(150, 150, 255, 0.8);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.placeholder-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.placeholder-progress {
    width: 80%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden;
}

.placeholder-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(100, 150, 255, 0.8), rgba(150, 100, 255, 0.8));
    border-radius: 4px;
    transition: width 0.5s ease;
    animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}
