.ztxk-table {
  // 动态列配置文本样式
  .ztxk-table__dynamic-text {
    font-size: 12px;
    color: #4285f4;
    cursor: pointer;
  }
  // 表格合计折叠样式
  // 表格合计
  .ztxk-table-summary-collapse {
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    left: 0;
    display: table-cell;
    // overflow: hidden;
    margin: 0 -17px;
    .ztxk-table-summary-collapse-title {
      cursor: pointer;
      padding: 0 12px;
      height: 20px;
      line-height: 20px;
      font-size: 12px;
      background-color: #cdd9e6;
      border-radius: 0 0 4px 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #555555;
      width: 76px;
      > span {
        margin-left: 7px;
      }
    }
  }
  /* 基础样式 */

  // 表头颜色设置
  .ant-table-thead > tr > th {
    background: @title-head-bg;
    .ant-table-column-sorters {
      padding: 0;
    }
  }
  // 这种方式修复表格无数据不出现滚动条，会导致固定列时，列头不对齐
  // .ant-table-scroll-horizontal {
  // 修复：表格数据不够撑开滚动条时，表格body也会预留滚动条位置
  // .ant-table-body {
  //   overflow: auto !important;
  // }
  // 修复：表格无数据时，出现滚动条
  // .ant-table-expanded-row-fixed {
  //   margin: 0 !important;
  // }
  // }
  // 让一些元素能换行显示
  .ant-table-tbody > tr > td {
    button {
      overflow-wrap: break-word;
      white-space: pre-wrap;
      word-break: break-all;
    }
  }
  // 行hover
  .ant-table-tbody > tr.ant-table-row:hover > td {
    background-color: @col-head-bg;
  }
  .ant-table-tbody > tr.ant-table-row > td.ztxk-table--info-td {
    background-color: @global-color;
  }
  .ant-table-tbody > tr.ant-table-row > td.ztxk-table--error-td {
    background-color: @stress-color;
  }
  // 显示行差异
  .ant-table-tbody > tr.ztxk-table--differences {
    background-color: @global-color;
    &:hover {
      > td {
        background-color: @global-color;
      }
    }
    > td {
      background-color: @global-color;
    }
  }
  .react-resizable {
    position: relative;
    background-clip: padding-box;
  }
  .react-resizable-handle {
    position: absolute;
    right: -5px;
    bottom: 0;
    z-index: 1;
    width: 10px;
    height: 100%;
    cursor: col-resize;
  }
  .react-resizable-handle.active::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    border-left: dotted 3px #40a9ff;
  }
  // 设置内容最小高度
  .ant-table-body {
    // 2023-12-13 去掉最小高度
    // min-height: 100px;
    // 无数据时，修改fixed的样式
    .ant-table-expanded-row-fixed {
      // width: 100% !important;
      margin: 0;
      padding: 0;
    }
  }
  // 设置单元格高度
  .ant-table-thead > tr > th,
  .ant-table-tbody > tr > td,
  .ant-table-summary > tr > td {
    height: 36px;
    padding: 0 5px;
    vertical-align: middle;
    // 表格字体颜色设置
    color: rgb(51, 51, 51);
    .ant-select {
      width: 100%;
      .ant-select-selector {
        // 2023-08-09 表格编辑显示边框
        // border: none;
      }
    }
    .ztxk-upload--preview-list__item {
      margin: 4px 0;
    }
  }
  // tbody文字换行方式
  .ant-table-tbody > tr > td {
    word-break: break-all;
  }
  //总结栏样式
  .ant-table-summary > tr > td {
    text-align: left;
    font-weight: bold;
    &:first-child {
      text-align: center;
    }
  }
  .ztxk-column--adddel-icon {
    font-size: @font-size-text;
    line-height: @font-size-text;
    // color: @weight-3;
    color: @link-color;
    &:hover {
      color: @link-hover-color;
    }
    &:first-child {
      margin-bottom: 4px;
    }
    &:last-child {
      margin-bottom: 0;
    }
  }
  // 单元格错误样式
  td.error-td {
    background: rgb(255, 136, 136) !important;
    border: 1px solid rgb(255, 136, 136) !important;
  }
  /* 基础样式 */

  /* 表头图标样式 */
  .thead-icon {
    cursor: pointer;
  }

  // 可编辑列样式
  .ztxk-table__enhance-cell {
    margin: 0;
    font-size: @font-size-text;
    input,
    .ant-input-affix-wrapper,
    .ant-input-number,
    .ant-select-selector {
      border: none;
      width: 100%;
    }
    &.input-model__input {
      border: 1px solid #d9d9d9;
    }
    .ant-form-item-control-input {
      min-height: auto;
    }
    .ant-input-number {
      min-height: 30px;
      input {
        min-height: 28px;
      }
    }
    .ant-input-affix-wrapper {
      min-height: 30px;
      padding: 0 11px;
      input {
        min-height: 28px;
      }
    }
    .ant-select-single:not(.ant-select-customize-input) .ant-select-selector,
    .ant-select-selector {
      min-height: 30px;
      input {
        min-height: 28px;
      }
    }
    .ant-input-number-input {
      text-align: left !important;
    }
  }
  .ztxk-table__enhance-cell-wrap {
    padding: 4px;
    min-height: 30px;
    cursor: pointer;
    border: 1px solid #d9d9d9;
    &:hover {
      border-color: #40a9ff;
    }
  }
  .ztxk-table__enhance-cell-wrap--disabled {
    color: rgba(0, 0, 0, 0.25);
    background-color: #f5f5f5;
    border-color: #d9d9d9;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
    &:hover {
      border-color: #d9d9d9;
    }
  }
  .ztxk-table__enhance-row {
    &:hover {
      .ztxk-table__enhance-cell-wrap {
        border-radius: 2px;
      }
    }
    &.drop-over-downward td {
      border-bottom: 2px dashed #1890ff;
    }
    &.drop-over-upward td {
      border-top: 2px dashed #1890ff;
    }
  }

  // 其他样式
  .zt-btn-link {
    padding: 0;
    margin-right: 5px;
  }
  .ant-dropdown-trigger {
    margin-right: 0;
  }

  // flex布局
  &.ztxk-table--flex {
    height: 100%;
    > .ant-spin-nested-loading {
      height: 100%;
      > .ant-spin-container {
        height: 100%;
        > .ant-table {
          height: 100%;
          > .ant-table-container {
            height: 100%;
            display: flex;
            flex-direction: column;
            > .ant-table-body {
              flex: 1;
              max-height: none !important;
            }
          }
        }
      }
    }
  }

  // 必填
  .ztxk-column--required {
    font-style: normal;
    color: @stress;
  }

  .ztxk-table--title-stress {
    font-style: normal;
    color: @stress;
  }

  // 排序相关样式
  .ztxk-table--sorter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    .ztxk-table--sorter-title {
      flex-grow: 1;
    }
    .ztxk-table--sorter-icon {
      color: #bfbfbf;
      font-size: 0;
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      cursor: pointer;
    }
  }

  // 过滤列的样式问题
  .ant-table-filter-trigger {
    margin: 0;
  }
}

.ztxk-table--wrapper-container {
  .ztxk-table--exit-fullscreen {
    position: absolute;
    width: 100px;
    text-align: center;
    margin-left: -50px;
    top: 30px;
    left: 50%;
    z-index: 1001;
    background: @white;
    padding: 10px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.8s;
    cursor: pointer;
    border-radius: 10px;
    color: @global-text-color;
  }
  &:hover {
    .ztxk-table--exit-fullscreen {
      opacity: 0.8;
    }
  }
  // 表格标题栏
  .ztxk-table-title {
    background: @title-head-bg;
    padding: 8px 5px;
    border: 1px solid #f0f0f0;
    border-bottom: none;
    font-weight: 500;
  }
}

.error-popover {
  .ant-popover-inner-content {
    padding: 6px 10px;
    color: rgb(255, 136, 136);
  }
}

// 兼容全屏时，分页器弹出层样式
.ztxk-table--fullscreen {
  .ant-pagination-options {
    .ant-select-dropdown {
      top: -140px !important;
    }
  }
}
.ztxk-table--pagination--select-top {
  top: -140px !important;
}

// 列头过滤相关样式
.ztxk-table--filter {
  padding: 6px;
  max-width: 220px;
  input::placeholder {
    font-size: 12px;
  }
  .ztxk-table--filter__checkbox-container {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
    margin-bottom: 8px;
    max-height: 200px;
    width: 200px;
    overflow-y: auto;
    .ant-checkbox-wrapper {
      margin-left: 0;
    }
    .ant-checkbox + span {
      text-overflow: ellipsis;
      display: block;
      white-space: nowrap;
      overflow: hidden;
    }
  }
  .ztxk-table--filter__btn-container {
    button {
      margin-right: 10px;
      &:last-child {
        margin-right: 0;
      }
      .anticon {
        line-height: inherit;
      }
    }
  }
}

// 表格动态头部样式
.ztxk-table-dynamic--header {
  margin-bottom: @margin-base;
  > button {
    margin-right: @margin-base;
    margin-bottom: 0;
    &:last-child {
      margin-right: 0;
    }
    &.ant-btn > .anticon + span,
    &.ant-btn > span + .anticon {
      margin-left: 2px;
    }
  }
}

// 框选合计样式
.ztxk-table-subtotal--tip {
  position: absolute;
  max-width: calc(200px * var(--zt-scale-factor, 1));
  background-color: #fff;
  border-radius: calc(4px * var(--zt-scale-factor, 1));
  box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px #00000014,
    0 9px 28px 8px #0000000d;
  padding: calc(10px * var(--zt-scale-factor, 1));
  top: -1000px;
  left: -1000px;
  z-index: 5;
}

.ztxk-table--select-none {
  user-select: none;
  * {
    user-select: none;
  }
  td.move-selected {
    user-select: none;
  }
}
.ztxk-table {
  .ant-table-tbody {
    td.move-selected {
      border: 1px solid #4285f4 !important;
      border-right: 1px solid #4285f4 !important;
    }
  }
}
