@import '../style/var';

.van-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: content-box;
  // ks add
  font-weight: 400;

  // hack for avoid max-width when use left & fixed
  width: @toast-default-width;
  max-width: @toast-max-width;
  min-height: @toast-default-min-height;
  padding: @toast-default-padding;
  color: @toast-text-color;
  font-size: 14px; // ks @toast-font-size => 14px;
  line-height: @toast-line-height;

  // allow newline character
  white-space: pre-wrap;
  text-align: center;
  // https://github.com/youzan/vant/issues/8959
  word-break: break-all;
  background-color: @toast-background-color;
  border-radius: @toast-border-radius;
  transform: translate3d(-50%, -50%, 0);

  &--unclickable {
    // lock scroll
    overflow: hidden;

    // should not add pointer-events: none directly to body tag
    // that will cause unexpected tap-highlight-color in mobile safari
    * {
      pointer-events: none;
    }
  }
  // ks add
  &--text {
    padding: 12px 16px;
}
  &--text,
  &--html {
    width: fit-content;
    min-width: @toast-text-min-width;
    min-height: 0;
    padding: @toast-text-padding;

    .van-toast__text {
      margin-top: 0;
    }
  }

  &--top {
    top: @toast-position-top-distance;
  }

  &--bottom {
    top: auto;
    bottom: @toast-position-bottom-distance;
  }

  &__icon {
    font-size: @toast-icon-size;
  }

  &__loading {
    padding: @padding-base;
    color: @toast-loading-icon-color;
  }

  &__text {
    margin-top: @padding-xs;
  }
  // ks add
  .ks-loading__spinner {
    -webkit-animation-duration: 2s;
    animation-duration: 2s;
    position: relative;
    display: inline-block;
    width: 36px;
    max-width: 100%;
    height: 36px;
    max-height: 100%;
    vertical-align: middle;
    -webkit-animation: van-rotate 0.8s linear infinite;
    animation: van-rotate 0.8s linear infinite;
    .van-icon__image {
        width: 36px;
        height: 36px;
    }
  }
}
