:root {
  --ink: #14211e;
  --muted: #5a6b66;
  --line: rgba(20, 33, 30, 0.1);
  --surface: #ffffff;
  --bg0: #e8f2ef;
  --bg1: #f4f7f6;
  --accent: #0b6b5a;
  --accent-deep: #085445;
  --accent-soft: #d9efe9;
  --ok: #0b6b5a;
  --err: #c0392b;
  --shadow: 0 18px 50px rgba(8, 40, 34, 0.1);
  --radius: 18px;
  --tap: 48px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, #bfe6db 0%, transparent 55%),
    radial-gradient(700px 360px at 100% 0%, #cfdce8 0%, transparent 50%),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 48%, #eef2f1 100%);
  background-attachment: fixed;
}

.hidden { display: none !important; }

.page {
  width: min(100%, 440px);
  margin: 0 auto;
  padding: calc(20px + var(--safe-t)) 18px calc(36px + var(--safe-b));
}

.hero {
  position: relative;
  margin: 0 0 18px;
  padding: 22px 20px 20px;
  border-radius: calc(var(--radius) + 4px);
  color: #f4fffb;
  background:
    linear-gradient(145deg, rgba(255,255,255,.12) 0%, transparent 42%),
    linear-gradient(160deg, #0e7a66 0%, #0b5c4d 48%, #094a3f 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.92;
  margin-bottom: 12px;
}

.brand-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9af0d6;
  box-shadow: 0 0 0 4px rgba(154, 240, 214, 0.25);
}

.hero h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 5.5vw, 1.85rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.lead {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(244, 255, 251, 0.86);
}

.steps {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}

.steps span {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(11, 107, 90, 0.15);
  transition: background 0.25s ease;
}

.steps span.on {
  background: linear-gradient(90deg, #0e8a73, var(--accent-deep));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
  animation: rise 0.28s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.card-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.field { margin-bottom: 14px; }

.field:last-of-type { margin-bottom: 18px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 7px;
}

.optional {
  font-weight: 500;
  opacity: 0.8;
}

input {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #f7fbfa;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder { color: #9aa8a4; }

input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(11, 107, 90, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: linear-gradient(180deg, #11907a 0%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(8, 84, 69, 0.28);
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.ghost {
  margin-top: 10px;
  background: #fff;
  color: var(--accent-deep);
  border: 1.5px solid rgba(11, 107, 90, 0.35);
  box-shadow: none;
}

.btn.ghost:active { background: var(--accent-soft); }

.msg {
  min-height: 1.2em;
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.msg.err { color: var(--err); }
.msg.ok { color: var(--ok); }

.item {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  background: #fbfcfb;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.item:last-child { margin-bottom: 14px; }

.item:active { transform: scale(0.99); }

.item:hover,
.item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.item .no {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.item .meta {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.item .amt {
  margin-top: 10px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: -0.02em;
}

.pay-meta {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-line;
  margin-bottom: 4px;
}

.pay-amt {
  margin: 14px 0 18px;
  font-size: clamp(1.7rem, 7vw, 2rem);
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: -0.03em;
}

.done-text {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.cfg-warn {
  background: #fff6eb;
  border: 1px solid #f0c48a;
  color: #8a4b12;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.foot {
  margin: 22px 8px 0;
  font-size: 11.5px;
  color: #7d8c88;
  text-align: center;
  line-height: 1.55;
}

@media (min-width: 480px) {
  .page { padding-top: calc(36px + var(--safe-t)); }
  .hero { padding: 26px 24px 22px; }
  .card { padding: 22px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .btn, .item { transition: none; }
}
