:root {
  color-scheme: light;
  --page-bg: #f6f7fb;
  --card-bg: #ffffff;
  --border: #e6e8ef;
  --border-strong: #d9dde8;
  --text: #1a1d27;
  --text-muted: #8d94a6;
  --accent: #2f80ed;
  --accent-soft: #eaf3ff;
  --warning-bg: #fff6df;
  --warning-text: #b27018;
  --button-disabled: #d8d9df;
  --shadow: 0 12px 30px rgba(20, 24, 33, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
  padding: 24px 16px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.pay-card {
  width: min(100%, 440px);
  background: var(--card-bg);
  border: 1px solid rgba(230, 232, 239, 0.8);
  box-shadow: var(--shadow);
  border-radius: 16px;
  padding: 28px 20px 20px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.brand-logo-full {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: cover;
  border-radius: 16px;
  flex: 0 0 auto;
}

.brand-title {
  font-size: clamp(30px, 6vw, 40px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.brand-subtitle {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0;
}

.field-section + .field-section {
  margin-top: 24px;
}

.section-label {
  display: block;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
}

.text-input {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.12);
}

.text-input::placeholder {
  color: #bcc1cf;
}

.field-tip {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.account-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  background: #fbfcff;
}

.account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(180deg, #eef3ff 0%, #e6ecfb 100%);
}

.account-name {
  font-size: 15px;
  font-weight: 600;
}

.account-id {
  font-size: 13px;
  color: var(--text-muted);
}

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

.amount-button {
  min-height: 74px;
  padding: 12px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.amount-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(47, 128, 237, 0.14);
}

.amount-money {
  font-size: 18px;
  font-weight: 700;
}

.amount-coin {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.amount-give {
  margin-top: 6px;
  font-size: 12px;
  color: #d1732a;
}

.custom-amount-card {
  display: block;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-amount-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(47, 128, 237, 0.14);
}

.custom-amount-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.custom-amount-title {
  font-size: 15px;
  font-weight: 600;
}

.custom-amount-tag {
  font-size: 12px;
  color: var(--text-muted);
}

.custom-amount-input-wrap {
  height: 54px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  align-items: center;
  gap: 10px;
}

.currency-prefix {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.custom-amount-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.custom-amount-input::placeholder {
  color: #bcc1cf;
  font-weight: 500;
}

.custom-amount-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.custom-amount-meta.error {
  color: #c34b4b;
}

.method-list {
  display: grid;
  gap: 12px;
}

.method-button {
  width: 100%;
  min-height: 60px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
}

.method-button img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.method-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.notice-box {
  margin-top: 28px;
  padding: 18px 16px;
  border-radius: 12px;
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 14px;
  line-height: 1.7;
}

.notice-box p {
  margin: 0;
}

.notice-box p + p {
  margin-top: 10px;
}

.submit-button {
  width: 100%;
  height: 54px;
  margin-top: 24px;
  border: 0;
  border-radius: 12px;
  background: #171a23;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.submit-button:disabled {
  background: var(--button-disabled);
  color: #fff;
  cursor: default;
}

.submit-tip,
.status-line {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.status-line.error {
  color: #c34b4b;
}

.status-line.success {
  color: #238152;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 18, 28, 0.48);
}

.modal-card {
  position: relative;
  width: min(100%, 360px);
  border-radius: 16px;
  background: #fff;
  padding: 22px 18px 18px;
  box-shadow: 0 24px 48px rgba(18, 24, 40, 0.2);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f1f3f8;
  color: #4d5568;
  font-size: 22px;
  line-height: 1;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.modal-subtitle {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.qr-box {
  width: 220px;
  height: 220px;
  margin: 18px auto 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-button {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}

.action-button.primary {
  border-color: #171a23;
  background: #171a23;
  color: #fff;
}

.order-meta {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  word-break: break-all;
}

@media (max-width: 420px) {
  .page-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .pay-card {
    padding-left: 16px;
    padding-right: 16px;
  }

  .amount-grid {
    grid-template-columns: 1fr;
  }

  .account-panel {
    grid-template-columns: 44px 1fr;
  }

  .custom-amount-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
