﻿:root {
    --primary-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #667eea 100%);
    --primary-light: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --secondary-gradient: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 50%, #ff6b9d 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --info-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
}

body {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
}

.text-gradient {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.hero-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 30%, #667eea 70%, #764ba2 100%);
    padding: 60px 0 40px 0;
    position: relative;
    overflow: hidden;
}

    .hero-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
        opacity: 0.8;
    }

    .hero-section h1 {
        position: relative;
        z-index: 1;
    }

.badge-free {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
    display: inline-block;
    margin-left: 12px;
}

.converter-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 2rem;
}

.converter-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    color: white;
}

.converter-body {
    padding: 2rem;
}

.upload-area {
    border: 3px dashed var(--gray-300);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--gray-50);
    cursor: pointer;
}

    .upload-area:hover {
        border-color: #667eea;
        background: #f0f4ff;
    }

    .upload-area.dragover {
        border-color: #667eea;
        background: #e8f0ff;
        transform: scale(1.02);
    }

.upload-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.file-input {
    display: none;
}

.preview-container {
    display: none;
    margin-top: 2rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.preview-item {
    position: relative;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
}

    .preview-item:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        transform: translateY(-4px);
    }

.preview-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.preview-info {
    padding: 0.75rem;
    background: var(--gray-50);
}

.preview-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-size {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.preview-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ff4757;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

    .preview-remove:hover {
        background: #ff4757;
        color: white;
        transform: scale(1.1);
    }

.options-panel {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.option-group {
    margin-bottom: 1.5rem;
}

.option-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.option-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

    .option-select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

.quality-slider {
    width: 100%;
    margin-top: 0.5rem;
}

.quality-value {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-convert {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    cursor: pointer;
}

    .btn-convert:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }

    .btn-convert:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

.btn-download {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
    cursor: pointer;
}

    .btn-download:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
    }

    .btn-download:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

.btn-clear {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    cursor: pointer;
}

    .btn-clear:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    }

.btn-history {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
    cursor: pointer;
    position: relative;
}

    .btn-history:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
    }

.history-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
}

.status-bar {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    display: none;
}

    .status-bar.show {
        display: block;
    }

.status-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-icon {
    font-size: 1.2rem;
}

.status-text {
    font-size: 0.9rem;
    color: var(--gray-700);
}

.status-number {
    font-weight: 700;
    color: #667eea;
}

.progress-container {
    display: none;
    margin-top: 1rem;
}

    .progress-container.show {
        display: block;
    }

.progress-bar-custom {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.feature-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    border: 2px solid transparent;
}

    .feature-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
        border-color: #667eea;
    }

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.feature-description {
    color: var(--gray-600);
    line-height: 1.6;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast-custom {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: none;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

    .toast-custom.show {
        display: block;
    }

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-header-custom {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.toast-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.toast-title {
    font-weight: 700;
    color: var(--gray-800);
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .toast-close:hover {
        color: var(--gray-600);
    }

.toast-body-custom {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.toast-success .toast-icon {
    color: #11998e;
}

.toast-error .toast-icon {
    color: #ff4757;
}

.toast-info .toast-icon {
    color: #667eea;
}

/* 历史记录模态框 */
.history-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

    .history-modal.show {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding: 2rem;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.history-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    margin: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.history-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

    .history-header h3 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 700;
    }

.history-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

    .history-close:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(90deg);
    }

.history-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.history-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-500);
}

    .history-empty i {
        font-size: 4rem;
        margin-bottom: 1rem;
        opacity: 0.5;
    }

.history-item {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid var(--gray-200);
    transition: all 0.3s ease;
}

    .history-item:hover {
        border-color: #f093fb;
        box-shadow: 0 4px 12px rgba(240, 147, 251, 0.2);
    }

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-item-info {
    flex: 1;
    min-width: 200px;
}

.history-item-time {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.history-item-params {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.history-param {
    display: inline-flex;
    align-items: center;
    background: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--gray-700);
}

    .history-param i {
        margin-right: 0.5rem;
        color: #f093fb;
    }

.history-item-actions {
    display: flex;
    gap: 0.5rem;
}

.history-item-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .history-item-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

    .history-item-btn.delete {
        background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    }

        .history-item-btn.delete:hover {
            box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
        }

.history-item-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.history-preview-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid white;
}

.history-item-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-300);
    flex-wrap: wrap;
}

.history-stat {
    font-size: 0.875rem;
    color: var(--gray-600);
}

    .history-stat strong {
        color: var(--gray-800);
        font-weight: 700;
    }

.history-footer {
    padding: 1rem 1.5rem;
    border-top: 2px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
    border-radius: 0 0 16px 16px;
}

.history-clear-all {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .history-clear-all:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    }

.history-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

    .history-image-wrapper:hover .history-image-download {
        opacity: 1;
    }

.history-image-download {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 1rem;
    z-index: 10;
}

    .history-image-download:hover {
        background: rgba(102, 126, 234, 0.95);
        transform: translate(-50%, -50%) scale(1.1);
    }

@media (max-width: 768px) {
    .history-image-download {
        opacity: 1;
        background: rgba(102, 126, 234, 0.85);
    }

    .hero-section {
        padding: 40px 0 30px 0;
    }

    .preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .action-buttons {
        flex-direction: column;
    }

        .action-buttons button {
            width: 100%;
        }

    .history-modal.show {
        padding: 1rem;
    }

    .history-item-actions {
        width: 100%;
        justify-content: stretch;
    }

    .history-item-btn {
        flex: 1;
    }
}
