/* 官网即时咨询浮窗 */
.gw-live-chat {
  --gw-chat-primary: #f15a24;
  --gw-chat-primary-dark: #ea580c;
  --gw-chat-bg: #fff;
  --gw-chat-muted: #64748b;
  --gw-chat-surface: #f4f6f9;
  position: fixed;
  right: 1rem;
  bottom: 65px;
  z-index: 99999;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  isolation: isolate;
}

.gw-live-chat__dock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.25rem;
  position: relative;
  z-index: 2;
  overflow: visible;
}

/* 竖排圆形图标，悬停时内容在左侧滑出 */
.gw-live-chat__contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.8rem;
  overflow: visible;
}

.gw-live-chat__contact-item[hidden] {
  display: none !important;
}

.gw-live-chat__contact-item {
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(241, 90, 36, 0.12);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1);
  cursor: default;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
  transition:
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

.gw-live-chat__contact-item:hover {
  transform: scale(1.06);
  border-color: rgba(241, 90, 36, 0.45);
  box-shadow:
    0 10px 28px rgba(241, 90, 36, 0.2),
    0 0 0 4px rgba(241, 90, 36, 0.08);
  z-index: 30;
}

.gw-live-chat__contact-icon {
  position: relative;
  z-index: 2;
  flex: 0 0 3.25rem;
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f15a24;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff 0%, #fffaf7 100%);
  transition: color 0.25s ease;
}

.gw-live-chat__contact-item:hover .gw-live-chat__contact-icon {
  color: #ea580c;
}

.gw-live-chat__contact-tip {
  position: absolute;
  right: calc(100% + 0.75rem);
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  min-width: 0;
  max-width: min(20rem, calc(100vw - 6rem));
  padding: 0.625rem 0.875rem 0.625rem 1rem;
  background: linear-gradient(135deg, #fff 0%, #fffaf8 100%);
  border: 1px solid rgba(241, 90, 36, 0.14);
  border-radius: 0.75rem;
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.12),
    0 2px 8px rgba(241, 90, 36, 0.08);
  text-align: right;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) translateX(1rem) scale(0.92);
  transform-origin: center right;
  transition:
    opacity 0.28s ease,
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.28s ease;
  z-index: 1;
}

.gw-live-chat__contact-tip::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.625rem;
  bottom: 0.625rem;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f15a24 0%, #ed1c24 100%);
  opacity: 0.85;
}

.gw-live-chat__contact-tip::after {
  content: "";
  position: absolute;
  right: -0.375rem;
  top: 50%;
  width: 0.625rem;
  height: 0.625rem;
  background: #fffaf8;
  border-top: 1px solid rgba(241, 90, 36, 0.14);
  border-right: 1px solid rgba(241, 90, 36, 0.14);
  transform: translateY(-50%) rotate(45deg);
  box-shadow: 2px -2px 4px rgba(15, 23, 42, 0.04);
}

.gw-live-chat__contact-tip-label {
  display: block;
  padding-left: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: #f15a24;
  text-transform: none;
  opacity: 0;
  transform: translateX(0.375rem);
  transition:
    opacity 0.24s ease 0.06s,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1) 0.06s;
}

.gw-live-chat__contact-tip-value {
  display: block;
  padding-left: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  color: #1e293b;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(0.5rem);
  transition:
    opacity 0.28s ease 0.1s,
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}

.gw-live-chat__contact-item--address .gw-live-chat__contact-tip-value {
  white-space: normal;
}

.gw-live-chat__contact-tip--address {
  align-items: stretch;
  min-width: min(22rem, calc(100vw - 5.5rem));
  max-width: min(32rem, calc(100vw - 4.5rem));
  padding: 0.875rem 1rem 0.875rem 1.125rem;
}

.gw-live-chat__contact-tip--address .gw-live-chat__contact-tip-body {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.875rem;
  width: 100%;
}

.gw-live-chat__contact-tip--address .gw-live-chat__contact-tip-label {
  flex: 0 0 auto;
  margin-top: 0.125rem;
  padding: 0.3125rem 0.625rem;
  background: rgba(241, 90, 36, 0.08);
  border-radius: 0.375rem;
  white-space: nowrap;
}

.gw-live-chat__contact-tip--address .gw-live-chat__contact-tip-value {
  flex: 1;
  min-width: 0;
  max-width: none;
  text-align: left;
  line-height: 1.65;
  font-size: 0.875rem;
  word-break: break-word;
}

.gw-live-chat__contact-tip--wechat {
  align-items: stretch;
  min-width: min(24rem, calc(100vw - 5.5rem));
  max-width: min(28rem, calc(100vw - 4.5rem));
  padding: 1rem 1rem 1rem 1.125rem;
}

.gw-live-chat__contact-tip--wechat .gw-live-chat__contact-tip-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.gw-live-chat__contact-qr-wrap {
  flex: 0 0 auto;
  padding: 0.5rem;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 0.625rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  opacity: 0;
  transform: translateX(0.5rem) scale(0.94);
  transition:
    opacity 0.3s ease 0.08s,
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.08s;
}

.gw-live-chat__contact-tip-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  flex: 1 1 auto;
  min-width: 7.5rem;
  text-align: left;
}

.gw-live-chat__contact-tip--wechat .gw-live-chat__contact-tip-label,
.gw-live-chat__contact-tip--wechat .gw-live-chat__contact-tip-value {
  text-align: left;
  padding-left: 0;
}

.gw-live-chat__contact-tip--wechat .gw-live-chat__contact-tip-value {
  white-space: nowrap;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.gw-live-chat__contact-tip-hint {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  color: #64748b;
  opacity: 0;
  transform: translateX(0.375rem);
  transition:
    opacity 0.28s ease 0.14s,
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.14s;
}

.gw-live-chat__contact-qr {
  display: block;
  width: 9.5rem;
  height: 9.5rem;
  object-fit: contain;
  border-radius: 0.375rem;
  background: #fff;
}

.gw-live-chat__contact-item:hover .gw-live-chat__contact-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0) scale(1);
}

.gw-live-chat__contact-item:hover .gw-live-chat__contact-tip-label,
.gw-live-chat__contact-item:hover .gw-live-chat__contact-tip-value,
.gw-live-chat__contact-item:hover .gw-live-chat__contact-tip-hint {
  opacity: 1;
  transform: translateX(0);
}

.gw-live-chat__contact-item:hover .gw-live-chat__contact-qr-wrap {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.gw-live-chat.is-open .gw-live-chat__dock {
  display: none;
}

.gw-live-chat__launcher {
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(145deg, #f15a24, #ea580c);
  color: #fff;
  box-shadow: 0 10px 28px rgba(241, 90, 36, 0.32);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gw-live-chat__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(241, 90, 36, 0.38);
}

.gw-live-chat.is-open .gw-live-chat__launcher {
  display: none;
}

.gw-live-chat__panel {
  display: none;
  position: relative;
  z-index: 3;
  width: min(24rem, calc(100vw - 2rem));
  height: min(30rem, calc(100vh - 6rem));
  background: var(--gw-chat-bg);
  border-radius: 1.125rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.2);
  overflow: hidden;
  flex-direction: column;
}

.gw-live-chat.is-open .gw-live-chat__panel {
  display: flex;
}

.gw-live-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9375rem 1rem;
  background: #fff;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.gw-live-chat__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.gw-live-chat__brand img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(241, 90, 36, 0.12);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.gw-live-chat__brand strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.gw-live-chat__brand span {
  display: block;
  font-size: 0.75rem;
  color: var(--gw-chat-muted);
  line-height: 1.3;
}

.gw-live-chat__close {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}

.gw-live-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.875rem;
  background: var(--gw-chat-surface);
  -webkit-overflow-scrolling: touch;
}

.gw-live-chat__msg {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: flex-start;
  max-width: 100%;
}

.gw-live-chat__msg.is-me {
  flex-direction: row-reverse;
}

.gw-live-chat__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #475569;
  overflow: hidden;
}

.gw-live-chat__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gw-live-chat__body {
  min-width: 0;
  max-width: calc(100% - 2.75rem);
  display: flex;
  flex-direction: column;
}

.gw-live-chat__msg.is-me .gw-live-chat__body {
  align-items: flex-end;
}

.gw-live-chat__meta {
  font-size: 0.6875rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.gw-live-chat__bubble {
  display: inline-block;
  max-width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  background: #fff;
  color: #1e293b;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.gw-live-chat__msg:not(.is-me) .gw-live-chat__bubble {
  border-top-left-radius: 0.25rem;
}

.gw-live-chat__msg.is-me .gw-live-chat__bubble {
  background: linear-gradient(145deg, #f15a24, #ea580c);
  color: #fff;
  border-color: transparent;
  border-top-right-radius: 0.25rem;
  box-shadow: 0 4px 14px rgba(241, 90, 36, 0.22);
}

.gw-live-chat__composer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  align-items: center;
}

.gw-live-chat__input {
  flex: 1;
  min-width: 0;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  padding: 0.6875rem 1rem;
  font-size: 1rem;
  line-height: 1.4;
  outline: none;
  background: #f8fafc;
  -webkit-text-size-adjust: 100%;
}

.gw-live-chat__input:focus {
  border-color: rgba(241, 90, 36, 0.45);
  background: #fff;
}

.gw-live-chat__send {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 0.6875rem 1.125rem;
  background: var(--gw-chat-primary);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.gw-live-chat__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 767px) {
  .gw-live-chat {
    right: 0.75rem;
    bottom: 0.75rem;
    left: auto;
  }

  .gw-live-chat__contacts {
    gap: 0.8rem;
  }

  .gw-live-chat__panel {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .gw-live-chat__composer {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
}
