.filter-dropdown {
  min-width: 130px;

  .item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px;
    cursor: pointer;
  }

  .active {
    background-color: #f2f2f2;
  }

  .filter-input {
    display: flex;
    justify-content: center;
    margin: 6px 6px;
    width: auto;
  }

  .footer {
    display: flex;
    justify-content: center;
    padding: 0 8px;
    margin: 8px 0;
  }
}

.rs-action-button {
  position: relative;

  &.rs-action-button-text {
    &:not(:last-child)::after {
      content: '';
      position: absolute;
      right: -4px;
      top: 50%;
      transform: translateY(-50%);
      width: 1px;
      height: 16px;
      background-color: #e8e8e8;
    }
  }
}

.rs-action-column-buttons {
  display: flex;
  gap: 8px;
  width: 100%;

  .button-items {
    color: var(--ant-primary-color);

    &:visited {
      color: var(--ant-primary-color);
    }

    &.button-items-danger {
      color: var(--ant-color-error);
    }
  }
}

.ant-table-thead,
.ant-table-row {
  .ant-table-cell {
    height: 36px;
    padding: 0 6px !important;
  }
}

.ant-table-row {
  .ant-table-cell {
    padding: 0 4px !important;
  }
}

.ant-table-row:has(.ant-form-item-has-error) {
  :not(.ant-table-selection-column) {
    vertical-align: top !important;
  }
}

.ant-table-column-sorters {
  cursor: pointer;
}

.rs-page-div {
  .action-bar {
    background-color: var(--rs-basic-background-color);
  }
}

.rs-table,
.rs-edit-table {
  .action-bar {
    & > .action-bar__item:last-child {
      margin-right: 20px;
    }
  }

  .ant-table-thead {
    .ant-table-cell {
      .ant-dropdown-trigger:not(.active, .ant-dropdown-open) {
        display: none;
        transition: color 0.3s;
      }

      &:hover {
        .ant-dropdown-trigger {
          display: flex;
        }
      }

      .ant-table-column-sorter {
        display: none;
      }

      .ant-table-column-sorter:has(.active) {
        display: block !important;
      }
    }
  }

  .rs-table-wrapper {
    overflow: hidden;
    display: flex;
    margin: 12px;
    background-color: #fff;
    position: relative;
    border: 1px solid #d7d7d7;

    .tree {
      padding: 8px;
      overflow: hidden;
      width: fit-content;
      border-right: 1px solid #d7d7d7;
    }

    .table {
      flex: 1;
      min-width: 0;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
  }

  .rs-edit-table.ant-table-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;

    .ant-spin-container,
    .ant-table-container {
      flex: 1 1 auto;
      display: flex;
      flex-direction: column;
      min-height: 0;
    }

    .ant-table-body {
      flex: 1 1 auto;
    }
  }

  .ant-pagination {
    font-size: 12px;

    .ant-select-selector {
      font-size: 12px;
    }
  }
}

/* 编辑表格样式 */
.rs-edit-table {
  .ant-table-body,
  .ant-table-content {
    .ant-table-row {
      &:hover {
        .editable-cell {
          .cell-hover {
            border: 1px solid #bcbcbc;
            box-sizing: border-box;

            &:hover {
              border: 1px solid var(--ant-primary-color);
            }
          }
        }
      }

      .editable-cell {
        .cell-hover {
          padding: 4px 2px;
          width: 100%;
        }

        .cell-focus {
          width: 100%;
          height: 100%;
          border: 1px solid #bcbcbc;
          box-sizing: border-box;
        }

        .cell-input {
          &.text-left {
            text-align: left;

            .ant-input-number-input {
              text-align: left;
            }

            .ant-picker-input > input {
              text-align: left;
            }

            .ant-select-selection-item {
              text-align: left;
            }
          }

          &.text-center {
            text-align: center;

            .ant-input-number-input {
              text-align: center;
            }

            .ant-picker-input > input {
              text-align: center;
            }

            .ant-select-selection-item {
              text-align: center;
            }
          }

          &.text-right {
            text-align: right;

            .ant-input-number-input {
              text-align: right;
              padding-right: 28px;
            }

            .ant-picker-input > input {
              text-align: right;
            }

            .ant-select-selection-item {
              text-align: right;
            }

            .ant-input-number-handler-wrap {
              opacity: 1;
              width: 22px;
            }
          }
        }
      }
    }
  }
}
