/* +----------------------------------------------------------------------
/* | Static Plugin for ThinkAdmin
/* +----------------------------------------------------------------------
/* | 官方网站: https://thinkadmin.top
/* +----------------------------------------------------------------------
/* | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
/* +----------------------------------------------------------------------
/* | 开源协议 ( https://mit-license.org )
/* | 免责声明 ( https://thinkadmin.top/disclaimer )
/* +----------------------------------------------------------------------
/* | gitee 代码仓库：https://gitee.com/zoujingli/think-plugs-static
/* | github 代码仓库：https://github.com/zoujingli/think-plugs-static
/* +----------------------------------------------------------------------
/* | 自定义后台扩展样式，需要在加载 console.css 后载入
/* | 使用 composer require zoujingli/think-plugs-static 时不会更新此文件
/* +---------------------------------------------------------------------- */
/* ========== 全局基础重置 ========== */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* ========== 外层容器 flex 化 ========== */
.layui-body > .think-page-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;          /* 防止 flex 溢出 */
}

.layui-body .layui-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.layui-body .layui-tab-content {
  flex: 1;
  display: flex;          /* 改为 flex，便于内部卡片撑开 */
  flex-direction: column;
  min-height: 0;
  overflow: auto;         /* 允许整体滚动（可选） */
  padding: 15px;
}

/* ========== 卡片区域占满且可伸缩 ========== */
.layui-tab-content .layui-card {
  display: flex;
  flex-direction: column;
  flex: 1;                /* 卡片填满剩余高度 */
  min-height: 0;
  margin-bottom: 0;
}

.layui-card > .layui-card-header {
  flex-shrink: 0;         /* 表头固定高度 */
}

.layui-card > .layui-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 15px;
}

/* ========== 表格容器（包裹表格的区域） ========== */
.layui-card-body > .layui-card-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ========== layui 表格视图容器 ========== */
.layui-card-table > .layui-table-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: none;           /* 去除边框，可选 */
}

/* ========== 表格盒子（包含表头和表体） ========== */
.layui-table-view > .layui-table-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ========== 表头固定 ========== */
.layui-table-box > .layui-table-header {
  flex-shrink: 0;
}

/* ========== 表体核心样式（高度自适应 + 滚动） ========== */
.layui-table-box > .layui-table-body {
  flex: 1 1 auto;                 /* 允许伸缩，自动分配剩余空间 */
  min-height: 0;                  /* 允许收缩 */
  height: 100% !important;        /* 覆盖 layui 可能设置的固定高度，确保由 flex 分配 */
  max-height: none !important;    /* 移除任何最大高度限制 */
  overflow-y: auto !important;    /* 强制纵向滚动 */
  overflow-x: auto !important;    /* 强制横向滚动 */
}

/* ========== 确保内部表格宽度由内容撑开（实现横向滚动） ========== */
.layui-table-body table {
  width: max-content !important;  /* 让表格宽度由内容决定，突破父容器限制 */
  min-width: 100%;                /* 至少和父容器等宽，避免列数少时空白 */
}

/* ========== 分页条等底部元素固定高度 ========== */
.layui-table-view > .layui-table-total,
.layui-table-view > .layui-table-page {
  flex-shrink: 0;
}

/* ========== 可选：表格内操作栏等布局微调 ========== */
.layui-table-body .layui-table-cell {
  white-space: nowrap;    /* 禁止换行，确保列宽稳定 */
}