/* batch-image-processor 页面专属样式 - Tailwind 无法覆盖的功能性样式（纯色主题，无渐变） */

/* 上传区 */
.bip-dropzone {
    border: 2px dashed #bae6fd;
    border-radius: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    outline: none;
}
.bip-dropzone:hover, .bip-dropzone:focus, .bip-dropzone.drag-over {
    border-color: #0ea5e9;
    background-color: #f0f9ff;
}

/* 全窗口拖放遮罩 */
.bip-drop-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(248, 250, 252, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.bip-drop-hint {
    padding: 1.75rem 3rem;
    border: 2px dashed #0ea5e9;
    border-radius: 0.75rem;
    background: #fff;
    color: #0284c7;
    font-size: 1.0625rem;
    font-weight: 600;
}

/* 表单字段 */
.bip-field { min-width: 0; }
.bip-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.375rem;
}
.bip-select, .bip-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bip-select:focus, .bip-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.bip-select:disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }
.bip-input:disabled { background: #f1f5f9; color: #94a3b8; }

/* 预设模板 chips */
.bip-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bip-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3125rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.bip-chip:hover { border-color: #0ea5e9; color: #0284c7; }
.bip-chip-custom {
    display: inline-flex;
    align-items: center;
    padding-left: 0.75rem;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    background: #f0f9ff;
}
.bip-chip-custom .bip-chip-label {
    border: 0;
    background: transparent;
    padding: 0.3125rem 0.125rem 0.3125rem 0;
    color: #0284c7;
    font-size: 0.75rem;
    cursor: pointer;
}
.bip-chip-custom .bip-chip-x {
    border: 0;
    background: transparent;
    padding: 0.3125rem 0.5rem 0.3125rem 0.125rem;
    color: #94a3b8;
    font-size: 0.8125rem;
    cursor: pointer;
    border-radius: 0 999px 999px 0;
}
.bip-chip-custom .bip-chip-x:hover { color: #dc2626; }

/* 裁剪方式双按钮 */
.bip-fit {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    padding: 0.5625rem 0.625rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.bip-fit:hover { border-color: #0ea5e9; }
.bip-fit.on { border-color: #0ea5e9; background: #f0f9ff; }
.bip-fit b { font-size: 0.8125rem; color: #1e293b; }
.bip-fit span { font-size: 0.6875rem; color: #94a3b8; line-height: 1.4; }

/* 滑块与颜色 */
.bip-range { width: 100%; accent-color: #0ea5e9; }
.bip-color {
    width: 2.25rem;
    height: 1.75rem;
    padding: 1px 2px;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    background: #fff;
    cursor: pointer;
}

/* 高级选项折叠 */
.bip-adv-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    background: #f8fafc;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.bip-adv-toggle:hover { background: #f1f5f9; border-color: #94a3b8; }
.bip-adv-arrow { transition: transform 0.2s ease; font-size: 0.75rem; }
.bip-adv-toggle.open .bip-adv-arrow { transform: rotate(180deg); }
.bip-advanced {
    margin-top: 0.875rem;
    padding: 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #f8fafc;
}

/* 按钮组 */
.bip-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    background: #0ea5e9;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.bip-btn-primary:hover:not(:disabled) { background: #0284c7; }
.bip-btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }
.bip-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.bip-btn-secondary:hover:not(:disabled) { border-color: #0ea5e9; color: #0284c7; }
.bip-btn-secondary:disabled { color: #94a3b8; cursor: not-allowed; }

/* 提示条 */
.bip-notice {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: #f0f9ff;
    color: #0284c7;
    font-size: 0.8125rem;
}
.bip-warn {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.8125rem;
}

/* 重命名预览 */
.bip-preview {
    margin-top: 0.5rem;
    padding: 0.5rem 0.625rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
}
.bip-preview-line {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.75rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 文件卡片网格 */
.bip-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.625rem;
    margin-top: 1rem;
}
.bip-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    overflow: hidden;
    cursor: grab;
}
.bip-card.dragging { opacity: 0.45; }
.bip-card:active { cursor: grabbing; }
.bip-thumb {
    position: relative;
    aspect-ratio: 1;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bip-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bip-idx {
    position: absolute;
    left: 0.375rem;
    top: 0.375rem;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3125rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #475569;
    font-size: 0.6875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}
.bip-badge {
    position: absolute;
    right: 0.375rem;
    top: 0.375rem;
    padding: 0.125rem 0.4375rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    color: #fff;
}
.bip-badge.pending { background: #94a3b8; }
.bip-badge.processing { background: #2563eb; }
.bip-badge.done { background: #059669; }
.bip-badge.failed { background: #dc2626; }
.bip-meta { padding: 0.5rem 0.5625rem 0.5625rem; display: flex; flex-direction: column; gap: 0.1875rem; min-width: 0; }
.bip-name {
    font-size: 0.75rem;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bip-dims { font-size: 0.6875rem; color: #94a3b8; font-variant-numeric: tabular-nums; }
.bip-huge { color: #b45309; }
.bip-out {
    font-size: 0.6875rem;
    color: #059669;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bip-err { font-size: 0.6875rem; color: #dc2626; }
.bip-acts {
    position: absolute;
    right: 0.3125rem;
    bottom: 0.3125rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.bip-card:hover .bip-acts { opacity: 1; }
.bip-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    background: #fff;
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.bip-act:hover:not(:disabled) { border-color: #0ea5e9; color: #0284c7; }
.bip-act.danger:hover:not(:disabled) { border-color: #dc2626; color: #dc2626; }
.bip-act:disabled { opacity: 0.5; cursor: not-allowed; }

/* 汇总条 */
.bip-summary {
    margin-top: 0.75rem;
    padding: 0.5625rem 0.75rem;
    border-radius: 0.375rem;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

/* 介绍/FAQ 区块卡片 */
.bip-section-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-top: 1rem;
}
.bip-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #334155;
}
.bip-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.875rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #fff;
    transition: border-color 0.15s ease;
}
.bip-tool-card:hover { border-color: #0ea5e9; }

/* ================= M5 手动裁剪标记（卡片缩略图左上） ================= */
.bip-cropped {
    position: absolute;
    left: 0.375rem;
    top: 0.375rem;
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.3125rem;
    background: #0ea5e9;
    color: #fff;
    font-size: 0.625rem;
}

/* ================= M5 裁剪编辑器模态 ================= */
.bip-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
}
.bip-modal-card {
    width: 100%;
    max-width: 48rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    padding: 1rem 1.25rem 1.25rem;
}
.bip-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.bip-crop-stage {
    display: flex;
    justify-content: center;
    background: #0f172a;
    border-radius: 0.5rem;
    overflow: hidden;
}
.bip-crop-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: grab;
    touch-action: none;
}
.bip-crop-canvas.grabbing { cursor: grabbing; }
.bip-crop-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}
.bip-crop-slider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 14rem;
}
.bip-crop-slider .bip-range { flex: 1; }
.bip-crop-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.875rem;
    flex-wrap: wrap;
}

/* ================= 水印与边框控件 ================= */
.bip-wm-block {
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    padding: 0.75rem;
    background: #fff;
}
.bip-textarea {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: #1e293b;
    background: #fff;
    outline: none;
    resize: vertical;
    min-height: 3.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bip-textarea:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.bip-wm-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.75rem;
    color: #475569;
    margin-top: 0.375rem;
}
.bip-wm-row > span:first-child { white-space: nowrap; }
.bip-wm-row .bip-range { flex: 1; }
.bip-wm-val {
    min-width: 2.75rem;
    text-align: right;
    font-size: 0.75rem;
    color: #0284c7;
    font-variant-numeric: tabular-nums;
}
.bip-pos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1rem);
    grid-auto-rows: 1rem;
    gap: 0.1875rem;
}
.bip-pos {
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    background: #fff;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.bip-pos:hover { border-color: #0ea5e9; }
.bip-pos.on { background: #0ea5e9; border-color: #0ea5e9; }

/* 兜底：本文件后于 Tailwind 加载，单类 .hidden(display:none) 会被同优先级的 .bip-modal/.bip-btn-secondary
   的 display 规则按顺序压掉，导致带 hidden 的元素仍然显示。用双类组合恢复隐藏语义。 */
.bip-modal.hidden, .bip-btn-secondary.hidden { display: none; }
