/* 证件照排版 image-idphoto 专用样式 */
.id-opts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px 24px;
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-body, #fff);
    border: 1px solid var(--border-color, #e3e8ee);
    border-radius: 12px;
}
.id-opts .field { margin: 0; }
.id-opts .field > label {
    display: block; font-size: 13px; color: var(--text-secondary, #5b6675); margin-bottom: 8px;
}
.id-opts .form-select { width: 100%; }

.swatches { display: flex; gap: 10px; align-items: center; }
.id-opts .swatch {
    width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
    border: 2px solid var(--border-color, #e3e8ee); box-sizing: border-box;
}
.id-opts .swatch.on { border-color: var(--primary, #ff6b00); box-shadow: 0 0 0 2px rgba(255,107,0,.25); }

.preview-area { margin: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.crop-wrap {
    position: relative; display: inline-block; line-height: 0;
    max-width: 100%; touch-action: none; user-select: none;
    border: 1px solid var(--line, #e3e8ef); border-radius: 8px; overflow: hidden;
    cursor: grab;
}
.crop-wrap:active { cursor: grabbing; }
.crop-canvas { display: block; }
.crop-box {
    position: absolute; border: 1px solid var(--primary, #ff6b00);
    box-sizing: border-box; pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0,0,0,.28);
}
.crop-box::before {
    content: ""; position: absolute; inset: 0;
    background:
        linear-gradient(rgba(255,107,0,.55) 1px, transparent 1px) 0 33% / 100% 1px no-repeat,
        linear-gradient(rgba(255,107,0,.55) 1px, transparent 1px) 0 66% / 100% 1px no-repeat,
        linear-gradient(90deg, rgba(255,107,0,.55) 1px, transparent 1px) 33% 0 / 1px 100% no-repeat,
        linear-gradient(90deg, rgba(255,107,0,.55) 1px, transparent 1px) 66% 0 / 1px 100% no-repeat;
    pointer-events: none;
}
.result-box { margin: 16px 0; }
.result-box .canvas-box { display: inline-block; }
.result-box .row-label { font-size: 13px; color: var(--text-secondary, #5b6675); margin-bottom: 8px; }
.result-canvas { max-width: 240px; height: auto; border: 1px solid var(--line, #e3e8ef); border-radius: 4px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.hidden { display: none !important; }

@media (max-width: 600px) {
    .id-opts { grid-template-columns: 1fr; }
}
