/* ============================================================
   支付选择窗口（微信支付 / 支付宝 二选一）
   ------------------------------------------------------------
   设计基线对齐 profile.html：暖灰白 + 圆角白卡 + 低饱和控件，
   8pt 网格，无 emoji。移动端为底部抽屉，桌面端为居中卡片。
   ============================================================ */

.sp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(45, 52, 54, 0.34);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-backdrop.is-open {
  opacity: 1;
}

.sp-sheet {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: var(--sua-radius, 22px);
  box-shadow: 0 24px 60px rgba(40, 70, 60, 0.18);
  padding: 24px 24px 20px;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  color: #2f4a45;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

.sp-backdrop.is-open .sp-sheet {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sp-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.sp-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(45, 52, 54, 0.06);
  color: #5a7a7a;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-close:hover {
  background: rgba(45, 52, 54, 0.1);
}

.sp-amount {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.1;
}

.sp-subject {
  margin-top: 6px;
  font-size: 13px;
  color: #8395a7;
  line-height: 1.5;
}

.sp-options {
  margin: 20px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(45, 52, 54, 0.12);
  border-radius: var(--sua-radius-sm, 14px);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.sp-option:hover:not(.is-disabled) {
  border-color: rgba(107, 142, 142, 0.5);
}

.sp-option.is-selected {
  border-color: var(--sua-primary, #6b8e8e);
  background: rgba(107, 142, 142, 0.07);
}

.sp-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sp-radio {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(45, 52, 54, 0.25);
  position: relative;
}

.sp-option.is-selected .sp-radio {
  border-color: var(--sua-primary, #6b8e8e);
}

.sp-option.is-selected .sp-radio::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--sua-primary, #6b8e8e);
}

.sp-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.sp-icon--alipay {
  background: rgba(22, 119, 255, 0.1);
  color: #1677ff;
}

.sp-icon--wechat {
  background: rgba(7, 193, 96, 0.12);
  color: #07c160;
}

.sp-icon--wxqr {
  background: rgba(194, 161, 131, 0.16);
  color: #a3805c;
}

.sp-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sp-opt-text {
  flex: 1;
  min-width: 0;
}

.sp-opt-name {
  font-size: 14px;
  font-weight: 600;
}

.sp-opt-desc {
  font-size: 11.5px;
  color: #93a5a5;
  margin-top: 2px;
  word-break: break-all;
}

.sp-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.sp-btn {
  flex: 1;
  height: 46px;
  border-radius: var(--sua-radius-sm, 14px);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.18s ease, background 0.18s ease;
}

.sp-btn--ghost {
  background: rgba(45, 52, 54, 0.05);
  color: #5a7a7a;
  flex: 0 0 96px;
}

.sp-btn--primary {
  background: var(--sua-primary, #6b8e8e);
  color: #fff;
}

.sp-btn--primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.sp-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sp-hint {
  margin-top: 12px;
  font-size: 11.5px;
  color: #a4b0be;
  line-height: 1.6;
}

/* ---------- 二维码支付态 ---------- */
.sp-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 4px;
}

.sp-qr-canvas {
  width: 184px;
  height: 184px;
  border-radius: 12px;
  border: 1px solid rgba(45, 52, 54, 0.08);
  background: #fff;
  padding: 8px;
  box-sizing: border-box;
}

.sp-qr-tip {
  margin-top: 14px;
  font-size: 13px;
  color: #5a7a7a;
}

.sp-qr-tip strong {
  color: #07c160;
  font-weight: 600;
}

.sp-qr-status {
  margin-top: 8px;
  font-size: 12px;
  color: #a4b0be;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sua-primary, #6b8e8e);
  animation: sp-pulse 1.4s ease-in-out infinite;
}

@keyframes sp-pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .sp-dot { animation: none; opacity: 0.8; }
}

.sp-link {
  margin-top: 10px;
  font-size: 12px;
  color: var(--sua-primary, #6b8e8e);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
}

.sp-mock-badge {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 11px;
  color: #b5763a;
  background: #fdf3e7;
  border-radius: 999px;
  padding: 4px 10px;
}

/* 移动端：底部抽屉 */
@media (max-width: 640px) {
  .sp-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .sp-sheet {
    max-width: none;
    border-radius: 22px 22px 0 0;
    padding: 20px 20px calc(18px + env(safe-area-inset-bottom));
    max-height: 88vh;
    transform: translateY(24px);
  }
}
