/* ==================== 编辑面板 ==================== */
.editor-panel-container {
    display: none;
    width: 0;
    min-width: 0;
    height: 100%;
    background: #fff;
    border-left: 1px solid #e5e5e5;
    overflow: hidden;
    flex-shrink: 0;
    transition: width 0.3s ease;
    position: relative;
}
.editor-panel-container.open {
    display: flex;
    flex-direction: column;
    width: 520px;
    min-width: 520px;
}

/* 拖拽调整宽度手柄 */
.editor-panel-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    z-index: 100;
    background: transparent;
}
.editor-panel-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 32px;
    border-radius: 2px;
    background: #ccc;
    transition: background 0.2s;
}
.editor-panel-resize-handle:hover,
.editor-panel-resize-handle.active {
    background: transparent;
}
.editor-panel-resize-handle:hover::after,
.editor-panel-resize-handle.active::after {
    background: #333;
}

.editor-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.editor-panel-title {font-size: 15px;font-weight: 600;color: #333;}
.editor-panel-close {background: none;border: none;font-size: 22px;color: #999;cursor: pointer;padding: 0 4px;line-height: 1;}
.editor-panel-close:hover {color: #333;}

/* 面板主体 */
.editor-panel-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.editor-panel-body .tool_container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* 功能工具栏容器 */
.editor-panel-body .function-toolbar-container {
    flex-shrink: 0;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}
.editor-panel-body .function-toolbar-container > div {
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
}

/* 抠图工具栏 */
.editor-panel-body .matting-mode-selector {display: flex;gap: 4px;flex-wrap: wrap;}
.editor-panel-body .matting-mode-btn {
    padding: 3px 10px;border: 1px solid #ddd;border-radius: 4px;background: #fff;font-size: 12px;cursor: pointer;color: #666;
}
.editor-panel-body .matting-mode-btn.active {background: #4A90D9;color: #fff;border-color: #4A90D9;}
.editor-panel-body .toolbar-btn-small {font-size: 12px;color: #999;}

/* 区域重绘/擦除工具栏 */
.editor-panel-body .brush-control-group {display: flex;align-items: center;gap: 6px;}
.editor-panel-body .brush-size-indicator {
    width: 10px;height: 10px;border-radius: 50%;background: transparent;border: 1px solid #333;flex-shrink: 0;
}
.editor-panel-body .brush-size-indicator.large {width: 18px;height: 18px;}
.editor-panel-body .brush-size-slider {
    width: 100px;height: 4px;border: none;
    -webkit-appearance: none;appearance: none;border-radius: 2px;background: #e0e0e0;outline: none;cursor: pointer;
}
.editor-panel-body .brush-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;appearance: none;width: 18px;height: 18px;border-radius: 50%;background: #333;border: none;cursor: pointer;
}
.editor-panel-body .brush-size-slider::-moz-range-thumb {
    width: 18px;height: 18px;border-radius: 50%;background: #333;border: none;cursor: pointer;
}
.editor-panel-body .toolbar-divider {width: 1px;height: 20px;background: #ddd;margin: 0 4px;}
.editor-panel-body .history-controls {display: flex;gap: 2px;}
.editor-panel-body .icon-btn {
    width: 28px;height: 28px;border: none;background: none;cursor: pointer;font-size: 14px;display: flex;align-items: center;justify-content: center;color: #666;
}
.editor-panel-body .icon-btn:disabled {opacity: 0.4;cursor: not-allowed;}
.editor-panel-body .icon-btn:hover:not(:disabled) {background: #f0f0f0;}
.editor-panel-body .clear-text-btn {
    padding: 4px 10px;border: none;background: none;font-size: 12px;cursor: pointer;color: #666;
}

/* 扩图工具栏 */
.editor-panel-body .ratio-selector {display: flex;gap: 4px;flex-wrap: wrap;}
.editor-panel-body .ratio-btn {
    padding: 3px 8px;border: 1px solid #ddd;border-radius: 4px;background: #fff;font-size: 11px;cursor: pointer;color: #666;
}
.editor-panel-body .ratio-btn.active {background: #4A90D9;color: #fff;border-color: #4A90D9;}

/* 主容器 - 图片区域 */
.editor-panel-body .panel-main-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    position: relative;
    min-height: 0;
}
.editor-panel-body .image-container {
    position: absolute;
    top: 5%;
    left: 5%;
    right: 5%;
    bottom: 5%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.editor-panel-body .main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
/* 画布层 */
.editor-panel-body .canvas-container {
    position: absolute;
    top: 0;left: 0;right: 0;bottom: 0;
    cursor: none;
    pointer-events: auto;
}
.editor-panel-body .canvas-container canvas {
    width: 100%;height: 100%;
}
.editor-panel-body .expand-canvas-container {
    position: absolute;
    top: 0;left: 0;width: 100%;height: 100%;
    background: #fff;display: flex;align-items: center;justify-content: center;
    cursor: default;
    z-index: 10;
}
.editor-panel-body .expand-canvas-container canvas {
    max-width: 100%;max-height: 100%;
}

/* 智能编辑输入区域 */
.editor-panel-body .smart-edit-input-area {
    display: flex;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin: 0 auto;
    position: relative;
    border: none;
    overflow: hidden;
    flex-shrink: 0;
}
.editor-panel-body .edit-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: none;
    font-size: 14px;
    padding-right: 60px;
    padding-bottom: 50px;
    resize: none;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.editor-panel-body .edit-textarea::placeholder {color: #999;}
.editor-panel-body .send-edit-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color, #4A90D9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    padding: 0;
    flex-shrink: 0;
}
.editor-panel-body .send-edit-btn:disabled {background-color: #e0e0e0;cursor: not-allowed;}
.editor-panel-body .send-edit-btn svg {color: #fff;}
.editor-panel-body .send-edit-btn .send-icon {width: 18px;height: 18px;}

/* 区域重绘输入区域 */
.editor-panel-body .inpaint-input-area {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin: 0 auto;
    position: relative;
    border: none;
    overflow: hidden;
    flex-shrink: 0;
}
.editor-panel-body .inpaint-input {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: none;
    font-size: 14px;
    padding-right: 60px;
    padding-bottom: 50px;
    resize: none;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.editor-panel-body .inpaint-input:focus {outline: none;}
.editor-panel-body .inpaint-input::placeholder {color: #999;}
.editor-panel-body .send-inpaint-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color, #4A90D9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    padding: 0;
}
.editor-panel-body .send-inpaint-btn:disabled {background-color: #e0e0e0;cursor: not-allowed;}
.editor-panel-body .send-inpaint-btn svg {color: #fff;width: 18px !important;height: 18px !important;max-width: 18px;max-height: 18px;}
.editor-panel-body .send-inpaint-btn .send-icon {width: 18px;height: 18px;}

/* 底部操作栏 */
.editor-panel-body .bottom-actions {
    flex-shrink: 0;
    padding: 10px;
    display: flex;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid #eee;
}

/* 自定义画笔光标 */
.editor-panel-body .custom-cursor {
    position: fixed;
    pointer-events: none;
    border: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    display: none;
    background-color: transparent;
}

/* 工具栏中的返回按钮区域 */
.editor-panel-body .back-btn-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}
.editor-panel-body .bottom-actions button {
    padding: 8px 24px;border: none;border-radius: 6px;font-size: 14px;cursor: pointer;display: none;
}
.editor-panel-body .generate-expand-btn {background: #4A90D9;color: #fff;}
.editor-panel-body .generate-matting-btn {background: #4A90D9;color: #fff;}
.editor-panel-body .generate-erase-btn {background: #4A90D9;color: #fff;}
.editor-panel-body .generate-hd-btn {background: #4A90D9;color: #fff;}
.editor-panel-body .generate-erase-btn:disabled {background: #ccc;cursor: not-allowed;}

/* 缩略图 - 默认隐藏 */
.editor-panel-body .thumbnails-wrapper {
    display: none;
    flex-shrink: 0;
    align-items: center;
    padding: 6px 0;
    border-top: 1px solid #eee;
    position: relative;
}
.editor-panel-body .thumbnails-container {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 10px;
    flex: 1;
}
.editor-panel-body .thumbnail-arrow {
    width: 24px;height: 24px;display: flex;align-items: center;justify-content: center;cursor: pointer;flex-shrink: 0;color: #999;
}
.editor-panel-body .nav-arrow-icon {width: 0;height: 0;border: 5px solid transparent;}
.editor-panel-body .nav-arrow-icon.left {border-right-color: #999;margin-right: 2px;}
.editor-panel-body .nav-arrow-icon.right {border-left-color: #999;margin-left: 2px;}

/* 全局加载遮罩 */
.editor-panel-body .global-loading-overlay {
    position: absolute;left: 0;top: 0;width: 100%;height: 100%;
    background: rgba(0,0,0,0.15);display: none;flex-direction: column;align-items: center;justify-content: center;z-index: 100;
}
.editor-panel-body .global-loading-spinner {
    width: 36px;height: 36px;border: 3px solid #ddd;border-top-color: #4A90D9;border-radius: 50%;animation: panel-spin 0.8s linear infinite;
}
@keyframes panel-spin {to {transform: rotate(360deg);}}
.editor-panel-body .global-loading-text {margin-top: 8px;font-size: 13px;color: #fff;}