.code-frame {
  overflow: visible;
  padding: clamp(24px, 6vw, 44px);
  background: #fff;
}

.code-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 0;
  background: #fff;
}

#mini-program {
  scroll-margin-block: 24px;
}

#mini-program.qr-attention {
  outline: 4px solid rgba(21, 89, 232, 0.72);
  outline-offset: 6px;
  animation: qr-attention-pulse 1.1s ease-in-out 2;
}

@media (max-width: 560px) {
  .code-card::before {
    inset: -10px;
    border-radius: 36px;
  }
}

@keyframes qr-attention-pulse {
  0%, 100% {
    outline-color: rgba(21, 89, 232, 0.18);
    outline-offset: 12px;
  }

  50% {
    outline-color: rgba(21, 89, 232, 0.82);
    outline-offset: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mini-program.qr-attention {
    animation: none;
  }
}

body.qr-modal-open {
  overflow: hidden;
}

.qr-modal[hidden] {
  display: none;
}

.qr-modal {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background: rgba(4, 16, 43, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  overscroll-behavior: contain;
  transition: opacity 180ms ease;
}

.qr-modal.is-open {
  opacity: 1;
}

.qr-modal__panel {
  width: min(440px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 30px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  box-shadow: 0 34px 90px rgba(3, 15, 41, 0.42);
  text-align: center;
  transform: translateY(14px) scale(0.98);
  transition: transform 180ms ease;
}

.qr-modal.is-open .qr-modal__panel {
  transform: translateY(0) scale(1);
}

.qr-modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.qr-modal__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.qr-modal__brand img {
  border-radius: 13px;
  box-shadow: 0 8px 24px rgba(21, 89, 232, 0.18);
}

.qr-modal__brand span {
  display: grid;
  gap: 2px;
}

.qr-modal__brand strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.qr-modal__brand small {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.qr-modal__close {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #ffffff;
  color: #1d4ed8;
  cursor: pointer;
  font: 800 13px/1 inherit;
}

.qr-modal__close:focus-visible,
.qr-modal__actions a:focus-visible,
.qr-modal__actions button:focus-visible {
  outline: 3px solid rgba(37, 120, 255, 0.45);
  outline-offset: 3px;
}

.qr-modal__kicker {
  margin: 20px 0 0;
  color: #1677e8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.qr-modal h2 {
  margin: 8px 0 0;
  color: #081a42;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.qr-modal__description {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.qr-modal__code {
  width: min(300px, 100%);
  margin: 18px auto 0;
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(31, 57, 103, 0.1);
}

.qr-modal__code img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.qr-modal__code.is-highlighted {
  outline: 4px solid rgba(22, 119, 232, 0.55);
  outline-offset: 5px;
}

.qr-modal__account {
  display: block;
  margin-top: 16px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.qr-modal__hint {
  margin: 8px auto 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
}

.qr-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.qr-modal__actions .button {
  width: 100%;
  min-height: 46px;
  padding-inline: 14px;
  text-decoration: none;
}

@media (max-width: 560px) {
  .qr-modal {
    place-items: center;
    padding-inline: 14px;
  }

  .qr-modal__panel {
    max-height: calc(100dvh - 28px);
    padding: 18px;
    border-radius: 26px;
  }

  .qr-modal__kicker {
    margin-top: 16px;
  }

  .qr-modal h2 {
    font-size: 26px;
  }

  .qr-modal__code {
    width: min(260px, 100%);
    padding: 18px;
    border-radius: 21px;
  }

  .qr-modal__actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qr-modal,
  .qr-modal__panel {
    transition: none;
  }
}
