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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

header {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

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

main {
    padding: 2rem 0;
}

h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-align: center;
}

.upload-section, .config-section, .result-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.upload-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.upload-area:hover {
    border-color: #2980b9;
    background-color: #f0f8ff;
}

.upload-placeholder .upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-placeholder p {
    margin-bottom: 0.5rem;
    color: #555;
}

.hint {
    font-size: 0.9rem;
    color: #777;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background-color: white;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.color-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.color-option:hover {
    background-color: #f0f0f0;
}

.color-preview {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    margin-right: 0.5rem;
    border: 2px solid #ddd;
    display: inline-block;
}

.color-preview.blue {
    background-color: #3498db;
}

.color-preview.red {
    background-color: #e74c3c;
}

.color-preview.white {
    background-color: #ecf0f1;
    border-color: #999;
}

.color-preview.custom-color {
    background-color: #4A90E2;
}

.custom-color-picker {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.custom-color-picker input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    cursor: pointer;
}

button {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    font-weight: 600;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.result-container {
    text-align: center;
}

.photo-preview {
    margin-bottom: 2rem;
}

.photo-preview img {
    max-width: 500px;
    max-height: 500px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    height: auto;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.result-actions button {
    width: auto;
    padding: 0.8rem 1.5rem;
}

#downloadBtn::before {
    content: "📥";
    margin-right: 0.5rem;
}

footer {
    background: #34495e;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .color-options {
        flex-direction: column;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions button {
        width: 100%;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 错误提示样式 */
.error-message {
    background-color: #e74c3c;
    color: white;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
    text-align: center;
}