:root {
  color-scheme: light;
  --text: #1d1d20;
  --muted: #6f7178;
  --line: #e6e8ee;
  --soft: #f6f7f9;
  --panel: #ffffff;
  --shadow: 0 18px 55px rgba(30, 35, 44, 0.1);
  --wechat: #16a34a;
  --alipay: #1677ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(247, 248, 250, 0.96), #ffffff 46%),
    #ffffff;
  color: var(--text);
  font-family: Lato, "Helvetica Neue", Arial, Helvetica, "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.pay-shell {
  width: min(1040px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0;
  display: grid;
  align-items: center;
}

.pay-panel {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 34px;
}

.pay-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.pay-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #111113;
  color: #fff;
}

.pay-logo svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.pay-kicker {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.pay-summary {
  display: grid;
  grid-template-columns: 1.3fr 0.85fr 0.85fr;
  gap: 12px;
  margin-bottom: 16px;
}

.pay-summary > div,
.order-box,
.method-card,
.pay-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pay-summary > div {
  padding: 18px;
}

.summary-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pay-summary strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

.order-box {
  padding: 18px;
  margin-bottom: 18px;
  background: var(--soft);
}

.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

#orderId {
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: #111113;
  font-size: 16px;
  font-weight: 700;
}

.copy-button {
  border: 1px solid #d7dae2;
  border-radius: 999px;
  background: #fff;
  color: #22242a;
  padding: 6px 12px;
  cursor: pointer;
}

.copy-button:hover {
  border-color: #b8beca;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.order-meta span {
  border: 1px solid #dfe2ea;
  border-radius: 999px;
  background: #fff;
  color: #555963;
  padding: 6px 10px;
  font-size: 13px;
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.method-card {
  padding: 20px;
}

.method-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.method-title h2 {
  font-size: 18px;
  line-height: 1.2;
}

.method-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111113;
}

.method-wechat .method-dot {
  background: var(--wechat);
}

.method-alipay .method-dot {
  background: var(--alipay);
}

.qr-frame {
  position: relative;
  width: min(320px, 100%);
  min-height: 260px;
  margin: 0 auto;
  border: 1px solid #e3e5eb;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 10px;
}

.qr-image {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.qr-fallback {
  display: none;
  color: var(--muted);
  font-size: 14px;
}

.qr-frame.is-missing .qr-image {
  display: none;
}

.qr-frame.is-missing .qr-fallback {
  display: block;
}

.pay-note {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding: 14px 16px;
  color: #565b65;
  background: #fbfbfc;
}

.pay-note strong {
  color: #1d1d20;
}

@media (max-width: 760px) {
  .pay-shell {
    width: min(100% - 20px, 1040px);
    padding: 18px 0;
    align-items: start;
  }

  .pay-panel {
    padding: 20px;
  }

  .pay-summary,
  .pay-methods {
    grid-template-columns: 1fr;
  }

  .pay-summary strong {
    font-size: 20px;
  }

  h1 {
    font-size: 26px;
  }

  .pay-note {
    display: block;
  }

  .pay-note span {
    display: block;
    margin-top: 6px;
  }
}

/* pay-submit injected button + form */
.pay-submit-section { margin-top: 18px; }
.pay-submit-btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
  transition: transform .15s, box-shadow .15s;
}
.pay-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32); }
.pay-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.pay-submit-form {
  margin-top: 12px;
  padding: 14px 16px;
  background: #f6f7f9;
  border-radius: 10px;
  display: grid;
  gap: 10px;
}
.pay-submit-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #d6d9e0;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}
.pay-submit-textarea { resize: vertical; min-height: 56px; }
.pay-submit-confirm {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #16a34a;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.pay-submit-confirm:disabled { opacity: 0.5; cursor: not-allowed; }
.pay-submit-status { font-size: 13px; min-height: 18px; }
