:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #243650;
  background: #f6f8fc;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  --blue: #3266b7;
  --muted: #65758d;
}

* { box-sizing: border-box; }
body { margin: 0; }
p, h1, h2 { margin: 0; }
svg { display: block; flex-shrink: 0; }

.page {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-inline: max(32px, env(safe-area-inset-left)) max(32px, env(safe-area-inset-right));
  overflow: clip;
}

.page::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0 0 0 60%;
  background: #eaf0f9;
  border-inline-start: 1px solid #e2eaf6;
}

.page::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 600px;
  aspect-ratio: 1;
  inset-inline-end: -290px;
  inset-block-end: -360px;
  border: 1px solid #cfddef;
  border-radius: 50%;
  box-shadow: 0 0 0 64px #e4ecf7, 0 0 0 65px #d6e2f1, 0 0 0 130px #e7eef8, 0 0 0 131px #dce6f3;
}

.site-header, main, footer { width: min(100%, 1184px); margin-inline: auto; }
.site-header { padding-block: clamp(12px, 2.5svh, 28px); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 44px; height: 44px; color: var(--blue); }
.brand strong { display: block; font-size: 21px; font-weight: 650; letter-spacing: 2px; line-height: 1.35; }
.brand span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; letter-spacing: 1.6px; }
.header-label { color: #566d8e; font-size: 13px; letter-spacing: 1px; }

main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: center;
  gap: 64px;
  padding: 12px 32px;
}

.introduction { padding-block: 0; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--blue); font-size: 13px; font-weight: 500; letter-spacing: 2px; }
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: #7a9dcd; box-shadow: 0 0 0 5px #e8eef8; }
h1 { margin-top: 25px; font-size: clamp(36px, 3.2vw, 48px); font-weight: 650; letter-spacing: -1.5px; line-height: 1.4; }
h1 span { display: block; color: var(--blue); }
.tagline { margin-top: 22px; color: #526984; font-size: 20px; line-height: 1.7; letter-spacing: 1px; }
.invitation { margin-top: 32px; padding-inline-start: 20px; border-inline-start: 2px solid #bed0e9; }
.invitation-title { margin-bottom: 10px; font-size: 16px; font-weight: 600; line-height: 1.6; }
.invitation p:last-child { color: var(--muted); font-size: 15px; line-height: 1.95; }
.contact-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 32px; color: #5a6d86; font-size: 12px; }
.contact-steps span { display: inline-flex; align-items: center; gap: 8px; }
.contact-steps i { color: #7f94b0; font-size: 11px; font-style: normal; font-variant-numeric: tabular-nums; }
.contact-steps svg { width: 16px; height: 16px; color: #9aacbf; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.contact-card {
  padding: 22px 32px 0;
  border: 1px solid #fff;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 60px -20px rgb(43 72 113 / 19%), 0 2px 8px rgb(43 72 113 / 3%);
  text-align: center;
}

.wechat-label { display: none; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; background: #eef8f2; color: #27764d; font-size: 11px; line-height: 1.5; }
.wechat-label svg { width: 16px; height: 16px; fill: currentColor; }
h2 { font-size: 24px; font-weight: 600; letter-spacing: .5px; line-height: 1.4; }
.card-description { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.qr-frame { width: min(100%, clamp(176px, calc(100svh - 450px), 252px)); margin: 16px auto 0; padding: 7px; border: 1px solid #e1e9f3; border-radius: 16px; background: #f8fafd; }
.qr-image { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: #86aaca; }
/* Display the QR area while keeping the supplied image unchanged for saving. */
.qr-image img { position: absolute; width: 124%; max-width: none; height: auto; top: -40.77%; left: -12.31%; }
.scan-instruction { margin-top: 10px; color: #5c6f87; font-size: 12px; line-height: 1.7; }
.save-button { display: flex; justify-content: center; align-items: center; gap: 9px; margin-top: 12px; min-height: 44px; padding: 10px 16px; border: 1px solid #d9e4f4; border-radius: 10px; background: #edf3fc; color: #305e9f; font-size: 13px; font-weight: 500; line-height: 1.5; text-decoration: none; transition: background 160ms ease, border-color 160ms ease; }
.save-button svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.save-button:hover { border-color: #aec4e5; background: #e1ebfa; }
.save-button:focus-visible { outline: 3px solid #4678bf; outline-offset: 4px; }
.mobile-instruction { display: none; margin-top: 8px; color: #718096; font-size: 11px; line-height: 1.6; }
.contact-note { margin-top: 14px; padding-block: 12px 16px; border-top: 1px solid #edf1f6; color: #6c7b8f; font-size: 11px; line-height: 1.7; }

footer { display: flex; justify-content: space-between; gap: 16px; padding-block: 12px 14px; border-top: 1px solid #dce4ef; color: #6e8098; font-size: 11px; line-height: 1.8; }
.footer-dot { padding-inline: 9px; }
.domain { color: #6a7e99; letter-spacing: .4px; }

@media (min-width: 821px) and (min-height: 800px) {
  .wechat-label { display: inline-flex; }
  h2 { margin-top: 10px; }
}

@media (max-width: 1060px) {
  main { grid-template-columns: minmax(0, 1fr) 350px; gap: 32px; padding-inline: 0; }
  h1 { font-size: 36px; }
  .contact-card { padding-inline: 26px; }
  .tagline { font-size: 18px; }
  .contact-steps { gap: 12px; }
}

@media (min-width: 821px) and (max-height: 680px) {
  .site-header { padding-block: 12px; }
  main { padding-block: 8px; }
  h1 { margin-top: 16px; font-size: 36px; }
  .tagline { margin-top: 14px; font-size: 18px; }
  .invitation, .contact-steps { margin-top: 24px; }
  .contact-card { padding-top: 18px; }
  .card-description { display: none; }
  .qr-frame { margin-top: 12px; }
  footer { padding-block: 9px; }
}

@media (max-width: 820px) {
  .page { padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); }
  .page::before { inset: 48% 0 0; border: 0; }
  .site-header { padding-block: 12px; }
  .brand { gap: 9px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand strong { font-size: 17px; }
  .brand span { display: none; }
  .header-label { font-size: 10px; letter-spacing: 0; }
  main { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding-block: 8px 12px; }
  .introduction { width: 100%; padding: 0; text-align: center; }
  .eyebrow, .tagline, .invitation, .contact-steps, .scan-instruction, .contact-note { display: none; }
  h1 { margin-top: 0; font-size: clamp(26px, 5.6vw, 32px); line-height: 1.35; letter-spacing: -1px; }
  .contact-card { width: min(100%, 330px); padding: 18px 24px; border-radius: 20px; }
  h2 { font-size: 20px; }
  .card-description { margin-top: 4px; font-size: 12px; }
  .qr-frame { width: min(100%, 244px, calc(100svh - 400px - env(safe-area-inset-bottom))); margin-top: 12px; }
  .mobile-instruction { display: block; }
  footer { justify-content: center; text-align: center; padding-block: 9px max(10px, env(safe-area-inset-bottom)); font-size: 10px; }
  footer p { display: none; }
}

@media (max-width: 820px) and (max-height: 640px) {
  .site-header { padding-block: 8px; }
  main { gap: 10px; padding-block: 0 8px; }
  h1 { font-size: 24px; line-height: 1.3; }
  .contact-card { padding: 12px 20px; }
  h2 { font-size: 18px; }
  .card-description { display: none; }
  .qr-frame { width: min(100%, 220px, calc(100svh - 304px - env(safe-area-inset-bottom))); margin-top: 8px; }
  .save-button { margin-top: 10px; }
  .mobile-instruction { margin-top: 6px; }
  footer { padding-block: 5px max(6px, env(safe-area-inset-bottom)); }
}

@media (min-width: 560px) and (max-height: 520px) {
  .page { padding-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right)); }
  .site-header { padding-block: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand span, .eyebrow, .tagline, .invitation, .contact-steps, .wechat-label, .card-description, .contact-note { display: none; }
  main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(350px, 1.3fr); gap: 16px; padding: 8px 0; }
  .introduction { text-align: start; }
  h1 { margin: 0; font-size: clamp(20px, 3vw, 28px); line-height: 1.4; }
  .contact-card { width: 100%; padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: 12px; }
  h2 { grid-column: 2; grid-row: 1; font-size: 17px; }
  .qr-frame { grid-column: 1; grid-row: 1 / 5; width: min(100%, 200px, calc(100svh - 140px)); margin: 0; padding: 5px; }
  .scan-instruction { display: block; grid-column: 2; grid-row: 2; margin-top: 6px; font-size: 11px; }
  .save-button { grid-column: 2; grid-row: 3; margin-top: 8px; padding-inline: 4px; font-size: 12px; gap: 5px; }
  .mobile-instruction { display: block; grid-column: 2; grid-row: 4; margin-top: 6px; font-size: 10px; }
  footer { padding-block: 6px max(6px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .save-button { transition: none; }
}
