.#{$table-prefix-cls} {
  width: inherit;
  max-width: 100%;
  height: 100%;
  overflow-x: auto;
  font-size: $font-size-sm;
  color: $body-color;
  background-color: $white;

  &-wrapper {
    position: relative;
  }
  
  .th-required .table__cell--text--inner::before {
    content: "*";
    display: inline-block;
    margin-left: 4px;
    line-height: 1;
    font-size: 12px;
    color: #ff3f3b;
  }

  & table {
    width: 100% !important;
    table-layout: fixed;
  }

  th,
  td {
    text-align: left;
    vertical-align: middle;
  }

  th {
    height: $table-th-height;
    overflow: hidden;
    font-weight: 500;
    color: $gray-dark;
    white-space: nowrap;
  }

  td {
    height: $table-td-height;
    background-color: $white;
    transition: backgroud $table-transition;
  }

  tbody tr {
    @include hover {
      td{
        background: $table-bg-hover;
      }
    }

    &:last-child td {
      border-bottom: none;
    }
  }


  //
  // 行
  //

  &__row {
    // 选中行
    &--highlight {
      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;
          }
        }
      }
    }

    // 展开行
    &--expanded {
      > td > div {
        height: auto !important;
      }
    }

    .expand-icon{
      font-size: 1.5em;
      cursor: pointer;
      transition: transform .2s ease-in-out;
    }
  }


  //
  // 列
  //

  &-sort,
  &-filter {
    margin-left: -10px;
    i {
      color: $gray;
      cursor: pointer;

      // &::before {
      //   transform: scale(2,2);
      // }

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

  // 列筛选
  &-filter {
    display: inline-block;
    vertical-align: middle;

    &-list {
      // 多选
      margin: 0 -14px;
      .table-filter-footer {
        text-align: center
      }

      &-item {
        padding-bottom: 8px;

        .form-checkbox {
          margin: 0;
          padding: 7px 16px;
        }

        .checkbox-wrapper + .checkbox-wrapper {
          margin: 0;
        }

        label {
          display: block;
          margin-bottom: 4px;
        }
      }

      ul {
        padding-left: 0;
        margin-bottom: 0;
        list-style: none;

        > li {
          cursor: pointer;
        }
      }
    }

    // 单选
    &-select-item {
      padding: 7px 16px;
      font-size: $font-size-xs;
      color: $gray;
      white-space: nowrap;
      list-style: none;
      transition: background $transition-time ease-in-out;
      font-size: 14px;
      @include hover-focus{
        background-color: $dropdown-link-hover-bg;
      }

      &-selected{
        position: relative;

        &::after {
          position: absolute;
          right: $dropdown-item-padding-x;
          color: $dropdown-link-check-icon-color;
          content: "\F8AE";
          @extend %aid-icon;
          transform: scale(1.2) translate(0, 0);
        }
      }
    }
  }

  // 列排序
  &-sort {
    display: inline-flex;
    flex-direction: column;

    i {
      font-size: 20px;
      line-height: 1;

      &:last-child {
        margin-top: -10px;
      }
    }
  }

  // 固定列
  &-fixed {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    background-color: $white;
    box-shadow: 2px 0 6px -2px rgba(0, 0, 0, .2);

    &-fixed__header {
      overflow: hidden;

      thead tr {
        background: #f1f4f6;
      }
    }

    &-fixed__body {
      position: relative;
      z-index: 3;
      overflow: hidden;
      background: $white;
    }

    &--right {
      top: 0;
      right: 0;
      left: auto;
      box-shadow: -2px 0 6px -2px rgba(0, 0, 0, .2);
      border-right: 1px solid $gray-lightest;
    }
  }

  // 固定表头
  &--with-fixed-top {
    .#{$table-prefix-cls}__body {
      overflow-y: auto;
    }
  }


  //
  // 单元格
  //

  &__cell {
    padding-right: 16px;
    padding-left: 16px;

    // 超出省略
    &--ellipsis {
      overflow: hidden;
      text-overflow: ellipsis;
      word-break: keep-all;
      white-space: nowrap;

      .tooltip-wrap,
      .tooltip-rel,
      .table__cell--text {
        display: inline;
        width: 100%;
      }
    }

    // 可编辑单元格
    &--edit {
      position: relative;
      height: 100%;
      padding: 0;

      .#{$table-prefix-cls}-edit__text {
        display: flex;
        align-items: center;
        height: 100%;
        padding: 0 15px;
      }

      .#{$table-prefix-cls}-edit__action {
        position: absolute;
        top: 50%;
        right: 15px;
        // display: none;
        cursor: pointer;
        transform: translateY(-50%);
      }

      .#{$table-prefix-cls}-edit__input {
        &,
        .input-wrapper,
        input {
          height: 100%;
        }

        input {
          border: none;
          border-radius: 0;
        }
      }

      // &:hover {
      //   .#{$table-prefix-cls}-edit__action {
      //     display: block;
      //   }
      // }
    }


    // 树单元格
    &--tree {
      display: flex;
      align-items: center;

      .tooltip-wrap,
      .tooltip-rel {
        display: inline;
      }

      .#{$table-prefix-cls}__tree-icon {
        width: 20px;
        cursor: pointer;
        vertical-align: middle;
        text-align: center;
        margin-left: -5px;

        &::before {
          display: inline-block;
          transform: scale(1.6);
        }
      }

      .#{$table-prefix-cls}__tree-folder-icon {
        font-size: 20px;
        margin-right: 8px;
        color: #999;
      }

      .#{$table-prefix-cls}__tree-no-child-icon {
        margin-right: 8px;
        margin-left: 2px;
        width: 6px;
        height: 6px;
        display: inline-block;
        border-radius: 50%;
        background: rgb(11, 130, 255);
      }
    }

    // 水平对齐方式
    &--column-left {
      text-align: left;
    }

    &--column-center {
      text-align: center;
    }

    &--column-right {
      text-align: right;
    }

    th & {
      display: inline-block;
      max-width: 90%;
      vertical-align: middle;
    }
  }

  // 表头首列斜线分割
  .diagonal__cell {
    width: 100%;
    height: 100%;
    padding: 0;

    .top-r,
    .top-l,
    .bottom-l {
      position: absolute;
      width: auto;
    }
  }

  .diagonal__line {
    border-bottom: 1px solid $table-border-color;
  }


  //
  // 表格提示信息
  //

  &--tips {
    padding-bottom: $table-bg-accent-height;
    &.#{$table-prefix-cls}--with-fixed-top {
      padding-bottom: 0;
    }
  }

  &__tip {
    position: absolute;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: $table-bg-accent-height;
    text-align: center;
    background: #FFF;
  }


  //
  // 表格隐藏
  //

  &--hide {
    opacity: 0;
  }

  &--hidden {
    visibility: hidden;
  }


  //
  // table--line
  //

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


  //
  // table--border
  //

  &--border {
    box-sizing: content-box;
    border-right: 1px solid $table-border-color;
    border-bottom: 1px solid $table-border-color;

    thead tr {
      background: $table-head-bg;
    }

    th,
    td {
      border-top: 1px solid $table-border-color;
      border-left: 1px solid $table-border-color;
    }

    .#{$table-prefix-cls}__tip {
      border-right: 1px solid $table-border-color;
      border-left: 1px solid $table-border-color;
    }
  }


  //
  // table--stripe
  //

  &--stripe {
    tbody tr:nth-of-type(odd) td {
      background-color: $table-bg-accent;
    }
  }


  //
  // table size
  //

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

    th {
      height: $table-sm-th-height;
    }

    td {
      height: $table-sm-td-height;
    }
  }

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

    th,
    td {
      height: $table-lg-th-height;
    }
  }
}