/* ============ 图片格式转换 - 工具特有样式 ============ */
/* 通用样式（容器布局、卡片、按钮、info-box、empty-state 等）由 common.css 统一提供 */

/* ---- 上传区 ---- */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.upload-hint {
    font-size: 12px;
    color: #9ca3af;
}

/* ---- 输出格式选择 ---- */
.format-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.format-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.format-btn:hover {
    border-color: #c4b5fd;
    background: #faf5ff;
}

.format-btn.active {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.format-btn.active .format-name,
.format-btn.active .format-desc {
    color: white;
}

.format-btn.active .format-icon {
    filter: brightness(0) invert(1);
}

.format-icon {
    font-size: 24px;
}

.format-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    min-width: 60px;
}

.format-desc {
    font-size: 12px;
    color: #9ca3af;
}

/* ---- 质量滑块 ---- */
.quality-slider {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
}

/* ---- 列表头统计 ---- */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.stats {
    font-size: 13px;
    color: #8b5cf6;
    background: #f5f3ff;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
}

/* ---- 图片列表（参考图片压缩工具的卡片网格） ---- */
.images-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

/* ---- 继续添加占位卡片（参考图片压缩工具的 add-more-card） ---- */
.add-more-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 44px 20px;
    border: 3px dashed #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}

.add-more-card:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.add-more-icon {
    font-size: 40px;
}

.add-more-text {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

.add-more-hint {
    font-size: 11px;
    color: #9ca3af;
}

/* ---- 上传中提示 ---- */
.uploading-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    color: #6d28d9;
    font-size: 14px;
    font-weight: 500;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd6fe;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.image-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.image-card:hover {
    border-color: #a78bfa;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.12);
}

.image-card.converting {
    opacity: 0.6;
}

.image-preview {
    position: relative;
    background: repeating-conic-gradient(#ccc 0% 25%, transparent 0% 50%) 50% / 16px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 12px;
}

.preview-img {
    max-width: 100%;
    max-height: 170px;
    border-radius: 6px;
    display: block;
}

.converted-badge,
.converting-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

.converted-badge {
    background: #8b5cf6;
}

.converting-badge {
    background: #f59e0b;
}

.image-info {
    padding: 12px;
}

.file-name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.convert-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    margin-bottom: 6px;
}

.meta-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.meta-badge.original {
    background: #dbeafe;
    color: #1d4ed8;
}

.meta-badge.target {
    background: #dcfce7;
    color: #16a34a;
}

.meta-arrow {
    color: #9ca3af;
}

.convert-sizes {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
    margin-bottom: 4px;
}

.size-item {
    color: #6b7280;
}

.savings {
    font-size: 12px;
    font-weight: 600;
    color: #ef4444;
}

.savings.positive {
    color: #22c55e;
}

.image-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* ---- 背景色处理 ---- */
.bg-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bg-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

.bg-color {
    width: 44px;
    height: 32px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    padding: 2px;
    background: #fff;
    cursor: pointer;
}

.bg-color:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


