.#{$radio-prefix-cls},
.#{$checkbox-prefix-cls} {
  position: relative;
  display: inline-block;

  .#{$radio-prefix-cls}__input[type="radio"],
  .#{$checkbox-prefix-cls}__input[type="checkbox"] {
    position: absolute;
    z-index: 2;
    width: $radio-size;
    height: $radio-size;
    overflow: hidden;
    opacity: 0;

    &:checked,
    &[checked] {
      & + .#{$radio-prefix-cls}__inner,
      & + .#{$checkbox-prefix-cls}__inner {
        &::before {
          background: $brand-primary;
          border-color: $brand-primary;
        }
        &::after {
          position: absolute;
          top: 50%;
          left: 0;
          width: $radio-size;
          height: $radio-size;
          font-size: $radio-font-size;
          line-height: $radio-size;
          color: $white;
          text-align: center;
          @extend %aid-icon;
          content: "\F27B";
          border-radius: 50%;
          transition: all .125s;
          transform: translate(0, -50%);
        }
      }
    }
  }

  &__inner {
    position: relative;
    padding-left: $radio-size + $radio-margin-x;
    margin-top: 0;

    &::before {
      position: absolute;
      top: 50%;
      left: 0;
      width: $radio-size;
      height: $radio-size;
      text-align: center;
      content: "";
      background: $white;
      border: 2px solid $gray-8;
      border-radius: 50%;
      transition: all .125s;
      transform: translate(0, -50%);
    }
  }
}

// radio
//
//
.#{$radio-prefix-cls} {
  //disabled
  @include status-disabled;
}

// checkbox
//
//
.#{$checkbox-prefix-cls} {
  &__inner{
    &::before,
    &::after{
      border-radius: $border-radius;
    }
  }

  //disabled
  @include status-disabled;
}

// radio-check list mode
.#{$list-prefix-cls} {
  &__item--#{$radio-prefix-cls},
  &__item--#{$checkbox-prefix-cls} {
    &:not(:last-child)::after {
      left: $list-item-padding-x + $radio-item-font-size + $radio-margin-x;
    }

    .#{$radio-prefix-cls},
    .#{$checkbox-prefix-cls} {
      // 与list 文本对齐
      padding-top: $list-item-padding-y;
      padding-bottom: $list-item-padding-y;
      line-height: $list-arrow-font-size;
    }

    .#{$radio-prefix-cls}__inner,
    .#{$checkbox-prefix-cls}__inner {
      padding-left: $radio-item-font-size + $radio-margin-x;

      &::before,
      &::after {
        display: none;
      }
    }

    .#{$radio-prefix-cls}__input[type="radio"],
    .#{$checkbox-prefix-cls}__input[type="checkbox"]{
      &:checked,
      &[checked] {
        & + .#{$radio-prefix-cls}__inner,
        & + .#{$checkbox-prefix-cls}__inner{
          &::after{
            display: block;
            font-size: $radio-item-font-size;
            color: $brand-primary;
          }
        }
      }
    }
  }
}
