:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --text: #1c2420;
  --muted: #66716b;
  --line: #dce2df;
  --green: #16784b;
  --green-soft: #e7f4ed;
  --gold: #a96d08;
  --gold-soft: #fff3d9;
  --blue: #1677c8;
  --wechat: #168c45;
  --danger: #b93832;
  --shadow: 0 16px 40px rgba(24, 42, 33, 0.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar-inner {
  width: min(1120px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--text);
  color: white;
}

.rate { color: var(--muted); font-size: 14px; }

.checkout-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 34px auto;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.checkout-form { padding: 34px 38px 38px; }
.order-summary { padding: 34px; border-left: 1px solid var(--line); background: #fafbfa; }

.section-heading,
.summary-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.step-label {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

h1, h2 { margin: 0; font-size: 24px; line-height: 1.25; }
h2 { font-size: 20px; }

.bonus-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 5px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.field-label {
  display: block;
  margin: 0 0 9px;
  color: #36413b;
  font-size: 14px;
  font-weight: 700;
}

.text-input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #cbd4cf;
  border-radius: 6px;
  outline: 0;
  background: white;
  color: var(--text);
}

.text-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 120, 75, 0.12); }
.field-error { min-height: 19px; margin: 6px 0 0; color: var(--danger); font-size: 13px; }
.field-group { margin-top: 21px; }

.package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.package-option {
  min-width: 0;
  height: 82px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.package-option:hover { border-color: #9eb7aa; }
.package-option.active { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.package-money { font-size: 17px; font-weight: 700; }
.package-points { overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.custom-option.active { border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }

.custom-row { margin-top: 16px; padding: 16px; border-left: 3px solid var(--gold); background: #fffcf5; }
.money-input-wrap { position: relative; }
.money-input-wrap > span { position: absolute; left: 13px; top: 13px; color: var(--muted); }
.money-input-wrap input { padding-left: 32px; }
.field-note { margin: 7px 0 0; color: var(--muted); font-size: 12px; }

.payment-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.method-button {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  cursor: pointer;
}
.method-button.active { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.method-mark { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px; color: white; font-size: 12px; font-weight: 700; }
.alipay-mark { background: var(--blue); }
.wxpay-mark { background: var(--wechat); }

.primary-button,
.secondary-button,
.danger-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: white;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.primary-button:hover { background: #11643e; }
.primary-button:disabled { cursor: not-allowed; opacity: 0.55; }
.secondary-button { margin-top: 13px; min-height: 42px; background: var(--text); }
.danger-button { margin-top: 9px; min-height: 42px; border: 1px solid #d9aaa7; background: white; color: var(--danger); }
.danger-button:hover { background: #fff4f3; }
.danger-button:disabled { cursor: not-allowed; opacity: 0.55; }
.form-message { min-height: 20px; margin: 8px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.form-message.error { color: var(--danger); }

.points-total { display: flex; align-items: baseline; gap: 7px; padding: 21px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.points-total strong { color: var(--green); font-size: 38px; line-height: 1; }
.points-total span { color: var(--muted); }
.summary-list { margin: 18px 0 0; }
.summary-list div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 700; text-align: right; }

.payment-result { margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; }
.result-status { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.status-dot.success { background: var(--green); }
.status-dot.error { background: var(--danger); }
.qr-image { width: min(220px, 100%); aspect-ratio: 1; margin: 16px auto 5px; border: 8px solid white; image-rendering: pixelated; }
.order-number { margin: 7px 0 0; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.payment-notice { margin: 13px 0 0; padding: 10px 12px; border-left: 3px solid var(--gold); background: #fffcf5; color: #5d513d; font-size: 12px; line-height: 1.65; text-align: left; }
.payment-notice p { margin: 0; }
.payment-notice p + p { margin-top: 3px; }
.footer { padding: 4px 16px 28px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 760px) {
  .topbar { height: 58px; }
  .rate { display: none; }
  .checkout-shell { width: 100%; margin: 0; grid-template-columns: 1fr; border: 0; border-radius: 0; box-shadow: none; }
  .checkout-form { padding: 25px 18px 30px; }
  .order-summary { padding: 26px 18px 32px; border-top: 1px solid var(--line); border-left: 0; }
  .package-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading { align-items: center; }
  h1 { font-size: 22px; }
  .points-total strong { font-size: 34px; }
}

@media (max-width: 390px) {
  .payment-methods { grid-template-columns: 1fr; }
  .bonus-badge { max-width: 105px; text-align: center; }
}
