input-box {
  display: inline-block;
  position: relative;

  #textbox {
    line-height: 26px;
  }

  .placeholder {
    padding: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  textarea {
    border: 0;
    padding: 4px;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
    font: inherit;
    line-height: inherit;
    resize: none;
  }

  &.enable-highlight {
    @supports (caret-color: #333) {
      textarea {
        color: transparent;
        caret-color: #333;
        background: none;
      }
    }

    @supports not (caret-color: #333) {
      /* Firefox 41 😞
         让 div 盖住 textarea。一个明显的问题是选中文本框中的文字后文字不会变色 */
      .placeholder {
        position: relative;
        z-index: 1;
        pointer-events: none;
      }
    }
  }
  &.disable-highlight {
    .placeholder {
      visibility: hidden;
    }
  }

  #listbox {
    position: fixed;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    z-index: 10000;

    &.vertical {
      display: block;
      border-radius: 0;

      .complete-list {
        width: 350px;
        border-radius: 5px 5px 0 0;
      }

      .complete-example {
        left: 0;
        top: -1px;
        border-radius: 0 0 5px 5px;
      }
    }
  }

  .list-item {
    padding: 6px 14px;
    display: flex;
    flex: 1;
    justify-content: space-between;
    position: static;
    color: #585858;

    + .list-item {
      border-top: 1px solid #EBEBEB;
    }

    div {
      pointer-events: none;
    }

    .text-ellipsis {
      flex: 1;
      margin-right: 8px;
    }

    &.active {
      background-color: rgba(0, 200, 193, 0.28);
    }
  }

  .complete-example {
    padding: 6px 14px;
    overflow-x: hidden;
    margin: 0;
    background: #F4F4F4;
    border: 1px solid #D7D7D7;
    border-radius: 0 5px 5px 0;
    width: 350px;
    position: relative;
    left: -1px;
    font-size: 14px;
    word-wrap: break-word;

    header {
      font-weight: bold;
    }

    p {
      white-space: pre-line;
    }

    div + div {
      margin-top: 8px;
    }
  }

  .complete-list {
    width: 300px;
    max-height: 233px;
    overflow-x: hidden;
    margin: 0;
    background: white;
    border: 1px solid #D7D7D7;
    border-radius: 5px 0 0 5px;
  }

  &:not(.completing) #listbox {
    display: none;
  }

  &[placeholder]::after {
    content: attr(placeholder);
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    padding: 4px;
    line-height: 26px;
    color: #999;
    text-overflow: clip;
    pointer-events: none;
  }

  &.ng-not-empty::after {
    display: none !important;
  }
}
