@import "../../../styles/assets/constant.scss";
$color: #111222;
/**
 * @atom Tab
 * @section Tab
 * @modifiers
 *  .tab 分页标签
 *  .tab.active 标签激活态
 *  .tab-activated 标签激活态，和.tab.active一样
 *  .btn-tab 按钮型分页标签
 *  .btn-tab.active 按钮型标签激活态
 *  .btn-tab-activated 按钮型标签激活态
 * @markup
 *  <span class="tab">tab1</span>
 *  <span class="tab active">tab2</span>
 *  <span class="btn-tab">tab1</span>
 *  <span class="btn-tab active">tab2</span>
 */

.tab {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  font-weight: bold;
  padding: 10px 0;
  margin-right: 10px;
  color: $font-color-base;
  fill: $font-color-base;
  border-bottom: 2px solid transparent;

  &:hover {
    cursor: pointer;
    color: $basic-imp-color;
    fill: $basic-imp-color;
  }

  &.active {
    color: $basic-imp-color;
    fill: $basic-imp-color;
    border-bottom: 2px solid $basic-imp-color;
  }
}

.tab-wrap {
  width: 100%;
  border-radius: 2px;
  border: 1px solid rgba($color, 0.13);
}
.tab-header {
  display: flex;
  justify-content: flex-start;
  font-weight: bold;
  color: $font-color-base;
  fill: $font-color-base;
  align-items: flex-end;
  border-bottom: 1px solid rgba($color, 0.13);
  padding-bottom: 3px;
}
.tab-header-item {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  font-weight: normal;

  &.mgr30 {
    margin-right: 30px;
  }

  &:hover {
    color: $basic-imp-color;
    fill: $basic-imp-color;
  }

  &.active {
    position: relative;
    color: $basic-imp-color;
    fill: $basic-imp-color;
    background: $basic-white-color;
    border-top: none;
    font-weight: bold;
    &:before {
      content: "";
      position: absolute;
      left: 0;
      bottom: -3px;
      background-color: rgba($color, 0.85);
      width: 100%;
      height: 3px;
    }
  }
  &.disabled {
    cursor: not-allowed;
    opacity: 0.6;
    &:hover {
      color: $font-color-base;
      fill: $font-color-base;
    }
  }
}

.tab-card {
  .tab-header-inner {
    width: 100%;
    line-height: 1.5;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  & > .tab-header {
    .tab-header-item {
      background-color: $input-bg-color;
      color: #666;
      font-size: 14px;
      text-align: center;
      font-weight: 400;
      height: 36px;
      margin-right: 0;
      line-height: 14px;
      padding: 10px 20px;
      border-left: 1px solid #e0e2ef;
      border-top: 1px solid #e0e2ef;
      // border-bottom: 1px solid #e0e2ef;

      &:hover {
        cursor: pointer;
      }

      &:last-child {
        border-right: 1px solid #e0e2ef;
      }

      &.active {
        position: relative;
        background-color: #fff;
        font-weight: 700;
        color: $font-color-base;
        border-bottom: none;
        margin-bottom: 0;
        height: 36px;
        &:before {
          content: "";
          position: absolute;
          width: 100%;
          height: 3px;
          background-color: #3d3e52;
          top: -3px;
          left: 0;
        }
        &:after {
          content: "";
          position: absolute;
          bottom: -1px;
          left: 0;
          width: 100%;
          height: 1px;
          background-color: #fff;
          z-index: 3;
        }
      }

      &.disabled {
        cursor: not-allowed;
        opacity: 0.6;

        &:hover {
          color: #666;
          fill: #666;

          &.active {
            color: $font-color-base;
            fill: $font-color-base;
          }
        }
      }
    }
  }
}
.tab-panel {
  display: none;

  &.active {
    display: block;
  }
}
