@use '../../../style/color/index.scss' as *;

.ver-tab {
  width: 100%;
}

.tab-header {
  display: flex;
  justify-content: space-around;
  padding: 5px;
  border-radius: 5px;
  background-color: $ver-zinc-3;

  .dark & {
    background-color: $ver-zinc-7;
  }
}

.tab-item {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 5px 10px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  overflow: hidden;
}

.tab-label {
  color: $ver-zinc-5;
}

.active-tab {
  position: relative;
  border-radius: 5px;
  z-index: 1;
}

.active-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: $ver-zinc-1;
  z-index: -1;

  .dark & {
    background-color: $ver-zinc-9;
  }
}

.tab-content {
  padding: 20px;
}

/* 过渡动画样式 */
.tab-slide-enter-active,
.tab-slide-leave-active {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-slide-enter {
  opacity: 0;
  transform: translateX(100%);
}

.tab-slide-leave-to {
  opacity: 0;
  transform: translateX(-100%);
}

/* tab-item切换为active-tab时的滑动进入效果 */
.active-tab-enter-active {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.active-tab-enter {
  transform: translateX(-100%);
}

/* tab-item从active-tab切换走时的滑动离开效果 */
.active-tab-leave-active {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.active-tab-leave-to {
  transform: translateX(100%);
}
