/* ============================================================
   GAOGE_PAY_V2 · AI池子 全站统一支付弹窗（P0 像素级美化令 2026-08-25）
   组件命名：gaoge-pay-modal（BEM）
   原则：默认只让用户看见四件事
   1) 这是微信支付 2) 买的是什么 3) 多少钱 4) 扫哪里付款
   ============================================================ */
#gaoge-pay-root { all: initial; }
:where(#gaoge-pay-root) * { box-sizing: border-box; margin: 0; padding: 0; }

.gaoge-pay-mask {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; overflow-y: auto;
  background: rgba(10, 22, 39, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 18px;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

.gaoge-pay-modal {
  position: relative; margin: auto;
  width: 420px; max-width: 100%;
  min-height: 560px;
  display: flex; flex-direction: column; justify-content: center;
  background: #FFFFFF;
  border: 1px solid rgba(15, 35, 60, 0.06);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(12, 28, 52, 0.18);
  padding: 24px 24px 20px;
  text-align: center;
  color: #0B1D33;
  animation: gaoge-pay-in 0.18s ease-out;
}
@keyframes gaoge-pay-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes gaoge-pay-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes gaoge-pay-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes gaoge-pay-spin {
  to { transform: rotate(360deg); }
}

/* ---------------- 关闭按钮 ---------------- */
.gaoge-pay-modal__close {
  position: absolute; top: 16px; right: 16px; z-index: 5;
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #E6EEF5; border-radius: 50%;
  background: #F5F8FB; color: #6E7C8C;
  font-family: inherit; font-size: 18px; font-weight: 600; line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.gaoge-pay-modal__close:hover { background: #EAF1F7; color: #24384E; }

/* ---------------- 头部：品牌行 / 主标题 / 商品名 / 价格 ---------------- */
.gaoge-pay-modal__header { display: flex; flex-direction: column; align-items: center; }

.gaoge-pay-modal__brand {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 600; line-height: 20px;
  color: #1D4F6F;
}
.gaoge-pay-modal__brand-ico {
  width: 18px; height: 18px; border-radius: 6px; flex: none;
  background: linear-gradient(135deg, #23B7D9 0%, #1173B6 100%);
}

.gaoge-pay-modal__title {
  margin-top: 8px;
  font-size: 34px; font-weight: 800; line-height: 42px;
  color: #0B1D33; letter-spacing: -0.5px;
}

.gaoge-pay-modal__product {
  margin-top: 10px; width: 100%;
  font-size: 15px; font-weight: 500; line-height: 22px;
  color: #5B6B7D;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis; white-space: normal; word-break: break-all;
}

.gaoge-pay-modal__price {
  margin-top: 10px; margin-bottom: 18px;
  font-size: 56px; font-weight: 900; line-height: 60px;
  color: #081A2D; letter-spacing: -1px;
}
.gaoge-pay-modal__price small {
  font-size: 28px; font-weight: 800; letter-spacing: 0; margin-right: 3px;
}

/* ---------------- 二维码主区域 ---------------- */
.gaoge-pay-modal__qr-wrap {
  width: 236px; height: 236px; margin: 0 auto;
  background: #FFFFFF;
  border: 1px solid #E7EEF5; border-radius: 16px;
  box-shadow: 0 8px 24px rgba(12, 28, 52, 0.06);
  padding: 9px;
}
.gaoge-pay-modal__qr {
  display: block; width: 100%; height: 100%;
  object-fit: contain;
}
.gaoge-pay-modal__qr-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  width: 216px; height: 216px; margin: 0 auto;
  background: #F6FAFC; border: 1px dashed #D3E2EE; border-radius: 12px;
  color: #6E7C8C; font-size: 13px; font-weight: 600; line-height: 20px;
}

.gaoge-pay-modal__scan {
  margin-top: 14px;
  font-size: 16px; font-weight: 700; line-height: 24px;
  color: #0B1D33;
}
.gaoge-pay-modal__sub {
  margin-top: 6px;
  font-size: 14px; font-weight: 500; line-height: 22px;
  color: #6E7C8C;
}

/* ---------------- 等待付款状态 ---------------- */
.gaoge-pay-modal__status {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 10px;
  font-size: 14px; font-weight: 600; line-height: 20px;
  color: #2C7BE5;
}
.gaoge-pay-modal__dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #2C7BE5;
  animation: gaoge-pay-breathe 1.6s ease-in-out infinite;
}

/* ---------------- 辅助入口（默认折叠） ---------------- */
.gaoge-pay-modal__help { margin-top: 14px; }
.gaoge-pay-modal__help-toggle {
  border: 0; background: transparent; cursor: pointer;
  font-family: inherit;
  font-size: 13px; font-weight: 600; line-height: 20px;
  color: #6B7D90;
  transition: color 0.15s ease;
}
.gaoge-pay-modal__help-toggle:hover { color: #2C7BE5; }
.gaoge-pay-modal__help-actions {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 10px;
}
.gaoge-pay-modal__help-actions[hidden] { display: none !important; }
.gaoge-pay-modal__help-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 14px; border-radius: 10px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: filter 0.15s ease;
}
.gaoge-pay-modal__help-btn:hover { filter: brightness(0.97); }
.gaoge-pay-modal__help-btn--ghost { background: #F4F8FC; border: 1px solid #D9E5F0; color: #35516E; }
.gaoge-pay-modal__help-btn--alt { background: #EEF7FF; border: 1px solid #CFE3F8; color: #1568B3; }

/* ---------------- 加载 / 异常 ---------------- */
.gaoge-pay-modal__loading {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin-top: 30px;
  font-size: 14px; font-weight: 600; line-height: 22px;
  color: #6E7C8C;
}
.gaoge-pay-modal__spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid #E3EBF3; border-top-color: #2C7BE5;
  animation: gaoge-pay-spin 0.8s linear infinite;
}
.gaoge-pay-modal__error {
  margin-top: 16px;
  font-size: 14px; font-weight: 500; line-height: 22px;
  color: #5B6B7D;
}
.gaoge-pay-modal__error-actions {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 16px;
}
.gaoge-pay-modal__err-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 18px; border-radius: 10px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.gaoge-pay-modal__err-btn--primary {
  border: 0; color: #142235;
  background: linear-gradient(135deg, #FFB21F 0%, #F49B00 100%);
  box-shadow: 0 8px 18px rgba(244, 155, 0, 0.18);
}
.gaoge-pay-modal__err-btn--primary:hover { filter: brightness(1.03); }
.gaoge-pay-modal__err-btn--ghost { background: #F4F8FC; border: 1px solid #D9E5F0; color: #35516E; }

/* ---------------- 支付成功态 ---------------- */
.gaoge-pay-modal__success {
  margin-top: 4px;
  animation: gaoge-pay-fade 0.2s ease-out;
}
.gaoge-pay-modal__success-icon {
  width: 60px; height: 60px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #EAF8F0; color: #15A05D;
  font-size: 30px; font-weight: 800; line-height: 1;
}
.gaoge-pay-modal__success-title {
  font-size: 28px; font-weight: 800; line-height: 36px;
  color: #0B1D33;
}
.gaoge-pay-modal__success-sub {
  margin-top: 8px;
  font-size: 15px; font-weight: 500; line-height: 22px;
  color: #667789;
}

/* ---------------- 交付按钮 / 说明 ---------------- */
.gaoge-pay-modal__delivery {
  margin-top: 18px;
  display: grid; gap: 10px;
}
.gaoge-pay-modal__row { display: flex; flex-direction: column; gap: 8px; }
.gaoge-pay-modal__row > * { width: 100%; }
.gaoge-pay-modal__delivery > * { width: 100%; }
.gaoge-pay-modal__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; border-radius: 14px;
  font-family: inherit; font-size: 16px; font-weight: 800; line-height: 1;
  text-decoration: none; cursor: pointer; border: 0;
  transition: filter 0.15s ease;
}
.gaoge-pay-modal__btn:hover { filter: brightness(1.03); }
.gaoge-pay-modal__btn--primary {
  height: 48px; color: #142235;
  background: linear-gradient(135deg, #FFB21F 0%, #F49B00 100%);
  box-shadow: 0 10px 22px rgba(244, 155, 0, 0.20);
}
.gaoge-pay-modal__btn--primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.gaoge-pay-modal__btn--secondary {
  height: 44px; border-radius: 12px;
  background: #F6F9FC; border: 1px solid #DCE7F1; color: #30485E;
  font-size: 15px; font-weight: 700;
}
.gaoge-pay-modal__btn--secondary:hover { background: #EEF4FA; filter: none; }
.gaoge-pay-modal__copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 44px; border-radius: 12px;
  background: #F6F9FC; border: 1px solid #DCE7F1; color: #30485E;
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer;
}
.gaoge-pay-modal__copy:hover { background: #EEF4FA; }
.gaoge-pay-modal__code {
  padding: 12px 16px; width: 100%;
  background: #F0FBF6; border: 1.5px solid #BCE6D3; border-radius: 12px;
  font-size: 22px; font-weight: 900; letter-spacing: 0.05em;
  color: #087A52; user-select: all; overflow-wrap: anywhere;
}
.gaoge-pay-modal__note {
  margin-top: 12px;
  font-size: 12px; font-weight: 500; line-height: 18px;
  color: #8AA0AD;
}

/* ---------------- 移动端 ---------------- */
@media (max-width: 480px) {
  .gaoge-pay-mask { padding: 12px; }
  .gaoge-pay-modal {
    width: calc(100vw - 32px); max-width: 358px;
    min-height: auto;
    border-radius: 20px;
    padding: 20px 18px 18px;
  }
  .gaoge-pay-modal__title { font-size: 30px; line-height: 38px; }
  .gaoge-pay-modal__product { font-size: 14px; line-height: 21px; }
  .gaoge-pay-modal__price { font-size: 48px; line-height: 52px; }
  .gaoge-pay-modal__price small { font-size: 24px; }
  .gaoge-pay-modal__qr-wrap { width: 220px; height: 220px; padding: 9px; }
}
