/* ── 上传区域 ── */
.upload-zone {
    border: 2px dashed #d0d5dd;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafbfc;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #2563eb;
    background: #f0f4ff;
}

.upload-icon {
    font-size: 2.5rem;
    color: #b0b8c4;
    margin-bottom: 0.8rem;
    line-height: 1;
}

.upload-zone:hover .upload-icon,
.upload-zone.drag-over .upload-icon {
    color: #2563eb;
}

.upload-text {
    font-size: 1rem;
    color: #555;
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.upload-hint {
    font-size: 0.82rem;
    color: #999;
}

/* ── 质量控制 ── */
.quality-control {
    margin-bottom: 1.5rem;
}

.quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.quality-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2563eb;
    font-family: 'Fira Code', monospace;
}

.quality-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #f87171 0%, #fbbf24 40%, #34d399 70%, #2563eb 100%);
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 3px solid #2563eb;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.quality-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 3px solid #2563eb;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.quality-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: #999;
}

/* ── 压缩结果 ── */
.compress-result {
    margin-top: 1.5rem;
    background: #f8f9fb;
    border: 1px solid #e8eaf0;
    border-radius: 10px;
    overflow: hidden;
}

.result-header {
    padding: 0.8rem 1.2rem;
    background: #ecfdf5;
    color: #059669;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
}

/* ── 统计数据 ── */
.result-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.2rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.82rem;
    color: #999;
    margin-bottom: 0.3rem;
}

.stat-val {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    font-family: 'Fira Code', monospace;
}

.stat-highlight {
    color: #2563eb;
}

/* ── 前后对比 ── */
.compare-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0 1.2rem 1.2rem;
}

.compare-side {
    text-align: center;
}

.compare-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 0.5rem;
}

.compare-img-wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.5rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-img-wrap img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 4px;
}

/* ── 压缩质量参考表格 ── */
.guide-table-wrap {
    max-width: 860px;
    margin: 0 auto;
}

.format-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.format-table th {
    background: #f5f7fa;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
}

.format-table td {
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

.format-table tr:last-child td {
    border-bottom: none;
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .upload-zone {
        padding: 2rem 1rem;
    }

    .result-stats {
        gap: 1rem;
    }

    .stat-val {
        font-size: 0.9rem;
    }

    .compare-preview {
        grid-template-columns: 1fr;
    }

    .compare-img-wrap img {
        max-height: 200px;
    }

    .format-table {
        font-size: 0.82rem;
    }

    .format-table th,
    .format-table td {
        padding: 0.6rem 0.5rem;
    }
}