/* =========================================================
   ui-consistency.css — 模块主界面统一规范
   ---------------------------------------------------------
   目标：让仪表盘 / 合同 / 项目 / 系统 / 往来单位 /
        商品 / 数据字典 / 报表 八个模块的主界面在
        页头、工具栏、表格、分页、间距、控件尺寸与
        按钮语义上保持同一套标准（Apple HIG 基调）。

   加载顺序：所有模块 CSS 之后，用于收敛各模块的局部差异。
   仅做视觉微调，不改变模块功能与交互逻辑。
   ========================================================= */

:root {
    --ui-page-height: calc(100vh - 100px);
    --ui-page-min-height: 560px;
    --ui-pad-x: 10px;
    --ui-pad-y: 8px;
    --ui-gap: 8px;
    --ui-control-h: 32px;
    --ui-control-radius: 8px;
    --ui-table-head-h: 36px;
    --ui-table-row-h: 38px;
    --ui-brand-red: #f73b6a;
}

/* ---------------------------------------------------------
   1. 页面骨架
   --------------------------------------------------------- */
/* 系统 / 报表原先按内容撑高，统一为与合同、基础资料一致的满高工作区 */
#mod-system > .mod-card,
#mod-reports > .mod-card {
    height: var(--ui-page-height);
    min-height: var(--ui-page-min-height);
    display: flex;
    flex-direction: column;
}

/* 顶栏已显示模块名，移除卡片内重复标题，避免两行标题 */
#mod-system > .mod-card > .mod-card-header,
#mod-reports > .mod-card > .mod-card-header {
    display: none;
}

#mod-system > .mod-card > .mod-card-body,
#mod-reports > .mod-card > .mod-card-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: var(--ui-pad-y) var(--ui-pad-x);
}

#mod-system > .mod-card > .mod-card-body {
    overflow-y: auto;
}

#mod-reports > .mod-card > .mod-card-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    overflow-y: auto;
}

/* 列表型模块统一内边距与纵向间距 */
#mod-contracts .ctr-page,
#mod-partners .bd-page,
#mod-goods .bd-page,
#mod-flat-dicts .bd-page {
    height: var(--ui-page-height);
    min-height: var(--ui-page-min-height);
}

#mod-contracts .ctr-page-body,
#mod-partners .bd-page-body,
#mod-goods .bd-page-body,
#mod-flat-dicts .bd-page-body {
    padding: var(--ui-pad-y) var(--ui-pad-x) var(--ui-pad-x);
    gap: var(--ui-gap);
}

/* 首页 / 项目页统一区块间距，并与卡片内边距对齐左右边缘 */
#mod-dashboard .dsh,
#mod-projects .pjv {
    gap: 12px;
    padding-left: var(--ui-pad-x);
    padding-right: var(--ui-pad-x);
}

/* 仪表盘不再单独限制 1520px 并居中，左右边缘与其它模块保持一致 */
#mod-dashboard .dsh {
    max-width: none;
    margin: 0;
}

/* 合同页不再抵消内容区留白，与其它模块保持同一左右边距 */
@media (min-width: 992px) {
    #mod-contracts.module-section {
        margin: 0;
        width: auto;
        max-width: 100%;
    }

    #mod-contracts .ctr-page-body {
        height: 100%;
    }
}

#mod-contracts .ctr-searchbar {
    flex-wrap: wrap;
    height: auto;
}

/* Bootstrap 弹窗表单：字号与页面表单一致，避免占位提示被基础 17px 规则放大 */
.modal .form-control,
.modal .form-select {
    font-size: var(--font-size-sm);
}

/* 合同表单字段：沿用原表单网格，但控件规格统一走 DS 令牌 */
#ctrForm .ctr-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ds-form-gap, 16px);
}

#ctrForm .ctr-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

#ctrForm .ctr-form-group.full-width {
    grid-column: 1 / -1;
}

#ctrForm .ctr-form-group > label {
    font-size: var(--ds-text-sm, 12px);
    font-weight: var(--ds-font-weight-medium, 500);
    color: var(--color-text-secondary);
}

#ctrForm .ctr-form-group input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
#ctrForm .ctr-form-group select,
#ctrForm .ctr-form-group textarea {
    width: 100%;
    min-height: var(--ds-control-h, 32px);
    padding: 0 10px;
    border: 1px solid var(--color-input-border);
    border-radius: var(--ds-radius-input, 6px);
    background: var(--color-input-bg);
    color: var(--color-text);
    font-family: inherit;
    font-size: var(--ds-text-body-sm, 12.5px);
    outline: none;
    transition: border-color var(--ds-motion-fast, 140ms) var(--ds-ease-standard, ease),
                box-shadow var(--ds-motion-fast, 140ms) var(--ds-ease-standard, ease);
}

#ctrForm .ctr-form-group textarea {
    min-height: 88px;
    padding: 8px 10px;
    resize: vertical;
}

#ctrForm .ctr-form-group input:focus,
#ctrForm .ctr-form-group select:focus,
#ctrForm .ctr-form-group textarea:focus {
    border-color: var(--color-primary);
    box-shadow: var(--ds-focus-ring, 0 0 0 3px rgba(0, 122, 255, 0.12));
}

/* 合同详情：切换页签时保持弹窗尺寸不变，内容在内部滚动 */
#ctrDetailModal .ds-modal__dialog {
    height: 88vh;
    max-height: 88vh;
}

#ctrDetailModal .ds-modal__body {
    min-height: 0;
    overflow-y: auto;
}

/* ---------------------------------------------------------
   2. 页头
   --------------------------------------------------------- */
#mod-dashboard .dsh-head,
#mod-projects .pjv-page-head {
    align-items: flex-end;
    gap: 12px;
    padding: 0 2px 2px;
}

#mod-dashboard .dsh-title,
#mod-projects .pjv-page-head h1 {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.02em;
}

#mod-dashboard .dsh-eyebrow {
    margin-bottom: 6px;
    font-size: 12px;
}

#mod-dashboard .dsh-sub,
#mod-projects .pjv-page-sub {
    margin-top: 6px;
    font-size: 12.5px;
    gap: 8px;
}

#mod-dashboard .dsh-seg {
    height: var(--ui-control-h);
    padding: 2px;
}

#mod-dashboard .dsh-seg button {
    height: 26px;
    padding: 0 11px;
}

/* ---------------------------------------------------------
   3. 工具栏 / 搜索栏
   --------------------------------------------------------- */
.ctr-searchbar,
.bd-searchbar {
    min-height: 42px;
    padding: 5px var(--ui-pad-x);
    gap: 6px;
    border-radius: var(--ui-control-radius);
}

.ctr-searchbar .btn,
.bd-searchbar .btn,
#mod-contracts .ctr-page-body .ctr-searchbar .btn {
    height: var(--ui-control-h);
    min-height: var(--ui-control-h);
    padding: 0 10px;
    border-radius: var(--ui-control-radius);
    font-size: 12px;
    gap: 4px;
}

/* 合同搜索栏按钮更紧凑，确保 11 个操作单行排布 */
#mod-contracts .ctr-page-body .ctr-searchbar .btn {
    padding: 0 7px;
}

.ctr-searchbar .ctr-search-input,
.bd-searchbar .ctr-search-input {
    width: 220px;
    height: var(--ui-control-h);
    min-height: var(--ui-control-h);
    border-radius: 6px;
}

/* 合同搜索栏压缩输入框，为一行按钮留出空间 */
.ctr-searchbar .ctr-search-input {
    flex: 0 1 160px;
    width: 160px;
    min-width: 120px;
}

.ctr-searchbar .bd-select,
.bd-searchbar .bd-select {
    height: var(--ui-control-h);
    min-height: var(--ui-control-h);
    border-radius: 6px;
}

.ctr-searchbar .ctr-search-label,
.bd-searchbar .ctr-search-label {
    font-size: 12.5px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

#mod-partners .prt-incomplete-filter {
    font-size: 12.5px;
}

.ctr-toolbar-right {
    margin-left: auto;
    flex: 0 0 auto;
    min-width: 0;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: nowrap;
}

/* 合同工具栏：搜索、设置列/导出/导入、行操作全部保持单行 */
.ctr-toolbar-secondary {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: nowrap;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* 项目页头按钮与其它模块保持一致 */
#mod-projects .pjv-btn,
#mod-dashboard .dsh-btn {
    height: var(--ui-control-h);
    padding: 0 12px;
    border-radius: var(--ui-control-radius);
    font-size: 12.5px;
    gap: 6px;
}

/* ---------------------------------------------------------
   4. 按钮语义色（统一收敛合同工具栏的七彩配色）
   --------------------------------------------------------- */
/* 主操作：查询 / 新增 */
.ctr-btn-query,
.ctr-btn-add {
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    color: #fff;
}

.ctr-btn-query:hover,
.ctr-btn-add:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #fff;
}

/* 普通操作：统一中性描边，悬停时使用品牌蓝 */
.ctr-btn-outline,
.ctr-btn-edit,
.ctr-btn-view,
.ctr-btn-print,
.ctr-btn-plan {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.ctr-btn-outline:hover,
.ctr-btn-edit:hover,
.ctr-btn-view:hover,
.ctr-btn-print:hover,
.ctr-btn-plan:hover {
    background: var(--color-primary-bg);
    border-color: var(--color-primary-border);
    color: var(--color-primary);
}

/* 审核 / 反审保留语义色，但统一为浅描边风格 */
.ctr-btn-approve {
    background: var(--color-card);
    border: 1px solid var(--color-success-border);
    color: #15803d;
}

.ctr-btn-approve:hover {
    background: var(--color-success-bg);
    border-color: var(--color-success);
    color: #15803d;
}

.ctr-btn-unapprove {
    background: var(--color-card);
    border: 1px solid var(--color-warning-border);
    color: #b45309;
}

.ctr-btn-unapprove:hover {
    background: var(--color-warning-bg);
    border-color: var(--color-warning);
    color: #b45309;
}

/* 删除：统一品牌红 */
.ctr-btn-del {
    background: var(--color-card);
    border: 1px solid rgba(247, 59, 106, 0.35);
    color: var(--ui-brand-red);
}

.ctr-btn-del:hover {
    background: rgba(247, 59, 106, 0.08);
    border-color: var(--ui-brand-red);
    color: var(--ui-brand-red);
}

[data-theme="dark"] .ctr-btn-approve {
    color: #4ade80;
}

[data-theme="dark"] .ctr-btn-unapprove {
    color: #fbbf24;
}

[data-theme="dark"] .ctr-btn-del {
    color: #ff6b93;
    border-color: rgba(247, 59, 106, 0.5);
}

/* ---------------------------------------------------------
   5. 表格
   --------------------------------------------------------- */
.bd-table thead th,
.ctr-list-table thead th,
.rpt-table thead th,
.mod-contracts-table thead th {
    height: var(--ui-table-head-h);
    padding: 4px var(--ui-pad-x);
    background: var(--color-bg);
    color: var(--color-text-tertiary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--color-border);
}

.bd-table tbody td,
.ctr-list-table tbody td,
.rpt-table tbody td,
.mod-contracts-table tbody td,
#mod-contracts #ctrMainTable tbody td {
    height: var(--ui-table-row-h);
    padding: 4px var(--ui-pad-x);
    font-size: 13px;
    vertical-align: middle;
}

#mod-contracts #ctrMainTable thead th {
    padding: 4px var(--ui-pad-x);
}

/* 空状态 / 加载态统一留白与颜色 */
.bd-table tbody td[colspan],
.ctr-list-table tbody td[colspan],
.rpt-table tbody td[colspan],
.mod-contracts-table tbody td[colspan] {
    height: auto;
    padding: 36px 12px;
    color: var(--color-text-tertiary);
    font-size: 13px;
    text-align: center;
}

/* 表格内小按钮保持紧凑，不与工具栏按钮混淆 */
.bd-table .btn-sm {
    height: 24px;
    min-height: 24px;
    padding: 0 8px;
    font-size: 12px;
}

/* ---------------------------------------------------------
   6. 分页
   --------------------------------------------------------- */
.mod-contracts-pagination,
.bd-main .prt-pagination,
.bd-main .gds-pagination {
    min-height: 36px;
    padding: 5px var(--ui-pad-x);
    border-top: 1px solid var(--color-border-light);
    font-size: 12px;
}

.mod-contracts-pagination .page-btns button,
.bd-main .page-btns button,
#mod-contracts .mod-contracts-pagination .page-btns button {
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-card);
    color: var(--color-text-secondary);
    font-size: 12px;
}

.mod-contracts-pagination .page-btns button:hover:not(:disabled),
.bd-main .page-btns button:hover:not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ---------------------------------------------------------
   7. 系统管理
   --------------------------------------------------------- */
#mod-system .fin-tabs {
    gap: 6px;
    margin-bottom: var(--ui-gap);
    padding-bottom: 10px;
}

#mod-system .fin-tab-btn {
    height: var(--ui-control-h);
    padding: 0 14px;
    border-radius: var(--ui-control-radius);
    font-size: 12.5px;
}

#mod-system .fin-tab-content {
    padding-bottom: 2px;
}

#mod-system > .mod-card > .mod-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--ui-gap);
}

#mod-system .fin-tab-content.active {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

#mod-system .fin-tab-content.active[data-systab="users"],
#mod-system .fin-tab-content.active[data-systab="roles"],
#mod-system .fin-tab-content.active[data-systab="logs"],
#mod-system .fin-tab-content.active[data-systab="logins"],
#mod-system .fin-tab-content.active[data-systab="scheduler"],
#mod-system .fin-tab-content.active[data-systab="data"],
#mod-system .fin-tab-content.active[data-systab="taxrates"] {
    display: flex;
    flex-direction: column;
    gap: var(--ui-gap);
}

#mod-system .fin-tab-content.active .ds-panel {
    flex: 1 1 auto;
    min-height: 0;
}

#mod-system .fin-tab-content.active[data-systab="data"] .ds-panel {
    flex: 0 0 auto;
    max-height: 46vh;
}

/* 系统管理各页签：工具条、说明和统计块按内容高度展示，避免被 flex 压扁后互相遮挡 */
#mod-system .fin-tab-content.active > .ds-toolbar,
#mod-system .fin-tab-content.active > .ds-hint,
#mod-system .fin-tab-content.active > .sys-backup-location,
#mod-system .fin-tab-content.active > .sys-storage-panel,
#mod-system .fin-tab-content.active > .sys-backup-hint {
    flex: 0 0 auto;
}

/* 备份目录提示独占一行，告警用深琥珀色 + 浅底，避免黄字白底看不清 */
#sysBackupFolderHint {
    flex: 1 0 100%;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 2px;
    line-height: 1.5;
    word-break: break-all;
}

#sysBackupFolderHint:empty { display: none; }

#sysBackupFolderHint.is-warning {
    padding: 6px 10px;
    border-radius: var(--ds-radius-xs);
    background: var(--ds-color-warning-soft);
    color: var(--ds-btn-warning-text);
}

[data-theme="dark"] #sysBackupFolderHint.is-warning {
    color: var(--color-warning);
}

/* 系统页签内的工具条与其它模块搜索栏同高、同圆角 */
#mod-system .mod-contracts-toolbar {
    min-height: 42px;
    gap: 6px;
    margin-bottom: var(--ui-gap);
    padding: 5px var(--ui-pad-x);
    border: 1px solid var(--color-border);
    border-radius: var(--ui-control-radius);
    background: var(--color-card);
}

#mod-system .mod-contracts-toolbar .search-box {
    flex: 0 1 220px;
    min-width: 180px;
    max-width: 220px;
}

#mod-system .mod-contracts-toolbar .search-box input {
    height: var(--ui-control-h);
    min-height: var(--ui-control-h);
    padding: 0 10px 0 32px;
    border-radius: 6px;
    font-size: 12.5px;
}

#mod-system .mod-contracts-toolbar .search-box i {
    left: 10px;
    font-size: 13px;
}

#mod-system .mod-contracts-toolbar select,
#mod-system .mod-contracts-toolbar .form-select,
#mod-system .mod-contracts-toolbar .form-control {
    height: var(--ui-control-h);
    min-height: var(--ui-control-h);
    padding: 0 30px 0 10px;
    border-radius: 6px;
    font-size: 12.5px;
}

#mod-system .mod-contracts-toolbar .btn {
    height: var(--ui-control-h);
    min-height: var(--ui-control-h);
    padding: 0 10px;
    border-radius: var(--ui-control-radius);
    font-size: 12px;
}

#mod-system .mod-contracts-table-wrap {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: none;
}

#mod-system .mod-contracts-pagination {
    margin-top: var(--ui-gap);
    padding: 0;
}

/* ---------------------------------------------------------
   8. 报表中心
   --------------------------------------------------------- */
#mod-reports .rpt-layout {
    height: auto;
    min-height: 0;
    gap: var(--ui-pad-x);
    padding: 0;
    align-items: flex-start;
}

#mod-reports .rpt-sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    width: 200px;
    min-height: 0;
    max-height: calc(var(--ui-page-height) - 40px);
    padding-right: var(--ui-pad-x);
    overflow-y: auto;
    background: var(--color-card);
    z-index: 1;
}

#mod-reports .rpt-main {
    height: auto;
    overflow: visible;
    padding-right: 0;
}

#mod-reports .rpt-head {
    margin-bottom: var(--ui-pad-x);
}

#mod-reports .rpt-filters {
    padding: 8px;
    border-radius: 8px;
    margin-bottom: var(--ui-pad-x);
    gap: 8px 10px;
}

#mod-reports .rpt-filter-actions {
    align-items: flex-end;
    gap: 4px;
}

#mod-reports .rpt-filter-actions .btn {
    height: var(--ui-control-h);
    min-height: var(--ui-control-h);
    padding: 0 8px;
    border-radius: var(--ui-control-radius);
    font-size: 12px;
}

#mod-reports .rpt-filter-sep {
    width: 1px;
    height: 20px;
    align-self: center;
    background: var(--color-border);
}

/* ---------------------------------------------------------
   8.2 图标重心：按钮/页签图标按视觉重心轻微下移
   --------------------------------------------------------- */
.ctr-searchbar .btn i,
.bd-searchbar .btn i,
#mod-system .mod-contracts-toolbar .btn i,
#mod-projects .pjv-btn i,
#mod-dashboard .dsh-btn i,
#mod-reports .rpt-filter-actions .btn i {
    position: relative;
    top: 0.5px;
}

#mod-reports .rpt-title {
    font-size: 16px;
}

#mod-reports .rpt-table-wrap {
    max-height: none;
    border-radius: 8px;
}

/* 报表列多：表头加深、单元格收紧，宽屏下尽量完整显示 */
#mod-reports .ds-table thead th {
    color: var(--color-text-secondary);
    padding-left: 8px;
    padding-right: 8px;
}

#mod-reports .ds-table tbody td {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 12.5px;
}

#mod-reports .ds-panel__body {
    scrollbar-gutter: stable;
}

/* 项目树形表格表头与其它模块同一字号/字重 */
#mod-projects .pjv-table thead th {
    height: var(--ui-table-head-h);
    padding: 0 var(--ui-pad-x);
    color: var(--color-text-tertiary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
}

#mod-projects .pjv-table thead th.is-sorted {
    font-weight: 700;
}

/* ---------------------------------------------------------
   8.1 表格列对齐：金额右对齐、状态/操作居中或右对齐
   --------------------------------------------------------- */
/* 合同：金额列右对齐，合计同步 */
#mod-contracts .ctr-list-table th.ctr-col-amount,
#mod-contracts .ctr-list-table td.ctr-amount,
#mod-contracts .ctr-main-foot-table td.ctr-foot-amount {
    text-align: right;
}

/* 合同：审核状态 / 执行情况 / 收付类型居中 */
#mod-contracts .ctr-list-table th.ctr-col-status,
#mod-contracts .ctr-list-table th.ctr-col-exec,
#mod-contracts .ctr-list-table th.ctr-col-type,
#mod-contracts #ctrMainTable tbody td:nth-child(8),
#mod-contracts #ctrMainTable tbody td:nth-child(9),
#mod-contracts #ctrMainTable tbody td:nth-child(10) {
    text-align: center;
}

/* 项目：金额表头跟随数据右对齐，状态列居中 */
#mod-projects .pjv-table thead th.pjv-num {
    text-align: right;
}

#mod-projects .pjv-table th[data-col="status"],
#mod-projects .pjv-table td[data-col="status"] {
    text-align: center;
}

/* 系统：操作列表头与行内按钮同为右对齐 */
#mod-system .sys-col-actions {
    text-align: right;
}

#mod-system .fin-tab-content[data-systab="users"] .mod-contracts-table th:nth-child(5),
#mod-system .fin-tab-content[data-systab="users"] .mod-contracts-table td:nth-child(5) {
    text-align: center;
}

/* ---------------------------------------------------------
   9. 卡片圆角统一（首页 / 项目 KPI）
   --------------------------------------------------------- */
#mod-dashboard .dsh-kpi,
#mod-dashboard .dsh-card,
#mod-projects .pjv-kpi {
    border-radius: 14px;
}

/* ---------------------------------------------------------
   10. 滚动条统一
   --------------------------------------------------------- */
#mod-system > .mod-card > .mod-card-body,
#mod-reports .rpt-main,
#mod-reports .rpt-sidebar,
.bd-table-scroll,
.ctr-table-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-strong) transparent;
}

/* ---------------------------------------------------------
   11. 响应式
   --------------------------------------------------------- */
@media (max-width: 991.98px) {
    #mod-system > .mod-card,
    #mod-reports > .mod-card {
        height: auto;
        min-height: 0;
    }

    #mod-system > .mod-card > .mod-card-body,
    #mod-reports > .mod-card > .mod-card-body {
        overflow: visible;
    }

    #mod-reports .rpt-layout {
        flex-direction: column;
    }

    #mod-reports .rpt-sidebar {
        width: 100%;
        padding: 0 0 var(--ui-pad-x);
        border-right: 0;
        border-bottom: 1px solid var(--color-border-light);
    }

    #mod-reports .rpt-main {
        height: auto;
        overflow: visible;
    }

    .ctr-searchbar .ctr-search-input,
    .bd-searchbar .ctr-search-input {
        width: auto;
        flex: 1 1 160px;
    }

    /* 合同搜索栏窄屏仍保持单行，输入框限宽，超出部分横向滚动 */
    .ctr-searchbar .ctr-search-input {
        width: 120px;
        flex: 0 1 120px;
    }
}

/* =========================================================
   2026-10-31 其他主界面跟随内容区高度（桌面端）
   目标：整页不再出现纵向滚动，滚动发生在模块内部
   ========================================================= */
@media (min-width: 992px) {
    #mod-dashboard.module-section,
    #mod-projects.module-section,
    #mod-partners.module-section,
    #mod-goods.module-section,
    #mod-flat-dicts.module-section,
    #mod-reports.module-section,
    #mod-system.module-section {
        height: 100%;
        min-height: 0;
    }

    /* 仪表盘：整页内容在模块内滚动，左右留白与其它模块一致 */
    #mod-dashboard .dsh {
        height: 100%;
        min-height: 0;
        overflow-y: auto;
        scrollbar-gutter: stable;
    }

    /* 基础资料：卡片撑满，表格区域内部滚动 */
    #mod-partners .bd-page,
    #mod-goods .bd-page,
    #mod-flat-dicts .bd-page {
        height: 100%;
        min-height: 0;
    }

    /* 项目列表：工作区撑满，表格内部滚动 */
    #mod-projects .pjv {
        height: 100%;
        min-height: 0;
    }
    #mod-projects .pjv-workspace {
        flex: 1 1 auto;
        min-height: 0;
        align-items: stretch;
    }
    #mod-projects .pjv-rail {
        max-height: none;
        overflow-y: auto;
    }
    #mod-projects .pjv-main {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    #mod-projects .pjv-table-card {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }

    /* 项目详情：模块内部滚动 */
    #mod-projects .pdv {
        height: 100%;
        min-height: 0;
        overflow-y: auto;
        padding-right: 4px;
    }
    #mod-projects .pdv-rail { top: 0; }

    /* 报表 / 系统管理：卡片撑满，内容区内部滚动 */
    #mod-reports .mod-card,
    #mod-system .mod-card {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    #mod-reports .mod-card > .mod-card-body,
    #mod-system .mod-card > .mod-card-body {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
    }
    #mod-reports .mod-card > .mod-card-body { 
        flex-direction: row;
        align-items: stretch;
        overflow: hidden;
    }
    #mod-system .mod-card > .mod-card-body { flex-direction: column; }
    #mod-reports .rpt-layout {
        flex: 1 1 auto;
        flex-direction: row;
        min-height: 0;
        align-items: stretch;
        overflow: hidden;
    }
    #mod-reports .rpt-sidebar {
        min-height: 0;
        overflow-y: auto;
    }
    #mod-reports .rpt-main {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow-y: auto;
    }
    #mod-system .fin-tabs { flex: 0 0 auto; }
    #mod-system .fin-tab-content.active {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }
}
