/* ============ 图片无损放大 - 工具特有样式 ============ */
/* 通用样式（容器布局、卡片、按钮、info-box、empty-state、section-row-1-2 等）由 common.css 统一提供 */

/* ---- 放大设置（倍数 / 降噪 / 类型） ---- */
.ratio-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-ratio {
    padding: 6px 12px;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ratio:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

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

.noise-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

/* ---- 下载卡片信息 ---- */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.info-label {
    color: #6b7280;
}

.info-value {
    color: #374151;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* ---- 列表头统计 ---- */
.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;
}

.image-size {
    font-size: 12px;
    color: #6b7280;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* ============ 上传区（与图片格式转换统一） ============ */
.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;
}

/* ---- 上传中提示 ---- */
.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);
    }
}

/* ============ 图片列表（与图片格式转换统一） ============ */
.images-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.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;
}

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

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

.image-card.selected {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35);
}

.image-card.processing {
    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,
.processing-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;
}

.processing-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;
}

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

/* ============ 效果预览（放大工具特有） ============ */
.result-preview {
    background:
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
}

.result-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

.result-info {
    text-align: center;
    margin-bottom: 12px;
}

.result-dims {
    font-size: 14px;
    color: #374151;
    font-family: 'Consolas', 'Monaco', monospace;
}

.result-size {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.result-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.nav-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
}

.nav-thumbs {
    flex: 1;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0;
}

.nav-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.nav-thumb:hover,
.nav-thumb.active {
    border-color: #8b5cf6;
}

.nav-thumb.active {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.nav-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-index {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 10px;
    text-align: center;
    padding: 1px 0;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .images-list {
        grid-template-columns: 1fr;
    }
}
