.nut-switch {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  background-color: $primary-color;
  border-radius: $switch-border-radius;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center center;
  flex: 0 0 auto; // 防止被压缩
  &.switch-close {
    background-color: $switch-close-bg-color;
    .close-line {
      background: $switch-close--cline-bg-color;
      border-radius: 2px;
    }
  }
  .switch-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: $white;
    transition: transform 0.3s;
    .nut-switch-label {
      color: $white;
      font-size: $font-size-1;
      &.open {
        transform: $switch-label-open-transform;
      }
      &.close {
        transform: $switch-label-close-transform;
      }
    }
  }
  &.nut-switch-disable {
    opacity: 0.6;
  }
  &.nut-switch-base {
    min-width: $switch-width;
    height: $switch-height;
    line-height: $switch-line-height;
    overflow: hidden;
    .switch-button {
      height: $switch-inside-height;
      width: $switch-inside-width;
      transform: $switch-inside-close-transform;
    }
    &.switch-open {
      .switch-button {
        transform: $switch-inside-open-transform;
      }
    }
    &.switch-close {
      .close-line {
        width: 8px;
        height: 2px;
      }
    }
  }
}
