/* billing/pay.css — 微信支付收银弹窗（钱包页和账单页共用，版本 20261009b3）。只用 usage.css / portal.css 的变量；弹窗追加在 <body> 上，所以两个页面都要加载本文件。
   唯一写死的颜色是二维码的白底和它里面的字：二维码必须是深色码点 + 白色静区，深色模式下也一样，否则微信扫不出来。 */

.pm-modal { --modal-w: 560px; }
.pm { display: grid; gap: 12px; min-width: 0; color: var(--ink); }
.pm-pending { display: grid; gap: 12px; min-width: 0; }
.pm-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; min-width: 0; }

/* ---------- 二维码 ---------- */
.pm-qr { --pm-qr-bg: #fff; --pm-qr-ink: #475569; --pm-qr-link: #0f766e; position: relative; display: grid; place-items: center; width: 194px; height: 194px; padding: 8px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--pm-qr-bg); }
.pm-qr-img { display: block; width: 176px; height: 176px; object-fit: contain; }
.pm-qr[data-state="loading"] .pm-qr-img, .pm-qr[data-state="failed"] .pm-qr-img { visibility: hidden; position: absolute; }
.pm-qr-veil, .pm-qr-fail { display: none; position: absolute; inset: 0; place-items: center; align-content: center; justify-items: center; gap: 8px; padding: 10px; text-align: center; font-size: 12.5px; line-height: 1.5; color: var(--pm-qr-ink); }
.pm-qr[data-state="loading"] .pm-qr-veil { display: grid; }
.pm-qr[data-state="failed"] .pm-qr-fail { display: grid; }
.pm-qr-fail p { margin: 0; }
.pm-qr-fail a { color: var(--pm-qr-link); text-decoration: underline; text-underline-offset: 2px; }
.pm-spin { display: inline-flex; align-items: center; flex: none; }

/* ---------- 金额 / 订单号 / 倒计时 / 步骤 ---------- */
.pm-info { display: grid; gap: 10px; min-width: 0; align-content: start; }
.pm-amount small { display: block; font-size: 12px; color: var(--muted); }
.pm-amount b { display: block; font-size: 32px; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pm-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; margin: 0; font-size: 13px; }
.pm-kv dt { color: var(--muted); }
.pm-kv dd { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; margin: 0; }
.pm-trade .code { font-size: 12px; }
.pm-count { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pm-count.warn { color: var(--warn-ink); }
.pm-steps { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.pm-steps li + li { margin-top: 2px; }

/* ---------- 状态行 / 说明 ---------- */
.pm-status { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; background: var(--info-bg); color: var(--info-ink); font-size: 13px; line-height: 1.5; }
.pm-status.is-idle { background: var(--card-2); color: var(--ink-2); }
.pm-status.is-idle .pm-spin { display: none; }
.pm-foot { margin: 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.pm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; width: 100%; }

/* ---------- 结果态：已到账 / 已过期 / 支付异常 / 核对中 / 出错 ---------- */
.pm-result { display: grid; justify-items: center; gap: 6px; padding: 8px 4px 2px; text-align: center; }
.pm-result-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--card-2); color: var(--muted); }
.pm-result.ok .pm-result-ic { background: var(--ok-bg); color: var(--ok-ink); }
.pm-result.warn .pm-result-ic { background: var(--warn-bg); color: var(--warn-ink); }
.pm-result.bad .pm-result-ic { background: var(--bad-bg); color: var(--bad-ink); }
.pm-result.info .pm-result-ic { background: var(--info-bg); color: var(--info-ink); }
.pm-result h3 { margin: 4px 0 0; font-size: 18px; font-weight: 700; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.pm-result p { margin: 0; max-width: 42ch; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.pm-after { display: grid; justify-items: center; gap: 6px; width: 100%; margin-top: 4px; }
.pm-after .pm-foot { max-width: 46ch; }
.pm-balance { font-weight: 600; color: var(--ink); }
.pm-balance[hidden] { display: none; }
.pm-trade-line { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 12.5px; min-width: 0; }
.pm-trade-line .code { overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .pm-main { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 12px; }
  .pm-info { width: 100%; }
  .pm-amount { text-align: center; }
  .pm-amount b { font-size: 30px; }
}
