* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
}

body {
    background: linear-gradient(145deg, #f4f8fc 0%, #e3ecf3 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.card {
    max-width: 1100px;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    border-radius: 56px;
    padding: 40px 45px;
    box-shadow: 0 25px 50px -8px rgba(0, 20, 40, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.logo-icon {
    background: #1a3b5d;
    color: white;
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 8px 16px -6px rgba(26, 59, 93, 0.3);
}

.title-group h1 {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #0b2a44;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.title-group h1 small {
    font-size: 0.9rem;
    font-weight: 600;
    background: #22a06b;
    padding: 4px 16px;
    border-radius: 60px;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    color: #2a4b6e;
    background: rgba(255, 255, 255, 0.5);
    padding: 8px 24px 8px 20px;
    border-radius: 60px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.subtitle i {
    margin-right: 10px;
    color: #1f6390;
}

.quality-section {
    margin: 24px 0 18px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.5);
    padding: 14px 24px;
    border-radius: 60px;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.quality-section label {
    font-weight: 600;
    color: #0b2a44;
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-key-section {
    margin: 0 0 18px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    overflow: hidden;
}

.api-key-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    cursor: pointer;
    font-weight: 600;
    color: #0b2a44;
    font-size: 0.95rem;
}

.api-key-header i.fa-chevron-down {
    transition: transform 0.2s;
    color: #1f6390;
}

.api-key-header.open i.fa-chevron-down {
    transform: rotate(180deg);
}

.api-key-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 12px;
    border-radius: 40px;
    background: #e6eef7;
    color: #5c7a95;
    margin-left: 6px;
}

.api-key-status.configured {
    background: #d7f3e3;
    color: #1a8b5c;
}

.api-key-body {
    padding: 0 24px 18px;
    display: none;
}

.api-key-body.open {
    display: block;
}

.api-key-body input[type="text"] {
    flex: 1;
    min-width: 220px;
    padding: 10px 18px;
    border-radius: 30px;
    border: 1px solid #b8cfdf;
    font-size: 0.9rem;
    background: white;
    color: #0b2a44;
}

.api-key-body input[type="text"]:focus {
    outline: none;
    border-color: #2b6c9e;
}

.api-key-body a {
    color: #1f6390;
    font-weight: 600;
}

.quality-slider {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.quality-slider input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: #b8cfdf;
    border-radius: 10px;
    outline: none;
}

.quality-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1a3b5d;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(26, 59, 93, 0.3);
    border: 2px solid white;
}

.quality-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: #0b2a44;
    min-width: 48px;
    text-align: center;
    background: white;
    padding: 2px 12px;
    border-radius: 40px;
}

.drop-zone {
    margin: 12px 0 20px;
    border: 2px dashed #a0bbd0;
    border-radius: 40px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.25s ease;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: #2b6c9e;
    background: rgba(255, 255, 255, 0.7);
}

.drop-zone.drag-over {
    border-color: #0f4b7a;
    background: rgba(210, 231, 255, 0.4);
    box-shadow: 0 0 0 6px rgba(26, 59, 93, 0.08);
}

.drop-zone i {
    font-size: 4.2rem;
    color: #1f6390;
    margin-bottom: 10px;
    opacity: 0.8;
}

.drop-zone h3 {
    font-weight: 500;
    color: #0f3757;
    font-size: 1.6rem;
}

.drop-zone p {
    color: #2f567a;
    font-size: 1rem;
}

.browse-btn {
    margin-top: 16px;
    background: #1a3b5d;
    color: white;
    padding: 12px 38px;
    border-radius: 60px;
    font-weight: 500;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(26, 59, 93, 0.25);
    transition: all 0.15s;
}

.browse-btn:hover {
    background: #0f2e4a;
    transform: scale(1.01);
}

#file-input {
    display: none;
}

.file-list {
    margin: 16px 0 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    padding: 10px 6px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    min-height: 70px;
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.7);
    margin: 4px 0;
    border: 1px solid transparent;
    flex-wrap: wrap;
    gap: 6px;
}

.file-item:hover {
    background: white;
    border-color: #c1d8ec;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.file-info i {
    font-size: 1.6rem;
    color: #1f6390;
    width: 28px;
    text-align: center;
}

.file-name {
    font-weight: 500;
    color: #0b2a44;
    word-break: break-word;
}

.file-size {
    font-size: 0.85rem;
    color: #2f5a7a;
    background: #e6eef7;
    padding: 2px 14px;
    border-radius: 40px;
}

.file-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.compress-badge {
    background: #1a8b5c;
    color: white;
    padding: 2px 16px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(26, 139, 92, 0.2);
}

.no-gain-badge {
    background: #7a8a99;
    color: white;
    padding: 2px 16px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.download-btn {
    background: #1a3b5d;
    color: white;
    border: none;
    padding: 4px 16px;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.download-btn:hover {
    background: #0f2e4a;
    transform: scale(1.02);
}

.remove-file {
    background: transparent;
    border: none;
    color: #8fadc7;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 30px;
    transition: all 0.1s;
}

.remove-file:hover {
    color: #b13e3e;
    background: #ffebeb;
}

.empty-message {
    text-align: center;
    color: #577b9b;
    padding: 18px 0;
    font-style: italic;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 6px;
}

.compress-btn {
    background: #0b3b5e;
    border: none;
    padding: 16px 44px;
    border-radius: 60px;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 22px -6px rgba(11, 59, 94, 0.3);
    transition: all 0.15s;
    cursor: pointer;
    flex: 1 1 auto;
    justify-content: center;
}

.compress-btn:hover:not(:disabled) {
    background: #0a2f4a;
    transform: scale(1.01);
}

.compress-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.download-all-btn {
    background: #1a8b5c;
    border: none;
    padding: 16px 32px;
    border-radius: 60px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 22px -6px rgba(26, 139, 92, 0.3);
    transition: all 0.15s;
    cursor: pointer;
}

.download-all-btn:hover:not(:disabled) {
    background: #13704a;
    transform: scale(1.01);
}

.download-all-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.reset-btn {
    background: transparent;
    border: 1px solid #b8cfdf;
    padding: 14px 28px;
    border-radius: 60px;
    color: #1f4c70;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.12s;
}

.reset-btn:hover {
    background: #e5eef8;
    border-color: #6f99bb;
}

.stats {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #1a3f60;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.4);
    padding: 4px 20px 4px 16px;
    border-radius: 60px;
}

.footer-note {
    margin-top: 28px;
    text-align: center;
    font-size: 0.9rem;
    color: #2f5a7a;
    border-top: 1px solid rgba(166, 194, 218, 0.4);
    padding-top: 22px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-note i {
    color: #1d6d9e;
}

.progress-container {
    width: 100%;
    margin: 10px 0;
    background: #e6eef7;
    border-radius: 30px;
    height: 8px;
    overflow: hidden;
    display: none;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1a8b5c, #22c55e);
    border-radius: 30px;
    width: 0%;
    transition: width 0.3s ease;
}

.status-text {
    text-align: center;
    font-size: 0.9rem;
    color: #1a3b5d;
    margin-top: 5px;
    display: none;
}

@media (max-width: 640px) {
    .card {
        padding: 24px 16px;
        border-radius: 36px;
    }
    .title-group h1 {
        font-size: 2rem;
    }
    .subtitle {
        font-size: 1rem;
        padding: 6px 16px;
    }
    .quality-section {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .actions {
        flex-direction: column;
    }
    .compress-btn,
    .download-all-btn,
    .reset-btn {
        width: 100%;
        justify-content: center;
    }
}
