:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1a2332;
  --muted: #5b6573;
  --line: #e2e8f0;
  --brand: #0f6b5c;
  --brand-soft: #e6f4f1;
  --warn: #8a5a00;
  --warn-bg: #fff6e5;
  --danger-soft: #fdecea;
  --ok: #0f6b5c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
  --max: 520px;
  font-family: "PingFang HK", "Noto Sans TC", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100vh; }
a { color: var(--brand); }
button, input, select { font: inherit; }

.app {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 16px 96px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.brand h1 { font-size: 16px; margin: 0; line-height: 1.2; }
.brand p { margin: 0; font-size: 12px; color: var(--muted); }

.banner {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #f0d9a0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 14px;
}
.banner strong { font-weight: 700; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.card h2 { margin: 0 0 8px; font-size: 20px; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.lead { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 14px; }
.tiny { font-size: 12px; color: var(--muted); line-height: 1.5; }
.ref { font-size: 11px; color: var(--muted); margin-top: 8px; }

.steps {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px;
}
.step-pill {
  font-size: 11px; padding: 4px 8px; border-radius: 999px;
  background: #eef2f6; color: var(--muted);
}
.step-pill.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn {
  appearance: none; border: none; border-radius: 12px;
  padding: 12px 16px; font-weight: 600; cursor: pointer;
  background: var(--brand); color: #fff;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: #eef2f6; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.block { width: 100%; }

.choice {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px;
}
.choice button {
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 14px; cursor: pointer; font-weight: 600;
}
.choice button.selected-yes { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.choice button.selected-no { border-color: #cbd5e1; background: #f8fafc; }

.progress { height: 6px; background: #e8eef3; border-radius: 999px; overflow: hidden; margin: 8px 0 14px; }
.progress > span { display: block; height: 100%; background: var(--brand); width: 0%; transition: width .2s; }

.tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; margin-bottom: 6px;
}
.tag.rel { background: #dff5ea; color: #0b6b45; }
.tag.maybe { background: #fff1d6; color: #8a5a00; }
.tag.na { background: #eef2f6; color: #64748b; }
.tag.kind { background: #e8eefc; color: #334155; }

.item {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.item:first-child { border-top: none; padding-top: 0; }
.cap { font-size: 13px; font-weight: 600; margin: 4px 0; }
.meta { font-size: 11px; color: var(--muted); }

.check-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.check-item:first-of-type { border-top: none; }
.check-item input { margin-top: 3px; width: 18px; height: 18px; }
.check-item label { font-size: 14px; line-height: 1.45; }

.nav-bottom {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}
.nav-bottom .inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
}
.nav-bottom a {
  text-align: center; text-decoration: none; color: var(--muted);
  font-size: 11px; padding: 6px 2px; border-radius: 10px;
}
.nav-bottom a.on { color: var(--brand); background: var(--brand-soft); font-weight: 700; }

form .field { margin-bottom: 12px; }
form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
form input[type="email"] {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff;
}
form .consent {
  display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45;
}
table.limits {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.limits th, table.limits td {
  text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.limits th { font-size: 12px; color: var(--muted); }

.hidden { display: none !important; }
.success {
  background: var(--brand-soft); color: var(--brand);
  border-radius: 12px; padding: 12px; font-size: 14px;
}
ul.clean { margin: 0; padding-left: 18px; }
ul.clean li { margin: 6px 0; font-size: 14px; line-height: 1.45; }
