:root {
    --primary-color: #0066FF;
    --gradient-start: #4158D0;
    --gradient-end: #C850C0;
    --accent-color: #FFCC00;
    --border-radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #1D1D1F;
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 1rem;
    backdrop-filter: blur(10px);
    padding-bottom: 5rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

header p {
    color: rgba(255,255,255,0.9);
}

.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    border: 2px dashed #DEDEDE;
    transition: border-color 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    fill: var(--primary-color);
}

.upload-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.3s;
}

.upload-btn:hover {
    opacity: 0.9;
}

.preview-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.preview-box {
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.image-container {
    margin: 1rem 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #F5F5F7;
    cursor: pointer;
    transition: transform 0.3s;
    flex: 1;
    display: flex;
    align-items: center;
    max-height: 400px;
}

.image-container:hover {
    transform: scale(1.02);
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    padding-bottom: 2rem;
}

.quality-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
}

input[type="range"] {
    width: 200px;
}

.download-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.3s;
}

.download-btn:hover {
    opacity: 0.9;
}

.advanced-options {
    width: 100%;
    max-width: 600px;
    margin-top: 0;
    text-align: center;
    margin-bottom: 0;
}

.advanced-options h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.compression-mode {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 0;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

@media (max-width: 768px) {
    .preview-container {
        grid-template-columns: 1fr;
    }
    
    .compression-mode {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .mode-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .controls {
        padding-bottom: 5rem;
    }

    .image-container {
        max-height: 300px;
    }

    .modal-close {
        right: 0;
        top: -50px;
    }

    .modal {
        padding: 10px;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: absolute;
    top: 2rem;
    left: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal img {
    max-width: 100%;
    max-height: calc(90vh - 40px);
    object-fit: contain;
    vertical-align: middle;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.footer {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
}

.footer .quote {
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer .contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.footer .wechat-icon {
    width: 24px;
    height: 24px;
    fill: white;
}

.download-btn-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    display: flex;
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.3s;
    z-index: 90;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.download-btn-container.visible {
    transform: translateY(0);
}
 