/* 证件照制作工具样式：换底色 / 改尺寸 / 排版照 / 批量处理 */
.ipd-form { margin-top: 14px; }
.ipd-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }

/* 上传区 */
.ipd-drop {
    border: 2px dashed rgba(59, 130, 246, 0.45);
    border-radius: 14px;
    padding: 30px 16px;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(59,130,246,0.06), rgba(59,130,246,0.02));
    transition: all 0.25s ease;
}
.ipd-drop:hover, .ipd-drop.ipd-dragover {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-1px);
}
.ipd-drop-icon { font-size: 2rem; color: #3b82f6; margin-bottom: 8px; }
.ipd-drop-text { font-weight: 600; margin: 0 0 4px; }
.ipd-drop-sub { font-size: 0.8rem; color: var(--text-gray); margin: 0; }

/* 编辑器整体 */
.ipd-editor {
    background: rgba(248, 250, 252, 0.75);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    overflow: hidden;
}

/* 顶部 Tab */
.ipd-tabs { display: flex; gap: 6px; padding: 10px 12px 0; justify-content: center; }
.ipd-tab {
    border: 1px solid var(--border-light); background: #fff; cursor: pointer;
    padding: 7px 26px; border-radius: 10px 10px 0 0; font-weight: 600; font-size: 0.88rem;
    color: var(--text-gray); transition: all 0.2s ease; border-bottom: none;
}
.ipd-tab.active {
    color: #2563eb;
    background: linear-gradient(180deg, #eff6ff, #fff);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 -2px 8px rgba(59, 130, 246, 0.10) inset;
}

/* 主体三栏 */
.ipd-body { display: flex; min-height: 420px; border-top: 1px solid var(--border-light); }

/* 左侧工具栏 */
.ipd-rail {
    display: flex; flex-direction: column; gap: 6px; padding: 12px 8px;
    background: #fff; border-right: 1px solid var(--border-light);
}
.ipd-rail-btn {
    border: none; background: transparent; cursor: pointer; border-radius: 10px;
    padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 5px;
    color: #64748b; font-size: 0.72rem; font-weight: 600; transition: all 0.2s ease; width: 62px;
}
.ipd-rail-btn i { font-size: 1.05rem; }
.ipd-rail-btn:hover { background: #eff6ff; color: #2563eb; }
.ipd-rail-btn.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

/* 设置面板 */
.ipd-panel {
    width: 250px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border-light);
    padding: 14px 12px; overflow-y: auto; max-height: 520px;
}
.ipd-panel-title { font-weight: 700; font-size: 0.9rem; margin: 0 0 12px; color: #1e293b; }
.ipd-panel-title i { color: #3b82f6; margin-right: 5px; }
.ipd-panel-tip { font-size: 0.74rem; color: var(--text-gray); line-height: 1.6; margin: 12px 0 0; }
.ipd-panel-tip i { color: #60a5fa; margin-right: 3px; }

/* 底色色板 */
.ipd-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.ipd-swatch {
    height: 46px; border-radius: 10px; cursor: pointer; border: 2px solid #e2e8f0;
    position: relative; transition: all 0.2s ease; overflow: hidden;
}
.ipd-swatch:hover { transform: translateY(-2px); box-shadow: 0 5px 12px rgba(30, 64, 175, 0.18); }
.ipd-swatch.active { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18); }
.ipd-swatch .ipd-swatch-name {
    position: absolute; left: 0; right: 0; bottom: 0; font-size: 0.62rem; text-align: center;
    background: rgba(0,0,0,0.35); color: #fff; padding: 1px 0; pointer-events: none;
}
.ipd-swatch.ipd-swatch-trans {
    background: repeating-conic-gradient(#e2e8f0 0% 25%, #fff 0% 50%) 50% / 12px 12px;
}
.ipd-custom-wrap { display: none; align-items: center; gap: 8px; margin: -6px 0 12px; font-size: 0.78rem; }
.ipd-custom-wrap.visible { display: flex; }
.ipd-custom-color {
    width: 34px; height: 34px; padding: 0; border: 2px solid #e2e8f0; border-radius: 8px;
    cursor: pointer; background: #fff;
}

/* 滑杆 */
.ipd-slider-row { margin-bottom: 10px; }
.ipd-slider-row label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 5px; color: #334155; }
.ipd-slider-row input[type="range"] { width: 100%; accent-color: var(--color-primary); }

/* 自定义尺寸 */
.ipd-custom-size {
    display: flex; align-items: center; gap: 5px; font-size: 0.78rem; color: #334155;
    background: #f8fafc; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.ipd-custom-size input[type="number"] {
    width: 62px; padding: 5px 6px; border: 1px solid var(--border-light); border-radius: 8px;
    font-size: 0.8rem; text-align: center;
}
.ipd-custom-size input:focus { outline: none; border-color: #3b82f6; }
.ipd-x { color: #94a3b8; }
.ipd-unit { color: var(--text-gray); }
.ipd-btn-mini {
    border: 1px solid rgba(59,130,246,0.4); background: #eff6ff; color: #2563eb; cursor: pointer;
    border-radius: 8px; padding: 5px 10px; font-size: 0.75rem; font-weight: 600; transition: all 0.2s ease;
    white-space: nowrap;
}
.ipd-btn-mini:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* 尺寸搜索与分类 */
.ipd-search {
    width: 100%; padding: 7px 10px; border: 1px solid var(--border-light); border-radius: 9px;
    font-size: 0.8rem; margin-bottom: 8px; box-sizing: border-box;
}
.ipd-search:focus { outline: none; border-color: #3b82f6; }
.ipd-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ipd-cat {
    border: 1px solid var(--border-light); background: #f8fafc; border-radius: 999px;
    padding: 4px 11px; font-size: 0.74rem; cursor: pointer; color: #475569; transition: all 0.2s ease;
}
.ipd-cat:hover { border-color: #93c5fd; color: #2563eb; }
.ipd-cat.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; border-color: transparent;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}

/* 尺寸预设列表 */
.ipd-presets { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; }
.ipd-preset {
    border: 1px solid var(--border-light); border-radius: 10px; padding: 8px 10px; cursor: pointer;
    background: #fff; transition: all 0.18s ease; text-align: center;
}
.ipd-preset:hover { border-color: #93c5fd; background: #f0f7ff; }
.ipd-preset.active {
    border-color: #2563eb; background: linear-gradient(135deg, #eff6ff, #dbeafe);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}
.ipd-preset-name { font-size: 0.82rem; font-weight: 700; color: #1e293b; }
.ipd-preset-meta { font-size: 0.7rem; color: var(--text-gray); margin-top: 2px; }

/* 预览舞台 */
.ipd-stage { flex: 1; min-width: 0; padding: 14px; display: flex; flex-direction: column; }
.ipd-canvas-wrap {
    flex: 1; display: flex; align-items: center; justify-content: center;
    background:
        linear-gradient(45deg, #eef2f7 25%, transparent 25%, transparent 75%, #eef2f7 75%),
        linear-gradient(45deg, #eef2f7 25%, transparent 25%, transparent 75%, #eef2f7 75%);
    background-size: 18px 18px; background-position: 0 0, 9px 9px;
    background-color: #f8fafc;
    border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden;
    min-height: 320px; touch-action: none; cursor: grab;
}
.ipd-canvas-wrap:active { cursor: grabbing; }
#ipd-canvas, #ipd-layout-canvas { max-width: 100%; max-height: 400px; box-shadow: 0 6px 24px rgba(15, 23, 42, 0.14); border-radius: 4px; }
.ipd-stage-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ipd-zoom-range { flex: 1; accent-color: var(--color-primary); }
.ipd-zoom-val { font-size: 0.78rem; font-weight: 700; color: #2563eb; min-width: 42px; text-align: right; }
.ipd-stage-tip { font-size: 0.74rem; color: var(--text-gray); margin: 8px 0 0; }
.ipd-stage-tip b { color: #2563eb; }
.ipd-select {
    padding: 7px 10px; border: 1px solid var(--border-light); border-radius: 9px; font-size: 0.8rem;
    background: #fff; flex: 1; min-width: 0;
}
.ipd-paper-info { font-size: 0.76rem; color: var(--text-gray); white-space: nowrap; }

/* 批量缩略图 */
.ipd-filmstrip {
    display: flex; gap: 8px; padding: 10px 12px; overflow-x: auto;
    border-top: 1px solid var(--border-light); background: #fff; min-height: 74px;
}
.ipd-thumb {
    position: relative; width: 58px; height: 58px; border-radius: 9px; overflow: hidden; flex-shrink: 0;
    border: 2px solid #e2e8f0; cursor: pointer; transition: all 0.2s ease; background: #f1f5f9;
}
.ipd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ipd-thumb.active { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16); }
.ipd-thumb-remove {
    position: absolute; top: 1px; right: 1px; width: 16px; height: 16px; border: none; border-radius: 50%;
    background: rgba(15, 23, 42, 0.62); color: #fff; font-size: 0.6rem; line-height: 16px; cursor: pointer;
    padding: 0; display: none;
}
.ipd-thumb:hover .ipd-thumb-remove { display: block; }
.ipd-thumb-add {
    width: 58px; height: 58px; border-radius: 9px; flex-shrink: 0; border: 1.5px dashed #93c5fd;
    background: #f0f7ff; color: #3b82f6; cursor: pointer; font-size: 1.05rem; transition: all 0.2s ease;
}
.ipd-thumb-add:hover { background: #dbeafe; }

/* 进度 */
.ipd-progress { margin: 10px 12px 0; }
.ipd-progress-head { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 600; margin-bottom: 5px; }
.ipd-progress-track { height: 9px; background: #e2e8f0; border-radius: 6px; overflow: hidden; }
.ipd-progress-bar { height: 100%; background: var(--grad-primary); border-radius: 6px; transition: width 0.25s ease; }

/* 操作按钮 */
.ipd-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ipd-btn-main { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); flex: 1; min-width: 130px; }
.ipd-btn-dl { background: linear-gradient(135deg, #10b981 0%, #059669 100%); flex: 1; min-width: 130px; }
.ipd-btn-ghost {
    padding: 12px 20px; border-radius: 12px; border: 1px solid var(--border-light);
    background: #f8fafc; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: all 0.25s ease;
}
.ipd-btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* 响应式 */
@media (max-width: 900px) {
    .ipd-body { flex-direction: column; }
    .ipd-rail { flex-direction: row; width: 100%; border-right: none; border-bottom: 1px solid var(--border-light); padding: 8px 12px; justify-content: center; }
    .ipd-rail-btn { flex-direction: row; width: auto; padding: 8px 14px; }
    .ipd-panel { width: 100%; max-height: none; border-right: none; border-bottom: 1px solid var(--border-light); }
    .ipd-presets { max-height: 180px; }
    .ipd-canvas-wrap { min-height: 260px; }
    #ipd-canvas, #ipd-layout-canvas { max-height: 300px; }
}
