* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', sans-serif;
}

body {
    background: #f0f2f5;
    padding: 30px;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    padding: 40px;
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 600;
    font-size: 28px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
    font-size: 15px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #4299e1;
    outline: none;
}

.submit-btn {
    width: 100%;
    background: #4299e1;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: #3182ce;
}

.preview-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.preview-card {
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.preview-card h3 {
    color: #4a5568;
    margin-bottom: 10px;
}

.preview-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    object-fit: contain;
}

.result-box {
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    text-align: center;
}

.download-btn {
    display: inline-block;
    background: #48bb78;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.download-btn:hover {
    background: #38a169;
}

.error-box {
    padding: 15px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #dc2626;
    margin-bottom: 20px;
    display: none;
}

.hidden {
    display: none;
}

.loading::after {
    content: " ";
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #4299e1;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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