:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #607080;
  --line: #d7dde3;
  --focus: #1677ff;
  --danger: #d93025;
  --danger-bg: #fff5f5;
  --button: #1677ff;
  --button-hover: #0f63d6;
  --success: #0f7b4f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
}

.page-shell {
  min-height: 100vh;
  padding: 32px 16px;
}

.form-panel {
  width: min(880px, 100%);
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}

.form-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.form-header h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 650;
}

.form-header p {
  margin: 0;
  color: var(--muted);
}

.field,
.agreement {
  margin-bottom: 18px;
}

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

.field-grid.compact {
  align-items: start;
}

label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--focus);
  outline: 2px solid rgb(22 119 255 / 18%);
  outline-offset: 1px;
}

input[readonly] {
  background: #eef2f6;
}

.field.invalid input,
.field.invalid select {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.field-error {
  min-height: 18px;
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 18px;
}

.input-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.captcha-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
}

.captcha-control button {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.captcha-control img {
  display: block;
  width: 128px;
  height: 44px;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

#smsCodeButton {
  background: #eef4ff;
  color: #1756a9;
  border: 1px solid #b9cdf5;
}

#smsCodeButton:disabled {
  cursor: not-allowed;
  color: #718096;
  background: #eef1f4;
  border-color: #d4dbe3;
}

.agreement {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.agreement input {
  width: 16px;
  min-height: 16px;
}

.submit-button {
  width: 100%;
  background: var(--button);
  color: #fff;
  font-weight: 650;
}

.submit-button:hover {
  background: var(--button-hover);
}

.hidden {
  display: none;
}

.cashier-summary,
.success-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.cashier-summary span,
.success-summary span {
  color: var(--muted);
  font-weight: 600;
}

.cashier-summary strong,
.success-summary strong {
  font-size: 30px;
  line-height: 1.2;
}

.payment-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.payment-actions button {
  background: #eef4ff;
  color: #1756a9;
  border: 1px solid #b9cdf5;
  font-weight: 650;
}

.payment-actions .dev-payment-button {
  background: #f0fbf6;
  color: #0f6b45;
  border-color: #9bd8bb;
}

.qr-box {
  width: 220px;
  min-height: 220px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fff;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(21, 8px);
  grid-template-rows: repeat(21, 8px);
  gap: 1px;
  padding: 12px;
  background: #fff;
}

.qr-cell {
  width: 8px;
  height: 8px;
  background: #fff;
}

.qr-cell.active {
  background: #111827;
}

.payment-status {
  min-height: 22px;
  margin: 0;
  text-align: center;
  color: var(--muted);
}

.payment-status.success {
  color: var(--success);
  font-weight: 650;
}

@media (max-width: 720px) {
  .form-panel {
    padding: 20px;
  }

  .field-grid,
  .payment-actions,
  .captcha-control,
  .input-button {
    grid-template-columns: 1fr;
  }

  .captcha-control button,
  .captcha-control img {
    width: 100%;
  }

  .cashier-summary,
  .success-summary {
    align-items: flex-start;
    flex-direction: column;
  }
}
