* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    background: white;
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e8f0ff;
    transform: scale(1.02);
}

.upload-area i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-area p {
    color: #666;
    font-size: 1rem;
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.options-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.options-section h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.3rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.option-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.option-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 15px;
    font-weight: 500;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-container input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-container i {
    margin-right: 8px;
    color: #667eea;
}

.option-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.option-details label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #666;
}

.option-details input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.option-details input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.option-details select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 0.9rem;
}

.process-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

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

.results-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.results-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.result-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.result-item h4 {
    margin-bottom: 10px;
    color: #333;
}

.result-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.info-item:last-child {
    border-bottom: none;
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

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

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

.loading p {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .upload-area i {
        font-size: 2.5rem;
    }
    
    .upload-area h3 {
        font-size: 1.3rem;
    }
}

/* 尺寸调整功能样式 */
.resize-mode,
.resize-presets {
    margin-bottom: 15px;
}

.resize-mode select,
.resize-presets select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 0.9rem;
    margin-top: 5px;
}

.custom-size {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.size-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.size-input {
    display: flex;
    flex-direction: column;
}

.size-input label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.size-input input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

.size-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.aspect-ratio {
    margin-top: 10px;
}

.aspect-ratio .checkbox-container {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.aspect-ratio .checkmark {
    width: 16px;
    height: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .size-inputs {
        grid-template-columns: 1fr;
    }
} 