:root {
  color-scheme: light;
  --paper: #f7f4eb;
  --card: #fffdf7;
  --ink: #253a31;
  --muted: #4e6156;
  --washed: #e7eddf;
  --rule: #c9cec1;
  --accent: #365948;
  --tint: #e6eddd;
  --copper: #9b492f;
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", SimSun, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.7 var(--sans); }
h1, h2, h3, p, ul { margin: 0; }
ul { list-style: none; padding: 0; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible, label:has(input:focus-visible) { outline: 2px solid #925034; outline-offset: 4px; }
h1:focus, h2:focus { outline: none; }
.shell { width: min(1160px, calc(100% - 72px)); margin-inline: auto; }

.mast {
  min-height: 88px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--ink);
  font: 700 1.22rem/1.2 var(--serif);
  letter-spacing: .12em;
  white-space: nowrap;
  cursor: pointer;
}
.brand-seal { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; background: var(--copper); color: #fff6e8; letter-spacing: 0; }

.screen { margin-top: 29px; }
.screen:not(#home) { animation: reveal .33s ease both; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero {
  display: grid;
  grid-template-columns: 1fr 1.14fr;
  align-items: center;
  gap: 18px;
  padding: clamp(20px, 3.5vw, 42px);
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 7px;
}
.hero-copy { min-width: 0; padding: 14px 0 14px 8px; }
.hero h1 {
  font: 700 clamp(2.4rem, 5vw, 4.4rem)/1.22 var(--serif);
  letter-spacing: -.06em;
  text-wrap: nowrap;
}
.hero h1 em { color: #47624d; margin-left: -.52em; font-style: normal; }
.intro { margin-top: 24px; color: var(--muted); line-height: 1.85; }
.hero .button { margin-top: 25px; min-width: 153px; }
.stats { color: var(--muted); font-size: .875rem; margin-top: 14px; }
.stats strong { color: var(--ink); }
.stats span::after { content: "·"; color: var(--copper); font-weight: 700; margin-inline: 6px; }
.hero-picture { position: relative; min-width: 0; padding: 9px; background: #eee9da; box-shadow: 0 10px 26px #574e2620; }
.hero-picture img { display: block; width: 100%; height: auto; }
.hero-picture::after {
  content: "";
  position: absolute;
  width: 86px;
  height: 23px;
  background: #d7c6a0b0;
  top: -5px;
  right: 18px;
  transform: rotate(7deg);
  pointer-events: none;
}
.home-note { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 20px; margin: 14px 0 0; padding: 14px 0; }
.home-note p, .home-note a { color: var(--muted); font-size: .9375rem; }
.home-note a { white-space: nowrap; text-underline-offset: .22em; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 47px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 5px;
  font: 700 .95rem/1.3 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.primary { background: #315545; color: #fffdf2; }
.primary:hover:not(:disabled) { background: #274636; }
.quiet { border-color: #a9b6a9; background: #fbfaf3; color: var(--ink); }
.quiet:hover { background: #eaf0e3; border-color: #819485; }
.button:disabled { background: #e5e8df; color: #56665a; cursor: default; }

.quiz {
  max-width: 792px;
  margin-inline: auto;
  padding: clamp(20px, 5.25vw, 53px);
  border-radius: 7px;
  border: 1px solid var(--rule);
  background: var(--card);
}
.quiz-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: .875rem; }
#question-count { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
#question-scene { color: var(--muted); }
progress { display: block; appearance: none; width: 100%; height: 6px; border: 0; border-radius: 8px; overflow: hidden; background: #e3e9dc; }
progress::-webkit-progress-bar { background: #e3e9dc; }
progress::-webkit-progress-value { background: #587963; transition: width .2s ease; }
progress::-moz-progress-bar { background: #587963; }
#question-title { margin: 24px 0 17px; font: 700 clamp(1.45rem, 3.5vw, 2rem)/1.48 var(--serif); }
fieldset { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.option {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 10px 13px;
  border: 1px solid #c8d0c1;
  border-radius: 5px;
  background: #f8f8f0;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.option:hover { border-color: #7b9682; }
.option:has(input:checked) { border-color: #457059; background: #e5edde; }
.option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.letter { flex: 0 0 28px; display: grid; place-content: center; height: 28px; border: 1px solid #a3b0a0; border-radius: 50%; color: #45634e; font-weight: 700; font-size: .8125rem; }
input:checked + .letter { color: white; background: #375b47; border-color: #375b47; }
.quiz-actions { display: flex; justify-content: space-between; gap: 14px; margin-top: 20px; }
#previous[hidden] + #next { margin-left: auto; }

.result { width: min(100%, 1000px); margin-inline: auto; }
.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  grid-template-areas: "identity radar" "story radar";
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--card);
}
.identity {
  grid-area: identity;
  padding: 30px clamp(22px, 4vw, 48px) 26px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(130deg, var(--tint), #faf8ed);
  color: var(--accent);
}
.result-kicker { font-size: .875rem; letter-spacing: .075em; color: #485d51; }
.identity h2 { margin: 7px 0 2px; font: 700 clamp(3.45rem, 8vw, 5.25rem)/1.18 var(--serif); letter-spacing: .02em; }
.person-type { color: var(--accent); font-size: .9375rem; font-weight: 700; }
.person-line { margin-top: 13px; font: 700 clamp(1.16rem, 2.2vw, 1.42rem)/1.6 var(--serif); color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags li { border: 1px solid #a6b2a3; border-radius: 999px; padding: 2px 10px; font-size: .875rem; color: #3d5849; background: #fffdf572; }
.story { grid-area: story; padding: 22px clamp(22px, 4vw, 48px) 28px; }
.story h3, .radar-card h3, .result-extras h3 { color: var(--ink); font: 700 1.28rem/1.45 var(--serif); margin-bottom: 6px; }
.story p, .result-extras p { color: var(--muted); }
.radar-card { grid-area: radar; padding: 30px clamp(18px, 3vw, 32px) 21px; border-left: 1px solid var(--rule); align-self: stretch; align-content: center; }
#radar { display: block; width: min(100%, 370px); height: auto; margin: 4px auto 0; }
.radar-values {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.chart-caption { text-align: center; margin-top: 8px; font-size: .8125rem; color: var(--muted); }
.result-extras { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.result-extras article { background: #efefe5; border: 1px solid var(--rule); border-radius: 5px; padding: 12px 17px; }
.inspiration { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 0; color: var(--muted); font-size: .875rem; }
.inspiration strong { white-space: nowrap; color: var(--accent); }
.result-actions, .dialog-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.feedback { min-height: 1.4em; text-align: center; color: var(--muted); font-size: .875rem; padding-top: 6px; }
.feedback:empty { display: none; }

.footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  padding: 13px 0 22px;
  font-size: .8125rem;
}
dialog {
  width: min(510px, calc(100% - 24px));
  max-height: calc(100% - 16px);
  padding: 12px 16px;
  border-radius: 7px;
  border: 1px solid #859787;
  background: var(--card);
  color: var(--ink);
}
dialog::backdrop { background: #24352bc7; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; }
.dialog-head h2 { font: 700 1.25rem/1.3 var(--serif); }
.dialog-head .button { min-height: 40px; }
#poster-image { display: block; width: auto; max-width: 100%; max-height: 60vh; margin-inline: auto; object-fit: contain; }
.dialog-tip { text-align: center; margin-top: 5px; font-size: .8125rem; color: var(--muted); }

@media (max-width: 760px) {
  .shell { width: calc(100% - 30px); }
  .mast { min-height: 65px; }
  .brand { font-size: 1.05rem; }
  .brand-seal { width: 27px; height: 27px; }
  .screen { margin-top: 16px; }
  .hero { gap: 12px; padding: 19px; }
  .hero-copy { padding-left: 3px; }
  .intro { margin-top: 14px; }
  .wide { display: none; }
  .hero .button { margin-top: 15px; }
}

@media (max-width: 560px) {
  .hero { grid-template-columns: 1fr; padding: 19px 16px 16px; }
  .hero-copy { padding: 3px 4px 6px; }
  .hero h1 { font-size: clamp(2.4rem, 9.1vw, 3.28rem); line-height: 1.17; }
  .hero-picture { padding: 5px; }
  .hero-picture::after { height: 18px; width: 63px; }
  .home-note { padding: 7px 1px; margin-top: 9px; }
  .home-note p, .home-note a { font-size: .875rem; }
  .footer { margin-top: 12px; justify-content: flex-start; }
  .quiz { padding: 17px 13px; }
  #question-title { margin: 19px 0 13px; }
  .option { gap: 8px; padding: 8px; }
  .result-card { display: block; }
  .identity { padding-top: 23px; }
  .radar-card { border-left: 0; border-top: 1px solid var(--rule); padding-top: 18px; }
  .result-extras { grid-template-columns: 1fr; }
  .result-actions .button { padding-inline: 12px; }
}

@media (max-width: 335px) {
  .hero h1 { font-size: 2.2rem; }
  .stats span::after { margin-inline: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
