/* 美颜处理界面样式 */

/* 美颜工作区 - 水平布局已在style.css中定义 */
.beauty-workspace {
    /* 基本布局在style.css中定义 */
}

/* 图片处理区域 - 布局已在style.css中定义 */
.image-processing-area {
    /* 基本布局在style.css中定义 */
    position: relative;
}

/* 上传区域样式 */
.upload-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    position: relative;
    overflow: hidden;
}

.upload-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

.upload-container {
    text-align: center;
    color: white;
    z-index: 1;
    position: relative;
    max-width: 600px;
    width: 100%;
}

.upload-icon-wrapper {
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
}

.upload-main-icon {
    font-size: 64px;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.upload-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(45deg, #ffffff, #f1f5f9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.upload-subtitle {
    font-size: 18px;
    margin-bottom: 32px;
    opacity: 0.9;
    line-height: 1.6;
}

.upload-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature-item i {
    font-size: 24px;
    color: #fbbf24;
}

.feature-item span {
    font-size: 14px;
    font-weight: 500;
}

.upload-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.btn-upload-primary {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.4);
    min-width: 180px;
    justify-content: center;
}

.btn-upload-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.5);
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

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

.upload-tips {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* 图片对比区域 */
.image-comparison-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    margin: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
}

.comparison-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.comparison-title i {
    color: #3b82f6;
    font-size: 22px;
}

.comparison-controls {
    display: flex;
    gap: 12px;
}

.comparison-controls .btn-icon {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 8px;
    color: #64748b;
    font-size: 14px;
    transition: all 0.2s ease;
}

.comparison-controls .btn-icon:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

/* 图片对比容器 */
.image-comparison-container {
    flex: 1;
    display: flex;
    position: relative;
    min-height: 400px;
    overflow: hidden;
    width: 100%;
}

.image-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    position: relative;
    min-width: 200px;
    max-width: 50%;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.panel-label {
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

.processing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #3b82f6;
    font-size: 14px;
}

.processing-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    text-align: center;
    padding: 40px;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.placeholder-content p {
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

/* 对比分割线 */
.comparison-divider {
    width: 4px;
    background: linear-gradient(to bottom, #e2e8f0, #cbd5e1, #e2e8f0);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: col-resize;
}

.divider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #94a3b8;
}

.divider-handle {
    width: 24px;
    height: 24px;
    background: white;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 12px;
    transition: all 0.2s ease;
    z-index: 1;
}

.divider-handle:hover {
    background: #f1f5f9;
    border-color: #64748b;
    transform: scale(1.1);
}

/* 图片操作控件 */
.image-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.image-actions .btn-icon {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s ease;
}

.image-actions .btn-icon:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.zoom-level {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

/* 修复布局挤压问题 */
.workspace {
    min-width: 1000px; /* 确保工作区有足够的最小宽度 */
    overflow-x: auto; /* 允许水平滚动 */
}

.beauty-workspace {
    min-width: 600px; /* 确保美颜工作区有足够的最小宽度 */
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.image-comparison-container {
    min-width: 400px; /* 确保图片对比容器有足够的最小宽度 */
    flex: 1;
    display: flex;
    gap: 16px;
}

/* 删除重复的image-panel样式定义，使用上面的统一样式 */

/* 属性面板在美颜界面中的调整 */
.beauty-workspace .properties-panel {
    width: 100%;
    flex: 0 0 auto;
    max-height: 300px;
    min-height: 250px;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .workspace {
        flex-direction: column;
        min-width: auto;
    }
    
    .beauty-workspace {
        flex-direction: column;
    }
    
    .image-processing-area {
        flex-direction: column;
    }
    
    .image-comparison-container {
        flex-direction: column;
        min-height: 400px;
    }
    
    .image-panel {
        max-width: none;
        min-height: 200px;
    }
    
    .properties-panel {
        width: 100%;
        flex: 0 0 auto;
        order: -1;
        max-height: 250px;
        min-height: 200px;
    }
    
    .beauty-workspace {
        min-width: auto;
        margin: 10px;
    }
}

@media (max-width: 768px) {
    .upload-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .image-comparison-container {
        flex-direction: column;
        min-width: auto;
    }
    
    .image-panel {
        min-width: auto;
        min-height: 200px;
    }
    
    .comparison-divider {
        width: 100%;
        height: 4px;
        cursor: row-resize;
    }
    
    .upload-title {
        font-size: 24px;
    }
    
    .upload-subtitle {
        font-size: 16px;
    }
    
    .image-comparison-container {
        flex-direction: column;
        min-height: 600px;
    }
    
    .comparison-divider {
        width: 100%;
        height: 4px;
        cursor: row-resize;
    }
    
    .divider-line {
        left: 0;
        right: 0;
        top: 50%;
        bottom: auto;
        width: 100%;
        height: 2px;
        transform: translateY(-50%);
    }
    
    .comparison-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .comparison-controls .btn-icon {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .upload-section {
        padding: 20px;
    }
    
    .upload-features {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .feature-item {
        padding: 12px;
    }
    
    .btn-upload-primary {
        padding: 14px 24px;
        font-size: 14px;
        min-width: 160px;
    }
    
    .comparison-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .comparison-title {
        font-size: 18px;
    }
}

/* 动画效果 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-comparison-area {
    animation: slideInUp 0.5s ease-out;
}

/* 拖拽上传效果 */
.upload-section.dragover {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.upload-section.dragover .upload-container {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* 加载状态 */
.upload-section.loading {
    pointer-events: none;
}

.upload-section.loading .upload-container {
    opacity: 0.7;
}

.upload-section.loading .btn-upload-primary {
    background: #9ca3af;
    cursor: not-allowed;
}

.upload-section.loading .btn-upload-primary:hover {
    transform: none;
    box-shadow: none;
}

/* 美颜参数面板样式 */
.beauty-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.beauty-panel .panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 12px;
    text-align: center;
}

.beauty-panel .panel-title {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.beauty-panel .panel-title i {
    font-size: 22px;
    color: #fbbf24;
}

.beauty-panel .panel-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.beauty-panel .panel-content {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

/* 参数组样式 */
.parameter-group {
    margin-bottom: 20px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.group-header i {
    font-size: 18px;
    color: #3b82f6;
}

.group-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.parameter-item {
    margin-bottom: 12px;
}

.parameter-item:last-child {
    margin-bottom: 0;
}

.parameter-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

.parameter-value {
    background: #3b82f6;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
}

/* 美颜滑块样式 */
.slider-container {
    position: relative;
    margin-bottom: 8px;
}

.beauty-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.beauty-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.beauty-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
}

.beauty-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.beauty-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
}

.parameter-tips {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
    line-height: 1.4;
}

/* 预设方案样式 */
.preset-section {
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
}

.preset-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.preset-header i {
    font-size: 18px;
    color: #1976D2;
}

.preset-header span {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.preset-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.preset-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.preset-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: #3b82f6;
}

.preset-btn i {
    font-size: 16px;
}

/* AI建议样式 */
.ai-suggestions {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #bae6fd;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #bae6fd;
}

.ai-header i {
    font-size: 18px;
    color: #0ea5e9;
}

.ai-header span {
    font-size: 16px;
    font-weight: 600;
    color: #0c4a6e;
}

.suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    font-size: 14px;
    color: #0c4a6e;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.suggestion-item i {
    font-size: 14px;
    color: #0ea5e9;
    flex-shrink: 0;
}

/* 操作按钮样式 */
.beauty-panel .panel-actions {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
}

.btn-process-beauty {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.btn-process-beauty:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-process-beauty:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-process-beauty.processing {
    background: #6b7280;
    cursor: not-allowed;
}

.btn-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-loading .loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.action-row {
    display: flex;
    gap: 12px;
}

.action-row .btn-secondary,
.action-row .btn-success {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-row .btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
}

.action-row .btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.action-row .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
}

.action-row .btn-success:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.action-row .btn-secondary:disabled,
.action-row .btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 禁用状态样式 */
.beauty-panel.disabled {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.beauty-panel.disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    border-radius: 12px;
}

.beauty-panel.disabled .panel-content {
    filter: grayscale(50%);
}

.beauty-panel.disabled .beauty-slider {
    cursor: not-allowed;
}

.beauty-panel.disabled .preset-btn {
    cursor: not-allowed;
}

.beauty-panel.disabled .btn-process-beauty {
    cursor: not-allowed;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .beauty-panel .panel-content {
        padding: 16px;
    }
    
    .parameter-group {
        padding: 16px;
        margin-bottom: 24px;
    }
    
    .preset-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .action-row {
        flex-direction: column;
        gap: 8px;
    }
}