/* @PROJECT_MEMORY_BLOCK: SilentSave, LeftDock, 万向框选, 分块编辑, 加密节点 */
        body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #121212; font-family: 'Inter', sans-serif; }
        canvas { display: block; position: absolute; z-index: 0; }

        #status-bar { position: absolute; bottom: 10px; left: 10px; color: #555; font-family: monospace; font-size: 11px; pointer-events: none; z-index: 100; }

        #sidebar { 
            position: absolute; left: 0; top: 0; width: 280px; height: 100%; 
            background: #1e1e1e; border-right: 1px solid #333; 
            transform: translateX(-100%); transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
            z-index: 1200; display: flex; flex-direction: column; box-shadow: 5px 0 15px rgba(0,0,0,0.5);
        }
        #sidebar.open { transform: translateX(0); }
        .sidebar-header { padding: 20px; color: #ffeb3b; border-bottom: 1px solid #333; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
        
        .file-item { 
            display: flex; justify-content: space-between; padding: 12px 20px; 
            color: #aaa; border-bottom: 1px solid #252525; cursor: pointer; font-size: 13px; align-items: center;
        }
        .file-item:hover { background: #2a2a2a; color: #fff; }
        .delete-icon { color: #444; transition: 0.2s; }
        .delete-icon:hover { color: #ff4444; }
        .rename-icon { color: #444; transition: 0.2s; margin-right: 6px; font-size: 13px; }
        .rename-icon:hover { color: #ffeb3b; }

        .ui-group { position: absolute; top: 15px; right: 15px; display: flex; gap: 8px; z-index: 200; }
        .ui-btn { 
            background: #252525; color: #eee; border: 1px solid #444; 
            padding: 8px 14px; border-radius: 4px; cursor: pointer; font-size: 12px;
        }
        .ui-btn:hover { border-color: #ffeb3b; color: #ffeb3b; }
        #login-btn { background: #000; color: #fff; font-weight: bold; border: 1px solid #555; }
        
        #color-menu { 
            position: absolute; display: none; background: #222; border: 1px solid #444; 
            padding: 8px; z-index: 3000; gap: 4px; border-radius: 6px;
            flex-direction: column;
        }
        .color-menu-row { display: flex; gap: 6px; align-items: center; }
        .color-menu-label { font-size: 9px; color: #666; letter-spacing: 0.1em; min-width: 28px; }
        .color-dot { width: 22px; height: 22px; cursor: pointer; border-radius: 50%; border: 2px solid transparent; flex-shrink: 0; }
        .color-dot:hover { border-color: #fff; }
        .color-dot.active { border-color: #ffeb3b; }

        #toast { 
            position: fixed; top: 20px; left: 50%; transform: translateX(-50%); 
            background: #ffeb3b; color: #000; padding: 10px 25px; border-radius: 4px; 
            font-weight: bold; font-size: 13px; display: none; z-index: 3000; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        }

        .admin-ctrl { display: none; }
        body.is-admin .admin-ctrl { display: block; }

        /* 原位编辑输入框 */
        .node-input {
            position: absolute;
            border: 1px solid #ffeb3b; padding: 3px 6px; outline: none;
            font-family: sans-serif; font-size: 12px; resize: none; z-index: 2000;
            box-shadow: 0 0 12px rgba(255,235,59,0.3);
            line-height: 1.5;
        }

        /* 自定义颜色按钮 */
        #color-picker-btn {
            position: absolute; display: none;
            width: 26px; height: 26px; border-radius: 50%;
            background: #252525; border: 2px solid #ffeb3b;
            cursor: pointer; z-index: 500;
            align-items: center; justify-content: center;
            font-size: 13px; box-shadow: 0 0 8px rgba(0,0,0,0.5);
            transition: transform 0.15s;
        }
        #color-picker-btn:hover { transform: scale(1.15); background: #333; }

        /* 渐变终止色按钮，紧贴第一个按钮右侧 */
        #color-picker-btn2 {
            position: absolute; display: none;
            width: 26px; height: 26px; border-radius: 50%;
            background: #252525; border: 2px solid #ff9800;
            cursor: pointer; z-index: 500;
            align-items: center; justify-content: center;
            font-size: 13px; box-shadow: 0 0 8px rgba(0,0,0,0.5);
            transition: transform 0.15s;
        }
        #color-picker-btn2:hover { transform: scale(1.15); background: #333; }

        /* 双击创建菜单 */
        #create-menu {
            position: absolute; display: none; background: #1e1e1e;
            border: 1px solid #444; border-radius: 6px; z-index: 3000;
            overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.6); min-width: 150px;
        }
        .create-item {
            padding: 11px 18px; color: #ccc; cursor: pointer; font-size: 13px;
            display: flex; align-items: center; gap: 10px;
        }
        .create-item:hover { background: #2a2a2a; color: #ffeb3b; }
        .create-item-icon { font-size: 16px; }

        /* 图片选择弹窗 */
        #img-modal {
            position: fixed; inset: 0; background: rgba(0,0,0,0.75);
            z-index: 4000; display: none; align-items: center; justify-content: center;
        }
        #img-modal.open { display: flex; }
        #img-modal-box {
            background: #1e1e1e; border: 1px solid #444; border-radius: 8px;
            width: 580px; max-height: 80vh; display: flex; flex-direction: column;
            box-shadow: 0 16px 48px rgba(0,0,0,0.8);
        }
        #img-modal-header {
            padding: 16px 20px; border-bottom: 1px solid #333;
            color: #ffeb3b; font-weight: bold; display: flex; justify-content: space-between; align-items: center;
        }
        #img-modal-body { padding: 16px; overflow-y: auto; flex: 1; }
        #img-upload-area {
            border: 2px dashed #444; border-radius: 6px; padding: 18px;
            text-align: center; color: #666; cursor: pointer; margin-bottom: 16px;
            transition: 0.2s; font-size: 13px;
        }
        #img-upload-area:hover { border-color: #ffeb3b; color: #ffeb3b; }
        #img-grid {
            display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
        }
        .img-thumb {
            aspect-ratio: 1; border-radius: 4px; overflow: hidden; cursor: pointer;
            border: 2px solid transparent; background: #252525;
            transition: border-color 0.15s;
        }
        .img-thumb:hover { border-color: #ffeb3b; }
        .img-thumb.selected { border-color: #ffeb3b; }
        .img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
        .img-thumb-label { font-size: 10px; color: #666; text-align: center; padding: 2px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        #img-modal-footer {
            padding: 14px 20px; border-top: 1px solid #333;
            display: flex; justify-content: flex-end; gap: 8px;
        }