:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  color: #142e24;
  background: #f3f7f3;
  --green: #155c43;
  --green-deep: #104832;
  --muted: #50645a;
  --border: #dce7df;
  --surface: #fff;
}

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

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at top, #e6f2ea 0, transparent 40rem), #f3f7f3;
  font-size: 1rem;
  line-height: 1.55;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid #168660;
  outline-offset: 3px;
}

.masthead {
  display: flex;
  justify-content: center;
  padding: 1.125rem 1.25rem;
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid #e3ebe5;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: 1.0625rem;
  font-weight: 750;
  letter-spacing: .075em;
}

.brand-icon {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  place-content: center;
  gap: 3px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--green);
}

.brand-icon i {
  display: block;
  border: 1.5px solid #f8fffa;
  border-radius: 1px;
}

.brand-icon i:last-child {
  width: 4px;
  height: 4px;
  margin: auto;
  background: #b3e5cc;
  border: 0;
}

.shell {
  width: min(100%, 32rem);
  margin: 0 auto;
  padding: 2.25rem 1rem 3rem;
}

.steps {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1.1rem;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--muted);
  font-size: .875rem;
}

.step i {
  width: .45rem;
  height: .45rem;
  border: 1px solid #618376;
  border-radius: 50%;
}

.step.is-current {
  color: var(--green-deep);
  font-weight: 700;
}

.step.is-current i {
  border-color: #217653;
  background: #217653;
}

.step-line {
  width: 1.25rem;
  height: 1px;
  background: #b6cbbd;
}

.intro { margin-bottom: 1.55rem; }

h1 {
  margin: 0;
  letter-spacing: -.035em;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  line-height: 1.25;
}

h1:focus { outline: none; }

.intro p {
  margin: .65rem 0 0;
  color: var(--muted);
}

.panel {
  display: grid;
  gap: 1rem;
  padding: clamp(1.05rem, 5vw, 1.65rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.35rem;
  box-shadow: 0 16px 45px rgba(26, 61, 43, .07);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  float: left;
  width: 100%;
  margin: 0 0 .85rem;
  padding: 0;
  font-weight: 700;
}

legend span {
  margin-left: .45rem;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 400;
}

.options {
  display: grid;
  clear: both;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.amount-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.amount-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.amount-caption {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.75rem;
  padding: .35rem 1.15rem .35rem .7rem;
  border: 1px solid var(--border);
  border-radius: .85rem;
  background: #f9fbfa;
  font-size: clamp(1rem, 4vw, 1.2rem);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: center;
  overflow-wrap: anywhere;
}

.amount-caption::after {
  position: absolute;
  top: .45rem;
  right: .45rem;
  width: .6rem;
  height: .6rem;
  border: 1px solid #82988a;
  border-radius: 50%;
  content: "";
}

.amount-option input:checked + .amount-caption {
  color: var(--green-deep);
  border-color: #4b966e;
  background: #e8f5ed;
}

.amount-option input:checked + .amount-caption::after {
  border-color: var(--green);
  background: radial-gradient(circle, var(--green) 0 44%, transparent 46%);
}

.amount-option input:focus-visible + .amount-caption {
  outline: 3px solid #168660;
  outline-offset: 2px;
}

.amount-option input:disabled + .amount-caption {
  cursor: wait;
}

.custom-option { grid-column: 1 / -1; }

.custom-option .amount-caption {
  justify-content: flex-start;
  min-height: 3rem;
  padding-left: .85rem;
  font-size: .9375rem;
}

.custom-option .amount-caption::after {
  top: 50%;
  right: .7rem;
  transform: translateY(-50%);
}

.custom-field {
  display: grid;
  gap: .38rem;
  margin-top: .85rem;
}

.custom-field > span:first-child { font-size: .9375rem; font-weight: 700; }

.custom-input {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 0 .8rem;
  border: 1px solid #b9cec0;
  border-radius: .65rem;
}

.custom-input > span {
  color: var(--green);
  font-weight: 700;
}

.custom-input input {
  width: 100%;
  min-height: 3rem;
  padding: .35rem 0;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  font-size: 1.0625rem;
}

.custom-input:focus-within {
  outline: 2px solid #168660;
  outline-offset: 1px;
}

.custom-field small {
  color: var(--muted);
  font-size: .875rem;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  padding: .62rem .85rem;
  border: 1px solid transparent;
  border-radius: .75rem;
  font-weight: 700;
  cursor: pointer;
}

.button-primary {
  color: #fff;
  background: var(--green);
}

.button-primary:hover:not(:disabled) { background: var(--green-deep); }

.button-primary:disabled {
  color: #526a5d;
  background: #eaf1ec;
  cursor: default;
}

.button-secondary {
  color: var(--green-deep);
  background: #fff;
  border-color: var(--border);
}

.button-secondary:hover { background: #edf5ef; }

.notice, .error {
  margin: 0;
  padding: .7rem .8rem;
  border-radius: .65rem;
  color: var(--muted);
  background: #f1f6f2;
  font-size: .9375rem;
}

.error {
  color: #7a2f20;
  background: #fff2ee;
}

.result-panel { gap: .7rem; }

.result-amount {
  display: grid;
  gap: .1rem;
  text-align: center;
}

.result-amount span {
  color: var(--muted);
  font-size: .875rem;
}

.result-amount strong {
  color: var(--green-deep);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.95rem, 6vw, 2.45rem);
  line-height: 1.25;
}

.qr-frame {
  display: grid;
  place-items: center;
  width: min(100%, 19rem);
  margin: .25rem auto;
  padding: .7rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #fafcfb;
}

.qr-frame[aria-busy="true"] { min-height: 11rem; }

.qr-frame img {
  display: block;
  width: 100%;
  max-height: 26rem;
  object-fit: contain;
  background: #fff;
}

.code-expiry {
  margin: 0;
  color: var(--muted);
  font-size: .875rem;
  text-align: center;
}

.album-hint {
  margin: 0;
  padding: .7rem .75rem;
  border: 1px solid #c5dfcd;
  border-radius: .75rem;
  color: var(--green-deep);
  background: #e6f4eb;
  font-size: 1.125rem;
  font-weight: 750;
  line-height: 1.4;
  text-align: center;
}

@media (min-width: 44rem) {
  .masthead { padding: 1.3rem; }
  .shell { padding-top: 3.8rem; }
}
