/* KCIMTable 自定义样式重写 */
.KCIMTable {
  /* 直接为KCIMTable组件添加边框 */
  border: 1px solid #DAE2F2 !important;
  border-radius: 8px !important;
  overflow: hidden;
  
  /* 确保最外层容器有边框 - 针对ProTable组件 */
  &.ant-pro-table,
  .ant-pro-table {
    border: 1px solid #DAE2F2 !important;
    border-radius: 8px !important;
    overflow: hidden;
  }
  /* 通用样式 - 表格行高设置为40px */
  .pfm-ant-table-tbody > tr:not(.pfm-ant-table-measure-row) > td {
    height: 40px !important;
    padding: 8px 16px !important;
  }

  
  /* 通用样式 - 表头行高设置为40px */
  .pfm-ant-table-thead > tr > th {
    height: 40px !important;
    padding: 8px 16px !important;
    background: #EEF3FA !important; /* 表头背景色 */
    color: #333 !important;
    font-weight: 500 !important;
    border-right: none !important; /* 移除表头列间的竖直分隔线 */
  }
  
  /* 通用样式 - 整个表格组件最外层边框（包含分页） */
  .ant-table-wrapper,
  .pfm-ant-table-wrapper {
    border: 1px solid #DAE2F2 !important;
    border-radius: 8px !important;
    overflow: hidden;
  }
  
  /* 移除内层容器的边框，避免重复 */
  .pfm-ant-table-container {
    border: none !important;
    border-radius: 0 !important;
  }
  
  /* 分页组件样式 */
  .ant-pagination,
  .pfm-ant-pagination {
    height: 40px !important;
    padding: 8px 16px !important;
    margin: 0 !important;
    border-top: 1px solid #DAE2F2 !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
  }
  
  /* 通用样式 - 悬停效果保持 */
  .pfm-ant-table-tbody > tr:hover > td {
    background-color: #f8f9fa !important;
  }
}

/* bordered模式 - 完整边框 */
.KCIMTable .pfm-ant-table-bordered {
  /* 表头边框设置 */
  .pfm-ant-table-thead > tr > th {
    border-bottom: 1px solid #DAE2F2 !important;
    border-right: 1px solid #DAE2F2 !important;
  }
  
  /* 表头最后一列移除右边框 */
  .pfm-ant-table-thead > tr > th:last-child {
    border-right: none !important;
  }
  
  /* 表体所有单元格的边框 */
  .pfm-ant-table-tbody > tr:not(.pfm-ant-table-measure-row) > td {
    border-bottom: 1px solid #DAE2F2 !important;
    border-right: 1px solid #DAE2F2 !important;
  }
  
  /* 表体最后一列移除右边框 - 但保留包含_item_格式data-row-key的行的右边框 */
  .pfm-ant-table-tbody > tr:not(.pfm-ant-table-measure-row):not([data-row-key*="_item_"]) > td:last-child {
    border-right: none !important;
  }
  
  /* 移除最后一行的底边框 */
  .pfm-ant-table-tbody > tr:last-child > td {
    border-bottom: none !important;
  }
  
  /* 移除表头第一行的顶边框 */
  .pfm-ant-table-thead > tr:first-child > th {
    border-top: none !important;
  }
}

/* 非bordered模式 - 只有上下边框 */
.KCIMTable .pfm-ant-table:not(.pfm-ant-table-bordered) {
  /* 只保留上下边框，移除左右边框 */
  .pfm-ant-table-thead > tr > th,
  .pfm-ant-table-tbody > tr:not(.pfm-ant-table-measure-row) > td {
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid #DAE2F2 !important;
  }
  
  /* 移除表头第一行的顶边框 */
  .pfm-ant-table-thead > tr:first-child > th {
    border-top: none !important;
  }
  
  /* 移除最后一行的底边框 */
  .pfm-ant-table-tbody > tr:last-child > td {
    border-bottom: none !important;
  }
}

/* 隐藏表头的列宽拖拽分隔线 */
.pfm-ant-table-column-handle,
.ant-table-column-handle {
  display: none !important;
}

.pfm-ant-table-cell::before {
  display: none !important;
}

.pfm-ant-table-thead > tr > th,
.pfm-ant-table-tbody > tr > td {
  text-align: left !important;
}
