:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #86909c;
  --primary: #1677ff;
  --danger: #ff4d4f;
  --warn: #ff7d00;
  --ok: #00b42a;
  --line: #e5e6eb;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
button { font-family: inherit; }

body.theme-boot,
body.theme-loading,
body.theme-error {
  background: linear-gradient(160deg, #f0f5ff 0%, #f6ffed 45%, #fafafa 100%);
}
body.theme-aa { background: #f5f5f5; }
body.theme-wechat { background: linear-gradient(180deg, #e8f8ef 0%, #f5f5f5 40%); }
body.theme-qq { background: radial-gradient(circle at 50% 0, rgba(255,255,255,0.95) 0, rgba(255,255,255,0.68) 42%, transparent 70%), #eee9da; }
body.theme-default,
body.theme-alipay,
body.theme-alipay_preauth,
body.theme-alipay_jsapi,
body.theme-return {
  background: linear-gradient(160deg, #f0f5ff 0%, #f6ffed 45%, #fafafa 100%);
}

#boot {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: inherit;
  z-index: 20;
}
body.is-ready #boot { display: none; }

.page {
  min-height: 100vh;
  padding: 16px 12px 32px;
}
.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.hidden { display: none !important; }

.card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 20px 16px 24px;
}
.card-soft {
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  padding: 28px 24px 20px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.card-wide { max-width: 520px; }

body.theme-default #panel-main,
body.theme-alipay #panel-main,
body.theme-alipay_preauth #panel-main,
body.theme-alipay_jsapi #panel-main {
  max-width: 520px;
  border-radius: 16px;
  padding: 28px 24px 20px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}
body.theme-wechat #panel-main {
  border-radius: 16px;
  padding: 28px 24px 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 15px;
  color: #333;
}
body.theme-aa .brand {
  justify-content: center;
  color: #1677ff;
  font-size: 16px;
}
.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1677ff, #69b1ff);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
body.theme-aa .brand-logo {
  border-radius: 6px;
  background: linear-gradient(135deg, #6366f1, #1677ff);
  font-size: 11px;
}
body.theme-wechat .brand-logo { background: #07c160; }

.title { margin: 0 0 8px; font-size: 20px; font-weight: 700; text-align: center; }
.tip { margin: 0; color: #4e5969; line-height: 1.6; font-size: 14px; text-align: center; }
.detail { margin: 10px 0 0; color: var(--muted); font-size: 12px; word-break: break-all; text-align: center; }

.amount-block { text-align: center; margin-bottom: 12px; }
.amount-label { font-size: 13px; color: #8c8c8c; margin-bottom: 6px; }
.amount {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
  text-align: center;
}
body.theme-aa .amount { font-size: 42px; color: #ff4d4f; margin-bottom: 12px; }
body.theme-wechat .amount { color: #111; margin-bottom: 16px; text-align: left; }
body.theme-default .amount,
body.theme-alipay .amount,
body.theme-alipay_preauth .amount,
body.theme-alipay_jsapi .amount { color: #1677ff; }
body.theme-wechat #checkout-amount-block { text-align: left; }

.order-line,
.meta {
  color: #666;
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 8px;
}
body.theme-aa .order-line { text-align: center; }
body.theme-wechat .order-line { color: #888; margin-bottom: 8px; }
body.theme-default .order-line,
body.theme-alipay .order-line,
body.theme-alipay_preauth .order-line,
body.theme-alipay_jsapi .order-line { display: none; }

.order-meta {
  padding: 14px 16px;
  background: #fafafa;
  border-radius: 10px;
  border: 1px solid #f0f0f0;
  margin-bottom: 16px;
}
.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
}
.meta-row + .meta-row { border-top: 1px dashed #eee; }
.meta-label { color: #8c8c8c; flex-shrink: 0; }
.meta-value { color: #1d2129; word-break: break-all; text-align: right; }
.meta-value.amount { font-weight: 600; color: #1677ff; }

.countdown {
  text-align: center;
  margin: 16px 0;
  font-size: 14px;
  color: #333;
}
body.theme-aa .countdown strong { color: #ff4d4f; }
body.theme-wechat .countdown { text-align: left; color: #fa8c16; margin-bottom: 20px; }
body.theme-default .countdown,
body.theme-alipay .countdown,
body.theme-alipay_preauth .countdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 8px;
  color: #ad6800;
}
body.theme-default .countdown strong,
body.theme-alipay .countdown strong,
body.theme-alipay_preauth .countdown strong {
  font-size: 20px;
  font-weight: 700;
  color: #d46b08;
  font-variant-numeric: tabular-nums;
}

.aa-tips .tip {
  text-align: center;
  color: #ff4d4f;
  font-size: 13px;
  margin: 0 0 8px;
}
.aa-tips .warn {
  text-align: center;
  color: #ff4d4f;
  font-weight: 700;
  margin: 0 0 4px;
}
.aa-tips .warn-sm {
  text-align: center;
  color: #ff4d4f;
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 4px;
}
.wx-tips .tip {
  text-align: left;
  color: #555;
  margin-bottom: 12px;
}

.status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #e8f3ff;
  color: #1677ff;
}
.status-tag.is-ok { background: #e8ffea; color: #00b42a; }
.status-tag.is-bad { background: #ffece8; color: #f53f3f; }
.status-tag.is-warn { background: #fff7e8; color: #ff7d00; }

.btn {
  display: block;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  line-height: 48px;
}
.btn[disabled],
.btn.is-disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid #91caff;
  margin-top: 10px;
}
.btn-ghost {
  background: #f2f3f5;
  color: #1d2129;
  margin-top: 10px;
}
body.theme-wechat .btn { background: #07c160; height: 48px; line-height: 48px; border-radius: 10px; }
body.theme-default .btn,
body.theme-alipay .btn,
body.theme-alipay_preauth .btn,
body.theme-alipay_jsapi .btn {
  height: 44px;
  line-height: 44px;
  border-radius: 10px;
  margin-top: 8px;
}

.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px 0;
  background: #fafafa;
  border-radius: 8px;
}
body.theme-default .qr-block,
body.theme-alipay .qr-block {
  padding: 16px;
  border-radius: 12px;
}
.qr-label { font-size: 14px; color: #8c8c8c; }
.qr-box {
  width: 220px;
  height: 220px;
  overflow: hidden;
  background: #fff;
}
.qr-box img, .qr-box canvas, .qr-box table { max-width: 100%; }

.aa-link-loading {
  margin: 12px 0 16px;
  padding: 14px 12px;
  border: 1px solid #d6e4ff;
  border-radius: 10px;
  background: #f5f8ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #1d2129;
  font-size: 13px;
}
.aa-link-loading-text { margin: 0; text-align: center; }
.aa-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e8f3ff;
  overflow: hidden;
}
.aa-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.25s linear;
}

.profile-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  color: #595959;
  font-size: 14px;
}
.tip-alert {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #ad6800;
  font-size: 13px;
}

.help-actions { margin-top: 14px; }
.copy-hint { margin-top: 8px; color: var(--muted); font-size: 12px; text-align: center; }

.result-icon {
  width: 56px;
  height: 56px;
  margin: 8px auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  background: #e8f3ff;
  color: #1677ff;
}
.result-icon.is-ok { background: #e8ffea; color: #00b42a; }
.result-icon.is-bad { background: #ffece8; color: #f53f3f; }
.result-icon.is-warn { background: #fff7e8; color: #ff7d00; }
.result-icon.is-error { background: #ffece8; color: #f53f3f; }
.poll-tip {
  margin: 8px 0 12px;
  font-size: 13px;
  color: #8c8c8c;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4e5969;
  font-size: 14px;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #bedaff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.spinner.lg { width: 28px; height: 28px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* AA scam demo */
.aa-scam-section {
  max-width: 420px;
  margin: 20px auto 0;
  padding: 0 4px;
}
.aa-scam-heading {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin: 0 0 6px;
}
.aa-scam-desc {
  text-align: center;
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  margin: 0 0 12px;
}
.aa-scam-demo {
  background: #fff;
  border-radius: 12px;
  padding: 14px 12px 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid #ffe7e7;
}
.aa-scam-demo-title {
  font-size: 13px;
  color: #999;
  margin-bottom: 4px;
}
.aa-scam-demo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.aa-scam-demo-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}
.aa-scam-demo-list li:last-child { border-bottom: none; }
.aa-scam-demo-list .avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: #f0f0f0;
}
.aa-scam-demo-list .info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.aa-scam-demo-list .name {
  font-size: 13px;
  color: #333;
  line-height: 1.35;
  word-break: break-all;
}
.aa-scam-demo-list .badge {
  font-size: 11px;
  color: #ff4d4f;
}
.aa-scam-demo-list .amt {
  flex-shrink: 0;
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}
.aa-scam-banner {
  margin: 14px 0 0;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: #ff1a1a;
  letter-spacing: 1px;
  line-height: 1.4;
}
.aa-scam-foot {
  text-align: center;
  font-size: 12px;
  color: #ff4d4f;
  line-height: 1.5;
  margin: 12px 0 0;
}

.iframe-helper {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
}

/* QQ theme */
.qq-card {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 14px 13px 28px;
  background: rgba(255, 255, 252, 0.92);
  border-top: 2px solid #c6a331;
  box-shadow: 0 8px 28px rgba(65, 50, 20, 0.12);
}
.qq-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid #c6a331;
  font-size: 20px;
  line-height: 1;
}
.qq-logo {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  background: #1f58b8;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
}
.qq-title { color: #171717; letter-spacing: 0.02em; }
.qq-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  padding: 26px 0 12px;
  color: #b61622;
}
.qq-amount .currency { color: #1f1f1f; font-size: 24px; }
.qq-amount strong {
  font-size: clamp(52px, 17vw, 72px);
  line-height: 0.9;
  font-weight: 800;
}
.deadline-tip {
  margin: 0 8px 26px;
  color: #32413b;
  font-size: 20px;
  line-height: 1.7;
}
.deadline-tip strong {
  margin: 0 2px;
  color: #b61622;
}
.platform-list {
  display: grid;
  gap: 8px;
  margin: 0 4px 14px;
}
.platform-btn,
.copy-submit,
.refresh-btn,
.known-btn,
.inline-copy {
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
}
.platform-btn {
  min-height: 58px;
  color: #fff;
  font-size: 22px;
  letter-spacing: 0.02em;
}
.platform-btn:disabled,
.copy-submit:disabled,
.inline-copy:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.jd { background: #d01822; }
.taobao { background: #f07800; }
.douyin { background: #080808; }
.pdd { background: #d71920; }
.platform-notice {
  margin: 8px 4px 12px;
  padding: 8px 10px;
  border: 1px solid #f0ca7a;
  border-radius: 4px;
  background: #fff8df;
  color: #8a5800;
  font-size: 14px;
}
.important-box {
  display: flex;
  gap: 10px;
  margin: 8px 4px 16px;
  padding: 13px 12px;
  border-radius: 4px;
  background: #fff1a8;
  color: #6a5a1d;
  font-size: 18px;
  line-height: 1.55;
}
.warn-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  border-radius: 50%;
  background: #f8bd1d;
  color: #5d4300;
  font-weight: 800;
}
.qq-account-box {
  margin: 0 4px 20px;
  padding: 20px 13px 24px;
  border: 1px solid #d6d3c8;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.76);
}
.account-label {
  display: block;
  margin-bottom: 12px;
  font-size: 20px;
}
.account-input-row { display: flex; gap: 8px; }
.account-input {
  min-width: 0;
  flex: 1;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #cfcfcf;
  border-radius: 2px;
  background: #fff;
  color: #161616;
  font-size: 18px;
  outline: none;
}
.inline-copy {
  min-width: 58px;
  padding: 0 10px;
  background: #1d4ed8;
  color: #fff;
}
.account-help {
  margin: 18px 0 0;
  text-align: center;
  color: #3d3d3d;
  font-size: 19px;
}
.copy-submit,
.refresh-btn {
  display: block;
  width: calc(100% - 8px);
  min-height: 58px;
  margin: 0 4px 16px;
  color: #fff;
  font-size: 22px;
}
.copy-submit {
  background: #064ee4;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}
.refresh-btn { background: #237a4b; }
.steps {
  margin: 8px 9px 0;
  color: #333;
  font-size: 16px;
  line-height: 1.75;
}
.steps-heading { margin: 0 0 6px; }
.steps-heading strong { color: #b61622; }
.steps ol { margin: 0; padding-left: 22px; }
.qq-card .order-line {
  margin: 20px 9px 0;
  color: #777;
  font-size: 13px;
  word-break: break-all;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.42);
}
.help-modal {
  width: min(100%, 560px);
  overflow: hidden;
  border-radius: 5px;
  background: #fffef7;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}
.modal-top {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px 0 26px;
  border-bottom: 1px solid #e6e0d4;
  color: #555;
  font-size: 20px;
}
.modal-close {
  border: 0;
  background: transparent;
  color: #676767;
  cursor: pointer;
  font-size: 40px;
  line-height: 1;
}
.modal-body { padding: 22px 28px 18px; }
.modal-body h2 {
  margin: 0 0 16px;
  text-align: center;
  color: #262626;
  font-size: 22px;
  font-weight: 700;
}
.modal-important { margin: 0 0 18px; }
.help-list {
  margin: 0;
  padding-left: 22px;
  color: #333;
  font-size: 18px;
  line-height: 1.8;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px 22px;
  border-top: 1px solid #eee8da;
}
.known-btn {
  min-height: 44px;
  padding: 0 18px;
  background: #1f58e7;
  color: #fff;
  font-size: 18px;
}

@media (max-width: 380px) {
  .deadline-tip,
  .platform-btn,
  .copy-submit,
  .refresh-btn { font-size: 18px; }
  .important-box,
  .account-label,
  .account-help,
  .help-list { font-size: 16px; }
}
