:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --green: #07c160;
  --green-dark: #06ad56;
  --alipay: #1677ff;
  --alipay-dark: #0e63dd;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --success: #047857;
  --success-soft: #d1fae5;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.10);
  --radius: 20px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.11), transparent 32rem),
    radial-gradient(circle at 95% 15%, rgba(7, 193, 96, 0.10), transparent 28rem),
    var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.page { flex: 1; padding: 28px 0 52px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(145deg, var(--primary), #7c3aed);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.25);
}
.brand strong { display: block; font-size: 16px; letter-spacing: 0.02em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.topbar-meta { display: flex; align-items: center; gap: 10px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.pill-demo { color: #92400e; background: var(--warning-soft); }
.pill-live { color: var(--success); background: var(--success-soft); }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 2px 4px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.card {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.card-pad { padding: 28px; }
.card-header { padding: 24px 28px 0; }
.card-body { padding: 24px 28px 28px; }

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 22px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 750;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1.12; letter-spacing: -0.035em; }
h2 { margin-bottom: 10px; font-size: 24px; letter-spacing: -0.02em; }
h3 { margin-bottom: 8px; font-size: 17px; }
.subtle { color: var(--muted); line-height: 1.7; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.hidden { display: none !important; }

.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
  gap: 22px;
  align-items: start;
}
.layout-side { display: grid; gap: 18px; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 9px; }

.alert {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 1.6;
}
.alert-error { color: #991b1b; background: var(--danger-soft); border-color: #fecaca; }
.alert-warning { color: #92400e; background: var(--warning-soft); border-color: #fde68a; }
.alert-info { color: #1e40af; background: var(--primary-soft); border-color: #bfdbfe; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field-full { grid-column: 1 / -1; }
label { color: #334155; font-size: 13px; font-weight: 650; }
input, textarea, select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
textarea { min-height: 82px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.help { color: #94a3b8; font-size: 12px; line-height: 1.5; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-submitting, .method-button.is-submitting { cursor: not-allowed; opacity: .55; }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 10px 24px rgba(37, 99, 235, .22); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { color: #334155; background: #fff; border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { color: #991b1b; background: #fff; border-color: #fecaca; }
.btn-danger:hover { background: #fff1f2; }
.btn-small { min-height: 36px; padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.pay-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 440px);
  gap: 24px;
  align-items: start;
}
.pay-card { overflow: hidden; }
.pay-card-top {
  padding: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,.22), transparent 18rem),
    linear-gradient(135deg, #1d4ed8, #2563eb 55%, #4f46e5);
}
.pay-card-top .muted-on-blue { color: rgba(255,255,255,.73); font-size: 13px; }
.pay-amount {
  margin: 12px 0 8px;
  font-size: clamp(38px, 7vw, 58px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}
.pay-amount small { margin-right: 6px; font-size: .45em; font-weight: 700; vertical-align: 0.7em; letter-spacing: 0; }
.pay-card-body { padding: 28px 30px 32px; }
.pay-subject { margin-bottom: 4px; font-size: 20px; font-weight: 750; letter-spacing: -0.02em; }
.pay-meta { display: grid; gap: 10px; margin: 24px 0 28px; padding: 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.pay-meta-row { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; }
.pay-meta-row strong { color: #334155; font-weight: 650; text-align: right; word-break: break-all; }
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.method-button {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  text-align: left;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.method-button:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(15,23,42,.08); }
.method-button.wechat:hover { border-color: rgba(7,193,96,.58); }
.method-button.alipay:hover { border-color: rgba(22,119,255,.58); }
.method-icon {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff; font-size: 14px; font-weight: 800;
}
.wechat .method-icon { background: var(--green); }
.alipay .method-icon { background: var(--alipay); }
.method-name { display: block; font-weight: 750; font-size: 14px; }
.method-hint { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.method-button:disabled { cursor: not-allowed; opacity: .5; transform: none; box-shadow: none; }

.qr-panel { text-align: center; padding: 30px; }
.qr-frame {
  width: min(290px, 100%);
  margin: 18px auto 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15,23,42,.10);
}
.qr-frame img { display: block; width: 100%; height: auto; border-radius: 11px; }
.qr-hint { color: var(--muted); font-size: 13px; line-height: 1.7; }
.qr-url { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 11px; word-break: break-all; }

.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-muted { color: #475569; background: #e2e8f0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { margin-top: 6px; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid #eef2f7; font-size: 13px; vertical-align: middle; }
th { color: var(--muted); background: var(--surface-2); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
td a { color: var(--primary); font-weight: 650; }
.empty { padding: 46px 24px; text-align: center; color: var(--muted); }

.admin-order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.order-amount { font-size: 34px; font-weight: 800; letter-spacing: -.04em; }
.order-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-top: 22px; }
.meta-item { padding: 13px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.meta-key { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.meta-value { font-size: 13px; font-weight: 650; word-break: break-all; }

.result-card { max-width: 620px; margin: 7vh auto 0; text-align: center; padding: 42px 30px; }
.result-icon {
  width: 78px; height: 78px; margin: 0 auto 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 34px; font-weight: 800;
}
.result-icon.success { color: #fff; background: linear-gradient(145deg, #10b981, #059669); box-shadow: 0 14px 34px rgba(5,150,105,.28); }
.result-icon.warning { color: #92400e; background: var(--warning-soft); }
.result-icon.muted { color: #475569; background: #e2e8f0; }
.result-amount { margin: 12px 0; font-size: 40px; font-weight: 800; letter-spacing: -.04em; }
.result-detail { max-width: 420px; margin: 20px auto 0; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.8; text-align: left; }

.mock-banner { margin-bottom: 18px; padding: 14px 16px; border-radius: 14px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 13px; line-height: 1.6; }
.mock-panel { max-width: 680px; margin: 0 auto; }
.mock-amount { margin: 22px 0; padding: 24px; border-radius: 18px; text-align: center; background: var(--surface-2); border: 1px dashed #cbd5e1; }
.mock-amount strong { display: block; margin-top: 8px; font-size: 42px; letter-spacing: -.05em; }

.login-card { max-width: 460px; margin: 8vh auto 0; }
.login-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 24px; margin-bottom: 18px; }
.login-footer { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }

.notice-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.notice-list li { display: flex; gap: 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.notice-dot { flex: 0 0 7px; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--primary); }

.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { background: var(--surface-2); font-size: 12px; }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(16px);
  padding: 10px 15px; border-radius: 11px; color: #fff; background: #0f172a;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 10;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .layout-2, .pay-layout { grid-template-columns: 1fr; }
  .scan-again { display: none; }
  .pay-layout { max-width: 620px; margin: 0 auto; }
  .layout-2 { max-width: 720px; margin: 0 auto; }
  .footer { flex-direction: column; }
}
@media (max-width: 620px) {
  .shell { padding: 16px; }
  .page { padding: 20px 0 36px; }
  .card-pad, .pay-card-body, .card-body { padding: 22px; }
  .pay-card-top { padding: 24px 22px; }
  .page-heading, .admin-order-head { flex-direction: column; align-items: stretch; }
  .form-grid, .method-grid, .order-meta, .stats { grid-template-columns: 1fr; }
  .topbar-meta .pill { display: none; }
  .result-card { margin-top: 2vh; padding: 32px 22px; }
  .pay-meta { padding: 14px; }
  .method-button { min-height: 64px; }
}
