@import 'common/var.scss';

.qf-textarea {
  display: inline-block;
  width: 100%;
  vertical-align: bottom;
  font-size: 14px;

  .qf-textarea-inner {
    display: block;
    resize: vertical;
    padding: 5px 12px;
    line-height: 1.5;
    box-sizing: border-box;
    width: 100%;
    font-size: inherit;
    background-color: #fff;
    border: 1px solid $--color-border;
    border-radius: 4px;
    transition: border-color .2s cubic-bezier(.645, .045, .355, 1);

    &::placeholder {
      color: $--color-font-light-2;
    }

    &:hover {
      border-color: $--color-focus
    }

    &:focus {
      outline: 0;
      border-color: $--color-focus
    }
  }

  &.is-disabled {
    .qf-textarea-inner {
      background-color: $--color-bg-light;
      border-color: $--color-border-light-1;
      color: $--color-font-light-3;
      cursor: not-allowed;

      &::placeholder {
        color: $--color-font-light-2;
      }
    }
  }
}

.qf-input {
  position: relative;
  font-size: 14px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  border-radius: 4px;
  border: 1px solid $--color-border;
  background-color: #fff;
  padding: 0 12px;
  height: 36px;

  .qf-input-label {
    min-width: 40px;
    white-space: nowrap;
  }

  &.is-focus {
    border-color: $--color-focus
  }

  &:hover {
    border-color: $--color-focus
  }

  .input-out-zone {
    height: 100%;
    width: 100%;
    position: relative;
    .input-rewrite-placeholder {
      position: absolute;
      top: 0px;
      height: 100%;
      width: 100%;
      font-size: 12px;
      outline: none;
      pointer-events: none;
      color: $--color-placeholder;
      display: flex;
      align-items: center;
      overflow: hidden;
      word-break: break-all;
    }
    .input-rewrite-placeholder:empty::before {
      content: attr(placeholder);
    }
    .input-rewrite-placeholder:focus:before{
      content: none;
    }
    .is-clear {
      content: none;
      display: none;
    }
  }

  .qf-input-inner {
    flex: 1;
    font-size: inherit;
    outline-style: none;
    border: none;
    background-color: transparent;
    box-sizing: border-box;
    height: 100%;
    line-height: 1;
    outline: 0;
    width: 100%;

    &::placeholder {
      color: transparent;
    }

    &::-webkit-keygen-select {
      visibility: hidden;
      display: none !important;
      pointer-events: none;
      position: absolute;
      right: 0;
    }
  }

  .qf-input-clear {
    font-size: 14px;
    line-height: 16px;
    margin-left: 4px;
    cursor: pointer;

    &:hover {
      color: #909399
    }
  }

  .qf-input-append {
    line-height: 1;
    margin-right: -12px;
    padding: 0 12px;
  }

  &.is-disabled {
    background-color: $--color-bg;
    &:hover {
      border-color: $--color-border;
    }
  }

  &.qf-input-small {
    height: 32px;
    font-size: 13px;
  }
}
