@import '../../base.less';

@import './_var.less';

.@{item} {
  flex: 1;
  height: @tab-bar-height;
  box-sizing: border-box;
  user-select: none;
  position: relative;
  margin: 8px 0;
  background-color: @tab-bar-bg-color;
  padding: 0 12px;

  &--split::before {
    .hairline-left(@color: @tab-bar-border-color);

    top: 8px;
    bottom: 8px;
  }

  &--crowded {
    padding: 0 8px;
  }

  &--round {
    border-radius: 99px;
  }

  &__content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: @tab-bar-color;

    &--checked {
      .@{item}__text,
      .@{item}__icon {
        color: @tab-bar-active-color;
        font-weight: 600;
      }
    }

    &--tag {
      border-radius: 99px;
    }

    &--tag&--checked {
      background-color: @tab-bar-active-bg;
    }

    // &--active {
    //   background-color: @tab-bar-hover-bg-color;
    // }
  }

  &__icon {
    .@{prefix}-icon {
      vertical-align: top;
    }
  }

  //.@{prefix}-badge--count {
  //// 缩放0.83是因为设计稿字体10px，而chrome最小12px
  //  transform: translate(50%, -10%) scale(0.83) !important; // stylelint-disable-line
  //}

  &__text {
    display: flex;
    align-items: center;
    font: @font-body-large;

    &--small {
      font: @font-body-extraSmall;
    }
  }

  &__icon-menu {
    margin-right: 4px;
  }

  &__spread {
    position: absolute;
    top: 0;
    left: 7%;
    width: 86%;
    background-color: @tab-bar-bg-color;
    transform: translate3d(0, calc(-100% - 16px), 0);
    z-index: 1;
    border-radius: 6px;
    color: @tab-bar-color;
    box-shadow: @tab-bar-spread-shadow;

    &::before {
      display: block;
      content: '';
      position: absolute;
      bottom: 0;
      left: 50%;
      width: 0;
      height: 0;
      border: 8px solid transparent;
      border-top: 8px solid @tab-bar-bg-color;
      transform: translate3d(-50%, 16px, 0);
    }

    &-item {
      width: 100%;
      height: 48px;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      position: relative;
      flex-direction: column;

      &--active,
      &:active {
        background-color: @tab-bar-hover-bg-color;
      }

      &-split {
        box-sizing: border-box;
        content: ' ';
        pointer-events: none;
        background-color: @tab-bar-spread-border-color;
        width: 80%;
        height: 1px;
        transform: translateY(.5);
      }

      &-text {
        padding-top: 12px;
      }
    }
  }
}
