.auth-modal-open {
  overflow: hidden;
}

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(16, 185, 129, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.76), rgba(15, 23, 42, 0.88));
  backdrop-filter: blur(12px);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.auth-modal-overlay.visible {
  opacity: 1;
}

.auth-modal-overlay--legacy-code {
  padding: 16px;
  background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.18), transparent 35%), rgba(15, 23, 42, 0.65);
  backdrop-filter: none;
}

.auth-modal-card {
  width: min(640px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 28px;
  padding: 30px 30px 24px;
  position: relative;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(220, 229, 255, 0.92);
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.auth-modal-overlay.visible .auth-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.auth-modal-card--legacy-code {
  width: min(520px, 100%);
  max-height: none;
  overflow: visible;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  border: 1px solid #e5edff;
  transform: none;
  opacity: 1;
  transition: none;
}

.auth-modal-card--hybrid {
  width: min(720px, 100%);
  max-height: min(90vh, 860px);
  padding: 22px 22px 18px;
}

.auth-modal-header {
  padding-right: 48px;
  margin-bottom: 16px;
}

.auth-modal-card--hybrid .auth-modal-header {
  margin-bottom: 12px;
}

.auth-modal-card h2 {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.25;
  font-weight: 800;
  color: #0f172a;
}

.auth-modal-card--legacy-code h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
  text-align: center;
}

.auth-modal-text {
  margin: 0 0 16px;
  color: #475569;
  font-size: 1rem;
  line-height: 1.7;
}

.auth-modal-card--legacy-code .auth-modal-text {
  margin-top: 0;
  margin-bottom: 18px;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
}

.auth-modal-card--hybrid .auth-modal-text {
  margin-bottom: 12px;
  font-size: 0.96rem;
  line-height: 1.6;
}

.auth-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-modal-sections {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-modal-sections--hybrid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #dbe6ff;
  background: #f4f8ff;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-pill--accent {
  border-color: #c6f0de;
  background: #ecfdf5;
  color: #047857;
}

.auth-block {
  padding: 20px;
  border-radius: 22px;
  border: 1px solid #e3ebff;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.auth-modal-card--hybrid .auth-block {
  padding: 18px;
  border-radius: 20px;
}

.auth-block--payment {
  border-color: #d6ece2;
  background: linear-gradient(180deg, #f7fcfb 0%, #eef9f5 100%);
}

.auth-block__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.auth-block__title {
  color: #0f172a;
  font-size: 1.08rem;
  font-weight: 800;
}

.auth-block__title-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.auth-block__title-row .auth-block__title {
  grid-column: 1;
  justify-self: start;
}

.auth-block__title-row .auth-price-tag {
  grid-column: 2;
  justify-self: center;
}

.auth-block__desc {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.65;
}

.auth-price-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #047857;
  font-size: 0.92rem;
  font-weight: 800;
  white-space: nowrap;
}

.auth-modal-card--hybrid .auth-block__head {
  margin-bottom: 14px;
}

.auth-modal-card--hybrid .auth-block__desc {
  font-size: 0.9rem;
  line-height: 1.55;
}

.auth-pay-grid {
  display: grid;
  gap: 12px;
}

.auth-pay-grid--single {
  grid-template-columns: 1fr;
}

.auth-pay-grid--dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-pay-btn {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid #d8e4ff;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.auth-pay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
}

.auth-pay-btn.is-active {
  transform: translateY(-1px);
}

.auth-modal-card--hybrid .auth-pay-btn {
  min-height: 70px;
  padding: 13px 15px;
  border-radius: 18px;
}

.auth-pay-btn--wechat {
  border-color: #b7e8cd;
}

.auth-pay-btn--wechat.is-active {
  border-color: #16a34a;
  box-shadow: 0 18px 36px rgba(22, 163, 74, 0.16);
}

.auth-pay-btn--alipay {
  border-color: #bfdbfe;
}

.auth-pay-btn--alipay.is-active {
  border-color: #0284c7;
  box-shadow: 0 18px 36px rgba(2, 132, 199, 0.16);
}

.auth-pay-btn__icon {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
}

.auth-pay-btn__icon svg {
  width: 28px;
  height: 28px;
  display: block;
}

.auth-pay-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.auth-pay-glyph--alipay {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.08em;
  transform: translateY(-0.02em) skewX(-12deg);
}

.auth-pay-btn--wechat .auth-pay-btn__icon {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.auth-pay-btn--alipay .auth-pay-btn__icon {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
}

.auth-modal-card--hybrid .auth-pay-btn__icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 0.95rem;
}

.auth-modal-card--hybrid .auth-pay-btn__icon svg {
  width: 24px;
  height: 24px;
}

.auth-modal-card--hybrid .auth-pay-glyph--alipay {
  font-size: 1.28rem;
}

.auth-pay-btn__content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-pay-btn__content strong {
  font-size: 1.08rem;
  line-height: 1.2;
  font-weight: 800;
}

.auth-link-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.auth-modal-card--legacy-code .auth-link-row {
  gap: 10px;
  margin-top: 0;
  margin-bottom: 16px;
}

.auth-link-btn {
  width: 100%;
  min-height: 52px;
  border: 1px solid #d7e3ff;
  background: linear-gradient(180deg, #f8fbff, #edf4ff);
  color: #1e40af;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 0.96rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08);
}

.auth-link-btn:hover {
  background: linear-gradient(180deg, #eef4ff, #e2ecff);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.auth-modal-card--legacy-code .auth-link-btn {
  min-height: 0;
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #eef4ff, #e0ecff);
  color: #1d4ed8;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.auth-modal-card--legacy-code .auth-link-btn:hover {
  background: linear-gradient(180deg, #dbeafe, #cfe1ff);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.auth-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.auth-modal-card--legacy-code .auth-input-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-direction: column;
  align-items: stretch;
}

.auth-modal-card--hybrid .auth-block--code .auth-input-row {
  grid-template-columns: 1fr;
  gap: 10px;
}

.auth-input-row input {
  min-width: 0;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid #d7e3ff;
  font-size: 1rem;
  background: #ffffff;
  color: #0f172a;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input-row input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auth-modal-card--legacy-code .auth-input-row input {
  min-height: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f9fbff;
}

.auth-btn {
  min-height: 54px;
  padding: 0 18px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #0f766e);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28);
}

.auth-modal-card--legacy-code .auth-btn {
  min-height: 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(120deg, #2563eb, #1d4ed8);
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

.auth-modal-card--legacy-code .auth-btn:hover {
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.32);
}

.auth-modal-card--hybrid .auth-btn {
  min-height: 50px;
}

.auth-qrcode {
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px dashed #c6e6d7;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.auth-qrcode img {
  width: min(196px, 58vw);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 18px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.auth-qrcode__title {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 800;
}

.auth-qrcode__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1d4ed8;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-modal-card--hybrid .auth-qrcode {
  margin-top: 14px;
  padding: 14px;
  gap: 10px;
}

.auth-modal-card--hybrid .auth-qrcode img {
  width: min(170px, 34vw);
  padding: 8px;
}

.auth-status,
.auth-error {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.94rem;
  line-height: 1.65;
}

.auth-status {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
}

.auth-status--info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.auth-status--success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.auth-error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.auth-modal-card--legacy-code .auth-status {
  margin-top: 10px;
}

.auth-modal-card--legacy-code .auth-error {
  margin-top: 4px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #ef4444;
  font-size: 0.85rem;
  line-height: 1.5;
}

.auth-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid #d9e6ff;
  background: rgba(244, 248, 255, 0.94);
  color: #1e3a8a;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
}

.auth-close-btn:hover {
  background: #eaf1ff;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}

.auth-modal-card--legacy-code .auth-close-btn {
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: #f1f5ff;
  color: #1d4ed8;
  font-size: 18px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.auth-modal-card--legacy-code .auth-close-btn:hover {
  background: #e0ecff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.auth-pay-btn:focus,
.auth-btn:focus,
.auth-link-btn:focus,
.auth-close-btn:focus,
.auth-input-row input:focus {
  outline: none;
}

.auth-pay-btn:focus-visible,
.auth-btn:focus-visible,
.auth-link-btn:focus-visible,
.auth-close-btn:focus-visible {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

.auth-pay-btn:disabled,
.auth-btn:disabled,
.auth-link-btn:disabled,
.auth-close-btn:disabled,
.auth-input-row input:disabled {
  opacity: 0.64;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (min-width: 1080px) {
  .auth-modal-card {
    width: min(680px, 100%);
  }

  .auth-modal-card--hybrid {
    width: min(760px, 100%);
  }
}

@media (max-width: 720px) {
  .auth-modal-card {
    width: min(100%, 100%);
    padding: 24px 18px 20px;
    border-radius: 24px;
  }

  .auth-modal-card--legacy-code {
    padding: 20px;
    border-radius: 20px;
  }

  .auth-modal-card h2 {
    font-size: 1.62rem;
  }

  .auth-modal-text {
    font-size: 0.96rem;
  }

  .auth-modal-card--hybrid {
    width: min(100%, 100%);
    padding: 22px 16px 18px;
  }

  .auth-modal-sections--hybrid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .auth-pay-grid--dual {
    grid-template-columns: 1fr;
  }

  .auth-input-row {
    grid-template-columns: 1fr;
  }

  .auth-modal-card--hybrid .auth-block--code .auth-input-row {
    grid-template-columns: 1fr;
  }

  .auth-pay-btn {
    min-height: 80px;
    padding: 15px 16px;
  }

  .auth-btn {
    width: 100%;
  }
}
