/* 图片滤镜编辑器样式 */
.tool-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tool-panel.hidden {
    display: none !important;
}

/* 标题栏 */
.filter-header {
    background: #4a6fa5;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.filter-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.filter-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 主要内容区域 */
#image-filter-editor {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 图片预览区 */
.filter-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #1a1a1a;
    position: relative;
}

#filter-canvas {
    max-width: 100%;
    max-height: 100%;
    border: 2px solid #4a6fa5;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    background: #2a2a2a;
}

.upload-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #4a6fa5;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.upload-btn:hover {
    background: #5a7fb5;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 111, 165, 0.4);
}

.upload-btn i {
    font-size: 1.5rem;
}

/* 滤镜控制区 */
.filter-controls {
    width: 350px;
    background: #e0e7ff;
    padding: 2rem;
    overflow-y: auto;
    border-left: 1px solid #4a6fa5;
}

/* 滤镜组 */
.filter-group {
    margin-bottom: 2rem;
}

.filter-group h3 {
    color: #4a6fa5;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4a6fa5;
}

/* 滤镜按钮 */
.filter-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.filter-buttons button {
    background: white;
    border: 2px solid #4a6fa5;
    color: #4a6fa5;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-buttons button:hover {
    background: #4a6fa5;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 111, 165, 0.3);
}

.filter-buttons button.active {
    background: #4a6fa5;
    color: white;
    box-shadow: 0 2px 8px rgba(74, 111, 165, 0.3);
}

/* 滑块控制 */
.slider-control {
    margin-bottom: 1.5rem;
}

.slider-control label {
    display: block;
    color: #4a6fa5;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.slider-control input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #d1d5db;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 0.5rem;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4a6fa5;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.slider-control input[type="range"]::-webkit-slider-thumb:hover {
    background: #5a7fb5;
    transform: scale(1.1);
}

.slider-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4a6fa5;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-value {
    display: inline-block;
    background: #4a6fa5;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* 操作按钮 */
.filter-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid #4a6fa5;
}

.filter-actions button {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

#save-image {
    background: #4a6fa5;
    color: white;
}

#save-image:hover {
    background: #5a7fb5;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 111, 165, 0.4);
}

#reset-filters {
    background: #f3f4f6;
    color: #4a6fa5;
    border: 2px solid #4a6fa5;
}

#reset-filters:hover {
    background: #4a6fa5;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 111, 165, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    #image-filter-editor {
        flex-direction: column;
    }
    
    .filter-controls {
        width: 100%;
        max-height: 50vh;
        order: -1;
    }
    
    .filter-preview {
        flex: 1;
        padding: 1rem;
    }
    
    .filter-buttons {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .filter-header {
        padding: 1rem;
    }
    
    .filter-header h2 {
        font-size: 1.2rem;
    }
    
    .filter-controls {
        padding: 1rem;
    }
    
    .upload-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-panel:not(.hidden) {
    animation: fadeIn 0.3s ease;
}

/* 滚动条样式 */
.filter-controls::-webkit-scrollbar {
    width: 6px;
}

.filter-controls::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-controls::-webkit-scrollbar-thumb {
    background: #4a6fa5;
    border-radius: 3px;
}

.filter-controls::-webkit-scrollbar-thumb:hover {
    background: #5a7fb5;
} 