:root {
  --bg1: #f6f1ff;
  --bg2: #e6dcff;
  --ink: #2f2552;
  --muted: #6a5f8d;
  --deep: #4b2a8c;
  --brand: #7a4fd6;
  --brand-dark: #5d36b5;
  --lav: #d9ccf7;
  --lav-soft: #efe9ff;
  --mint: #d5f3e4;
  --mint-line: #a8e3c5;
  --mint-ink: #1f7a55;
  --gold: #ffc94d;
  --warn: #c0334f;
  --line: #d6c9f3;
  --card: #ffffffcc;
  --shadow: 0 10px 30px rgba(93, 54, 181, .14);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  color: var(--ink);
  line-height: 1.75;
  font-size: 16px;
  background:
    radial-gradient(circle at 12% 8%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 78% 14%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 40% 30%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 90% 46%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 20% 62%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 66% 80%, #fff 0 1.5px, transparent 2.5px),
    linear-gradient(180deg, var(--bg1), var(--bg2) 55%, #f1eaff);
  background-attachment: scroll;
}
h1, h2, h3 { color: var(--deep); line-height: 1.3; }
.skip { position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* top bar */
.topbar { background: var(--deep); color: #efe9ff; font-size: 14px; padding: 8px 16px; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; text-align: center; }
.topbar-tag { background: var(--gold); color: #3a2a00; font-weight: 700; border-radius: 999px; padding: 0 12px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  background: rgba(246, 241, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 8px 20px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--deep); font-weight: 800; font-size: 20px; line-height: 1.1; }
.brand small { display: block; font-size: 10px; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
nav { display: flex; gap: 6px; flex-wrap: wrap; }
nav a { padding: 8px 14px; border-radius: 999px; color: var(--deep); font-weight: 700; text-decoration: none; font-size: 15px; }
nav a:hover, nav a:focus-visible { background: var(--lav); }
.nav-toggle { display: none; }

main { max-width: 1040px; margin: 0 auto; padding: 16px; }

/* hero */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; padding: 28px 0 16px; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 6px; }
.eyebrow.center { text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 14px; font-weight: 700; }
.hero h1 strong { font-size: 1.15em; font-weight: 900; display: inline-block; }
.hero-text > p { color: var(--muted); max-width: 480px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.popup { margin: 0; position: relative; border-radius: 32px; overflow: hidden; background: linear-gradient(135deg, #3a2a8f, #7a4fd6); box-shadow: var(--shadow); border: 4px solid #fff; }
.popup img { display: block; width: 100%; height: auto; }
.popup figcaption { position: absolute; right: 0; top: 0; bottom: 0; width: 38px; background: rgba(255,255,255,.9); color: var(--deep); font-weight: 900; font-size: 12px; letter-spacing: .15em; writing-mode: vertical-rl; display: flex; align-items: center; justify-content: center; gap: 10px; }

/* mint feature bar */
.band { display: flex; align-items: center; gap: 18px; background: linear-gradient(135deg, #fff, var(--lav-soft)); border: 1px solid var(--line); border-radius: 32px; box-shadow: var(--shadow); padding: 16px 20px; margin: 20px 0; }
.band-title { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.band-title img { height: 64px; width: auto; }
.band-title strong { display: block; color: var(--deep); font-size: 18px; }
.band-title span { font-size: 13px; color: var(--muted); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0; margin: 0; flex: 1; }
.steps a { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 14px 16px; border-radius: 22px; text-decoration: none; color: var(--ink); border: 2px solid transparent; transition: transform .15s, box-shadow .15s; }
.steps a:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(93,54,181,.2); }
.steps small { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.steps b { font-size: 19px; color: var(--deep); }
.steps em { font-style: normal; font-size: 14px; color: var(--muted); }
.steps .go { margin-top: 6px; align-self: flex-start; font-size: 13px; font-weight: 700; background: #fff; border-radius: 999px; padding: 0 14px; border: 1px solid currentColor; }
.s1 a { background: var(--lav); border-color: #b9a4ee; color: var(--brand-dark); }
.s2 a { background: var(--mint); border-color: var(--mint-line); color: var(--mint-ink); }
.s3 a { background: #ffe9c2; border-color: #f4cf86; color: #8a5a00; }
.s1 b, .s2 b, .s3 b { color: var(--deep); }

.info-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: var(--mint); border: 1px solid var(--mint-line); border-radius: 999px; padding: 12px 24px; margin: 12px 0 24px; }
.info-row > div { display: flex; align-items: center; gap: 10px; }
.info-row .ico { width: 40px; height: 40px; display: grid; place-items: center; background: #fff; border-radius: 50%; font-size: 20px; flex: none; }
.info-row b { color: var(--mint-ink); }
.info-row p { margin: 0; font-size: 13px; color: #3e6b58; line-height: 1.4; }

/* panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 36px; padding: 28px; margin: 28px 0; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 8px; font-size: clamp(24px, 4vw, 32px); text-align: center; font-weight: 800; }
.panel > .muted { text-align: center; max-width: 720px; margin: 0 auto 8px; }
.muted { color: var(--muted); font-size: 15px; }
.status { min-height: 1.5em; color: var(--mint-ink); font-size: 15px; margin: 8px 0; }
.status.error { color: var(--warn); }

/* buttons */
.btn { font: inherit; font-weight: 700; cursor: pointer; padding: 10px 22px; border-radius: 999px; border: 2px solid var(--brand); background: #fff; color: var(--brand-dark); min-height: 46px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:hover { background: var(--lav-soft); }
.btn.primary, .btn.dark { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover, .btn.dark:hover { background: var(--brand-dark); }
.btn.outline { background: #fff; }
.btn.danger { color: var(--warn); border-color: #e9a9b6; }
:focus-visible { outline: 3px solid #ff9f1c; outline-offset: 2px; }

/* form */
fieldset { border: 1px solid var(--line); border-radius: 22px; margin: 14px 0; padding: 14px 18px; background: #fff; }
legend { font-weight: 700; padding: 0 8px; color: var(--deep); }
.basic { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.basic legend, .basic .field-error { grid-column: 1 / -1; }
label { display: block; font-size: 15px; }
input[type="text"], input[type="number"], select { width: 100%; font: inherit; padding: 11px 14px; margin-top: 4px; border: 2px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); }
input[type="text"]:focus, input[type="number"]:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px #d9ccf7; }
.field-error { color: var(--warn); font-size: 14px; min-height: 1.2em; margin: 4px 0; }
input.invalid, fieldset.invalid { border-color: var(--warn); background: #fff5f7; }

.q-item { scroll-margin-top: 24px; }
.q-item.pulse { animation: qpulse 1.4s ease-out; }
@keyframes qpulse { 0% { box-shadow: 0 0 0 0 rgba(122, 79, 214, .55); border-color: var(--brand); } 100% { box-shadow: 0 0 0 16px rgba(122, 79, 214, 0); } }
.q-item legend { font-size: 16px; max-width: 100%; }
.q-tag { font-size: 12px; background: var(--lav); color: var(--brand-dark); padding: 1px 10px; border-radius: 999px; margin-right: 6px; }
.opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.opts label { position: relative; }
.opts input { position: absolute; opacity: 0; }
.opts span { display: block; text-align: center; padding: 9px 2px; border: 2px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 14px; min-height: 44px; background: #fff; font-weight: 600; }
.opts span:hover { border-color: var(--brand); }
.opts input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.opts input:focus-visible + span { outline: 3px solid #ff9f1c; outline-offset: 2px; }

.progress-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: 14px; color: var(--muted); }
.bar { flex: 1; height: 12px; background: var(--lav-soft); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #9b7be8, #7a4fd6); transition: width .25s; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }

/* result */
.result { margin-top: 18px; padding: 20px; border-radius: 28px; background: linear-gradient(135deg, var(--lav-soft), #fff); border: 2px solid var(--lav); }
.result h3 { margin: 0 0 8px; }
.meter { margin: 12px 0; }
.meter .row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; font-size: 14px; }
.meter .track { height: 16px; background: #fff; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.meter .fill { height: 100%; border-radius: 99px; }
.lv-low { background: #5fd4a0; } .lv-mid { background: #ffc94d; } .lv-high { background: #ff8aa1; }
.tag { display: inline-block; padding: 1px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.tag.low { background: #d5f3e4; color: #1b6a49; } .tag.mid { background: #fff0c2; color: #7a5a00; } .tag.high { background: #ffdde5; color: #a11e3f; }
.disclaimer { font-size: 14px; border-left: 5px solid var(--gold); padding: 8px 14px; background: #fff; border-radius: 0 16px 16px 0; margin-top: 12px; }

/* photos / illustrations */
.photo { margin: 18px auto; max-width: 640px; }
.photo img { display: block; width: 100%; height: auto; border-radius: 28px; background: var(--lav-soft); border: 3px solid #fff; box-shadow: var(--shadow); }
.photo.side img { max-height: 340px; object-fit: cover; }
.photo figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; }

/* cards */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; justify-content: center; }
.chip { font: inherit; font-weight: 700; cursor: pointer; padding: 6px 18px; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--brand-dark); min-height: 42px; }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { border: 2px solid var(--line); border-radius: 28px; padding: 18px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.card h3 { margin: 0; font-size: 18px; }
.card.rec { border-color: var(--gold); background: linear-gradient(180deg, #fffaea, #fff); }
.card .badge { align-self: flex-start; font-size: 12px; padding: 0 10px; border-radius: 999px; background: #ffe9a8; color: #6f4d00; font-weight: 700; }
.card .badge.read { background: var(--mint); color: var(--mint-ink); }
.card ul { margin: 4px 0; padding-left: 20px; font-size: 15px; }
.card .body[hidden] { display: none; }
.card .btn { margin-top: auto; }

/* scenario */
.sim-head { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 14px 0; }
.sim-head label { flex: 1; min-width: 220px; font-weight: 600; }
.scenario { border: 2px dashed #b9a4ee; border-radius: 28px; padding: 18px; background: #fbf9ff; }
.scene { background: var(--lav-soft); border-radius: 22px; padding: 14px; margin-bottom: 12px; }
.choices { display: grid; gap: 10px; }
.choice { text-align: left; font: inherit; cursor: pointer; border: 2px solid var(--line); background: #fff; border-radius: 22px; padding: 13px 16px; color: var(--ink); min-height: 48px; }
.choice:hover { border-color: var(--brand); background: var(--lav-soft); }
.choice.picked { border-color: var(--brand); background: #ece3ff; box-shadow: 0 0 0 3px #d9ccf7; }
.feedback { margin-top: 14px; padding: 16px; border-radius: 22px; background: #fff; border: 2px solid var(--mint-line); }
.scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; text-align: center; }
.scores div { background: var(--lav-soft); border-radius: 18px; padding: 6px; font-size: 14px; }
.scores b { display: block; font-size: 20px; color: var(--deep); }

/* progress */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stat { background: var(--lav-soft); border-radius: 24px; padding: 14px 16px; border: 1px solid var(--line); }
.stat:nth-child(2) { background: var(--mint); border-color: var(--mint-line); }
.stat:nth-child(3) { background: #fff0cf; border-color: #f4cf86; }
.stat b { font-size: 26px; display: block; color: var(--deep); }
.empty { background: #fbf9ff; border: 2px dashed #b9a4ee; border-radius: 22px; padding: 14px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }

.help { background: var(--mint); border: 1px solid var(--mint-line); border-radius: 36px; padding: 22px 28px; margin: 28px 0; }
.help h2 { margin: 0 0 6px; color: var(--mint-ink); }
.help ul { padding-left: 20px; }

/* footer */
.site-footer { margin-top: 40px; }
.waves { position: relative; line-height: 0; }
.waves svg { display: block; width: 100%; height: 90px; }
.foot-mascot { position: absolute; right: 6%; bottom: 18px; width: 90px; height: auto; }
.foot-body { background: #19a7e0; background: linear-gradient(180deg, #9b7be8, #5d36b5); color: #efe9ff; text-align: center; padding: 16px 16px 40px; font-size: 13px; margin-top: -1px; }
.foot-body p { max-width: 760px; margin: 8px auto; }
.foot-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; background: #fff; border-radius: 999px; padding: 6px 14px; width: fit-content; max-width: 100%; margin: 0 auto 12px !important; }
.foot-links a { color: var(--deep); font-weight: 700; text-decoration: none; padding: 4px 10px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .band { flex-direction: column; align-items: stretch; }
  .info-row { border-radius: 28px; grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-toggle { display: inline-block; font: inherit; font-weight: 700; padding: 8px 18px; border: 2px solid var(--brand); border-radius: 999px; background: #fff; color: var(--brand-dark); min-height: 42px; }
  nav { display: none; width: 100%; flex-direction: column; padding-top: 6px; }
  nav.open { display: flex; }
  .steps { grid-template-columns: 1fr; }
  .basic { grid-template-columns: 1fr; }
  .opts { grid-template-columns: 1fr 1fr; }
  .opts label:last-child { grid-column: 1 / -1; }
  .panel { padding: 18px 14px; border-radius: 28px; }
  .foot-mascot { width: 64px; right: 4%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .bar span, .steps a { transition: none; } }

/* ===== 字型：粉圓體標題 + 黑體內文 ===== */
:root { --font-display: "Huninn", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif; }
h1, h2, h3, .brand, .band-title strong, .steps b, .stat b, .eyebrow, .topbar-tag, .foot-links a, nav a { font-family: var(--font-display); font-weight: 400; }
.hero h1 strong { font-weight: 400; }
.brand { font-size: 22px; }
.panel h2 { letter-spacing: .02em; }

/* ===== 篩檢分段標題、分數門檻說明 ===== */
.q-section { font-size: 19px; color: var(--brand-dark); margin: 26px 0 6px; padding-left: 12px; border-left: 6px solid var(--gold); }
.q-section:first-child { margin-top: 12px; }
details.why { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 8px 16px; margin: 12px 0; }
details.why summary { cursor: pointer; font-weight: 700; color: var(--brand-dark); min-height: 32px; display: flex; align-items: center; }
details.why p { font-size: 14px; color: var(--muted); margin: 6px 0 8px; }
.status.hint { color: var(--muted); text-align: center; margin: 4px 0 8px; }
.scenario .badge { display: inline-block; font-size: 12px; padding: 0 10px; border-radius: 999px; background: #ffe9a8; color: #6f4d00; font-weight: 700; }

/* ===== 列印用報告 ===== */
.print-only { display: none; }
@media print {
  @page { margin: 14mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing-report { background: #fff !important; }
  body.printing-report > *:not(#printReport) { display: none !important; }
  body.printing-report #printReport { display: block !important; color: #222; font-size: 11.5pt; line-height: 1.65; }
  #printReport .rp-head { display: flex; gap: 14px; align-items: center; border-bottom: 3px solid #7a4fd6; padding-bottom: 8px; margin-bottom: 12px; }
  #printReport .rp-head p { margin: 2px 0 0; color: #555; }
  #printReport h1 { font-size: 22pt; margin: 0; color: #4b2a8c; }
  #printReport h2 { font-size: 14pt; color: #4b2a8c; border-left: 5px solid #ffc94d; padding-left: 8px; margin: 18px 0 6px; }
  #printReport section { break-inside: avoid-page; }
  #printReport table { width: 100%; border-collapse: collapse; font-size: 10.5pt; margin: 6px 0; }
  #printReport th, #printReport td { border: 1px solid #bbb; padding: 5px 8px; vertical-align: top; text-align: left; }
  #printReport th { background: #efe9ff; }
  #printReport tr { break-inside: avoid; }
  #printReport .rp-note { font-size: 9.5pt; color: #555; border-left: 4px solid #ffc94d; padding-left: 8px; margin: 10px 0; }
}
