/* ================================================================
   菜刀客在线工具页 · bw-converter.html 私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

/* ---- 隐私提示条 ---- */
.privacy-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #166534;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 15px;
    text-align: center;
    justify-content: center;
}

.privacy-notice .icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ---- 上传区 ---- */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #eef2ff;
}

.upload-area .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-area .upload-text {
    color: #6b7280;
    font-size: 14px;
}

.upload-area .upload-text strong {
    color: #667eea;
}

.upload-area .upload-tip {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

/* ---- 文件信息卡片 ---- */
.info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.info-card .thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #fff;
}

.info-card .meta {
    flex: 1;
    min-width: 0;
}

.info-card .name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-card .dims,
.info-card .size {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.btn-remove {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.btn-remove:hover {
    color: #dc2626;
}

.compress-tip {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
}

/* ---- 效果按钮组 ---- */
.effect-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.effect-bar .btn {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.effect-bar .btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.effect-bar .btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

/* ---- 参数滑杆 ---- */
.param-row {
    width: 100%;
}

.param-row input[type="range"] {
    width: 100%;
    accent-color: #667eea;
    cursor: pointer;
}

.val {
    font-weight: 600;
    color: #667eea;
    font-variant-numeric: tabular-nums;
}

/* ---- 预览对比 ---- */
.preview-compare {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.preview-box {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.preview-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
}

.preview-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    background: #fff;
    border-radius: 6px;
    padding: 4px;
}

.preview-img-wrap img,
.preview-img-wrap canvas {
    max-width: 100%;
    max-height: 280px;
    border-radius: 4px;
}

.preview-arrow {
    font-size: 24px;
    color: #667eea;
    font-weight: bold;
    flex-shrink: 0;
}

/* ---- 结果统计 ---- */
.stats-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.stats-card {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: #f0f4ff;
    border-radius: 6px;
    border: 1px solid #e0e7ff;
}

.stats-card .label {
    font-size: 11px;
    color: #6b7280;
}

.stats-card .value {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

/* ---- 全屏预览弹窗 ---- */
.preview-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.preview-modal.show {
    display: flex;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.modal-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    transition: transform 0.15s ease-out;
    user-select: none;
    -webkit-user-drag: none;
}

@media (max-width: 600px) {
    .preview-compare {
        flex-direction: column;
    }
    .preview-arrow {
        transform: rotate(90deg);
    }
    .effect-bar {
        justify-content: center;
    }
}
