/**
 * CsgModal — 三种显式布局，禁止按页面 ID 写例外。
 * 脚本：__STATIC__/csg_modal/csg_modal.js
 *
 * window（默认）：视口侧滚动，标题/页脚 sticky。
 * body：框内滚动（data-csg-modal-layout="body" / data-csg-modal-body-scroll / modal-dialog-scrollable）。
 * fill：固定视口高度的工具壳（iframe 铺满），data-csg-modal-layout="fill" 或根节点 .csg-modal-fill。
 */

/* —— window：窗口滚动 + 标题固顶 —— */
.csg-modal-window-scroll .modal-dialog {
    max-height: none !important;
    height: auto;
    margin: 1.75rem auto;
}

.csg-modal-window-scroll .modal-content {
    display: block;
    max-height: none !important;
    height: auto;
}

.csg-modal-window-scroll .modal-body {
    overflow: visible !important;
    max-height: none !important;
    height: auto;
    flex: none !important;
}

.csg-modal-window-scroll .modal-header {
    position: sticky;
    top: 0;
    z-index: 1055;
    background: var(--bs-body-bg, #fff);
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.csg-modal-window-scroll .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 1055;
    background: var(--bs-body-bg, #fff);
    border-top: 1px solid var(--bs-border-color, #dee2e6);
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.06);
}

/* —— fill：90vh 工具壳，header/footer 不滚，body 铺满（iframe 或其它填满子件） —— */
.csg-modal-fill .modal-dialog {
    height: 90vh;
    max-height: 90vh;
    margin: 5vh auto;
}

.csg-modal-fill .modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: none;
}

.csg-modal-fill .modal-header,
.csg-modal-fill .modal-footer {
    flex-shrink: 0;
    position: relative;
}

.csg-modal-fill .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.csg-modal-fill .modal-body > iframe,
.csg-modal-fill .csg-modal-fill-loading {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    border: 0;
}

/* 比 Bootstrap modal-xl 更宽的工具壳（评测数据等） */
.csg-modal-wide {
    max-width: min(95vw, 1600px);
}
