* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  color: #1f2937;
  background:
    radial-gradient(1000px 600px at 10% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    radial-gradient(800px 500px at 95% 100%, rgba(12, 211, 255, 0.22), transparent 60%),
    linear-gradient(155deg, #1677ff 0%, #0b4bd6 45%, #061e5c 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 32px;
}

.card {
  width: min(420px, 100%);
  background: #ffffff;
  border-radius: 28px;
  padding: 30px 26px 24px;
  box-shadow: 0 28px 70px rgba(3, 20, 70, 0.38), 0 2px 0 rgba(255, 255, 255, 0.5) inset;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #3b8cff, #0b4bd6);
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.35);
}

.brand-text {
  text-align: left;
}

.brand-text h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0.5px;
  color: #10203f;
}

.brand-text p {
  margin: 3px 0 0;
  font-size: 12px;
  color: #8a94a6;
  letter-spacing: 1px;
}

.channel {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1f5dd6;
  font-size: 13px;
  font-weight: 600;
}

.channel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.16);
}

.qr-area {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 22px auto 4px;
  padding: 14px;
  width: fit-content;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff, #f2f6ff);
  border: 1px solid #e5ecf9;
}

.qrcode {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 220px;
}

.qrcode canvas,
.qrcode img {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #667085;
  font-size: 13px;
}

.loading p {
  margin: 0;
}

.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid #dbe6fb;
  border-top-color: #1677ff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
}

.empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  color: #d4380d;
  background: #fff1ed;
  border: 1px solid #ffd7c9;
}

.empty p {
  margin: 0;
  color: #344054;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.empty span {
  color: #98a2b3;
  font-size: 12px;
  line-height: 1.5;
}

.scan-tip {
  margin: 12px 0 0;
  color: #344054;
  font-size: 14px;
  font-weight: 500;
}

.status-text {
  margin: 6px 0 0;
  min-height: 18px;
  color: #98a2b3;
  font-size: 12px;
}

.pay-btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #3b8cff, #0b4bd6);
  box-shadow: 0 10px 22px rgba(11, 75, 214, 0.32);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pay-btn:active {
  transform: translateY(1px);
  box-shadow: 0 6px 16px rgba(11, 75, 214, 0.28);
}

.pay-btn:disabled {
  cursor: default;
  opacity: 0.86;
}

.switch-code-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 11px 18px;
  border: 1px solid #d7e4ff;
  border-radius: 12px;
  background: #f5f9ff;
  color: #0b4bd6;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.switch-code-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.switch-code-btn:not(:disabled):active {
  background: #e7f0ff;
}

.pay-hint {
  margin: 10px 0 0;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px dashed #fedf89;
  background: #fffaeb;
  color: #b54708;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  text-align: left;
}

.qrcode {
  transition: transform 0.25s ease;
}

.qr-area.zoomed {
  margin-bottom: 30px;
}

.qr-area.zoomed .qrcode {
  transform: scale(1.28);
}

.warning {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff2f0;
  border: 1px solid #ffd6d6;
  color: #d92d20;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  text-align: left;
}

.switch {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(8px);
}

.switch button {
  border: 0;
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 600;
  color: #e8f0ff;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.switch button.active {
  color: #0b4bd6;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(5, 30, 90, 0.25);
}

.switch button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.switch button.active:hover {
  background: #ffffff;
}

.footnote {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 480px) {
  .page {
    padding: 24px 12px;
  }

  .card {
    padding: 24px 18px 20px;
    border-radius: 22px;
  }

  .brand-text h1 {
    font-size: 19px;
  }

  .qrcode {
    min-width: 200px;
    min-height: 200px;
  }

  .qr-area {
    padding: 10px;
  }

  .warning {
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .switch button {
    padding: 8px 16px;
  }
}

/* ---------- 放大二维码遮罩（纯页内，不跳转） ---------- */

.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 16, 32, 0.84);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

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

body.overlay-open {
  overflow: hidden;
}

.qr-overlay-card {
  width: min(92vw, 420px);
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.qr-overlay-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: #0b4bd6;
}

.qr-overlay-code {
  display: flex;
  justify-content: center;
  padding: 10px;
  border: 1px solid #eef2f9;
  border-radius: 12px;
  background: #fff;
}

.qr-overlay-img {
  width: min(70vmin, 300px);
  height: auto;
  image-rendering: pixelated;
}

.qr-overlay-hint {
  margin: 14px 0 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #667085;
}

.qr-overlay-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.overlay-btn {
  border: 1px solid #d8e0ec;
  background: #f7faff;
  color: #344054;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  cursor: pointer;
}

.overlay-btn-primary {
  border-color: #0b4bd6;
  background: #0b4bd6;
  color: #fff;
  box-shadow: 0 8px 18px rgba(11, 75, 214, 0.28);
}

.overlay-btn:active {
  transform: translateY(1px);
}

