.switch-wrap {
  @include removeSpace($--font-xs);

  .switch {
    height: 14px;
    position: relative;
    display: inline-block;
    cursor: pointer;
    color: $--color-c6;
    padding: 0 8px;

    & > span {
      user-select: none;
    }

    &--animate {
      &::after {
        transition: all 0.3s;
      }
    }

    &::after {
      content: "";
      position: absolute;
      width: 18px;
      height: 18px;
      background-color: $--color-c6;
      top: -1px;
      left: 0px;
      bottom: 0;
      margin: auto;
      border-radius: 50%;
      box-shadow: 0px 1px 4px 0px rgba($--color-c1, 0.6);
    }

    // 关闭状态
    &.inactive-bgc {
      background-color: $--color-c3;
      text-align: right;
    }

    // 开启状态
    &.active-bgc {
      text-align: left;

      &.switch {
        &::after {
          left: calc(100% - 17px);
        }
      }
    }

    // 禁用状态
    &.disabled {
      opacity: 0.5;
      cursor: not-allowed;

      &.active-bgc {
        &.switch {
          &::before {
            left: calc(100% - 9px);
          }
        }
      }
    }

    // 绿色开关
    &-success {
      background-color: $--color-c8;
    }

    // 红色开关
    &-danger {
      background-color: $--color-c11;
    }
  }

  .small {
    height: 14px;
  }

  .normal {
    height: 22px;
  }
}
