/* ==========================================================================
   伴玩星球 · 收银台与支付状态 1.2.0
   依赖 style.css 的色板与基础组件
   ========================================================================== */

/* 页脚支付标识 */
.footer-pay { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.footer-pay .payment-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 4px;
  border-radius: 6px; background: rgba(255, 255, 255, .06); border: 1px solid #2a2e37;
  font-size: 11.5px; color: #a7adb8;
}
.footer-pay .payment-logo { width: 16px; height: 16px; border-radius: 4px; flex: none; }
.payment-logo { display: block; width: 28px; height: 28px; border-radius: 7px; flex: none; }

/* 支付方式选择 */
.checkout-methods, .pay-methods { border: 0; padding: 0; margin: 0; min-width: 0; }
.pay-methods legend, .checkout-methods legend {
  font-size: 12px; color: #5c626d; margin-bottom: 7px; padding: 0;
}
.pay-methods { margin: 2px 0 0; }
.method-grid, .payment-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.payment-method-choice {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; min-height: 58px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.payment-method-choice:hover { border-color: #c9ccd4; }
.payment-method-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.payment-method-choice:has(input:checked) { border-color: var(--ink); background: #fafbfc; }
.payment-method-choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.payment-method-choice.disabled { background: #fafbfc; border-style: dashed; color: var(--faint); cursor: not-allowed; }
.payment-method-choice.disabled .payment-logo { opacity: .45; }
.method-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.method-text strong { font-size: 13px; font-weight: 600; color: var(--ink); }
.method-text small { font-size: 11px; color: var(--faint); line-height: 1.4; }
.method-check {
  margin-left: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--ink);
  color: #fff; font-size: 10px; display: grid; place-items: center; opacity: 0;
}
.payment-method-choice:has(input:checked) .method-check { opacity: 1; }
.method-note, .payment-config-note { margin-top: 8px; font-size: 11.5px; line-height: 1.7; color: var(--faint); }
.payment-unavailable-note { padding: 9px 11px; background: #fafbfc; border: 1px solid var(--line); border-radius: 7px; }

/* 收银台弹窗内部 */
.dialog-payment { width: min(500px, calc(100% - 28px)); }
.dialog-payment .dialog-head h2 { font-size: 18px; }

.payment-steps { display: flex; align-items: center; gap: 0; margin-bottom: 18px; font-size: 11.5px; color: var(--faint); }
.payment-steps li { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.payment-steps li:not(:last-child)::after { content: ""; width: 22px; height: 1px; background: var(--line); margin: 0 9px; }
.payment-steps li > span {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: #f2f3f6; color: var(--faint); font-size: 11px; font-weight: 600;
}
.payment-steps li.active { color: var(--ink); font-weight: 600; }
.payment-steps li.active > span { background: var(--ink); color: #fff; }
.payment-steps li.complete > span { background: #e8f7ef; color: #15784a; }
.payment-steps li.complete { color: #4e545e; }

.payment-order-box {
  padding: 14px; border-radius: 9px; background: #fafbfc; border: 1px solid var(--line);
}
.payment-order-box > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.payment-order-box span { font-size: 12.5px; color: var(--muted); }
.payment-order-box strong { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.8px; }
.payment-order-box small { display: block; margin-top: 5px; font-size: 11px; color: var(--faint); overflow-wrap: anywhere; }

.payment-status-line {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 15px 0 6px; font-size: 14px; font-weight: 600; color: var(--ink);
}
.payment-status-mark {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: #f2f3f6; color: var(--muted); font-size: 12px;
}
.payment-status-line.paid { color: #15784a; }
.payment-status-line.paid .payment-status-mark { background: #e8f7ef; color: #15784a; }
.payment-status-line.closed { color: #8d6a1d; }
.payment-status-line.closed .payment-status-mark { background: #fff7e6; color: #8d6a1d; }
.payment-state-copy { max-width: 400px; margin: 0 auto 10px; font-size: 12px; line-height: 1.75; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.pay-service-status { text-align: center; font-size: 11.5px; color: var(--faint); margin-bottom: 14px; }
.pay-service-status strong { color: #4e545e; font-weight: 500; }
.payment-message {
  padding: 9px 11px; margin: 10px 0; border-radius: 7px; background: #fff7e6;
  font-size: 11.5px; line-height: 1.7; color: #7d5c14;
}

.payment-channel-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 10px; }
.payment-channel-summary > span:last-child { font-size: 11px; color: var(--faint); }
.payment-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px 5px 5px;
  border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; color: var(--ink);
}
.payment-badge .payment-logo { width: 18px; height: 18px; border-radius: 4px; flex: none; }

/* 扫码 */
.payment-scan-panel { padding: 14px; border: 1px solid var(--line); border-radius: 9px; text-align: center; background: #fafbfc; }
.payment-qr {
  width: 208px; max-width: 100%; margin: 0 auto; padding: 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
}
.payment-qr svg { width: 100%; height: auto; }
.payment-qr-caption { margin: 10px 0 4px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.payment-qr-help { max-width: 340px; margin: 0 auto; font-size: 11px; line-height: 1.7; color: var(--faint); }

/* 跳转 */
.payment-redirect-panel { margin: 12px 0; padding: 18px 16px; border: 1px solid var(--line); border-radius: 9px; text-align: center; background: #fafbfc; }
.payment-redirect-panel > .payment-logo { width: 36px; height: 36px; margin: 0 auto 9px; border-radius: 9px; }
.payment-redirect-panel > strong { display: block; font-size: 14px; color: var(--ink); }
.payment-redirect-note { max-width: 330px; margin: 6px auto 14px; font-size: 11.5px; line-height: 1.75; color: var(--muted); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; background: none; color: var(--ink);
}
.button-small { height: 34px; padding: 0 14px; font-size: 12.5px; }
.button-primary { background: var(--brand); color: #fff; }
.button-primary:hover { background: var(--brand-d); }
.button-quiet { background: var(--line-soft); color: var(--ink); }
.button-quiet:hover { background: #e9ebf0; }

.payment-primary {
  margin-top: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 46px; border: 0; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: #fff;
}
.payment-primary.wechat { background: #1aad56; color: #fff; }
.payment-primary.wechat:hover { background: #159247; }
.payment-primary.alipay { background: #2f86f6; color: #fff; }
.payment-primary.alipay:hover { background: #2673d6; }
.payment-button-spinner { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }

.payment-modal-actions { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 14px; }
.payment-modal-actions button { padding: 5px 0; font-size: 12px; color: var(--muted); }
.payment-modal-actions button:first-child { color: var(--ink); font-weight: 600; }
.payment-modal-actions button:hover { text-decoration: underline; text-underline-offset: 3px; }
.payment-poll-note { margin-top: 5px; font-size: 11px; color: var(--faint); text-align: center; line-height: 1.7; }
.payment-lock-note { margin: 9px auto 11px; max-width: 380px; font-size: 11px; line-height: 1.75; color: var(--faint); text-align: center; }
.payment-expiry { margin: 10px 0 11px; font-size: 11px; color: var(--faint); text-align: center; }
.payment-error { margin-top: 11px; }
.payment-safety-note {
  margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line-soft);
  font-size: 11px; line-height: 1.7; color: var(--faint); text-align: center;
}
.payment-loading { min-height: 180px; }
.payment-loading .spinner { margin: 0 auto; }
.dialog-payment .empty-state { min-height: 150px; }

/* 订单里的支付状态 */
.order-payment-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; font-size: 11px; color: var(--faint); }
.order-payment-tag { padding: 2px 7px; border-radius: 4px; background: #fff7e6; color: #8d6a1d; font-size: 11px; }
.order-payment-tag.paid { background: #e8f7ef; color: #15784a; }
.order-payment-tag.pending, .order-payment-tag.creating { background: #fff7e6; color: #8d6a1d; }
.order-payment-tag.closed { background: #f2f3f6; color: #6d7380; }
.order-payment-tag.demo, .order-payment-tag.legacy { background: #f2f3f6; color: #767c88; }

.order-acts .pay-order-action {
  background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 500;
}
.order-acts .pay-order-action:hover { background: #000; border-color: #000; }
.order-acts .review-action { border-color: #ffd9cd; color: var(--brand-d); background: var(--brand-soft); }
.order-acts .review-action:hover { border-color: var(--brand); }

@media (max-width: 680px) {
  .method-grid, .payment-method-grid { gap: 7px; }
  .payment-method-choice { padding: 9px 10px; min-height: 56px; gap: 8px; }
  .payment-method-choice .payment-logo { width: 26px; height: 26px; }
  .method-text strong { font-size: 12.5px; }
  .method-text small { font-size: 10px; }
  .payment-steps { font-size: 11px; margin-bottom: 15px; }
  .payment-steps li:not(:last-child)::after { width: 14px; margin: 0 7px; }
  .payment-order-box strong { font-size: 23px; }
  .payment-qr { width: 196px; }
  .payment-primary { height: 44px; font-size: 13.5px; }
}
