.#{$switch-prefix-cls} {
  position: relative;
  display: inline-block;
  vertical-align: middle;

  &__inner,
  &__inner-close {
    span {
      line-height: .4rem;
      font-size: .24rem;
      color: #666;
      position: absolute;
      z-index: 3;
      top: 50%;
      right: .08rem;
      transform: translateY(-50%);
    }
  }

  &__inner {
    position: relative;
    width: $switch-width;
    height: $switch-height;
    background: $gray-5;
    border-radius: $switch-height;
    transition: all 300ms;

    &::before,
    &::after {
      position: absolute;
      content: '';
    }

    span {
      right: auto;
      left: .08rem;
      color: #FFF;
    }

    &::before {
      right: 0;
      left: 0;
      z-index: 1;
      width: 100%;
      height: 100%;
      background: $gray-5;
      border-radius: $switch-height;
      transition: all 200ms;
      transform: scale(1);
    }

    &::after {
      top: $switch-trigger-spacer;
      left: -$switch-trigger-spacer;
      z-index: 2;
      width: $switch-inner-height;
      height: $switch-inner-height;
      background: $white;
      border-radius: $switch-inner-height;
      transition: all 200ms;
      box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.11);
    }
  }

  &__inner-close {
    position: relative;
    width: $switch-width;
    height: $switch-height;
    border-radius: $switch-height;
    transition: all 300ms;

    &::before,
    &::after {
      position: absolute;
      content: '';
    }

    &::before {
      right: 0;
      left: 0;
      z-index: 1;
      width: 100%;
      height: 100%;
      background: $gray-seg;
      border-radius: $switch-height;
      transition: all 200ms;
      transform: scale(1);
    }

    &::after {
      top: $switch-trigger-spacer;
      left: $switch-trigger-spacer;
      z-index: 2;
      width: $switch-inner-height;
      height: $switch-inner-height;
      background: $white;
      border-radius: $switch-inner-height;
      transition: all 200ms;
      box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.11);
    }
  }

  input[type='checkbox'] {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    border: 0 none;
    opacity: 0;
    appearance: none;

    &:checked {
      & + .#{$switch-prefix-cls}__inner {
        background: $brand-primary;

        &::before {
          transform: scale(0);
        }

        &::after {
          /* NOTE: 修改left为100% */
          left: 100%;
          margin-left: -$switch-inner-height - $switch-trigger-spacer;
        }
      }
    }
  }

  @include status-disabled;
}
