:root {
  color-scheme: light;
  --ink: #182621;
  --muted: #64716b;
  --forest: #15372e;
  --forest-2: #245345;
  --mint: #dcebe3;
  --cream: #fbf8f1;
  --paper: #fffefb;
  --gold: #f3b84b;
  --gold-soft: #fff1cc;
  --line: #d9e1dc;
  --danger: #8a4239;
  --shadow: 0 18px 55px rgba(18, 47, 39, .1);
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--cream); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(243, 184, 75, .16), transparent 28rem),
    radial-gradient(circle at 92% 28%, rgba(36, 83, 69, .11), transparent 32rem),
    var(--cream);
}

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

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 12px max(20px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid rgba(21, 55, 46, .09);
  background: rgba(251, 248, 241, .9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--forest);
  font-weight: 850;
  text-decoration: none;
  letter-spacing: .02em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: var(--gold);
  background: var(--forest);
  font-size: 21px;
}

.mode-badge, .eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
}

.mode-badge { padding: 6px 10px; color: #6b4a08; background: var(--gold-soft); }
.mode-badge[hidden] { display: none; }
.eyebrow { margin: 0 0 12px; padding: 6px 10px; color: var(--forest-2); background: var(--mint); }

#app {
  width: min(100% - 32px, 1060px);
  min-height: calc(100vh - 160px);
  margin: 0 auto;
  padding: 44px 0 72px;
  outline: 0;
}

.hero, .two-column, .report-head {
  display: grid;
  gap: 28px;
}

.hero { grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); align-items: center; min-height: 68vh; }
.hero h1, .page-title { margin: 0; color: var(--forest); font-family: ui-serif, "Noto Serif TC", serif; font-size: clamp(2.35rem, 6vw, 4.8rem); line-height: 1.06; letter-spacing: -.035em; }
.page-title { font-size: clamp(2rem, 5vw, 3.7rem); }
.hero-copy { max-width: 680px; }
.hero-copy > p:not(.eyebrow) { max-width: 620px; margin: 22px 0 28px; color: #43524b; font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.85; }

.map-card {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  border-radius: 30px;
  padding: 28px;
  color: #f7fbf8;
  background: var(--forest);
  box-shadow: var(--shadow);
}

.map-card::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.2) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  content: "";
  mask-image: linear-gradient(135deg, transparent 2%, #000 70%);
}

.map-route { position: absolute; inset: 54px 46px; }
.route-line { position: absolute; width: 70%; height: 58%; top: 18%; left: 12%; border: 3px dashed rgba(243,184,75,.8); border-width: 0 0 3px 3px; border-radius: 0 0 0 60px; transform: rotate(-9deg); }
.route-point { position: absolute; display: grid; width: 50px; height: 50px; place-items: center; border: 2px solid rgba(255,255,255,.5); border-radius: 50%; color: var(--forest); background: var(--gold); font-weight: 900; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.route-point.one { top: 4%; left: 4%; }
.route-point.two { top: 42%; right: 6%; }
.route-point.three { bottom: 2%; left: 28%; }
.map-caption { position: absolute; right: 26px; bottom: 24px; left: 26px; display: flex; justify-content: space-between; gap: 12px; color: rgba(255,255,255,.78); font-size: .86rem; }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 13px 20px;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .choice:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(243,184,75,.7); outline-offset: 2px; }
.button.primary { color: white; background: var(--forest); box-shadow: 0 10px 24px rgba(21,55,46,.18); }
.button.primary:hover { background: var(--forest-2); }
.button.secondary { color: var(--forest); background: var(--mint); }
.button.ghost { min-height: 42px; color: var(--forest); background: transparent; }
.button.full { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }

.trust-row { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 24px; color: var(--muted); font-size: .9rem; }
.trust-row span::before { margin-right: 7px; color: var(--forest-2); content: "•"; font-weight: 900; }

.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(20px, 4vw, 34px);
  background: rgba(255, 254, 251, .94);
  box-shadow: 0 8px 28px rgba(22, 48, 40, .055);
}

.card + .card { margin-top: 18px; }
.narrow { width: min(100%, 720px); margin: 0 auto; }
.wide { width: min(100%, 900px); margin: 0 auto; }
.section-head { margin-bottom: 24px; }
.section-head h1, .section-head h2, .card h2, .card h3 { margin: 0 0 10px; color: var(--forest); line-height: 1.3; }
.section-head p, .muted { color: var(--muted); line-height: 1.7; }

.progress-shell { margin-bottom: 22px; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: .88rem; font-weight: 750; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e4e9e5; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), #e18c2e); transition: width .25s ease; }

.question { margin: 0 0 24px; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.5; }
.choices { display: grid; gap: 12px; }
.choice {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--ink);
  text-align: left;
  background: white;
  cursor: pointer;
}
.choice:hover { border-color: #9db4a8; background: #fbfdfb; }
.choice.selected { border-color: var(--forest-2); background: #edf5f0; box-shadow: inset 0 0 0 1px var(--forest-2); }
.choice-letter { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--forest); background: var(--mint); font-weight: 900; }

.form-field { display: grid; gap: 8px; margin: 18px 0; }
.form-field label, .field-label { color: var(--forest); font-size: .92rem; font-weight: 850; }
input, textarea, select {
  width: 100%;
  border: 1px solid #bcc9c2;
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--ink);
  background: white;
}
textarea { min-height: 122px; resize: vertical; line-height: 1.65; }
.field-help { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }

.result-banner { padding: clamp(26px, 6vw, 48px); color: white; background: var(--forest); }
.result-banner .eyebrow { color: var(--gold); background: rgba(255,255,255,.1); }
.result-banner h1 { margin: 0 0 18px; font-family: ui-serif, "Noto Serif TC", serif; font-size: clamp(2rem, 5vw, 3.5rem); }
.result-banner p { max-width: 760px; color: rgba(255,255,255,.84); line-height: 1.8; }
.strength-list { display: grid; gap: 10px; padding: 0; list-style: none; }
.strength-list li { padding: 12px 14px; border-radius: 12px; background: #eef5f0; }

.code-box { display: grid; gap: 10px; margin: 24px 0; padding: 22px; border: 2px dashed #c3922e; border-radius: 18px; text-align: center; background: var(--gold-soft); }
.code-box strong { color: var(--forest); font-size: clamp(1.8rem, 7vw, 2.8rem); letter-spacing: .08em; }

.report-head { grid-template-columns: minmax(0, 1fr) 210px; align-items: end; margin-bottom: 28px; }
.score-box { border-radius: 20px; padding: 20px; color: white; background: var(--forest); }
.score-box p { margin: 0 0 8px; color: rgba(255,255,255,.7); font-size: .82rem; }
.score-box strong { font-size: 1.15rem; }
.score-context { margin-top: 18px; padding-left: 16px; border-left: 4px solid var(--gold); color: #44534c; line-height: 1.7; }

.observation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 20px; }
.observation-grid > .card + .card { margin-top: 0; }
.observation-card { display: flex; flex-direction: column; border-top: 5px solid var(--gold); }
.observation-card .source { color: var(--muted); font-size: .9rem; line-height: 1.65; }
.observation-context { margin: 18px 0; color: var(--forest); font-size: 1.08rem; font-weight: 800; line-height: 1.65; }
.guide-box { margin: 0 0 18px; padding: 14px; border-radius: 14px; background: #edf5f0; line-height: 1.65; }
.safety-box { margin: 0 0 18px; padding: 13px 14px; border-radius: 14px; color: #654b15; background: var(--gold-soft); font-size: .9rem; line-height: 1.6; }
.observation-card .button { margin-top: 0; }


.notice { margin: 18px 0; padding: 14px 16px; border-radius: 14px; color: #4b5b53; background: #edf1ee; line-height: 1.65; }
.notice.warning { color: #654b15; background: var(--gold-soft); }
.notice.error { color: var(--danger); background: #f8e9e6; }


.loading { display: grid; min-height: 55vh; place-items: center; color: var(--muted); text-align: center; }
.spinner { width: 44px; height: 44px; margin: 0 auto 16px; border: 4px solid #d7dfda; border-top-color: var(--forest); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; z-index: 50; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px)); border-radius: 14px; padding: 13px 16px; color: white; background: var(--forest); box-shadow: var(--shadow); line-height: 1.5; }
.site-footer { width: min(100% - 32px, 1060px); margin: 0 auto; padding: 22px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; line-height: 1.6; }

@media (max-width: 840px) {
  .hero, .report-head { grid-template-columns: 1fr; }
  .hero { padding-top: 12px; }
  .map-card { min-height: 300px; }
  .observation-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  #app { width: min(100% - 24px, 1060px); padding-top: 28px; }
  .site-header { min-height: 60px; padding-inline: 14px; }
  .brand { font-size: .94rem; }
  .brand-mark { width: 31px; height: 31px; }
  .hero { min-height: auto; }
  .hero h1 { font-size: 2.6rem; }
  .map-card { min-height: 270px; border-radius: 22px; }
  .map-caption { font-size: .74rem; }
  .button-row .button { width: 100%; }
  .card { border-radius: 18px; }
  .choice { grid-template-columns: 32px 1fr; padding: 12px; }
  .site-footer { width: min(100% - 24px, 1060px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
