:root {
  --ink: #3f3a38;
  --muted: #746d68;
  --paper: #fffdf9;
  --paper-deep: #f7f1ea;
  --rose: #b87878;
  --rose-soft: #ead4d0;
  --sage: #7f9789;
  --sage-soft: #dce7df;
  --lavender: #89809c;
  --lavender-soft: #e4dfec;
  --gold: #b2915d;
  --line: #ddd2c7;
  --danger: #9f5b5b;
  --shadow: 0 18px 50px rgba(80, 64, 53, .10);
  --radius: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(234, 212, 208, .62), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(220, 231, 223, .7), transparent 31%),
    linear-gradient(160deg, #f8f2eb 0%, #f4eee7 50%, #f8f3ed 100%);
  font-family: "Noto Sans TC", system-ui, sans-serif;
  line-height: 1.75;
}

button, input { font: inherit; }
button { color: inherit; }

.paper-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}

.site-header {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--rose);
  box-shadow: 0 8px 25px rgba(93, 73, 60, .10);
}

.brand strong { display: block; font-family: "Noto Serif TC", serif; letter-spacing: .03em; }
.brand small { display: block; color: var(--muted); font-size: .73rem; letter-spacing: .16em; }

#app { width: min(1040px, calc(100% - 32px)); margin: 0 auto; min-height: calc(100vh - 190px); }

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 52px;
  align-items: center;
  min-height: 650px;
  padding: 70px 64px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 36px;
  background: rgba(255,253,249,.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.eyebrow { color: var(--rose); font-weight: 700; letter-spacing: .14em; font-size: .86rem; }
h1, h2, h3 { font-family: "Noto Serif TC", serif; line-height: 1.45; }
h1 { margin: 14px 0 18px; font-size: clamp(2.25rem, 6vw, 4.35rem); letter-spacing: .02em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); }
.hero-copy { font-size: 1.08rem; color: var(--muted); max-width: 650px; }
.hero-copy strong { color: var(--ink); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button {
  border: 0;
  border-radius: 999px;
  padding: 14px 24px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--ink); color: #fff; box-shadow: 0 10px 24px rgba(63,58,56,.18); }
.button.secondary { background: var(--paper-deep); border: 1px solid var(--line); }
.button.danger { background: var(--danger); color: #fff; }
.button.full { width: 100%; }
.text-button { background: transparent; border: 0; cursor: pointer; color: var(--muted); padding: 10px 4px; }
.text-button:hover { color: var(--ink); }

.compass-art { position: relative; display: grid; place-items: center; min-height: 390px; }
.compass-ring {
  width: 310px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255,255,255,.95) 0 34%, transparent 35%), conic-gradient(from 18deg, var(--rose-soft), var(--sage-soft), var(--lavender-soft), var(--rose-soft));
  box-shadow: inset 0 0 0 18px rgba(255,255,255,.55), 0 20px 60px rgba(84,67,54,.11);
  animation: drift 8s ease-in-out infinite;
}
.compass-ring::before, .compass-ring::after { content: ""; position: absolute; background: rgba(255,255,255,.7); }
.compass-ring::before { width: 1px; height: 280px; }
.compass-ring::after { width: 280px; height: 1px; }
.compass-center { width: 105px; height: 105px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; text-align: center; font-family: "Noto Serif TC", serif; box-shadow: 0 8px 30px rgba(74,58,49,.12); z-index: 1; }
.compass-note { position: absolute; padding: 8px 14px; border-radius: 12px; background: var(--paper); box-shadow: 0 8px 24px rgba(74,58,49,.10); font-size: .82rem; color: var(--muted); transform: rotate(-4deg); }
.compass-note.one { top: 32px; right: 8px; }
.compass-note.two { bottom: 34px; left: 0; transform: rotate(3deg); }

.mini-features { margin-top: 34px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.mini-feature { padding: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.mini-feature strong { color: var(--ink); display: block; }

.book-page { max-width: 780px; margin: 28px auto 0; padding: 42px; background: rgba(255,253,249,.94); border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius); box-shadow: var(--shadow); }
.book-page.wide { max-width: 980px; }
.book-page p { color: var(--muted); }
.check-list { margin: 24px 0; padding: 0; list-style: none; }
.check-list li { position: relative; margin: 12px 0; padding-left: 30px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--sage); font-weight: 700; }
.answer-key { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; margin: 24px 0; }
.answer-key div { text-align: center; padding: 12px 6px; border-radius: 14px; background: var(--paper-deep); font-size: .82rem; }
.answer-key span { display: block; font-size: 1.45rem; }

.quiz-shell { max-width: 760px; margin: 20px auto 0; }
.progress-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .88rem; margin-bottom: 10px; }
.progress-track { height: 8px; background: rgba(255,255,255,.8); border-radius: 99px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--rose), var(--sage)); border-radius: inherit; transition: width .35s ease; }
.question-card { margin-top: 24px; min-height: 505px; padding: 46px; border-radius: 30px; background: rgba(255,253,249,.96); box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.9); display: flex; flex-direction: column; }
.question-number { color: var(--rose); font-weight: 700; letter-spacing: .12em; }
.question-card h1 { font-size: clamp(1.55rem, 4vw, 2.25rem); margin: 30px 0 34px; }
.answer-list { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-top: auto; }
.answer-option { position: relative; width: 100%; min-height: 132px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; text-align: center; padding: 16px 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 22px; cursor: pointer; transition: .18s ease; }
.answer-option:hover { border-color: var(--rose); transform: translateY(-3px); }
.answer-option.selected { border-color: var(--rose); background: #fbefed; box-shadow: inset 0 0 0 1px var(--rose); }
.answer-option .emoji { font-size: 2rem; line-height: 1; }
.answer-option .answer-label { font-weight: 700; white-space: nowrap; }
.answer-option .check { position: absolute; top: 8px; right: 10px; opacity: 0; color: var(--rose); font-weight: 700; }
.answer-option.selected .check { opacity: 1; }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 16px; }
.quiz-nav button:disabled { opacity: .35; cursor: default; }

.result-hero { padding: 44px; border-radius: 30px; background: linear-gradient(135deg, rgba(234,212,208,.7), rgba(220,231,223,.8)); box-shadow: var(--shadow); }
.result-hero .result-kicker { font-weight: 700; color: var(--rose); letter-spacing: .12em; }
.result-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.result-grid { display: grid; grid-template-columns: minmax(300px,.9fr) minmax(360px,1.1fr); gap: 22px; margin-top: 22px; }
.result-card { padding: 30px; border-radius: var(--radius); background: rgba(255,253,249,.96); border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow); }
.result-card h2 { margin-top: 0; }
.radar-wrap { display: grid; place-items: center; min-height: 420px; }
#radarCanvas { width: min(100%, 420px); height: auto; }
.score-list { display: grid; gap: 12px; }
.score-row { display: grid; grid-template-columns: 64px 1fr 48px; gap: 10px; align-items: center; }
.score-bar { height: 9px; border-radius: 99px; background: var(--paper-deep); overflow: hidden; }
.score-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--rose), var(--sage)); }

.section-heading { margin: 52px 0 18px; display: flex; align-items: end; justify-content: space-between; }
.section-heading.compact { margin-top: 32px; }
.section-heading h2 { margin: 0; }
.section-heading p { margin: 0; font-size: .88rem; }
.result-stack { display: grid; gap: 14px; }
details.result-detail { background: rgba(255,253,249,.94); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
details.result-detail[open] { box-shadow: 0 12px 34px rgba(75,58,48,.08); }
details.result-detail summary { list-style: none; cursor: pointer; padding: 20px 22px; display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; font-weight: 700; }
details.result-detail summary::-webkit-details-marker { display: none; }
.detail-score { color: var(--rose); }
.detail-arrow { color: var(--muted); transition: transform .2s; }
details[open] .detail-arrow { transform: rotate(180deg); }
.detail-body { padding: 0 22px 22px; color: var(--muted); }
.detail-body h3 { color: var(--ink); }
.reminder { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--paper-deep); color: var(--muted); font-size: .9rem; }
.chip-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.insight-card { padding: 22px; border-radius: 18px; background: rgba(255,253,249,.94); border: 1px solid var(--line); }
.insight-card h3 { margin: 0 0 8px; }
.insight-card p { margin: 0; color: var(--muted); }
.insight-score { color: var(--rose); font-weight: 700; font-size: .86rem; }
.highlight-card { margin-top: 22px; }
.highlight-card h2 { margin: 4px 0 20px; }
.highlight-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.highlight-grid > div { padding: 16px; border-radius: 14px; background: var(--paper-deep); }
.highlight-grid span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .8rem; }
.highlight-grid strong { display: block; line-height: 1.5; }
.result-more { margin-top: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,249,.86); overflow: hidden; }
.result-more > summary { cursor: pointer; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-weight: 700; list-style: none; }
.result-more > summary::-webkit-details-marker { display: none; }
.result-more > summary::after { content: "＋"; color: var(--rose); font-size: 1.25rem; }
.result-more[open] > summary::after { content: "－"; }
.result-more > summary small { margin-left: auto; color: var(--muted); font-weight: 400; }
.result-more-body { padding: 0 22px 24px; }
.result-more-body .section-heading { margin-top: 36px; }
.result-actions { margin: 42px 0 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.privacy-note { text-align: center; color: var(--muted); font-size: .85rem; }
.result-credit { text-align: center; color: var(--ink) !important; font-size: .82rem; font-weight: 700; }

.site-footer { width: min(1040px, calc(100% - 32px)); margin: 34px auto; padding: 22px 0; text-align: center; color: var(--muted); font-size: .78rem; border-top: 1px solid rgba(146,129,115,.25); }
.site-footer p { margin: 2px; }
.site-footer .studio-credit { margin-bottom: 7px; color: var(--ink); font-weight: 700; letter-spacing: .04em; }
.site-footer a { color: var(--muted); text-underline-offset: 3px; }
.prose-page { max-width: 780px; margin: 28px auto 0; padding: 46px; background: rgba(255,253,249,.95); border-radius: var(--radius); box-shadow: var(--shadow); }
.prose-page h2 { margin-top: 36px; }
.prose-page p, .prose-page li { color: var(--muted); }
.prose-page .back-link { display: inline-block; margin-bottom: 22px; color: var(--rose); text-decoration: none; font-weight: 700; }

.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(50,43,40,.42); backdrop-filter: blur(5px); }
.modal { width: min(460px,100%); padding: 34px; border-radius: 26px; background: var(--paper); box-shadow: 0 25px 80px rgba(45,38,35,.24); text-align: center; }
.modal-icon { width: 58px; height: 58px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--rose-soft); color: var(--rose); font-size: 1.6rem; }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.modal-actions .button { flex: 1; }
.age-locked { overflow: hidden; }
.age-locked .site-header, .age-locked main, .age-locked .site-footer { visibility: hidden; }
.age-gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #f5ece6, #e4ede6); }
.age-card { width: min(560px,100%); padding: 44px; border-radius: 30px; background: rgba(255,253,249,.97); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 28px 90px rgba(45,38,35,.18); text-align: center; }
.age-card h1 { font-size: clamp(1.8rem,5vw,2.65rem); }
.age-card p { color: var(--muted); }
.age-mark { width: 82px; height: 82px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; background: var(--rose-soft); color: var(--rose); font-size: 1.65rem; font-weight: 800; }
.age-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 20; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: var(--shadow); transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.hidden { display: none !important; }

@keyframes drift { 0%,100% { transform: translateY(-5px) rotate(-1deg); } 50% { transform: translateY(8px) rotate(1deg); } }

@media (max-width: 780px) {
  .site-header { min-height: 70px; }
  .hero { grid-template-columns: 1fr; padding: 42px 24px; gap: 20px; }
  .compass-art { min-height: 300px; }
  .compass-ring { width: 245px; }
  .compass-ring::before { height: 218px; }
  .compass-ring::after { width: 218px; }
  .mini-features { grid-template-columns: 1fr; }
  .book-page, .question-card, .result-hero, .result-card { padding: 26px 20px; }
  .prose-page { padding: 30px 22px; }
  .answer-key { grid-template-columns: 1fr; }
  .answer-key div { display: flex; align-items: center; gap: 12px; text-align: left; }
  .answer-key span { display: inline; }
  html:has(body.quiz-active), body.quiz-active { height: 100dvh; overflow: hidden; }
  body.quiz-active { min-height: 0; }
  body.quiz-active .site-header { min-height: 54px; padding-top: 4px; padding-bottom: 4px; }
  body.quiz-active .brand small { display: none; }
  body.quiz-active .site-footer { display: none; }
  body.quiz-active main { height: calc(100dvh - 54px); }
  body.quiz-active .quiz-shell { height: 100%; margin: 0 auto; padding: 4px 12px 8px; display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; }
  body.quiz-active .progress-meta { margin-bottom: 5px; font-size: .76rem; }
  body.quiz-active .progress-track { height: 6px; }
  body.quiz-active .question-card { min-height: 0; margin-top: 7px; padding: 12px 14px; border-radius: 20px; overflow: hidden; }
  body.quiz-active .question-number { font-size: .72rem; }
  body.quiz-active .question-card h1 { margin: 8px 0 10px; font-size: clamp(1.02rem,4.7vw,1.28rem); line-height: 1.42; }
  body.quiz-active .answer-list { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; }
  body.quiz-active .answer-option { min-height: 82px; gap: 8px; padding: 9px 2px 7px; border-radius: 13px; font-size: clamp(.68rem,3vw,.82rem); }
  body.quiz-active .answer-option .emoji { font-size: 1.45rem; }
  body.quiz-active .answer-option .check { top: 2px; right: 4px; font-size: .7rem; }
  body.quiz-active .quiz-nav { margin-top: 4px; min-height: 35px; }
  body.quiz-active .quiz-nav .text-button { padding: 5px 3px; font-size: .84rem; }
  .result-grid, .chip-grid { grid-template-columns: 1fr; }
  .highlight-grid { grid-template-columns: 1fr; }
  .result-more > summary { align-items: flex-start; }
  .result-more > summary small { display: none; }
  .result-more-body { padding: 0 14px 18px; }
  .result-actions .button { width: 100%; }
  .modal-actions { flex-direction: column; }
  .age-card { padding: 30px 22px; }
  .age-actions { grid-template-columns: 1fr; }
  details.result-detail summary { grid-template-columns: 1fr auto; }
  .detail-score { grid-row: 2; }
}

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