:root.wechat-contact-open,
:root.wechat-contact-open body {
  overflow: hidden;
}

[data-wechat-open] {
  cursor: pointer;
}

.wechat-contact-dialog,
.wechat-contact-dialog * {
  box-sizing: border-box;
}

.wechat-contact-dialog {
  width: min(424px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100svh - 32px);
  padding: 0;
  border: 0;
  overflow: visible;
  color: #edf7f7;
  background: transparent;
}

.wechat-contact-dialog[open] {
  animation: wechat-dialog-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.wechat-contact-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 45%, rgba(37, 230, 210, 0.08), transparent 36%),
    rgba(1, 5, 8, 0.82);
  backdrop-filter: blur(12px);
  animation: wechat-backdrop-in 180ms ease both;
}

.wechat-contact-card {
  position: relative;
  isolation: isolate;
  width: 100%;
  padding: 42px 38px 32px;
  border: 1px solid rgba(37, 230, 210, 0.3);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(37, 230, 210, 0.08), transparent 30%),
    linear-gradient(315deg, rgba(255, 99, 51, 0.08), transparent 34%),
    #061019;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.wechat-contact-card::before {
  position: absolute;
  top: 0;
  left: 32px;
  width: 92px;
  height: 2px;
  background: #ff6333;
  box-shadow: 154px 0 0 rgba(37, 230, 210, 0.65);
  content: "";
}

.wechat-contact-card::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(37, 230, 210, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 230, 210, 0.09) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, #000, transparent 70%);
  content: "";
}

.wechat-contact-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(166, 189, 196, 0.26);
  color: #a6bdc4;
  background: rgba(4, 13, 19, 0.78);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.wechat-contact-close:hover {
  border-color: rgba(255, 99, 51, 0.78);
  color: #fff;
  background: rgba(255, 99, 51, 0.12);
}

.wechat-contact-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  color: #25e6d2;
  font-family: "Roboto Mono", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.wechat-contact-eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentcolor;
  box-shadow: 0 0 16px currentcolor;
  content: "";
}

.wechat-contact-card h2 {
  margin: 0;
  color: #f4f8f8;
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.wechat-contact-intro {
  margin: 10px auto 20px;
  color: #94adb5;
  font-size: 14px;
  line-height: 1.7;
}

.wechat-contact-qr {
  position: relative;
  width: min(294px, 72vw);
  margin: 0 auto;
  padding: 16px;
  border: 1px solid rgba(37, 230, 210, 0.32);
  background: #fff;
  box-shadow:
    0 0 0 6px rgba(2, 11, 16, 0.92),
    0 20px 54px rgba(0, 0, 0, 0.38),
    0 0 34px rgba(37, 230, 210, 0.09);
}

.wechat-contact-qr img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.wechat-contact-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 0;
  color: #dce9eb;
  font-size: 13px;
  font-weight: 700;
}

.wechat-contact-hint i {
  width: 24px;
  height: 1px;
  background: #ff6333;
}

.wechat-contact-mail {
  display: inline-flex;
  margin-top: 14px;
  color: #78949d;
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: color 160ms ease;
}

.wechat-contact-mail:hover {
  color: #25e6d2;
}

.wechat-contact-close:focus-visible,
[data-wechat-open]:focus-visible,
.wechat-contact-mail:focus-visible {
  outline: 2px solid #25e6d2;
  outline-offset: 4px;
}

@keyframes wechat-dialog-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.965);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes wechat-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 520px) {
  .wechat-contact-dialog {
    width: min(358px, calc(100vw - 24px));
    max-height: calc(100svh - 24px);
    overflow-y: auto;
  }

  .wechat-contact-card {
    padding: 38px 22px 26px;
  }

  .wechat-contact-intro {
    margin-bottom: 18px;
    font-size: 13px;
  }

  .wechat-contact-qr {
    width: min(270px, 70vw);
    padding: 13px;
  }

  .wechat-contact-hint {
    margin-top: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wechat-contact-dialog[open],
  .wechat-contact-dialog::backdrop {
    animation: none;
  }
}
