/* ==================== 上传区域样式 ==================== */
.upload-section {
    margin-bottom: 30px;
}

.drop-zone {
    border: 3px dashed #4a90e2;
    border-radius: 16px;
    padding: 60px 30px;
    text-align: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover {
    border-color: #357abf;
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.15);
}

.drop-zone.drag-over {
    border-color: #2196f3;
    background: linear-gradient(135deg, #bbdefb 0%, #e3f2fd 100%);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 64px;
    color: #4a90e2;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.upload-text {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 14px;
    color: #666;
}

/* ==================== 设置区域样式 ==================== */
.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
}

.form-label i {
    margin-right: 6px;
    color: #4a90e2;
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #4a90e2;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-range::-webkit-slider-thumb:hover {
    background: #357abf;
    transform: scale(1.2);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4a90e2;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.form-range::-moz-range-thumb:hover {
    background: #357abf;
    transform: scale(1.2);
}

.form-help {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

/* ==================== 预览区域样式 ==================== */
.preview-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
}

.original-preview {
    text-align: center;
}

.original-preview h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.original-preview h3 i {
    margin-right: 8px;
    color: #4a90e2;
}

.preview-wrapper {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-wrapper img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.grid-preview-container h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.grid-preview-container h3 i {
    margin-right: 8px;
    color: #4a90e2;
}

/* ==================== 网格预览样式 ==================== */
.grid-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 12px;
    margin-bottom: 20px;
}

.grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.grid-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.grid-item::after {
    content: '\f019';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: rgba(74, 144, 226, 0.9);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-item:hover::after {
    opacity: 1;
}

/* ==================== 按钮样式 ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abf 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #357abf 0%, #2868a6 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
    border-color: #ccc;
}

.download-actions {
    text-align: center;
}

.download-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 10px;
}

/* ==================== 响应式设计 ==================== */

/* 平板端（768px - 1024px） */
@media (max-width: 1024px) {
    .preview-section {
        grid-template-columns: 1fr;
    }

    .grid-images {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 移动端（< 768px） */
@media (max-width: 768px) {
    .drop-zone {
        padding: 40px 20px;
    }

    .upload-icon {
        font-size: 48px;
    }

    .upload-text {
        font-size: 16px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .preview-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .preview-wrapper img {
        max-height: 300px;
    }

    .grid-images {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .grid-item::after {
        font-size: 20px;
        width: 40px;
        height: 40px;
    }
}

/* 小屏幕移动端（< 480px） */
@media (max-width: 480px) {
    .drop-zone {
        padding: 30px 15px;
    }

    .upload-icon {
        font-size: 40px;
    }

    .upload-text {
        font-size: 14px;
    }

    .grid-images {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .grid-item::after {
        font-size: 16px;
        width: 35px;
        height: 35px;
    }
}

/* ==================== 加载动画 ==================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
