/* 右下角悬浮操作栏 */
.ns-floatdock {
  position: fixed;
  right: 18px;
  bottom: 24px;
  z-index: 990;
  pointer-events: none;
  --ns-dock-size: 56px;
  --ns-dock-radius: 50%;
  --ns-dock-gotop-size: 48px;
  --ns-dock-gap: 12px;
  --ns-dock-color: #2563eb;
  --ns-dock-color-light: #eff6ff;
}

.ns-floatdock__group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ns-dock-gap, 12px);
}

.ns-floatdock__item,
.ns-floatdock__gotop {
  pointer-events: auto;
}

.ns-floatdock__btn2 {
  position: relative;
}

.ns-floatdock__trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--ns-dock-size, 56px);
  height: var(--ns-dock-size, 56px);
  border-radius: var(--ns-dock-radius, 50%);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: visible;
}

.ns-floatdock__trigger:hover,
.ns-floatdock__trigger:focus {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--ns-dock-color, #2563eb) 28%, transparent);
  text-decoration: none;
  outline: none;
}

.ns-floatdock__trigger-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: var(--ns-dock-radius, 50%);
  overflow: hidden;
  background: var(--ns-dock-color-light, #eff6ff);
  color: var(--ns-dock-color, #2563eb);
  font-size: calc(var(--ns-dock-size, 56px) * 0.39);
}

.ns-floatdock__trigger-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ns-floatdock__hover-tip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  min-width: 120px;
  max-width: 220px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--ns-dock-color, #2563eb);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--ns-dock-color, #2563eb) 35%, transparent);
}

.ns-floatdock__hover-tip::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent var(--ns-dock-color, #2563eb);
}

.ns-floatdock__hover-tip--qrcode {
  min-width: 132px;
  width: max-content;
  max-width: none;
  padding: 6px;
  white-space: normal;
  overflow: visible;
}

.ns-floatdock__hover-tip--qrcode img {
  display: block;
  width: 120px !important;
  min-width: 120px;
  max-width: none !important;
  height: 120px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}

.ns-floatdock__hover-tip p {
  margin: 0;
}

.ns-floatdock__trigger:hover .ns-floatdock__hover-tip,
.ns-floatdock__trigger:focus .ns-floatdock__hover-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.ns-floatdock__circles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ns-floatdock__circles .circle {
  position: absolute;
  inset: 0;
  border-radius: var(--ns-dock-radius, 50%);
  border: 1px solid color-mix(in srgb, var(--ns-dock-color, #2563eb) 30%, transparent);
  animation: ns-floatdock-pulse 2.4s ease-out infinite;
}

.ns-floatdock__circles .c-2 {
  animation-delay: 0.8s;
}

.ns-floatdock__circles .c-3 {
  animation-delay: 1.6s;
}

@keyframes ns-floatdock-pulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

.ns-floatdock__gotop {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--ns-dock-gotop-size, 48px);
  height: var(--ns-dock-gotop-size, 48px);
  border: none;
  border-radius: var(--ns-dock-radius, 50%);
  background: #fff;
  color: #64748b;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, color 0.2s ease, background 0.2s ease;
  font-size: calc(var(--ns-dock-gotop-size, 48px) * 0.34);
}

.ns-floatdock__gotop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ns-floatdock__gotop:hover,
.ns-floatdock__gotop:focus {
  color: var(--ns-dock-color, #2563eb);
  background: var(--ns-dock-color-light, #eff6ff);
  outline: none;
}

@media (max-width: 767px) {
  .ns-floatdock {
    display: none !important;
  }

  body:has(.ns-mobile-kefu-bar.is-on) {
    padding-bottom: calc(var(--ns-mobile-kefu-bar-h, 72px) + env(safe-area-inset-bottom, 0px));
  }
}

/* 手机端底部快捷联系 */
.ns-mobile-kefu-bar {
  display: none;
}

:root {
  --ns-mobile-kefu-bar-h: 72px;
}

@media (max-width: 767px) {
  .ns-mobile-kefu-bar.is-on {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 985;
    display: flex;
    align-items: stretch;
    gap: 12px;
    box-sizing: border-box;
    min-height: var(--ns-mobile-kefu-bar-h, 72px);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .ns-mobile-kefu-bar__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 12px 0;
    border: none;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  }

  .ns-mobile-kefu-bar__btn:active {
    transform: scale(0.98);
  }

  .ns-mobile-kefu-bar__btn .fa {
    font-size: 22px;
    color: #fff;
  }

  .ns-mobile-kefu-bar__btn span {
    color: #fff;
  }

  .ns-mobile-kefu-bar__icon-wework {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #fff;
    flex-shrink: 0;
  }

  .ns-mobile-kefu-bar__icon-wework svg {
    display: block;
    width: 22px;
    height: 22px;
  }

  .ns-mobile-kefu-bar__btn--tel {
    margin-right: 0;
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
  }

  .ns-mobile-kefu-bar__btn--wechat {
    color: #fff;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.24);
  }

  .ns-mobile-kefu-bar__btn--wechat:only-child {
    margin-left: 0;
  }

  .ns-mobile-kefu-bar__btn--tel:only-child {
    margin-right: 0;
  }
}

/* 在线咨询外链桥接层（新窗口打开，本页不跳转） */
.ns-online-bridge {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.ns-online-bridge.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ns-online-bridge__bg {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ns-online-bridge__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  padding: 28px 24px 22px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  text-align: center;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease;
}

.ns-online-bridge.is-open .ns-online-bridge__panel {
  transform: translateY(0) scale(1);
}

.ns-online-bridge__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.ns-online-bridge__close:hover,
.ns-online-bridge__close:focus {
  background: #e2e8f0;
  color: #334155;
  outline: none;
}

.ns-online-bridge__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.ns-online-bridge__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
}

.ns-online-bridge__desc {
  margin: 0 0 14px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
}

.ns-online-bridge__fallback {
  margin: 0 0 10px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

.ns-online-bridge:not(.is-blocked) .ns-online-bridge__fallback,
.ns-online-bridge:not(.is-blocked) .ns-online-bridge__open {
  display: none;
}

.ns-online-bridge__open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  height: 42px;
  padding: 0 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.ns-online-bridge__open:hover,
.ns-online-bridge__open:focus {
  color: #fff !important;
  text-decoration: none !important;
}

body.ns-online-bridge-open {
  overflow: hidden;
}
