/* 图像编辑器样式 */
.image-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-editor-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.image-editor-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.image-editor-actions {
    display: flex;
    gap: 1rem;
}

.editor-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.editor-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
}

.editor-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.editor-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.editor-btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.editor-btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.image-editor-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.image-editor-canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.image-editor-canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    background: white;
}

.image-editor-sidebar {
    width: 320px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    padding: 1.5rem;
}

.editor-section {
    margin-bottom: 2rem;
}

.editor-section-title {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-control-group {
    margin-bottom: 1.5rem;
}

.editor-control-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-control-value {
    color: var(--primary-color);
    font-weight: 500;
}

.editor-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.editor-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.editor-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.editor-filter-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.filter-preset-btn {
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    text-align: center;
}

.filter-preset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: white;
}

.filter-preset-btn.active {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
    color: white;
}

.editor-transform-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.transform-btn {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.transform-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: white;
}

.transform-btn i {
    font-size: 1.2rem;
}

.transform-btn span {
    font-size: 0.7rem;
}

.editor-resize-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
    align-items: center;
}

.resize-input {
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    text-align: center;
    font-size: 0.9rem;
}

.resize-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.resize-link-btn {
    padding: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.resize-link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.resize-link-btn.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.editor-crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.crop-selection {
    position: absolute;
    border: 2px dashed var(--primary-color);
    background: rgba(67, 97, 238, 0.1);
    pointer-events: all;
    cursor: move;
    min-width: 50px;
    min-height: 50px;
}

.crop-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
}

.crop-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.crop-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.crop-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.crop-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }
.crop-handle.n { top: -5px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.crop-handle.s { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.crop-handle.w { top: 50%; left: -5px; transform: translateY(-50%); cursor: w-resize; }
.crop-handle.e { top: 50%; right: -5px; transform: translateY(-50%); cursor: e-resize; }

.editor-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    border-radius: 8px;
    color: white;
    text-align: center;
    z-index: 20;
}

.editor-progress-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .image-editor-content {
        flex-direction: column;
    }
    
    .image-editor-sidebar {
        width: 100%;
        height: 40vh;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .image-editor-canvas-container {
        padding: 1rem;
    }
    
    .image-editor-header {
        padding: 1rem;
    }
    
    .image-editor-actions {
        gap: 0.5rem;
    }
    
    .editor-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* 暗色主题适配 */
body.dark-mode .image-editor-sidebar {
    background: rgba(0, 0, 0, 0.3);
}

body.dark-mode .resize-input,
body.dark-mode .filter-preset-btn,
body.dark-mode .transform-btn {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .resize-input:focus,
body.dark-mode .filter-preset-btn:hover,
body.dark-mode .transform-btn:hover {
    background: rgba(0, 0, 0, 0.3);
} 