/* ===== 梦境跨境 · 微信客服浮层 ===== */

.mj-wechat {
  --mj-wechat-gold: rgba(198, 167, 106, 0.72);
  --mj-wechat-gold-soft: rgba(198, 167, 106, 0.22);
  --mj-wechat-ink: #1a1816;
  --mj-wechat-glass: rgba(252, 248, 242, 0.82);
  --mj-wechat-line: rgba(26, 24, 22, 0.08);
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  font-family: var(--font-b-medium, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif);
  position: fixed;
  right: calc(1.1rem + env(safe-area-inset-right, 0px));
  z-index: 120;
}

.mj-wechat__trigger {
  align-items: center;
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  background:
    radial-gradient(120% 120% at 30% 0%, rgba(255, 255, 255, 0.55), transparent 55%),
    var(--mj-wechat-glass);
  border: 1px solid var(--mj-wechat-gold-soft);
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    0 10px 28px rgba(26, 24, 22, 0.14),
    0 2px 8px rgba(26, 24, 22, 0.06);
  color: var(--mj-wechat-ink);
  cursor: pointer;
  display: inline-flex;
  gap: 0.45rem;
  height: 2.65rem;
  isolation: isolate;
  padding: 0 0.85rem 0 0.7rem;
  position: relative;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease;
}

.mj-wechat__trigger::before {
  animation: mj-wechat-pulse 3.2s ease-in-out infinite;
  border: 1px solid var(--mj-wechat-gold);
  border-radius: inherit;
  content: "";
  inset: -3px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 0.35s ease;
}

.mj-wechat__trigger:hover,
.mj-wechat__trigger:focus-visible {
  border-color: var(--mj-wechat-gold);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.45) inset,
    0 14px 36px rgba(26, 24, 22, 0.18),
    0 0 24px var(--mj-wechat-gold-soft);
  transform: translateY(-2px) scale(1.02);
}

.mj-wechat__trigger:hover::before,
.mj-wechat__trigger:focus-visible::before {
  opacity: 0.55;
}

.mj-wechat__trigger:focus-visible {
  outline: 2px solid rgba(198, 167, 106, 0.55);
  outline-offset: 3px;
}

.mj-wechat__icon {
  display: block;
  flex-shrink: 0;
  height: 1.15rem;
  width: 1.15rem;
}

.mj-wechat__label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1;
  white-space: nowrap;
}

.mj-wechat__panel {
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(245, 238, 228, 0.88)),
    var(--mj-wechat-glass);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 1.15rem;
  bottom: calc(100% + 0.75rem);
  box-shadow:
    0 0 0 1px var(--mj-wechat-line) inset,
    0 24px 60px rgba(26, 24, 22, 0.16),
    0 8px 20px rgba(26, 24, 22, 0.08);
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
  transform: translateY(8px) scale(0.96);
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.38s;
  visibility: hidden;
  width: min(17.5rem, calc(100vw - 2.2rem));
}

.mj-wechat__panel::after {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  content: "";
  inset: 0;
  mix-blend-mode: multiply;
  opacity: 0.35;
  pointer-events: none;
  position: absolute;
}

.mj-wechat.is-open .mj-wechat__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.mj-wechat__head {
  align-items: center;
  border-bottom: 1px solid var(--mj-wechat-line);
  display: flex;
  gap: 0.65rem;
  padding: 0.9rem 1rem 0.75rem;
  position: relative;
  z-index: 1;
}

.mj-wechat__avatar {
  align-items: center;
  background: linear-gradient(135deg, #2a2622, #1a1816);
  border-radius: 0.55rem;
  color: #f5efe6;
  display: flex;
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 600;
  height: 2rem;
  justify-content: center;
  letter-spacing: 0.06em;
  width: 2rem;
}

.mj-wechat__meta {
  min-width: 0;
}

.mj-wechat__title {
  color: var(--mj-wechat-ink);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  margin: 0;
}

.mj-wechat__sub {
  color: rgba(26, 24, 22, 0.52);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
  margin: 0.15rem 0 0;
}

.mj-wechat__close {
  background: transparent;
  border: 0;
  color: rgba(26, 24, 22, 0.42);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  margin-left: auto;
  padding: 0.2rem 0.35rem;
  transition: color 0.2s ease;
}

.mj-wechat__close:hover {
  color: var(--mj-wechat-ink);
}

.mj-wechat__body {
  padding: 0.85rem 1rem 1rem;
  position: relative;
  z-index: 1;
}

.mj-wechat__qr {
  background: #fff;
  border: 1px solid var(--mj-wechat-line);
  border-radius: 0.75rem;
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 11.5rem;
  padding: 0.45rem;
  width: 100%;
}

.mj-wechat__id-row {
  align-items: center;
  background: rgba(26, 24, 22, 0.04);
  border: 1px solid var(--mj-wechat-line);
  border-radius: 0.65rem;
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.45rem 0.45rem 0.45rem 0.65rem;
}

.mj-wechat__id {
  color: var(--mj-wechat-ink);
  flex: 1;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mj-wechat__copy {
  background: var(--mj-wechat-ink);
  border: 0;
  border-radius: 0.45rem;
  color: #f5efe6;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 0.42rem 0.65rem;
  transition: background 0.25s ease, transform 0.25s ease;
}

.mj-wechat__copy:hover {
  background: #2e2a26;
}

.mj-wechat__copy.is-copied {
  background: #3d5a3a;
}

.mj-wechat__hint {
  color: rgba(26, 24, 22, 0.45);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  line-height: 1.5;
  margin: 0.55rem 0 0;
  text-align: center;
}

.mj-wechat__backdrop {
  background: rgba(10, 9, 8, 0.18);
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 0.35s ease, visibility 0.35s;
  visibility: hidden;
  z-index: 119;
}

.mj-wechat__backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

@keyframes mj-wechat-pulse {
  0%,
  100% {
    opacity: 0;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(1.06);
  }
}

@media (max-width: 767px) {
  .mj-wechat {
    bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
    right: calc(0.85rem + env(safe-area-inset-right, 0px));
  }

  .mj-wechat__trigger {
    height: 2.45rem;
    padding: 0 0.7rem;
  }

  .mj-wechat__label {
    display: none;
  }

  .mj-wechat__panel {
    bottom: calc(100% + 0.55rem);
    right: -0.15rem;
    width: min(16.5rem, calc(100vw - 1.7rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  .mj-wechat__trigger::before {
    animation: none;
  }

  .mj-wechat__trigger,
  .mj-wechat__panel,
  .mj-wechat__backdrop {
    transition-duration: 0.01ms;
  }
}
