/* ── 支付弹窗 ── */

.pm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.pm-overlay.open {
  display: flex;
  opacity: 1;
}

.pm-card {
  background: #fff;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  position: relative;
  transform: translateY(12px);
  transition: transform 0.25s;
}

.pm-overlay.open .pm-card {
  transform: translateY(0);
}

/* 关闭按钮 */
.pm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #6b7280;
  transition: background 0.15s;
  z-index: 2;
}

.pm-close:hover {
  background: #e5e7eb;
  color: #111;
}

/* 头部 */
.pm-header {
  padding: 28px 28px 0;
  text-align: center;
}

.pm-title {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin: 0;
}

.pm-subtitle {
  margin-top: 6px;
  color: #6b7280;
  font-size: 13px;
}

/* 内容区 */
.pm-body {
  padding: 20px 28px 28px;
}

/* ── Step 1: 档位选择 ── */

.pm-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.pm-tier {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.pm-tier:hover {
  border-color: #d1d5db;
}

.pm-tier.selected {
  border-color: #ec5b13;
  background: #fef7f2;
}

.pm-tier-icon {
  font-size: 24px;
  line-height: 1;
  margin-bottom: 8px;
}

.pm-tier-period {
  font-family: "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 700;
  color: #111;
}

.pm-tier-desc {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

.pm-tier-price {
  margin-top: 10px;
  font-family: "Noto Serif SC", serif;
  font-size: 26px;
  font-weight: 700;
  color: #ec5b13;
}

.pm-tier-price span {
  font-size: 14px;
  font-weight: 400;
}

.pm-tier-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: #ec5b13;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 0 10px 0 6px;
  letter-spacing: 0.06em;
}

/* 邮箱输入 */
.pm-email-label {
  font-size: 13px;
  color: #374151;
  font-weight: 600;
  margin-bottom: 8px;
}

.pm-email-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.pm-email-input:focus {
  border-color: #ec5b13;
}

.pm-email-input::placeholder {
  color: #c0c4cc;
}

.pm-email-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #ec5b13;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 提交按钮 */
.pm-submit {
  margin-top: 20px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: #ec5b13;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, opacity 0.15s;
}

.pm-submit:hover {
  background: #d45311;
}

.pm-submit:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.pm-submit .wx-icon-btn {
  width: 22px;
  height: 22px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* 错误提示 */
.pm-error {
  margin-top: 10px;
  color: #ef4444;
  font-size: 13px;
  text-align: center;
  display: none;
}

.pm-error.show {
  display: block;
}

/* ── Step 2: 二维码 ── */

.pm-qr-wrap {
  text-align: center;
}

.pm-qr-amount {
  font-family: "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
  color: #111;
  margin-bottom: 16px;
}

.pm-qr-frame {
  display: inline-block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.pm-qr-frame img {
  width: 200px;
  height: 200px;
  display: block;
}

.pm-qr-frame canvas {
  display: block;
}

.pm-qr-tip {
  margin-top: 14px;
  color: #6b7280;
  font-size: 13px;
}

.pm-qr-status {
  margin-top: 8px;
  color: #9ca3af;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pm-qr-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #e5e7eb;
  border-top-color: #ec5b13;
  border-radius: 50%;
  animation: pm-spin 0.7s linear infinite;
}

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

.pm-qr-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.pm-qr-btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #374151;
  transition: border-color 0.15s, color 0.15s;
}

.pm-qr-btn:hover {
  border-color: #9ca3af;
}

.pm-qr-btn.primary {
  background: #ec5b13;
  border-color: #ec5b13;
  color: #fff;
}

.pm-qr-btn.primary:hover {
  background: #d45311;
}

/* ── Step 3: 成功 ── */

.pm-success {
  text-align: center;
}

.pm-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #16a34a;
}

.pm-license-box {
  background: #f8f6f6;
  border: 2px solid #ec5b13;
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
}

.pm-license-label {
  font-size: 11px;
  color: #9ca3af;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.pm-license-key {
  font-size: 20px;
  font-weight: 700;
  font-family: "Courier New", monospace;
  letter-spacing: 0.03em;
  color: #111;
  word-break: break-all;
}

.pm-copy-btn {
  margin-top: 12px;
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.pm-copy-btn:hover {
  background: #ec5b13;
}

.pm-email-sent {
  margin-top: 14px;
  color: #16a34a;
  font-size: 13px;
}

.pm-done-btn {
  margin-top: 16px;
  padding: 8px 20px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pm-done-btn:hover {
  border-color: #9ca3af;
}

/* 隐藏步骤 */
.pm-step { display: none; }
.pm-step.active { display: block; }
