/* KCIMTable 统一表格样式（仅保留 pfm 前缀） */

.pfm-ant-table-bordered {
  /* 去掉外层 border，避免与 container 重复 */
  border: none !important;
}

/* 外框统一 */
.pfm-ant-table-bordered .pfm-ant-table-container {
  /* 统一外框，只保留这一层边框 */
  border: 1px solid #dae2f2 !important;
  border-right: none !important;
  border-radius: 8px !important;
  overflow: hidden;
  /* 移除内层 table 可能残留的外边框，避免出现双线 */
  table {
    border: none !important;
  }
}

/* 表头、表体单元格边框 */
.pfm-ant-table-bordered thead > tr > th,
.pfm-ant-table-bordered tbody > tr > td {
  border-right: 1px solid #dae2f2 !important;
  border-bottom: 1px solid #dae2f2 !important;
}

// /* 最后一列、最后一行去掉多余边线 */
// .pfm-ant-table-bordered thead > tr > th:last-child,
// .pfm-ant-table-bordered tbody > tr > td:last-child {
//   border-right: none !important;
// }

.pfm-ant-table-bordered tbody > tr:last-child > td {
  border-bottom: none !important;
}

.pfm-ant-table-bordered thead > tr:first-child > th {
  border-top: none !important;
}

/* 非 bordered 表格：去掉外框及占位行底边，并清理首列/尾列外边线 */
.KCIMTable .pfm-ant-table:not(.pfm-ant-table-bordered) {
  /* 外框 */
  .pfm-ant-table-container {
    border: 1px solid #dae2f2 !important;
    border-radius: 8px !important;
  }

  /* 空数据占位行 */
  .pfm-ant-table-placeholder > td {
    border: none !important;
  }

  /* 行横向分隔线 */
  thead > tr > th,
  tbody > tr > td {
    border-right: none !important;
    border-left: none !important;
    border-bottom: 1px solid #dae2f2 !important;
  }

  /* 表头顶边留给外框；底边已由上述横线提供 */
  thead > tr > th {
    border-top: none !important;
  }

  /* 最后一行去掉底横线，避免与外框重叠 */
  tbody > tr:last-child > td {
    border-bottom: none !important;
  }

  /* 首列保持无左边框，外框自身即为左边框 */
}

/* 通用表头及单元格对齐 */
.KCIMTable .pfm-ant-table {
  .pfm-ant-table-thead > tr > th {
    background: #f5f7fa !important;
    color: #333 !important;
    font-weight: 500 !important;
    text-align: left !important;
  }
  .pfm-ant-table-tbody > tr > td {
    text-align: left !important;
    &:first-child {
      padding-left: 8px !important;
    }
  }
}

/* 针对rowSpan合并单元格导致的边框断裂，补齐竖线，避免多重边框 */
.ant-table-wrapper {
  /* 只针对KCIMTable生效，避免影响全局 */
  .ant-table {
    /* 只补左右竖线，去掉上下边框，避免多重边框 */
    .ant-table-tbody > tr > td[rowspan='0'] {
      border-left: 1px solid #e5e6eb !important;
      border-right: 1px solid #e5e6eb !important;
      border-top: none !important;
      border-bottom: none !important;
      background: #fff;
      padding: 0 !important;
      height: 0 !important;
      min-width: 0 !important;
      max-width: 0 !important;
      line-height: 0 !important;
      font-size: 0 !important;
    }
    /* 首列补齐左边框 */
    .ant-table-tbody > tr > td[rowspan='0']:first-child {
      border-left: 1px solid #e5e6eb !important;
    }
    /* 末列补齐右边框 */
    .ant-table-tbody > tr > td[rowspan='0']:last-child {
      border-right: 1px solid #e5e6eb !important;
    }
  }
}
