.#{$search-bar-prefix-cls} {
  position: relative;
  display: flex;
  align-items: center;
  height: $search-bar-height;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 0.04rem;

  &__input {
    position: relative;
    flex: 1;
    width: 100%;
    height: $search-bar-input-height;
    overflow: hidden;
    background-clip: padding-box;
    border-radius: $border-width;

    .#{$search-bar-prefix-cls}__synthetic-ph,
    input[type='search'] {
      position: absolute;
      top: 0;
      left: 0;
    }

    .#{$search-bar-prefix-cls}__synthetic-ph {
      z-index: 1;
      display: flex;
      align-items: center;
      justify-content: left;
      width: 100%;
      height: 100%;
      padding: 0 0.08rem;
      transition: width $transition-time;

      &-icon {
        margin: 0 $search-bar-input-icon-margin-x;
        font-size: $search-bar-input-icon-font-size;

        /* NOTE: 修改图标和placeholder颜色 */
        // color: $gray-11;
        color: $search-bar-input-icon-color;

        @extend %aid-icon;
        &::before {
          content: '\F54E';
        }
      }

      &-placeholder {
        font-size: $search-bar-input-font-size;

        /* NOTE: 修改图标和placeholder颜色 */
        // color: $gray-11;
        color: $input-placeholder-color;
      }
    }

    input[type='search'] {
      z-index: 2;
      display: block;
      width: 100%;
      height: 100%;
      font-size: $search-bar-input-font-size;

      /* NOTE: 修改字体颜色 */
      // color: $gray-9;
      color: $input-color;
      text-align: left;
      background: transparent;
      border: 0;
      opacity: 0;

      &::placeholder {
        color: transparent;
      }

      &::-webkit-search-cancel-button {
        // stylelint-disable property-no-vendor-prefix
        -webkit-appearance: none;
      }
    }

    .#{$search-bar-prefix-cls}__clear {
      position: absolute;
      top: 50%;
      right: 0;
      z-index: 3;
      display: none;
      padding-right: nth($search-bar-input-padding-x, 2);
      font-size: $search-bar-input-icon-font-size;
      color: $gray-11;
      transition: all $transition-time;
      transform: translate(0, -50%);
      @extend %aid-icon;

      &::before {
        content: '\F10D';
      }

      &--show {
        display: block;
      }
    }
  }

  &__cancel {
    display: none;
    flex: none;
    height: $search-bar-height;
    padding-left: $search-bar-cancel-margin-x;
    margin-right: -0.4rem;
    line-height: $search-bar-height;
    color: $gray-9;
    text-align: right;
    opacity: 0;

    &--anim {
      transition: margin-right $transition-time, opacity $transition-time;
      transition-delay: 0.1s;
    }

    &--show {
      display: block;
      margin-right: 0;
      opacity: 1;
    }
  }

  &--start {
    .#{$search-bar-prefix-cls}__input {
      input[type='search'] {
        padding-left: 0.64rem;
        opacity: 1;

        &::placeholder {
          color: $gray-11;
          text-align: left;
        }
      }
      .#{$search-bar-prefix-cls}__synthetic-ph {
        justify-content: flex-start;

        &-placeholder {
          visibility: hidden;
        }
      }
    }
  }
}
