/* ==================== 图片编辑器样式 ==================== */

/* 功能标签页样式 */
.tool-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tool-tab {
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-tab:hover {
    color: var(--text-color);
    background: rgba(127, 157, 172, 0.1);
}

.tool-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--bg-card);
}

.tool-tab i {
    font-size: 1.1rem;
}

/* 对比视图样式 - 优化版 */
.compare-view {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-radius: 12px;
    border: 2px solid #4a5568;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.compare-container {
    display: grid;
    grid-template-columns: 1fr 50px 1fr;
    gap: 0.8rem;
    align-items: center;
}

.compare-item {
    text-align: center;
    position: relative;
    transition: transform 0.3s ease;
}

.compare-item:hover {
    transform: scale(1.02);
}

.compare-item h3 {
    margin-bottom: 1rem;
    color: #e2e8f0;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.compare-item h3::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2em;
}

.compare-item:first-child h3::before {
    content: '\f03e'; /* 图片图标 */
    color: #94a3b8;
}

.compare-item:last-child h3 {
    color: #10b981;
}

.compare-item:last-child h3::before {
    content: '\f005'; /* 星星图标 */
    color: #10b981;
}

.compare-item img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 3px solid #4a5568;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    /* 为透明背景添加棋盘格背景 */
    background-image: 
        linear-gradient(45deg, #374151 25%, transparent 25%),
        linear-gradient(-45deg, #374151 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #374151 75%),
        linear-gradient(-45deg, transparent 75%, #374151 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.compare-item:last-child img {
    border-color: #10b981;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
}

.compare-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 50px rgba(16, 185, 129, 0.4);
}

.compare-divider {
    width: 50px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.compare-divider::before {
    content: '\f061'; /* Font Awesome right arrow icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.4);
}

/* 图片上传区域增强 */
.image-upload-area {
    position: relative;
    min-height: 300px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    background: var(--bg-light);
    transition: all 0.3s ease;
}

.image-upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(127, 157, 172, 0.1);
}

.upload-placeholder {
    text-align: center;
    padding: 2rem;
}

.upload-placeholder i {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.upload-placeholder p {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.upload-btn {
    margin: 1rem 0;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(127, 157, 172, 0.3);
}

.upload-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.image-preview {
    position: relative;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.remove-image-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.remove-image-btn:hover {
    background: #B39188;
    transform: scale(1.1);
}

.image-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.image-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.image-info i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* 加载进度样式 */
.loading-progress {
    width: 100%;
    max-width: 400px;
    margin: 20px auto 0;
    background: rgba(127, 157, 172, 0.1);
    border-radius: 4px;
    overflow: hidden;
    height: 4px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading-info {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.loading-info i {
    margin-right: 5px;
    color: var(--primary-color);
}

/* 图片预览增强 - 支持透明背景显示 */
.compare-item img {
    position: relative;
}

/* 为处理后的图片添加特殊效果 */
.compare-item:last-child {
    position: relative;
}

.compare-item:last-child::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.1), transparent);
    pointer-events: none;
    border-radius: 12px;
}

/* 添加成功标记动画 */
@keyframes successGlow {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 10px 50px rgba(16, 185, 129, 0.5);
    }
}

.compare-item:last-child img {
    animation: successGlow 3s ease-in-out infinite;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tool-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tool-tab {
        padding: 0.8rem 1rem;
        justify-content: center;
    }
    
    .compare-view {
        padding: 1.5rem;
    }
    
    .compare-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .compare-divider {
        width: 100%;
        height: 3px;
        background: linear-gradient(90deg, transparent, #10b981, transparent);
    }
    
    .compare-divider::before {
        content: '\f063'; /* 向下箭头 */
        transform: translate(-50%, -50%) rotate(90deg);
    }
    
    .image-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .loading-progress {
        max-width: 300px;
    }
}


