// 输入框 - 基础
input {
  height: $--height-input;
  box-sizing: border-box;
  border: 1px solid $--color-c3;
  border-radius: $--border-radius-base;
  padding: 0 8px;
  outline: none;
  width: 100%;
  font: normal $--font-xs "Mircosoft Yahei";

  &::placeholder {
    color: $--color-c2;
    font-size: 14px;
    position: relative;
    top: -1px;
  }

  &:focus span {
    i {
      color: $--color-c8;
    }
  }

  &:hover span {
    i {
      color: $--color-c8;
    }
  }
}

.jr-input {
  font-size: $--font-xs;
  position: relative;
  display: inline-block;
  width: 100%;
  min-width: 100px;

  input.border-deep {
    border-color: $--color-c3;
  }

  input.border-simple {
    border-color: $--color-c3;
  }

  input {
    &.over-icon,
    &:focus,
    &:hover {
      border: 1px solid $--color-c9;
      box-shadow: $--box-shadow-input;
    }

    &.readonly {
      cursor: pointer;
    }
  }

  &:hover {
    color: $--color-c9;

    i {
      color: $--color-c9;
    }
  }

  &:focus {
    color: $--color-c9;

    i {
      color: $--color-c9;
    }
  }

  span {
    i {
      font-size: 24px;
      color: $--color-c3;
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
    }
  }
}

// 后置图标-插槽
.jr-suffix-icon {
  position: absolute;
  top: 0;
  height: 100%;
  z-index: 1;
  right: 4px;

  i {
    right: 0;
  }

  &-search {
    top: 1px;
    background-color: $--color-c8;
    width: 32px;
    height: 30px;
    cursor: pointer;
    border-radius: 0 $--border-radius-base $--border-radius-base 0;
    @include center;
    transform: translateX(3px);

    i {
      font-size: $--font-l !important;
      color: $--color-c6 !important;
      right: auto;
    }

    &:hover {
      background-color: $--color-c9;
    }
  }
}

// 前置图标-插槽
.jr-prifix-icon {
  position: absolute;
  top: 0;
  height: 100%;
  z-index: 1;
  left: 4px;

  i {
    left: 0;
  }
}

// 前置图标-配置
.jr-input-prefix {
  padding-left: 30px;
}

// 后置图标-配置
.jr-input-suffix {
  padding-right: 30px;
}

.center {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

// 单下划线形式
.jr-input-underline {
  border-radius: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid $--color-c3 !important;

  &:focus,
  &:hover {
    border-bottom: 1px solid $--color-c9 !important;
    box-shadow: none !important;
  }
}

/** 禁用输入框 - start **/

.jr-input-disabled {
  background-color: $--color-c16 !important;
  border: 1px solid $--color-c3 !important;
  color: $--color-c17 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;

  & ~ span {
    cursor: not-allowed !important;

    i {
      color: $--color-c3 !important;
    }
  }
}

/** 禁用输入框 - end **/

/** 文本域 - start **/

// 文本域placeholder
textarea {
  &::placeholder {
    color: $--color-c2;
  }
}

.jr-textarea {
  position: relative;
  width: 100%;
  text-align: left;
  box-sizing: content-box;
  overflow: hidden;

  .jr-input-prefix {
    padding-left: 30px;
  }

  .jr-input-suffix {
    padding-right: 30px;
  }

  // 处理换行问题 overflow: hidden;
  > textarea {
    display: block;
    min-height: 80px;
    width: 100%;
    height: 100%;
    padding: 5px 11px 11px 11px;
    font-size: 13px;
    line-height: 23px;
    outline: none;
    resize: none;
    border: 1px solid $--color-c3;
    border-radius: $--border-radius-base;
    background-color: $--color-c6;
    &:hover {
      border: 1px solid $--color-c9;
    }

    &:focus {
      border: 1px solid $--color-c9;
    }
  }

  span {
    position: absolute;
    bottom: 4px;
    right: 7px;
    color: $--color-c2;
    font-weight: normal;
    font-size: 12px;
    font-family: Arial;
  }
}

.jr-textarea {
  // @include scroll-bar;
  textarea.scroll-bar {
    ::-webkit-scrollbar {
      width: 15px;
      height: 15px;
    }

    /*定义滚动条轨道*/
    ::-webkit-scrollbar-track {
      background-color: $--color-c14;
    }

    /*定义滑块*/
    ::-webkit-scrollbar-thumb {
      border-radius: $--border-radius-scroll;
      background-color: $--color-c3;

      &:hover {
        background-color: $--color-c18;
      }
    }
  }
}

/** 文本域 - end **/

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

input[type="number"] {
  -moz-appearance: textfield;
}
