.kefu-widget {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 900;
  display: flex;
  align-items: flex-end;
}

.kefu-fab {
  width: auto;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #3370ff 0%, #5b8cff 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(51, 112, 255, .32), 0 2px 6px rgba(16, 24, 40, .12);
  transition: transform .2s ease, box-shadow .2s ease;
}

.kefu-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(51, 112, 255, .4);
}

.kefu-fab:active {
  transform: translateY(0);
}

.kefu-fab svg {
  width: 26px;
  height: 26px;
}

.kefu-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.kefu-pop {
  position: absolute;
  right: calc(100% + 14px);
  bottom: 0;
  width: 216px;
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e8edf5;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px) scale(.96);
  transform-origin: right bottom;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.kefu-widget.is-open .kefu-pop {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.kefu-pop::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 22px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid #e8edf5;
  border-top: 1px solid #e8edf5;
  transform: rotate(45deg);
}

.kefu-qr {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

.kefu-info {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e8edf5;
}

.kefu-info p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: #667085;
  white-space: nowrap;
}

.kefu-info p + p {
  margin-top: 2px;
}

@media (max-width: 767px) {
  .kefu-widget {
    right: 16px;
    bottom: 20px;
  }

  .kefu-fab {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
  }

  .kefu-label {
    display: none;
  }

  .kefu-fab svg {
    width: 24px;
    height: 24px;
  }

  .kefu-pop {
    right: 0;
    bottom: calc(100% + 14px);
    width: 196px;
    padding: 14px;
    transform-origin: right bottom;
    transform: translateY(8px) scale(.96);
  }

  .kefu-widget.is-open .kefu-pop {
    transform: none;
  }

  .kefu-pop::after {
    right: 18px;
    bottom: -6px;
    border-right: 0;
    border-top: 0;
    border-left: 1px solid #e8edf5;
    border-bottom: 1px solid #e8edf5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kefu-fab,
  .kefu-pop {
    transition: none;
  }
}
