.fs-support,
.fs-support * {
  box-sizing: border-box;
}

.fs-support {
  --fs-support-accent: #087f8c;
  --fs-support-accent-dark: #056a75;
  --fs-support-ink: #132c3a;
  --fs-support-muted: #647b86;
  --fs-support-line: #dfe8ea;
  --fs-support-surface: #ffffff;
  --fs-support-soft: #f3f8f9;
  position: fixed;
  z-index: 4000;
  right: 24px;
  bottom: 24px;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--fs-support-ink);
  pointer-events: none;
}

.fs-support button,
.fs-support textarea {
  font: inherit;
}

.fs-support-launcher {
  position: relative;
  z-index: 3;
  display: grid;
  width: 60px;
  height: 60px;
  margin-left: auto;
  padding: 0;
  place-items: center;
  color: #fff;
  background: var(--fs-support-accent);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 14px 34px rgba(5, 83, 93, .26), 0 4px 12px rgba(5, 83, 93, .16);
  cursor: pointer;
  pointer-events: auto;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
  transform: scale(.8);
  transform-origin: bottom right;
}

.fs-support-launcher:hover {
  background: var(--fs-support-accent-dark);
  box-shadow: 0 16px 38px rgba(5, 83, 93, .31), 0 5px 14px rgba(5, 83, 93, .18);
  transform: translateY(-2px) scale(.8);
}

.fs-support-launcher:focus-visible,
.fs-support button:focus-visible,
.fs-support textarea:focus-visible {
  outline: 3px solid rgba(8, 127, 140, .22);
  outline-offset: 3px;
}

.fs-support-launcher .fs-support-chat-icon,
.fs-support-launcher .fs-support-close-icon {
  position: absolute;
  width: 31px;
  height: 31px;
  transition: opacity .16s ease, transform .2s ease;
}

.fs-support-launcher .fs-support-chat-icon {
  width: 43px;
  height: 38px;
  display: block;
  object-fit: contain;
  background: transparent;
}

.fs-support-launcher .fs-support-close-icon {
  opacity: 0;
  transform: rotate(-45deg) scale(.75);
}

.fs-support.is-open .fs-support-launcher .fs-support-chat-icon {
  opacity: 0;
  transform: rotate(45deg) scale(.75);
}

.fs-support.is-open .fs-support-launcher .fs-support-close-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.fs-support.is-open .fs-support-launcher {
  transform: translate(8px, 10px) scale(.8);
}

.fs-support-hint {
  position: absolute;
  right: 72px;
  bottom: 8px;
  width: max-content;
  max-width: 250px;
  padding: 11px 14px;
  color: var(--fs-support-ink);
  background: #fff;
  border: 1px solid var(--fs-support-line);
  border-radius: 13px 13px 4px 13px;
  box-shadow: 0 10px 30px rgba(18, 54, 66, .14);
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.fs-support-hint.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.fs-support-panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(400px, calc(100vw - 32px));
  height: min(650px, calc(100svh - 122px));
  min-height: 470px;
  overflow: hidden;
  background: var(--fs-support-surface);
  border: 1px solid rgba(19, 44, 58, .08);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(11, 48, 60, .2), 0 8px 24px rgba(11, 48, 60, .1);
  opacity: 0;
  transform: translateY(14px) scale(.776);
  transform-origin: bottom right;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .22s ease, visibility .22s;
}

.fs-support.is-open .fs-support-panel {
  opacity: 1;
  transform: translateY(0) scale(.8);
  visibility: visible;
  pointer-events: auto;
}

.fs-support-header {
  position: relative;
  display: flex;
  min-height: 86px;
  padding: 18px 54px 16px 20px;
  align-items: center;
  gap: 12px;
  color: #fff;
  background: var(--fs-support-accent);
}

.fs-support-header::after {
  content: "";
  position: absolute;
  right: -35px;
  top: -56px;
  width: 160px;
  height: 160px;
  border: 28px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  pointer-events: none;
}

.fs-support-brand-mark,
.fs-support-agent-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
}

.fs-support-brand-mark {
  width: 46px;
  height: 46px;
  color: #fff;
  background: var(--fs-support-accent-dark);
  box-shadow: 0 5px 15px rgba(5, 80, 90, .22), inset 0 0 0 1px rgba(255, 255, 255, .14);
}

.fs-support-brand-mark img {
  width: 31px;
  height: 27px;
  display: block;
  object-fit: contain;
}

.fs-support-header-copy {
  min-width: 0;
}

.fs-support-header-copy strong {
  display: block;
  margin-bottom: 3px;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: .01em;
}

.fs-support-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  line-height: 1.4;
}

.fs-support-status i {
  display: block;
  width: 7px;
  height: 7px;
  background: #6ee7b7;
  border: 2px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(110, 231, 183, .12);
}

.fs-support.is-offline .fs-support-status i {
  background: #f4c15d;
  border-color: rgba(255,255,255,.55);
  box-shadow: 0 0 0 3px rgba(244,193,93,.12);
}
.fs-support.agent-busy .fs-support-status i { background: #ffd36a; }
.fs-support.agent-offline .fs-support-status i { background: #d8e1e3; box-shadow: none; }

.fs-support-minimize {
  position: absolute;
  z-index: 1;
  right: 17px;
  top: 22px;
  display: grid;
  width: 35px;
  height: 35px;
  padding: 0;
  place-items: center;
  color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .1);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.fs-support-minimize:hover {
  background: rgba(255, 255, 255, .2);
}

.fs-support-minimize svg {
  width: 19px;
  height: 19px;
}

.fs-support-conversation {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 16px 22px;
  background: var(--fs-support-soft);
  overscroll-behavior: contain;
  scrollbar-color: rgba(8, 127, 140, .28) transparent;
  scrollbar-width: thin;
}

.fs-support-day {
  margin: 0 0 16px;
  text-align: center;
  color: #81939b;
  font-size: 11px;
  line-height: 1.4;
}

.fs-support-row {
  display: flex;
  margin: 0 0 15px;
  align-items: flex-end;
  gap: 9px;
}

.fs-support-row.is-user {
  justify-content: flex-end;
}

.fs-support-agent-avatar {
  width: 30px;
  height: 30px;
  margin-bottom: 18px;
  background: var(--fs-support-accent);
  border: 1px solid var(--fs-support-accent-dark);
  box-shadow: 0 3px 10px rgba(8, 127, 140, .2);
}

.fs-support-agent-avatar img {
  width: 22px;
  height: 19px;
  display: block;
  object-fit: contain;
}

.fs-support-message-wrap {
  max-width: calc(100% - 52px);
}

.fs-support-row.is-user .fs-support-message-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.fs-support-bubble {
  padding: 12px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #fff;
  border: 1px solid rgba(19, 44, 58, .07);
  border-radius: 5px 17px 17px 17px;
  box-shadow: 0 5px 15px rgba(30, 68, 80, .08);
  font-size: 14px;
  line-height: 1.62;
}

.fs-support-row.is-user .fs-support-bubble {
  color: #fff;
  background: var(--fs-support-accent);
  border-color: var(--fs-support-accent);
  border-radius: 17px 5px 17px 17px;
  box-shadow: 0 6px 16px rgba(8, 127, 140, .2);
}

.fs-support-meta {
  margin-top: 5px;
  color: #84969e;
  font-size: 10px;
  line-height: 1.4;
}

.fs-support-row.is-user .fs-support-meta {
  padding-right: 2px;
}

.fs-support-quick-wrap {
  margin: 4px 0 18px 39px;
}

.fs-support-quick-label {
  display: block;
  margin: 0 0 9px;
  color: var(--fs-support-muted);
  font-size: 12px;
}

.fs-support-quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.fs-support-quick {
  min-height: 34px;
  padding: 7px 11px;
  color: var(--fs-support-accent-dark);
  background: #fff;
  border: 1px solid #cfe3e6;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}

.fs-support-quick:hover {
  color: #fff;
  background: var(--fs-support-accent);
  border-color: var(--fs-support-accent);
  transform: translateY(-1px);
}

.fs-support-typing {
  display: none;
  margin: 0 0 15px 39px;
  align-items: center;
  gap: 5px;
}

.fs-support-typing.is-visible {
  display: flex;
}

.fs-support-typing span {
  width: 6px;
  height: 6px;
  background: #92abb4;
  border-radius: 50%;
  animation: fs-support-typing 1s ease-in-out infinite;
}

.fs-support-typing span:nth-child(2) { animation-delay: .14s; }
.fs-support-typing span:nth-child(3) { animation-delay: .28s; }

.fs-support-composer {
  padding: 12px 14px 10px;
  background: #fff;
  border-top: 1px solid var(--fs-support-line);
}

.fs-support-input-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 48px;
  padding: 5px;
  align-items: end;
  border: 1px solid #cbdcdf;
  border-radius: 15px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.fs-support-input-shell:focus-within {
  border-color: var(--fs-support-accent);
  box-shadow: 0 0 0 3px rgba(8, 127, 140, .11);
}

.fs-support-attach,
.fs-support-send {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
}

.fs-support-attach {
  color: #506a75;
  background: transparent;
}

.fs-support-attach:hover {
  color: var(--fs-support-accent);
  background: var(--fs-support-soft);
}

.fs-support-attach:disabled {
  opacity: .38;
  cursor: default;
}

.fs-support-send {
  color: #fff;
  background: var(--fs-support-accent);
  transition: background .16s ease, opacity .16s ease;
}

.fs-support-send:hover {
  background: var(--fs-support-accent-dark);
}

.fs-support-send:disabled {
  opacity: .42;
  cursor: default;
}

.fs-support-attach svg,
.fs-support-send svg {
  width: 20px;
  height: 20px;
}

.fs-support-input {
  width: 100%;
  min-height: 38px;
  max-height: 96px;
  padding: 9px 7px 7px;
  resize: none;
  color: var(--fs-support-ink);
  background: transparent;
  border: 0;
  outline: 0 !important;
  box-shadow: none !important;
  font-size: 14px;
  line-height: 1.5;
}

.fs-support-input::placeholder {
  color: #91a1a7;
}

.fs-support-attachment {
  display: block;
  margin-top: 7px;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fs-support-footnote {
  margin: 8px 0 0;
  text-align: center;
  color: #82939a;
  font-size: 10px;
  line-height: 1.4;
}

.fs-support-unread {
  position: absolute;
  right: -2px;
  top: -2px;
  display: none;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  color: #fff;
  background: #e14c4c;
  border: 2px solid #fff;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 750;
}

.fs-support-unread.is-visible {
  display: grid;
}

.fs-support-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes fs-support-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 560px) {
  .fs-support {
    right: 14px;
    bottom: 14px;
  }

  .fs-support-launcher {
    width: 56px;
    height: 56px;
  }

  .fs-support-panel {
    position: fixed;
    inset: 10px 10px 78px;
    width: auto;
    height: auto;
    min-height: 0;
    border-radius: 20px;
    transform-origin: bottom right;
  }

  .fs-support-header {
    min-height: 80px;
    padding: 15px 50px 14px 16px;
  }

  .fs-support-brand-mark {
    width: 42px;
    height: 42px;
  }

  .fs-support-conversation {
    padding: 15px 13px 20px;
  }

  .fs-support-composer {
    padding: 10px 10px 8px;
  }
}

@media (max-height: 650px) and (min-width: 561px) {
  .fs-support-panel {
    height: calc(100svh - 102px);
    min-height: 430px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fs-support *,
  .fs-support *::before,
  .fs-support *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
