:root {
  --paper: #f6efe2;
  --paper-soft: #fffaf0;
  --paper-deep: #eadfc9;
  --ink: #17221d;
  --muted: #5d665e;
  --jade: #2f7d69;
  --jade-deep: #1f5f51;
  --cinnabar: #a8422d;
  --bronze: #9c7a3d;
  --line: rgba(23, 34, 29, 0.16);
  --line-strong: rgba(23, 34, 29, 0.24);
  --shadow: 0 24px 70px rgba(23, 34, 29, 0.13);
  --soft-shadow: 0 14px 42px rgba(23, 34, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(47, 125, 105, 0.11), transparent 28%),
    linear-gradient(90deg, rgba(47, 125, 105, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(47, 125, 105, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 44px 44px, 44px 44px, auto;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 250, 240, 0.8), transparent 46%),
    radial-gradient(circle at 82% 22%, rgba(168, 66, 45, 0.08), transparent 26%);
  content: "";
}

a {
  color: inherit;
}

.site-header,
.site-footer,
.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto auto;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
}

.brand-mark,
.top-nav,
.language-toggle,
.trust-strip,
.hero-actions,
.form-actions,
.cta-row {
  display: flex;
  align-items: center;
}

.brand-mark {
  gap: 12px;
  text-decoration: none;
}

.brand-mark strong,
.pathway-card strong {
  display: block;
}

.brand-mark small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.seal {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--cinnabar);
  color: var(--cinnabar);
  font-weight: 900;
  line-height: 1;
}

.top-nav {
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.top-nav a {
  text-decoration: none;
}

.language-toggle {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: var(--soft-shadow);
}

.language-toggle button {
  min-width: 58px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 9px 12px;
  cursor: pointer;
}

.language-toggle button.active {
  background: var(--ink);
  color: #fffdf7;
}

.hero {
  min-height: 86vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  gap: 52px;
  align-items: center;
  padding: 48px 0 38px;
}

.hero-copy h1,
.intro-band h2,
.tool-header h2,
.section-heading h2,
.boundary-grid h2,
.result-card h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy h1 {
  max-width: 820px;
  font-size: clamp(48px, 7vw, 94px);
}

.hero-copy p,
.tool-header > div > p {
  max-width: 700px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cinnabar);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-actions,
.form-actions,
.cta-row {
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  color: #fffdf7;
  border-color: var(--ink);
  background: var(--ink);
}

.button.secondary {
  color: var(--ink);
  background: rgba(255, 253, 247, 0.7);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.trust-strip {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.trust-strip span {
  border: 1px solid rgba(47, 125, 105, 0.2);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.62);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}

.hero-art {
  min-width: 0;
}

.paper-card {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 250, 240, 0.88), rgba(255, 250, 240, 0.84)),
    radial-gradient(circle at 50% 45%, rgba(47, 125, 105, 0.12), transparent 38%),
    var(--paper-soft);
  box-shadow: var(--shadow);
}

.paper-card::before,
.paper-card::after {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(156, 122, 61, 0.35);
  content: "";
}

.paper-card::after {
  inset: 26px;
  border-color: rgba(168, 66, 45, 0.18);
}

.bagua-ring {
  position: absolute;
  inset: 34px 34px auto auto;
  width: 92px;
  aspect-ratio: 1;
  border: 2px solid rgba(23, 34, 29, 0.18);
  border-radius: 50%;
}

.bagua-ring::before,
.bagua-ring::after {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: conic-gradient(var(--ink) 0 25%, transparent 25% 50%, var(--ink) 50% 75%, transparent 75%);
  opacity: 0.16;
  content: "";
}

.bagua-ring::after {
  inset: 38px;
  background: var(--cinnabar);
  opacity: 0.7;
}

.hero-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(72%, 430px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 253, 247, 0.96) 0 21%, transparent 22%),
    conic-gradient(from 12deg, #2f7d55, #a8422d, #9c7a3d, #7d8177, #2d6473, #2f7d55);
  box-shadow: var(--soft-shadow);
  transform: translate(-50%, -50%);
}

.hero-orbit::before,
.hero-orbit::after {
  position: absolute;
  inset: 15%;
  border: 1px solid rgba(255, 253, 247, 0.82);
  border-radius: 50%;
  content: "";
}

.hero-orbit::after {
  inset: 31%;
  background: rgba(246, 239, 226, 0.9);
}

.element {
  position: absolute;
  z-index: 2;
  min-width: 76px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 253, 247, 0.74);
  border-radius: 999px;
  color: #fffdf7;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  transform: translate(-50%, -50%);
}

.wood {
  top: 18%;
  left: 50%;
}

.fire {
  top: 40%;
  left: 83%;
}

.earth {
  top: 78%;
  left: 69%;
}

.metal {
  top: 78%;
  left: 31%;
}

.water {
  top: 40%;
  left: 17%;
}

.mountain-lines {
  position: absolute;
  right: -8%;
  bottom: -4%;
  left: -8%;
  height: 190px;
  opacity: 0.28;
  background:
    linear-gradient(145deg, transparent 45%, var(--jade-deep) 46% 48%, transparent 49%) 0 50% / 28% 100%,
    linear-gradient(35deg, transparent 48%, var(--ink) 49% 51%, transparent 52%) 8% 35% / 34% 100%,
    linear-gradient(155deg, transparent 45%, var(--bronze) 46% 48%, transparent 49%) 48% 28% / 30% 100%;
}

.intro-band,
.tool-panel,
.boundary-grid,
.pathway-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: var(--shadow);
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.48fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  margin-bottom: 34px;
  padding: 28px;
}

.intro-band h2,
.section-heading h2,
.boundary-grid h2 {
  font-size: clamp(30px, 4vw, 52px);
}

.feature-grid,
.pathway-grid,
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature-grid article,
.pathway-card,
.result-grid section,
.lead-box,
.result-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  padding: 18px;
}

.feature-grid span {
  color: var(--cinnabar);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.feature-grid h3,
.result-grid h3 {
  margin: 10px 0 8px;
}

.feature-grid p,
.pathway-card span,
.result-grid p,
.small,
.boundary-grid ul,
.question-card p,
.reflection span,
.lead-box span {
  color: var(--muted);
  line-height: 1.65;
}

.tool-panel {
  padding: 30px;
}

.tool-header,
.boundary-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(260px, 0.42fr);
  gap: 24px;
  align-items: start;
}

.progress {
  align-self: center;
}

.progress span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 900;
}

.progress-track,
.score-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(23, 34, 29, 0.12);
}

#progressBar,
.score-track i {
  display: block;
  height: 100%;
  background: var(--jade);
  transition: width 0.2s ease;
}

.question-card {
  margin: 28px 0 20px;
  border: 0;
  padding: 0;
}

.question-card legend {
  max-width: 780px;
  font-size: clamp(25px, 3.5vw, 42px);
  font-weight: 900;
  line-height: 1.15;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.option-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  min-height: 120px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  padding: 18px;
  cursor: pointer;
}

.option-card:has(input:checked) {
  border-color: var(--jade);
  outline: 3px solid rgba(47, 125, 105, 0.18);
}

.reflection,
.lead-box label {
  display: grid;
  gap: 8px;
}

textarea,
input[type="email"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
  font: inherit;
  padding: 13px 14px;
}

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin: 18px 0;
  color: var(--muted);
  line-height: 1.55;
}

.hidden {
  display: none !important;
}

.needs-answer {
  outline: 3px solid rgba(168, 66, 45, 0.24);
  outline-offset: 4px;
}

.result-panel {
  margin-top: 30px;
}

.result-card,
.result-warning {
  border-top: 5px solid var(--jade);
  background:
    linear-gradient(135deg, rgba(47, 125, 105, 0.06), transparent 42%),
    #fffdf7;
  padding: 26px;
  border-radius: 8px;
}

.result-card h2,
.result-warning h2 {
  font-size: clamp(30px, 4vw, 58px);
}

.result-summary {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(240px, 0.38fr);
  gap: 18px;
  margin: 22px 0;
  background: var(--paper);
}

.dominant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
}

.dominant-pill {
  border: 1px solid rgba(255, 253, 247, 0.86);
  border-radius: 999px;
  color: #fffdf7;
  font-size: 13px;
  font-weight: 900;
  padding: 8px 11px;
}

.score-list {
  display: grid;
  gap: 12px;
  margin: 20px 0 24px;
}

.score-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 40px;
  gap: 12px;
  align-items: center;
  font-weight: 900;
}

.result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lead-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 16px;
  background: var(--paper);
}

.lead-status {
  margin: 8px 0 0;
  color: var(--jade-deep);
  font-size: 13px;
  font-weight: 800;
}

.cta-row {
  margin-top: 16px;
}

.pathway-section {
  margin-top: 34px;
  padding: 30px;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.pathway-card {
  min-height: 132px;
  text-decoration: none;
}

.pathway-card strong {
  margin-bottom: 8px;
  font-size: 20px;
}

.boundary-grid {
  margin: 34px 0 70px;
  padding: 30px;
}

.boundary-grid ul {
  margin: 0;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 24px 0 34px;
}

.site-footer a {
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 960px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    display: none;
  }

  .hero,
  .intro-band,
  .tool-header,
  .boundary-grid,
  .result-summary {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 28px;
  }

  .paper-card {
    min-height: 440px;
  }

  .feature-grid,
  .pathway-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header,
  .site-footer,
  .app-shell {
    width: min(100% - 24px, 1180px);
  }

  .hero-copy h1 {
    font-size: clamp(42px, 14vw, 64px);
  }

  .option-grid,
  .result-grid,
  .lead-box {
    grid-template-columns: 1fr;
  }

  .tool-panel,
  .intro-band,
  .pathway-section,
  .boundary-grid {
    padding: 20px;
  }

  .site-header {
    gap: 12px;
  }

  .brand-mark small {
    display: none;
  }

  .language-toggle button {
    min-width: 50px;
  }
}
