/* ============================================================
   DSH 前端修复（三）：表格里的长文件名 / 包名显示不完整
   ------------------------------------------------------------
   实测（AB 包管理页，1926px，未放大）：
     「已构建 B 包」文件名列 49px、「包名」列 49px；「已构建 A 包」文件名列 98px；
     单元格样式是 nowrap + overflow:hidden + text-overflow:ellipsis
     → 长文件名与包名只露出开头一小截；页面放大后更短。
   原因：antd 给带 ellipsis 的列配了 table-layout:fixed，固定的
         「大小/构建时间/操作」列先占满宽度，文本列被压到几十像素。
   修法：
     ① 只有含 ellipsis 列的表格改回 table-layout:auto（按内容分配列宽）
     ② ellipsis 单元格允许换行、任意位置断行 —— 完整内容始终在
     ③ 文本列给下限宽度（否则会被压成 1 字宽、行高被撑爆）
     ④ 视口变窄（= 页面放大）时列表卡片整行独占，表格横向空间翻倍
   ============================================================ */

/* ① 按内容分配列宽（只影响有省略号列的表格） */
.ant-table:has(.ant-table-cell-ellipsis) table {
  table-layout: auto !important;
  width: 100% !important;
}

/* ② 不再用省略号吃掉内容：必要时整段换行（保留自然断行点，避免把 com.pro.viewer 从中间劈开） */
.ant-table-tbody > tr > td.ant-table-cell-ellipsis {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.45 !important;
}
.ant-table-tbody > tr > td.ant-table-cell-ellipsis > span,
.ant-table-tbody > tr > td.ant-table-cell-ellipsis > div {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}

/* ③ 文本列下限宽度：避免被压成 1 字宽导致行高暴涨 */
.ant-table:has(.ant-table-cell-ellipsis) .ant-table-thead > tr > th.ant-table-cell-ellipsis,
.ant-table:has(.ant-table-cell-ellipsis) .ant-table-tbody > tr > td.ant-table-cell-ellipsis {
  min-width: 110px !important;
}
/* 首列（文件名）再多给一点 */
.ant-table:has(.ant-table-cell-ellipsis) .ant-table-thead > tr > th:first-child,
.ant-table:has(.ant-table-cell-ellipsis) .ant-table-tbody > tr > td:first-child {
  min-width: 150px !important;
}
/* 表头单行；大小/时间/操作不换行 */
.ant-table-thead > tr > th.ant-table-cell-ellipsis {
  white-space: nowrap !important;
}
.ant-table:has(.ant-table-cell-ellipsis) .ant-table-tbody > tr > td:last-child {
  white-space: nowrap !important;
}

/* 万一仍然超出，允许表格自己横向滚动，而不是把内容裁掉 */
.ant-table:has(.ant-table-cell-ellipsis) .ant-table-content {
  overflow-x: auto !important;
}

/* ④ 视口变窄（页面放大）时，三张卡片改为上下排列，列表拿到整行宽度 */
@media (max-width: 1500px) {
  .ant-col-lg-8 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}
