/* ============================================================
   付款页 / 订单查询
   ============================================================ */
.pay-main { padding: 44px 0 80px; }

[hidden] { display: none !important; }

/* ---------------- 加载 / 错误 ---------------- */
.pay-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 90px 0;
  color: var(--text-dim);
  font-size: 14px;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid rgba(148, 163, 184, 0.18);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pay-error {
  max-width: 460px;
  margin: 60px auto;
  padding: 38px 32px;
  text-align: center;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.err-icon {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 700;
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.pay-error h2 { margin: 0 0 8px; font-size: 19px; }
.pay-error p { margin: 0 0 24px; font-size: 13.5px; color: var(--text-dim); }
.err-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.btn-ghost {
  background: rgba(148, 163, 184, 0.06);
  border-color: var(--line-strong);
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(148, 163, 184, 0.45); background: rgba(148, 163, 184, 0.11); }
.btn-sm { padding: 8px 14px; font-size: 12.5px; border-radius: 9px; }

/* ---------------- 查询卡片 ---------------- */
.query-card {
  max-width: 520px;
  margin: 40px auto;
  padding: 34px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.query-card h2 { margin: 0 0 6px; font-size: 20px; }
.query-sub { margin: 0 0 22px; font-size: 13.5px; color: var(--text-dim); }
.query-form { display: flex; gap: 10px; }
.query-form .input { flex: 1; font-family: var(--mono); letter-spacing: 0.5px; }
.query-tip { margin: 16px 0 0; font-size: 12px; color: var(--text-mute); }

/* ---------------- 支付布局 ---------------- */
.pay-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.pay-card {
  position: relative;
  padding: 30px 34px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* 状态徽章 */
.pay-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.26);
  margin-bottom: 18px;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 1.8s infinite;
}
.pay-status-badge.paid { color: var(--green); background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.28); }
.pay-status-badge.closed { color: var(--text-mute); background: rgba(148, 163, 184, 0.08); border-color: var(--line-strong); }

/* 金额 */
.pay-amount-block { text-align: center; padding: 6px 0 22px; border-bottom: 1px dashed var(--line); }
.pay-amount-label { font-size: 12.5px; color: var(--text-mute); letter-spacing: 0.6px; }
.pay-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin: 6px 0 12px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 46px;
  line-height: 1.1;
  background: linear-gradient(120deg, #fff, #b9cdf5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pay-amount .cur { font-size: 24px; opacity: 0.75; }

.pay-countdown {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.07);
}
.pay-countdown svg { width: 14px; height: 14px; }
.pay-countdown b { color: var(--brand-2); font-family: var(--mono); }
.pay-countdown.urgent b { color: var(--red); }
.pay-countdown.hidden { display: none; }

/* 订单信息 */
.pay-order-info { padding: 18px 0; border-bottom: 1px dashed var(--line); }
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  font-size: 13px;
}
.info-label { color: var(--text-mute); flex: 0 0 auto; }
.info-value { color: var(--text); text-align: right; word-break: break-all; display: inline-flex; align-items: center; gap: 8px; }
.mono { font-family: var(--mono); font-size: 12.5px; }

.copy-btn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--line);
  transition: all 0.16s ease;
}
.copy-btn:hover { color: var(--brand-2); border-color: rgba(34, 211, 238, 0.4); }

/* 二维码 */
.pay-qr-block { display: flex; flex-direction: column; align-items: center; padding: 24px 0 6px; }
.qr-frame {
  position: relative;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.qr-frame img { display: block; width: 220px; height: 220px; object-fit: contain; border-radius: 8px; }
.qr-frame img.hidden { display: none; }

.qr-scanline {
  position: absolute;
  left: 12px; right: 12px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.95), transparent);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.8);
  animation: scan 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes scan {
  0%, 100% { top: 14px; opacity: 0.2; }
  50% { top: calc(100% - 16px); opacity: 1; }
}

.qr-tip { margin: 14px 0 12px; font-size: 12.5px; color: var(--text-dim); text-align: center; }
.qr-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* 操作按钮 */
.pay-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}
.btn-pay {
  flex: 1;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  border-radius: 13px;
  background: linear-gradient(120deg, #059669, #10b981 60%, #34d399);
  box-shadow: 0 14px 32px -16px rgba(16, 185, 129, 0.95);
  transition: all 0.22s ease;
}
.btn-pay:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-pay:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.btn-spinner {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.pay-foot { margin: 14px 0 0; text-align: center; font-size: 11.5px; color: var(--text-mute); }

/* ---------------- 侧栏 ---------------- */
.pay-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; }

.side-card {
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(17, 25, 40, 0.6);
  border: 1px solid var(--line);
}
.side-card h3 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.4px;
}

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.step { display: flex; gap: 11px; position: relative; }
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 11px; top: 26px; bottom: -12px;
  width: 1px;
  background: var(--line);
}
.step-dot {
  flex: 0 0 23px;
  height: 23px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-mute);
  border: 1px solid var(--line-strong);
  background: rgba(7, 11, 20, 0.8);
  z-index: 1;
}
.step b { display: block; font-size: 13px; font-weight: 500; color: var(--text-dim); }
.step small { display: block; font-size: 11.5px; color: var(--text-mute); line-height: 1.45; margin-top: 2px; }
.step.done .step-dot { color: #fff; background: rgba(16, 185, 129, 0.9); border-color: transparent; }
.step.done b { color: var(--text); }
.step.active .step-dot { color: var(--brand-2); border-color: rgba(34, 211, 238, 0.7); box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.1); }
.step.active b { color: var(--text); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.timeline li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-mute); }
.tl-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.tl-text { flex: 1; }
.timeline time { font-family: var(--mono); font-size: 11px; }
.timeline li.active { color: var(--text); }
.timeline li.active .tl-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }

.side-tip p { margin: 0; font-size: 12px; color: var(--text-mute); line-height: 1.65; }

/* ---------------- 结果页 ---------------- */
.result-card {
  max-width: 560px;
  margin: 30px auto;
  padding: 42px 38px 34px;
  text-align: center;
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-icon { width: 78px; height: 78px; margin: 0 auto 20px; }
.result-icon svg { width: 100%; height: 100%; }
.result-icon.success { color: var(--green); }
.result-icon.closed { color: var(--text-mute); }
.result-circle { stroke-dasharray: 140; stroke-dashoffset: 140; animation: draw-circle 0.6s ease forwards; opacity: 0.35; }
.result-check { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw-check 0.45s 0.35s ease forwards; }
@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-check { to { stroke-dashoffset: 0; } }

.result-card h2 { margin: 0 0 6px; font-size: 22px; }
.result-amount { margin: 0 0 8px; font-family: var(--mono); font-size: 15px; color: var(--text-dim); }
.result-amount b { font-size: 38px; color: var(--text); margin-left: 4px; }
.result-desc { margin: 0 0 26px; font-size: 13.5px; color: var(--text-dim); }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 26px;
}
.result-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 16px;
  background: rgba(17, 25, 40, 0.9);
  text-align: left;
}
.result-grid span { font-size: 11.5px; color: var(--text-mute); }
.result-grid b { font-size: 13px; font-weight: 500; word-break: break-all; }

.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .pay-grid { grid-template-columns: 1fr; }
  .pay-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .side-card { flex: 1 1 240px; }
}

@media (max-width: 560px) {
  .pay-main { padding: 26px 0 56px; }
  .pay-card { padding: 24px 20px; border-radius: 20px; }
  .pay-amount { font-size: 38px; }
  .qr-frame img { width: 190px; height: 190px; }
  .pay-actions { flex-direction: column; }
  .result-card { padding: 32px 22px 26px; }
  .result-grid { grid-template-columns: 1fr; }
  .query-form { flex-direction: column; }
  .pay-side { flex-direction: column; }
}
