.#{$table-prefix-cls} {
  $root: #{&};
  position: relative;
  box-sizing: border-box;
  flex: 1;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  font-size: $table-font-size;
  color: $table-color;
  background-color: $table-bg;
  td.gutter,
  th.gutter {
    padding: 0;
    border-right-width: 0;
    border-bottom-width: 0;
  }
  &__body{
    tr.current-row > td {
      background-color: $table-bg-active;

      &:first-child {
        position: relative;

        &::before {
          position: absolute;
          top: 0;
          bottom: 0;
          left: 0;
          width: 3px;
          content: "";
          background-color: $brand-primary;
        }
      }
    }
  }

  // 数据为空
  &__empty-block{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 300px;
    text-align: center;
  }

  &__empty-text {
    // min-height doesn't work in IE10 and IE11 https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items
    // set empty text line height up to contrainer min-height as workaround.
    width: 50%;
    line-height: 60px;
    color: $table-empty-text-color;
  }
  // 展开行
  &__expand-column {
    .cell {
      padding: 0;
      text-align: center;
    }
  }

  &__expand-icon {
    position: relative;
    height: 20px;
    font-size: 16px;
    cursor: pointer;
    //color: #666;
    transition: transform .2s ease-in-out;
    &--expanded {
      transform: rotate(90deg);
    }
    >  {
      position: absolute;
      top: 50%;
      left: 50%;
      margin-top: -5px;
      margin-left: -5px;
    }
  }

  &__expanded-cell {
    background-color: $table-cell-bg;

    // 纯属为了增加权重
    &[class*="cell"] {
      padding: 20px 50px;
    }

    &:hover {
      background-color: transparent !important;
    }
  }

  &__placeholder {
    display: inline-block;
    width: 20px;
  }

  &--fit {
    border-right: 0;
    border-bottom: 0;

    th.gutter,
    td.gutter {
      border-right-width: 1px;
    }
  }

  &--scrollable-x {
    .#{$table-prefix-cls}__body-wrapper {
      overflow-x: auto;
    }
  }
  &--scrollable-y {
    .#{$table-prefix-cls}__body-wrapper {
      overflow-y: auto;
    }
  }

  thead {
    font-weight: 500;
    color: $table-head-color;

    &.is-group {
      th {
        background: $table-head-bg;
      }
    }
  }

  th,
  td {
    position: relative;
    box-sizing: border-box;
    min-width: 0;
    height: $table-cell-height;
    padding: 0 $table-cell-x-padding;
    text-align: left;
    text-overflow: ellipsis;
    vertical-align: middle;
    @at-root {
      &.is-center {
        text-align: center;
      }
    }

    @at-root {
      &.is-right {
        text-align: right;
      }
    }

    &.gutter {
      width: 15px;
      padding: 0;
      border-right-width: 0;
      border-bottom-width: 0;
    }

    &.is-hidden {
      > * {
        visibility: hidden;
      }
    }
  }

  &--medium{
    th,
    td {
      padding: 10px 0;
    }
  }
  tr {
    background-color: $table-bg;

    input[type="checkbox"] {
      margin: 0;
    }
  }
  th.is-leaf,
  th.is-sortable {
    //cursor: pointer;
  }
  td,
  th.is-leaf {
    border-bottom: $table-border;
  }
  th {
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    background-color: $table-bg;

    div {
      box-sizing: border-box;
      display: inline-block;
      //padding-right: 10px;
      //padding-left: 10px;
      overflow: hidden;
      line-height: 40px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    > .cell {
      position: relative;
      box-sizing: border-box;
      display: inline-block;
      width: 100%;
      text-overflow: ellipsis;
      word-wrap: normal;
      vertical-align: middle;

      &.highlight {
        color: $brand-primary;
      }
    }

    &.required > div::before {
      display: inline-block;
      width: 8px;
      height: 8px;
      margin-right: 5px;
      vertical-align: middle;
      content: "";
      background: #ff4d51;
      border-radius: 50%;
    }
  }
  td {
    div {
      box-sizing: border-box;
    }

    &.gutter {
      width: 0;
    }
    &:hover {
      .cell--edit-action {
        display: inline-block;
      }
    }
  }
  td.td__edit {
    padding: 0;
  }
  .cell {
    box-sizing: border-box;
    //padding-right: 10px;
    //padding-left: 10px;
    overflow: hidden;
    line-height: 23px;
    text-overflow: ellipsis;
    word-break: break-all;
    white-space: normal;

    &--ellipsis {
      min-width: 50px;
      max-width: 100%;
      white-space: nowrap;
    }
    &--edit {
      padding: 0 $table-cell-x-padding;
    }
    &--editing {
      padding: 0;
    }
    &--editing,
    .cell_input-wrap {
      height: 100%;
      input {
        width: 100%;
        height: 100%;
        border: transparent;
        border-radius: 0;
      }
    }
    &--edit-action {
      display: none;
      float: right;
      cursor: pointer;
    }
  }

  // 拥有多级表头
  &--group,
  &--border {
    border: $table-border;
    thead  {
      background: $table-head-bg;
    }

    @include table-share-rule(border-pseudo) {
      position: absolute;
      z-index: 1;
      content: "";
      background-color: $table-border-color;
    }

    // 表格右部伪 border
    &::after {
      @include table-share-rule(border-pseudo);
      top: 0;
      right: 0;
      width: 1px;
      height: 100%;
    }
  }
  // 表格底部伪 border，总是有的
  &::before {
    @include table-share-rule(border-pseudo);
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
  }
  // table--border
  &--border {
    border-right: none;
    border-bottom: none;
    &.loading-parent--relative {
      border-color: transparent;
    }
    thead th  {
      background: $table-head-bg;
    }
    //td {
    //  border-top: $table-border;
    //}
    th,
    td {
      border-right: $table-border;

      &:first-child .cell {
        //padding-left: 10px;
      }
    }

    th,
    th.gutter:last-of-type {
      border-bottom: $table-border;
    }
    #{$root}__empty-block {
      border-right: $table-border;
      border-bottom: $table-border;
    }
  }

  // table--line
  &--line {
    th,
    td{
      border-bottom: $table-border-width solid $table-border-color;
    }
    th {
      background: $table-head-bg;
    }
  }
  &--hidden {
    visibility: hidden;
  }

  &__fixed,
  &__fixed-right {
    position: absolute;
    top: 0;
    left: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    box-shadow: $table-fixed-box-shadow;

    &::before {
      position: absolute;
      bottom: 0;
      left: 0;
      z-index: 4;
      width: 100%;
      height: 1px;
      content: ""; 
      background-color: $table-border-color;
    }
  }
  &__fixed-right-patch {
    position: absolute;
    top: -1px;
    right: 0;
    background-color: $table-bg;
    border-bottom: $table-border;
  }
  &__fixed-right {
    top: 0;
    right: 0;
    left: auto;

    .#{$table-prefix-cls}__fixed-header-wrapper,
    .#{$table-prefix-cls}__fixed-body-wrapper,
    .#{$table-prefix-cls}__fixed-footer-wrapper {
      right: 0;
      left: auto;
    }
  }

  &__fixed-header-wrapper{
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
  }

  &__fixed-footer-wrapper{
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 3;

    & tbody td {
      color: $table-color;
      background-color: $table-bg-hover;
      border-top: $table-border;
    }
  }
  &__fixed-body-wrapper {
    position: absolute;
    top: 37px;
    left: 0;
    z-index: 3;
    overflow: hidden;
  }
  &__header-wrapper,
  &__body-wrapper,
  &__footer-wrapper {
    width: 100%;
  }
  &__footer-wrapper {
    margin-top: -1px;
    td {
      border-top: $table-border;
    }
  }
  &__header,
  &__body,
  &__footer {
    width: 100% !important;
    table-layout: fixed;
    border-collapse: separate;
  }

  &__header-wrapper,
  &__footer-wrapper {
    overflow: hidden;

    & tbody td {
      color: $table-color;
      background-color: $table-bg-hover;
    }
  }

  &__body-wrapper {
    position: relative;
    overflow: hidden;

    @include table-when(scrolling-none) {
      ~ .#{$table-prefix-cls}__fixed,
      ~ .#{$table-prefix-cls}__fixed-right {
        box-shadow: none;
      }
    }

    @include table-when(scrolling-left) {
      ~ .#{$table-prefix-cls}__fixed {
        box-shadow: none;
      }
    }

    @include table-when(scrolling-right) {
      ~ .#{$table-prefix-cls}__fixed-right {
        box-shadow: none;
      }
    }

    .#{$table-prefix-cls}--border {
      @include table-when(scrolling-right) {
        ~ .#{$table-prefix-cls}__fixed-right {
          border-left: $table-border;
        }
      }

      @include table-when(scrolling-left) {
        ~ .#{$table-prefix-cls}__fixed {
          border-right: $table-border;
        }
      }
    }
  }
  .caret-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    height: 34px;
    width: 24px;
    vertical-align: middle;
    cursor: pointer;
    overflow: initial;
    position: relative;
  }

  .sort-caret {
    width: 0;
    height: 0;
    position: absolute;
    border: solid 5px transparent;
    left: 7px;

    &.ascending {
      top: 5px;
      border-bottom-color: $table-border-color;
    }

    &.descending {
      bottom: 7px;
      border-top-color: $table-border-color;
    }
  }

  .ascending .sort-caret.ascending {
    border-bottom-color: $brand-primary;
  }

  .descending .sort-caret.descending {
    border-top-color: $brand-primary;
  }

  .hidden-columns {
    visibility: hidden;
    position: absolute;
    z-index: -1;
  }
  //striped
  &--striped {
    tbody :nth-of-type(odd) td {
      background-color: $table-bg-accent;
    }
  }

  &__column-resize-proxy {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 200px;
    z-index: 10;
    width: 0;
    border-left: $table-border;
  }
  &__column-filter-trigger {
    display: inline-block;
    line-height: 34px;
    cursor: pointer;

    & i {
      font-size: $table-font-size;
      color: $table-color;
      transform: scale(.75);
    }
  }

  &--enable-row-transition{
    .#{$table-prefix-cls}__body td {
      transition: background-color .25s ease;
    }
  }
  &--enable-row-hover {
    .#{$table-prefix-cls}__body tr:hover > td {
      background-color: $table-bg-hover;
    }
  }
  &--fluid-height{
    .#{$table-prefix-cls}__fixed,
    .#{$table-prefix-cls}__fixed-right {
      bottom: 0;
      overflow: hidden;
    }
  }
  // size
  // table--sm
  &--sm {
    font-size: $table-sm-font-size;

    th,
    td {
      height: $table-sm-cell-height;
    }

  }

  // table--lg
  &--lg {
    font-size: $table-lg-font-size;

    th,
    td {
      height: $table-lg-cell-height;
    }
  }
  [class*=#{$table-prefix-cls}__row--level] {
    .#{$table-prefix-cls}__expand-icon {
      display: inline-block;
      width: 14px;
      margin-right: 5px;
      vertical-align: middle;
    }
  }
  &-filter{
    border: 1px solid #ebeef5;
    border-radius: 2px;
    background-color: #fff;
    box-shadow: $shadow-card;
    box-sizing: border-box;
    margin: 2px 0;
    .#{$table-prefix-cls}-filter__content{
      min-width: 180px;
      .#{$table-prefix-cls}-filter__checkbox-group{
        margin: 10px 0;
        label{
          display: block;
          margin-right: 10px;
          margin-bottom: 8px;
          margin-left: 10px;
          .form-checkbox__inner{
            display: inline-block;
            padding-left: 24px;
            line-height: 19px;
            font-size: 14px;
          }
        }
      }
    }
    .#{$table-prefix-cls}-filter__bottom{
      display:flex;
      height: 36px;
      line-height: 36px;
      border-top:1px solid $gray-light-9;
      justify-content: space-between;
      width: 100%;
      padding:0 10px;
      box-sizing: border-box;
      span{
        color:$brand-primary;
      }
    }
  }
  .#{$table-prefix-cls}__column-filter-trigger{
    i{
      font-size: 18px;
      color: $gray-light-45;
      margin-left: 4px;
    }
  }
  &__tree-icon {
    transform: scale(1.6);
    margin-top: -7px;
  }
}