@mixin focusInput {
  border: 1px solid $--color-c9;
  box-shadow: $--box-shadow-input;
}

.jerri-select {
  position: relative;
  height: $--height-input;
  width: 100%;
  display: inline-block;
  vertical-align: middle;
  min-width: 60px;
  box-sizing: border-box;

  & > input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    padding-left: 8px;
    padding-right: 20px;
    padding-bottom: 2px;
    border: 1px solid $--color-c3;
    border-radius: $--border-radius-base;
    line-height: $--height-input;
    color: $--color-c1;
    cursor: pointer;
    @include ellip;
    @include placeholder($--color-c2);

    &:hover,
    &:focus {
      @include focusInput;
    }

    // 禁用输入框样式
    &.disabled {
      background-color: $--color-c16 !important;
      border: 1px solid $--color-c3;
      color: $--color-c17 !important;
      @include placeholder($--color-c17);

      &:focus,
      &:hover {
        border: 1px solid $--color-c3;
        box-shadow: none;
      }
    }

    // 占位符为全部的时候
    &.black {
      @include placeholder($--color-c1);
    }
  }

  .disabled {
    cursor: no-drop;
  }

  .arrow,
  .icon-wrong-warning {
    z-index: 6;
    cursor: pointer;
    font-size: 24px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0px;
    transition: 0.3s;

    &.disabled {
      display: none;
    }

    &.re {
      transform: rotate(180deg) translateY(50%);
    }

    &:hover {
      & ~ input {
        @include focusInput;
      }
    }
  }

  .icon-wrong-warning {
    color: #abc0ba;
    transition: none;
    &:hover {
      color: $--color-c11;
    }
  }
}

.optionsWrap {
  max-height: 265px;
  overflow-y: auto;
  box-sizing: border-box;
  border-top: 0;
  z-index: 20;
  background-color: $--color-c6;
  border-radius: 0 0 $--border-radius-base $--border-radius-base;

  .jr-options-item {
    position: relative;

    &.disabled {
      background-color: $--color-c0 !important;
      color: $--color-c2 !important;
      text-align: left;
      cursor: not-allowed;

      &:hover {
        font-weight: normal;
      }
    }

    &.insert-mark {
      padding-left: 24px;
    }

    > i {
      position: absolute;
      width: 8px;
      height: 8px;
      top: 0;
      bottom: 0;
      left: 8px;
      margin: auto;
      border-radius: 50%;
      background-color: $--color-c8;
    }
  }
}

// 下拉选项
.options {
  position: absolute;
  z-index: 99;
  border-radius: $--border-radius-base;
  border: solid 1px $--color-c9;
  box-shadow: 0px 1px 10px 0px rgba($--color-c1, 0.2);
  @include scroll-bar;

  ul {
    display: inline-block;
    background-color: $--color-c6;

    &.drop-up {
      bottom: 100%;
      top: auto;
    }

    &.auto-pos {
      bottom: 200%;
      top: auto;
    }

    li {
      padding-left: 8px;
      height: $--height-input;
      line-height: $--height-input;
      text-align: left;
      cursor: pointer;
      font-size: $--font-xs;
      font-weight: normal;
      color: $--color-c13;

      &:hover {
        background-color: #eff4ef;
      }

      &.selected {
        background-color: $--color-c10;
        font-weight: 600;
      }
    }
  }

  .search {
    z-index: 21;
    top: calc(100% + 5px);
    border-bottom: 1px solid $--color-c3;
    box-sizing: content-box;
    border-radius: $--border-radius-base $--border-radius-base 0 0;

    label {
      position: absolute;
      left: 4px;
      color: $--color-c2;
      font-size: $--font-l;
      line-height: $--height-input;
    }

    input {
      border-radius: $--border-radius-base $--border-radius-base 0 0;
      width: 100%;
      padding-left: $--height-input;
      border: 0;
      height: $--height-input;
      line-height: $--height-input;
      background-color: $--color-c5;
    }

    &.drop-up {
      top: -100%;
    }
  }
}
