@yee-table-padding-vertical-md: @yee-table-padding-vertical * 3 / 4;
@yee-table-padding-horizontal-md: @yee-table-padding-horizontal / 2;
@yee-table-padding-vertical-sm: @yee-table-padding-vertical / 2;
@yee-table-padding-horizontal-sm: @yee-table-padding-horizontal / 2;

.@{yee-table-prefix-cls}-middle {
  > .@{yee-table-prefix-cls}-title,
  > .@{yee-table-prefix-cls}-content > .@{yee-table-prefix-cls}-footer {
    padding: @yee-table-padding-vertical-md @yee-table-padding-horizontal-md;
  }
  > .@{yee-table-prefix-cls}-content {
    > .@{yee-table-prefix-cls}-header > table,
    > .@{yee-table-prefix-cls}-body > table,
    > .@{yee-table-prefix-cls}-scroll > .@{yee-table-prefix-cls}-header > table,
    > .@{yee-table-prefix-cls}-scroll > .@{yee-table-prefix-cls}-body > table,
    > .@{yee-table-prefix-cls}-fixed-left > .@{yee-table-prefix-cls}-header > table,
    > .@{yee-table-prefix-cls}-fixed-right > .@{yee-table-prefix-cls}-header > table,
    > .@{yee-table-prefix-cls}-fixed-left
      > .@{yee-table-prefix-cls}-body-outer
      > .@{yee-table-prefix-cls}-body-inner
      > table,
    > .@{yee-table-prefix-cls}-fixed-right
      > .@{yee-table-prefix-cls}-body-outer
      > .@{yee-table-prefix-cls}-body-inner
      > table {
      > .@{yee-table-prefix-cls}-thead > tr > th,
      > .@{yee-table-prefix-cls}-tbody > tr > td {
        padding: @yee-table-padding-vertical-md @yee-table-padding-horizontal-md;
      }
    }
  }

  tr.@{yee-table-prefix-cls}-expanded-row td > .@{yee-table-prefix-cls}-wrapper {
    margin: -@yee-table-padding-vertical-md -@yee-table-padding-horizontal / 2 -@yee-table-padding-vertical-md - 1px;
  }
}

.@{yee-table-prefix-cls}-small {
  border: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
  border-radius: @yee-table-border-radius-base;

  > .@{yee-table-prefix-cls}-title,
  > .@{yee-table-prefix-cls}-content > .@{yee-table-prefix-cls}-footer {
    padding: @yee-table-padding-vertical-sm @yee-table-padding-horizontal-sm;
  }

  > .@{yee-table-prefix-cls}-title {
    top: 0;
    border-bottom: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
  }

  > .@{yee-table-prefix-cls}-content > .@{yee-table-prefix-cls}-footer {
    background-color: transparent;
    border-top: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
    &::before {
      background-color: transparent;
    }
  }

  > .@{yee-table-prefix-cls}-content {
    > .@{yee-table-prefix-cls}-body {
      margin: 0 @yee-table-padding-horizontal-sm;
    }

    > .@{yee-table-prefix-cls}-header > table,
    > .@{yee-table-prefix-cls}-body > table,
    > .@{yee-table-prefix-cls}-scroll > .@{yee-table-prefix-cls}-header > table,
    > .@{yee-table-prefix-cls}-scroll > .@{yee-table-prefix-cls}-body > table,
    > .@{yee-table-prefix-cls}-fixed-left > .@{yee-table-prefix-cls}-header > table,
    > .@{yee-table-prefix-cls}-fixed-right > .@{yee-table-prefix-cls}-header > table,
    > .@{yee-table-prefix-cls}-fixed-left
      > .@{yee-table-prefix-cls}-body-outer
      > .@{yee-table-prefix-cls}-body-inner
      > table,
    > .@{yee-table-prefix-cls}-fixed-right
      > .@{yee-table-prefix-cls}-body-outer
      > .@{yee-table-prefix-cls}-body-inner
      > table {
      border: 0;
      > .@{yee-table-prefix-cls}-thead > tr > th,
      > .@{yee-table-prefix-cls}-tbody > tr > td {
        padding: @yee-table-padding-vertical-sm @yee-table-padding-horizontal-sm;
      }
      > .@{yee-table-prefix-cls}-thead > tr > th {
        background-color: @yee-table-header-bg-sm;
      }
      > .@{yee-table-prefix-cls}-thead > tr {
        border-bottom: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
      }
      > .@{yee-table-prefix-cls}-thead > tr > th.@{yee-table-prefix-cls}-column-sort {
        background-color: @yee-table-body-sort-bg;
      }
    }

    > .@{yee-table-prefix-cls}-scroll > .@{yee-table-prefix-cls}-header > table,
    > .@{yee-table-prefix-cls}-scroll > .@{yee-table-prefix-cls}-body > table,
    > .@{yee-table-prefix-cls}-fixed-left > .@{yee-table-prefix-cls}-header > table,
    > .@{yee-table-prefix-cls}-fixed-right > .@{yee-table-prefix-cls}-header > table,
    > .@{yee-table-prefix-cls}-fixed-left
      > .@{yee-table-prefix-cls}-body-outer
      > .@{yee-table-prefix-cls}-body-inner
      > table,
    > .@{yee-table-prefix-cls}-fixed-right
      > .@{yee-table-prefix-cls}-body-outer
      > .@{yee-table-prefix-cls}-body-inner
      > table {
      padding: 0;
    }

    .@{yee-table-prefix-cls}-header {
      background-color: @yee-table-header-bg-sm;
      border-radius: @yee-table-border-radius-base @yee-table-border-radius-base 0 0;
    }

    .@{yee-table-prefix-cls}-placeholder,
    .@{yee-table-prefix-cls}-row:last-child td {
      border-bottom: 0;
    }
  }

  &.@{yee-table-prefix-cls}-bordered {
    border-right: 0;

    .@{yee-table-prefix-cls}-title {
      border: 0;
      border-right: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
      border-bottom: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
    }

    .@{yee-table-prefix-cls}-content {
      border-right: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
    }

    .@{yee-table-prefix-cls}-footer {
      border: 0;
      border-top: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
      &::before {
        display: none;
      }
    }

    .@{yee-table-prefix-cls}-placeholder {
      border-right: 0;
      border-bottom: 0;
      border-left: 0;
    }

    .@{yee-table-prefix-cls}-thead > tr > th.@{yee-table-prefix-cls}-row-cell-last,
    .@{yee-table-prefix-cls}-tbody > tr > td:last-child {
      border-right: none;
    }

    .@{yee-table-prefix-cls}-fixed-left {
      .@{yee-table-prefix-cls}-thead > tr > th:last-child,
      .@{yee-table-prefix-cls}-tbody > tr > td:last-child {
        border-right: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
      }
    }

    .@{yee-table-prefix-cls}-fixed-right {
      border-right: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
      border-left: @yee-border-width-base @yee-border-style-base @yee-border-color-split;
    }
  }

  tr.@{yee-table-prefix-cls}-expanded-row td > .@{yee-table-prefix-cls}-wrapper {
    margin: -@yee-table-padding-vertical-sm -@yee-table-padding-horizontal / 2 -@yee-table-padding-vertical-sm - 1px;
  }

  // https://github.com/ant-design/ant-design/issues/19287#issuecomment-544368967
  &.@{yee-table-prefix-cls}-fixed-header
    > .@{yee-table-prefix-cls}-content
    > .@{yee-table-prefix-cls}-scroll
    > .@{yee-table-prefix-cls}-body {
    border-radius: 0 0 @yee-table-border-radius-base @yee-table-border-radius-base;
  }
}
