@root-entry-name: 'default';
@import (reference) '~antd/es/style/themes/index.less';

@pro-table-prefix-cls: ~'@{ant-prefix}-pro-table';

@font-size-base: 13px;

.pro-table-tooltip-text span {
  color: @component-background;
}

.ls-protable-top-extra {
  padding-top: 8px;
}

.ls-protable-bottom-desc {
  &.is-page {
    width: 50%;
    margin-top: -40px;
  }
}

.ant-pro-table--fullscreen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50 !important;
  overflow: auto;
  background: var(--bg-color, #f9fafb);
}

.@{pro-table-prefix-cls} {
  z-index: inherit; //z-index:1;

  &:not(:root):fullscreen {
    min-height: 100vh;
    overflow: auto;
    background: @component-background;
  }

  &-extra {
    margin-bottom: 10px;
  }

  &-polling {
    .@{pro-table-prefix-cls}-list-toolbar-setting-item {
      .anticon.anticon-reload {
        transform: rotate(0deg);
        animation: turn 1s linear infinite;
      }
    }
  }

  td.@{ant-prefix}-table-cell {
    color: #5b5b5b;

    // user-select: none;

    > a {
      font-size: @font-size-base;
    }
  }

  .@{ant-prefix}-table
    .@{ant-prefix}-table-tbody
    .@{ant-prefix}-table-wrapper:only-child
    .@{ant-prefix}-table {
    margin: 0;
  }

  .@{ant-prefix}-table.@{ant-prefix}-table-middle .@{pro-table-prefix-cls} {
    margin: -12px -8px;
  }

  .ant-card-body {
    padding: 6px 20px;
  }
}

.cell-selected {
  background-color: #f9e4c9 !important;
}

.cell-selected.is-copy {
  background-color: #f6eee5 !important;
}

.ant-pro-table-srcoll {
  display: flex;
  flex-direction: column;

  width: 100%;
  height: 100%;

  .ant-checkbox-checked::after {
    animation: none !important;
    animation-fill-mode: none !important;
    content: none;
  }

  .ant-checkbox-inner,
  .ant-checkbox-inner::after,
  .ant-checkbox-checked .ant-checkbox-inner::after {
    transition: none !important;
  }

  .ant-table-tbody > tr > td {
    transition: none !important;
  }

  .ant-table-summary {
    .total-cell-label {
      padding-right: 0 !important;
      padding-left: 0 !important;
      text-align: right;
    }
  }

  .ant-card {
    flex: 1;
    height: 0;
    overflow: visible;
    border-radius: 8px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.05);

    .ant-card-body {
      display: flex;
      flex-direction: column;
      height: 100%;
      overflow: visible;
    }

    .ant-table-wrapper {
      flex: 1;
      height: 0;

      .ant-spin-nested-loading,
      .ant-spin-container {
        height: 100%;
      }

      .ant-spin-container {
        display: flex;
        flex-direction: column;

        .ant-pagination.mini.ant-table-pagination {
          margin: 10px 0;
        }

        .ant-table {
          flex: 1;
          height: 0;

          .ant-table-container {
            display: flex;
            flex-direction: column;
            height: 100%;

            .ant-table-header {
              border-radius: 4px 4px 0 0;
            }

            div.ant-table-body {
              // overflow: auto !important;
              position: relative;
              flex: 1;
            }

            &::before,
            &::after {
              box-shadow: none;
            }
          }
        }
      }
    }
  }

  .ant-table-placeholder {
    td {
      border-bottom: none;
    }
  }

  .ant-table.ant-table-small tfoot.ant-table-summary tr td:last-child {
    padding-right: 17px !important;
  }

  .resizable-th,
  .react-resizable {
    position: relative;

    &::before {
      // height: 0 !important;
      // width: 0 !important;
    }
  }

  .resizable-th-handle,
  .react-resizable-handle {
    position: absolute;
    top: 50%;
    right: 0px;
    width: 3px;
    height: 1.6em;
    border-left: solid 2px rgba(0, 0, 0, 0.12);
    transform: translateY(-50%);
    cursor: col-resize;
    transition: background-color 0.3s;
  }

  .resizable-th {
    .resizable-th-handle {
      visibility: hidden;
    }

    &:hover {
      .resizable-th-handle {
        z-index: 10;
        visibility: visible;
      }
    }
  }

  .ant-table-cell.ant-table-selection-column {
    text-overflow: inherit !important;
  }

  .ant-table-has-fix-left {
    .ant-table-selection-col {
      width: 36px;
    }
  }

  .ant-table.ant-table-bordered .ant-table-tbody > tr > td {
    border-right: 1px solid #f0f0f0;
  }
}

.ant-table.ant-table-small .ant-table-title,
.ant-table.ant-table-small .ant-table-footer,
.ant-table.ant-table-small .ant-table-thead > tr > th,
.ant-table.ant-table-small .ant-table-tbody > tr > td,
.ant-table.ant-table-small tfoot > tr > th,
.ant-table.ant-table-small tfoot > tr > td {
  padding: 10px 5px;
  // 不让换行。
  white-space: nowrap;
  text-overflow: ellipsis;

  &:not(.ant-table-cell-fix-right-first, .ant-table-cell-fix-left-last),
  &:not(.ant-table-cell-fix-right-first, .ant-table-cell-fix-left-last) {
    overflow: hidden;
  }

  &:first-child {
    padding: 10px 5px 10px 16px;
  }

  &:last-child {
    padding: 10px 16px 10px 5px;
  }

  &.ant-table-cell-fix-right-first {
    padding-left: 15px !important;
  }

  &.ant-table-cell-fix-left-last {
    padding-right: 30px !important;
  }

  &.ant-table-selection-column {
    text-overflow: unset;
  }
}

.ls-pro-table-mini {
  .ant-table.ant-table-small .ant-table-thead > tr > th {
    background-color: #f4f7fd;
    border-bottom: none;
    transition: none;
  }

  .ant-table.ant-table-small .ant-table-title,
  .ant-table.ant-table-small .ant-table-footer,
  .ant-table.ant-table-small .ant-table-thead > tr > th,
  .ant-table.ant-table-small .ant-table-tbody > tr > td,
  .ant-table.ant-table-small tfoot > tr > th,
  .ant-table.ant-table-small tfoot > tr > td {
    box-sizing: border-box;
    height: 32px;
    padding: 5px 10px;
    font-size: @font-size-base;

    .total-label {
      font-size: 12px;
    }

    &:first-child {
      padding: 5px 10px 5px 16px;
    }

    &.ant-table-selection-column,
    &.ant-table-row-expand-icon-cell {
      padding-top: 4px;
      padding-bottom: 4px;
    }

    &:last-child {
      padding: 5px 16px 5px 10px;
    }

    &.ant-table-cell-fix-right-first {
      padding-left: 15px;
    }

    &.ant-table-cell-fix-left-last {
      padding-right: 15px;
    }
  }

  .ant-table-tbody > tr.ant-table-row-current > td {
    background: var(--ant-primary-1);
  }

  .ant-pagination {
    margin: 8px 0;
  }

  .ant-pagination-item-active {
    background: #e4eefa;
    border-color: transparent;
    border-radius: 4px;
  }
}

.ls-pro-table {
  .ant-table-tbody {
    tr:nth-of-type(odd) {
      background-color: #f7fafc;

      .ant-table-cell-fix-left,
      .ant-table-cell-fix-right {
        background-color: #f7fafc;
      }
    }

    .ant-table-cell-fix-left,
    .ant-table-cell-fix-right {
      z-index: 1;
    }

    > tr {
      > td {
        border-bottom: none;
      }
    }

    > tr.ant-table-row-current,
    > tr.ant-table-row-selected,
    > tr.ant-table-row:hover {
      .ant-table-cell-fix-left,
      .ant-table-cell-fix-right,
      > td {
        background-color: #e6f5ff;
      }
    }

    .ant-table-column-sort {
      background: inherit;
    }
  }

  .ant-table-thead tr th {
    background-color: #f5f9ff;
  }
}

.theme-yellow {
  .ls-pro-table {
    .ant-table-tbody {
      tr:nth-of-type(odd) {
        background-color: #fcfaf7;
      }

      tr.ant-table-row-current,
      tr.ant-table-row-selected,
      > tr.ant-table-row:hover {
        .ant-table-cell-fix-left,
        .ant-table-cell-fix-right,
        > td {
          background-color: #ffedd9;
        }
      }
    }
  }

  .cell-selected {
    background-color: #e6f4ff !important;
  }
}

.ant-pro-card-body {
  .ant-pro-table {
    .ant-card {
      border-radius: 0;
      box-shadow: none;
    }

    .ant-card-body {
      padding: 0 !important;
    }
  }
}

.ant-modal-body {
  .ant-pro-table {
    .ant-card {
      padding: 0;
      box-shadow: none;
    }

    .ant-card-body {
      padding: 0;
    }
  }
}

.ant-cell-selected {
  ::selection {
    color: inherit;
    background-color: inherit;
  }
}

@keyframes turn {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(90deg);
  }

  50% {
    transform: rotate(180deg);
  }

  75% {
    transform: rotate(270deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.export-data-notice {
  height: 500px;
  padding: 24px;
  overflow: auto;
  font-family: Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;

  p {
    font-size: 16px;
    line-height: 32px;

    &.indent {
      padding-left: 15px;
      text-indent: -15px;
    }

    .important {
      font-weight: 600;
      text-decoration-line: underline;
      text-underline-offset: 3px;
      text-decoration-thickness: 3px;
    }
  }
  .sign {
    position: relative;
    margin-top: 24px;
    font-weight: 600;
    text-align: right;
  }
}
