.nut-switch {
  cursor: pointer;
  display: flex;
  align-items: center;
  background-color: $switch-active-background-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-inactive-background-color;
    .close-line {
      background: $switch-close-line-background-color;
      border-radius: 2px;
    }
  }

  .switch-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: $primary-text-color;
    transition: transform 0.3s;
  }

  &__label {
    color: $primary-text-color;
    font-size: $font-size-1;
    &.open {
      transform: translateX(-16px);
    }

    &.close {
      transform: translateX(16px);
    }
  }

  &-disabled {
    opacity: 0.6;
  }

  &-base {
    width: $switch-width;
    height: $switch-height;
    line-height: $switch-line-height;

    .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;
      }
    }
  }
}
