:root {
  --navy: #1c3557;
  --navy-2: #24446f;
  --wood: #b98b5e;
  --bg: #f4f2ee;
  --card: #ffffff;
  --text: #222831;
  --muted: #6b7280;
  --line: #e3e0da;
  --error: #c0392b;
  --ok: #1e7f4f;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.center { text-align: center; }
.small { font-size: 0.9rem; color: var(--muted); }
a { color: var(--navy-2); }

.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 70%, #345a8a 100%); color: #fff; padding: 36px 0 44px; }
.hero .eyebrow { margin: 0 0 4px; letter-spacing: 0.18em; font-size: 0.85rem; color: #f2d9b8; }
.hero h1 { margin: 0 0 10px; font-size: 1.5rem; line-height: 1.35; font-weight: 700; }
.hero h1 span { color: #f2d9b8; }
.hero .meta { margin: 0 0 12px; font-size: 0.95rem; opacity: 0.9; }
.hero .lead { margin: 0; font-size: 0.95rem; opacity: 0.92; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(28, 53, 87, 0.08); padding: 24px 20px; margin: -22px 0 20px; }
.card + .card, .card.small { margin-top: 0; }
main .card:not(:first-child) { margin-top: 0; }
h2 { font-size: 1.15rem; margin: 0 0 14px; color: var(--navy); padding-left: 10px; border-left: 4px solid var(--wood); line-height: 1.3; }
section + section { margin-top: 28px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.95rem; }
.field span { color: var(--muted); font-size: 0.88rem; }
.field b, .check b, .q-title b { color: var(--error); font-weight: 600; }
input[type=text], input[type=tel], input[type=email], select {
  width: 100%; padding: 12px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; background: #fff; color: var(--text);
}
input:focus, select:focus { outline: 2px solid rgba(28, 53, 87, 0.25); border-color: var(--navy-2); }
.field.invalid input, .field.invalid select { border-color: var(--error); background: #fff7f6; }
.field .msg { color: var(--error); font-size: 0.82rem; }

.q { margin-top: 20px; }
.q-title { font-weight: 600; margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.93rem; background: #fafaf8; cursor: pointer; user-select: none;
}
.chip input:focus-visible + span { outline: 2px solid rgba(28, 53, 87, 0.35); }
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip small { display: block; font-size: 0.75rem; color: var(--muted); }
.chip input:checked + span small { color: #d9e2f1; }
.q.invalid .chips { outline: 2px dashed var(--error); outline-offset: 6px; border-radius: 12px; }
.q .msg { color: var(--error); font-size: 0.82rem; margin-top: 6px; }
.other-input { margin-top: 10px; }
.other-input input { max-width: 420px; }

.consent { border-top: 1px dashed var(--line); padding-top: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; margin-bottom: 12px; }
.check input { margin-top: 5px; width: 18px; height: 18px; flex: 0 0 auto; }
.check.invalid span { color: var(--error); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.turnstile { margin: 16px 0 6px; min-height: 0; }

.btn { display: inline-block; border: 0; border-radius: 12px; padding: 14px 22px; font-size: 1.02rem; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn.primary { background: var(--wood); color: #fff; width: 100%; margin-top: 10px; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.primary[disabled] { opacity: 0.6; cursor: wait; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.hint { font-size: 0.88rem; color: var(--muted); text-align: center; margin: 14px 0 0; }
.error { background: #fdf0ee; color: var(--error); border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; margin-top: 12px; }

.qr { margin: 16px auto; }
.qr img { width: 220px; height: 220px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.ticket { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; letter-spacing: 0.08em; color: var(--navy); margin-top: 6px; }
.note { font-size: 0.9rem; color: var(--muted); }
#resultTitle { border: 0; padding: 0; text-align: center; font-size: 1.5rem; }
#result.ok #resultTitle { color: var(--ok); }
#result.warn #resultTitle { color: var(--wood); }

details.card summary { cursor: pointer; font-weight: 600; color: var(--navy); }
details.card ol { padding-left: 20px; }
footer { padding: 10px 16px 40px; text-align: center; }

/* 嵌入模式（官網 iframe）：隱藏頁首頁尾、卡片改細框；flow-root 讓 body 高度包含子元素外距，供外層自動調高 */
html.embed body { background: #fff; display: flow-root; }
html.embed .hero, html.embed footer { display: none; }
html.embed .wrap { padding: 12px; }
html.embed main .card { margin: 0 0 16px; box-shadow: none; border: 1px solid var(--line); }
