* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e0e7ff 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: #333;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 1000px;
}

.logo {
    width: 80px;
    height: 80px;
    margin-right: 15px;
    background: #d70006;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    padding: 5px;
    box-shadow: 0 4px 10px rgba(215, 0, 6, 0.3);
}

.title-container {
    text-align: center;
}

h1 {
    color: #d70006;
    margin-bottom: 5px;
    font-size: 1.8rem;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1rem;
}

.container {
    max-width: 1000px;
    width: 100%;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.upload-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.upload-box {
    flex: 1;
    min-width: 280px;
    border: 2px dashed #d70006;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fff5f5;
    cursor: pointer;
    position: relative;
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-box:hover {
    border-color: #a00000;
    background: #ffeaea;
    transform: translateY(-5px);
}

.upload-box h3 {
    color: #d70006;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.upload-icon {
    font-size: 50px;
    color: #d70006;
    margin-bottom: 15px;
}

.upload-btn {
    display: inline-block;
    background: #d70006;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin-top: 10px;
    font-size: 0.9rem;
}

.upload-btn:hover {
    background: #a00000;
    transform: translateY(-2px);
}

input[type="file"] {
    display: none;
}

.preview-img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: contain;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background: white;
}

.upload-content {
    z-index: 2;
    position: relative;
}

.upload-box.has-image .upload-content {
    display: none;
}

.upload-box.has-image .preview-img {
    display: block;
}

.change-image-btn {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 3;
    display: none;
    font-size: 0.9rem;
}

.upload-box.has-image:hover .change-image-btn {
    display: block;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
}

.btn-generate {
    background: #d70006;
    color: white;
}

.btn-generate:hover {
    background: #a00000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(215, 0, 6, 0.3);
}

.btn-download {
    background: #2c3e50;
    color: white;
}

.btn-download:hover {
    background: #1a252f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 62, 80, 0.3);
}

.btn-reset {
    background: #95a5a6;
    color: white;
}

.btn-reset:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.result-section {
    text-align: center;
    margin-top: 30px;
    display: none;
}

.result-title {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.3rem;
}

.result-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

#resultImage {
    max-width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    background: white;
    display: none;
}

.wechat-tips {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 0.9rem;
    text-align: left;
}

.wechat-tips h4 {
    margin-bottom: 8px;
    color: #d70006;
}

.instructions {
    background: #f8f9fa;
    border-left: 4px solid #d70006;
    padding: 15px;
    margin-top: 25px;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
}

.instructions h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.instructions ul {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 6px;
    line-height: 1.4;
}

.file-info {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.format-support {
    background: #e8f4fd;
    border: 1px solid #b8daff;
    color: #004085;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .upload-section {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}

.status-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    width: 100%;
    font-size: 0.9rem;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.watermark-preview {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(215, 0, 6, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1rem;
    z-index: 2;
}

.improve-before {
    background: rgba(215, 0, 6, 0.8);
}

.improve-after {
    background: rgba(40, 167, 69, 0.8);
}

.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #d70006;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}