/**
 * 弹层 / 模态框内表单项标签加粗（与若依后台表单风格一致）
 * - layui layer 内嵌 HTML（type:1）同页弹层
 * - Bootstrap 模态框 body
 * - layer type=2 打开页面为 iframe 时，子页 .layui-layer-content 内 .form-horizontal 同样生效
 */
.layui-layer-content .form-group > label:not(.radio-inline):not(.checkbox-inline),
.layui-layer-content .form-horizontal .form-group > label.control-label,
.modal-body .form-group > label:not(.radio-inline):not(.checkbox-inline),
.modal-body .form-horizontal .form-group > label.control-label {
    font-weight: 700 !important;
}

/* 同 layer / 模态框内行内单选、多选标签 */
.layui-layer-content .form-group label.radio-inline,
.layui-layer-content .form-group label.checkbox-inline,
.modal-body .form-group label.radio-inline,
.modal-body .form-group label.checkbox-inline {
    font-weight: 700 !important;
}

/* 标签正下方紧跟的 help 说明也加粗（与标签同属说明区） */
.layui-layer-content .form-group > label + .help-block,
.layui-layer-content .form-group > label + p.help-block,
.modal-body .form-group > label + .help-block,
.modal-body .form-group > label + p.help-block {
    font-weight: 700 !important;
}

/* ========== 横排表单：左侧 control-label（含 layer iframe 子页）========== */
.form-horizontal .form-group > label.control-label,
.form-horizontal .form-group > label:not(.radio-inline):not(.checkbox-inline) {
    font-weight: 700 !important;
}

/* 横排下首段静态文案若作标题用时加粗 */
.form-horizontal .form-group > div[class*="col-sm-"] > .form-control-static:first-child,
.form-horizontal .form-group > div[class*="col-sm-"] > p.form-control-static:first-child,
.form-horizontal .form-group > div[class*="col-md-"] > .form-control-static:first-child,
.form-horizontal .form-group > div[class*="col-md-"] > p.form-control-static:first-child {
    font-weight: 700 !important;
}

/* 横排控件区域内的 help-block 加粗 */
.form-horizontal .form-group .help-block,
.form-horizontal .form-group p.help-block {
    font-weight: 700 !important;
}

/* 零售录入/编辑：模块页 layer，小屏贴边留白（与开台弹窗视口策略一致） */
.board-layer-retail-modal.layui-layer {
    box-sizing: border-box;
}
/* 弹层打开时禁止背后页面滚动；弹层内滚动链不穿透（移动端触摸） */
html.modal-scroll-lock,
html.modal-scroll-lock body {
    overflow: hidden;
    overscroll-behavior: none;
}
.layui-layer,
.layui-layer .layui-layer-content,
.modal.in,
.modal.in .modal-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.board-layer-scrollable .layui-layer-content {
    overscroll-behavior: contain;
}

/* ========== layer 全屏：桌面端/移动端都必须贴满当前视口 ========== */
body .layui-layer.layui-layer-full {
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
}
body .layui-layer.layui-layer-full .layui-layer-content {
    height: auto !important;
    max-height: none !important;
}
body .board-layer-retail-modal.layui-layer.layui-layer-full {
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
}

/* ========== 弹层 / Bootstrap 模态：关闭按钮触屏可点区域（≥44px，不影响最小化/最大化） ========== */
.layui-layer-setwin .layui-layer-close1,
.layui-layer-setwin .layui-layer-close {
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
/* 透明热区：视觉仍为 16px 图标，可点区域约 44×44px */
.layui-layer-setwin .layui-layer-close1::before,
.layui-layer-setwin .layui-layer-close::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    z-index: 1;
}
.layui-layer-setwin .layui-layer-close2 {
    position: absolute;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.layui-layer-setwin .layui-layer-close2::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    z-index: 1;
}
.modal-header .close {
    position: relative;
    float: right;
    width: 44px;
    height: 44px;
    margin: -8px -8px -8px 0;
    padding: 0;
    font-size: 28px;
    font-weight: 300;
    line-height: 44px;
    text-align: center;
    opacity: 0.55;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.modal-header .close:hover,
.modal-header .close:focus {
    opacity: 0.85;
}

/* 小屏兜底：避免遗漏的固定 width 撑出模块视口 */
@media (max-width: 575px) {
    body .layui-layer {
        max-width: calc(100% - 24px) !important;
        box-sizing: border-box;
    }

    /* 全屏弹层必须贴满模块视口（覆盖上面的窄屏兜底宽度/左右留白） */
    body .layui-layer.layui-layer-full {
        left: 0 !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
    }
    body .layui-layer.layui-layer-full .layui-layer-content {
        height: auto !important;
        max-height: none !important;
    }

    .board-layer-retail-modal.layui-layer {
        width: calc(100% - 24px) !important;
        max-width: calc(100% - 24px) !important;
        left: 12px !important;
        right: 12px !important;
        margin: 0 auto;
    }

    /* 零售弹层全屏：同样必须贴边铺满 */
    .board-layer-retail-modal.layui-layer.layui-layer-full {
        left: 0 !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
    }
    .board-layer-retail-modal .layui-layer-btn a,
    body .layui-layer .layui-layer-btn a {
        padding: 0 12px;
        font-size: 13px;
    }
}
