.#{$ns}Number {
  margin: 0;
  padding: 0;
  // line-height: var(--Form-input-height);
  font-size: var(--Form-input-fontSize);
  // height: var(--Form-input-height);
  display: inline-block;
  vertical-align: middle;
  background: var(--Number-bg);
  border: var(--Number-borderWidth) solid var(--Number-borderColor);
  border-radius: 4px;

  @media screen and (min-width: 1280px) and (max-width: 1440px) {
    border-radius: 0px;
  }

  @media screen and (min-width: 1440px) and (max-width: 1680px) {
    border-radius: 0px;
  }

  @include media-breakpoint-down(sm) {
    font-size: 15px;
  }

  &-disabled {
    background: var(--Form-input-onDisabled-bg) !important;
  }

  @include input-border();

  &.no-steps>&-handler-wrap {
    display: none;
  }

  &-focused {
    border-color: var(--Form-input-onFocused-borderColor);
    box-shadow: var(--Form-input-boxShadow);
  }

  &-handler {
    text-align: center;
    overflow: hidden;
    display: block;
    touch-action: none;

    &-active {
      background: #ddd;
    }
  }

  &-handler-up-inner,
  &-handler-down-inner {
    user-select: none;
    -webkit-user-select: none;
    display: inline-block;
  }

  &:hover {
    border-color: var(--Form-input-onFocused-borderColor);

    .#{$ns}Number-handler-up,
    .#{$ns}Number-handler-wrap {
      border-color: var(--Form-input-onFocused-borderColor);
    }
  }

  &-disabled:hover {
    border-color: var(--Form-input-borderColor);

    .#{$ns}Number-handler-up,
    .#{$ns}Number-handler-wrap {
      border-color: var(--Form-input-borderColor);
    }
  }

  &-input-wrap {
    overflow: hidden;
    height: 100%;
  }

  &-input {
    width: 100%;
    background: transparent;
    text-align: inherit;
    vertical-align: top;
    outline: 0;
    -moz-appearance: textfield;
    line-height: calc(var(--Form-input-height) - var(--Number-borderWidth) * 2);

    transition: all var(--animation-duration) ease;
    border: 0;
    border-radius: var(--Form-input-borderRadius);
    padding: 0 var(--Form-input-paddingX);
    color: var(--saas-font-size-black);
    @include input-placeholder();

    @include media-breakpoint-down(sm) {
      padding: 0;
      line-height: 22px;
    }

    @media screen and (min-width: 1280px) and (max-width: 1440px) {
      padding: 0;
      height: 100%;
    }

    @media screen and (min-width: 1440px) and (max-width: 1680px) {
      line-height: 22px;
    }
  }

  &-handler {
    background: var(--Number-handler-bg);
    color: var(--Number-handler-color);
    font-family: var(--Number-handler-fontFamily);
    font-size: var(--Number-handler-fontSize);

    &:hover {
      background: var(--Number-handler-onHover-bg);
      color: var(--Number-handler-onHover-color);
    }

    &:hover:active {
      background: var(--Number-handler-onActive-bg);
    }
  }

  &-handler-up {
    &-inner {
      transform: var(--Number-handler--up-transform);
      color: #999;

      &:after {
        content: var(--Number-handler--up-content);
      }
    }
  }

  &-handler-down {
    &-inner {
      &:after {
        color: #999;
        content: var(--Number-handler--down-content);
      }
    }
  }

  @if $Number-handler-mode==vertical {
    &-handler-wrap {
      float: right;
      border-left: px2rem(1px) solid var(--Form-input-borderColor);
      width: var(--Number-handler-width);
      height: 100%;
      border-top-right-radius: 4px;
      border-bottom-right-radius: 4px;
      overflow: hidden;
    }

    &-handler {
      line-height: calc((var(--Form-input-height) - #{px2rem(6px)}) / 2);
      height: calc((var(--Form-input-height) - var(--Number-borderWidth) * 2) / 2);

      @media screen and (min-width: 1280px) and (max-width: 1440px) {
        height: calc(1rem / 2);
        line-height: calc((1rem - #{px2rem(6px)}) / 2);
      }

      @media screen and (min-width: 1441px) and (max-width: 1680px) {
        height: calc(1.3rem / 2);
        line-height: calc((1.5rem - #{px2rem(6px)}) / 2);
      }
    }

    &-handler-up {
      border-bottom: var(--Number-handler-borderBottom);
      padding-top: px2rem(1px);
    }
  }

  @else {
    position: relative;

    &-input {
      text-align: center;
    }

    &-handler-up,
    &-handler-down {
      position: absolute;
      width: var(--Number-handler-width);
      height: 100%;
      top: 0;
    }

    &-handler-down {
      left: 0;
    }

    &-handler-up {
      right: 0;
    }
  }

  &-handler-down-disabled,
  &-handler-up-disabled {
    background: var(--Number-handler-onDisabled-bg);
    pointer-events: none;
    color: var(--Number-handler-onDisabled-color);
  }

  &-disabled {
    .#{$ns}Number-input {
      opacity: 0.72;
      cursor: not-allowed;
      background: var(--Form-input-onDisabled-bg);

      @include media-breakpoint-down(sm) {
        background: #fff;
      }
    }

    .#{$ns}Number-handler {
      opacity: 0.72;

      &:hover {
        color: var(--text--muted-color);
        border-color: var(--Form-input-borderColor);
      }
    }
  }
}

.#{$ns}NumberControl:not(.is-inline)>.#{$ns}Number {
  display: block;

  @media screen and (min-width: 1280px) and (max-width: 1440px) {
    height: 1.2rem;
  }

  @media screen and (min-width: 1441px) and (max-width: 1680px) {
    height: 1.5rem;
  }
}

.#{$ns}Number--borderHalf,
.#{$ns}Number--borderNone {
  .#{$ns}Number-handler-wrap {
    border-left: none;
  }
}

.#{$ns}NumberControl--withUnit {
  display: flex;

  .#{$ns}Number {
    flex-grow: 1;
  }

  .#{$ns}Select {
    border-left: 0;
  }
}

/** 
  * Aug -- 组件大小
 */
@mixin formatSize($fontSize, $height) {
  .#{$ns}Number {
    height: $height;
    line-height: $height;
    font-size: $fontSize;

    &-input {
      padding-top: 0;
      padding-bottom: 0;
    }
  }
}

.#{$ns}NumberControl {
  &.format-xs {
    @include formatSize(var(--fontSizeXs), var(--Form-input-height-xs));

    .#{$ns}Number-handler {
      font-size: var(--fontSizeXs);
      line-height: calc((var(--Form-input-height-xs) - #{px2rem(6px)}) / 2);
      height: calc((var(--Form-input-height-xs) - var(--Number-borderWidth) * 2) / 2);
    }
  }

  &.format-sm {
    @include formatSize(var(--fontSizeSm), var(--Form-input-height-sm));

    .#{$ns}Number-handler {
      font-size: var(--fontSizeSm);
      line-height: calc((var(--Form-input-height-sm) - #{px2rem(6px)}) / 2);
      height: calc((var(--Form-input-height-sm) - var(--Number-borderWidth) * 2) / 2);
    }
  }
}
