:root {
  color-scheme: light;
  --page: #f7f2e8;
  --paper: #fbf6ec;
  --ink: #252a24;
  --muted: #5c5b50;
  --red: #943830;
  --dark-red: #772a24;
  --line: #d9cdb9;
  --serif: "Noto Serif SC", "Songti SC", "STZhongsong", "SimSun", "PMingLiU", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--page);
  font-synthesis: weight;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, blockquote, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--serif); }
button:focus-visible, a:focus-visible, input:focus-visible + .option-body {
  outline: 2px solid #74332c;
  outline-offset: 4px;
}
[tabindex="-1"]:focus { outline: none; }

.shell { width: min(100% - 7rem, 74rem); margin-inline: auto; }
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5.1rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink);
  font: 700 1.35rem var(--serif);
  letter-spacing: .13em;
  text-decoration: none;
}
.brand-seal {
  display: inline-grid;
  place-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid var(--red);
  box-shadow: inset 0 0 0 2px var(--page);
  flex: 0 0 auto;
  background: var(--red);
  color: var(--paper);
  font: 700 .88rem/.98 var(--serif);
  letter-spacing: 0;
}
.brand-seal i { font-style: normal; }
.about-link {
  display: inline-flex;
  align-items: center;
  gap: .46rem;
  min-height: 2.75rem;
  padding: .25rem 0 .25rem .45rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .9rem;
}
.about-link:hover { color: var(--red); }
.info-mark {
  display: inline-grid;
  place-items: center;
  width: 1.02rem;
  height: 1.02rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 700 .74rem/1 Georgia, serif;
}

main { padding-block: 2.2rem 1.5rem; }
.screen.active-screen { animation: screen-in .38s ease-out both; }
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 34.5rem;
  display: flex;
  align-items: center;
  border: 1px solid #cdbda4;
  background: #fbf2e2;
}
.hero::after {
  position: absolute;
  content: "";
  inset: .55rem;
  z-index: -1;
  border: 1px solid #a78e685c;
  pointer-events: none;
}
.hero-art, .result-card-art { position: absolute; z-index: -2; pointer-events: none; }
.hero-art {
  inset: 0 0 0 38%;
  background:
    linear-gradient(90deg, #fbf2e2 0%, #fbf2e2e6 12%, #fbf2e26e 31%, transparent 58%),
    url("assets/ink-landscape.jpg") right 47% / auto 126% no-repeat,
    #fbf2e2;
}
.hero-copy { padding: 3.3rem clamp(2rem, 5.1vw, 5rem); }
.eyebrow {
  display: flex;
  align-items: center;
  gap: .62rem;
  color: var(--red);
  font-size: .88rem;
  font-weight: 650;
  letter-spacing: .15em;
}
.diamond {
  display: inline-block;
  flex: 0 0 .43rem;
  width: .43rem;
  height: .43rem;
  margin-inline: .13rem;
  background: currentColor;
  transform: rotate(45deg);
}
.hero h1 {
  max-width: 15ch;
  margin-top: 1.12rem;
  font-size: clamp(3.1rem, 5.05vw, 4.65rem);
  line-height: 1.15;
  letter-spacing: .015em;
}
.hero-name { display: block; color: var(--red); }
.hero-description {
  max-width: 29rem;
  margin-top: 1.3rem;
  color: #514d42;
  font-size: 1rem;
  line-height: 1.8;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 3rem;
  padding: .65rem 1.35rem;
  border: 1px solid transparent;
  font-size: .99rem;
  font-weight: 650;
  letter-spacing: .055em;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.button-primary { color: #fff9ee; background: var(--red); border-color: var(--red); }
.button-primary:hover { background: var(--dark-red); border-color: var(--dark-red); }
.button-outline { color: var(--red); background: transparent; border-color: #b79885; }
.button-outline:hover { background: #f5e9da; border-color: var(--red); }
.button:disabled { cursor: default; color: #6e6253; background: #eee7da; border-color: #d9cdb9; }
.start-button { min-width: 10.45rem; min-height: 3.35rem; margin-top: 1.55rem; }
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 1.6rem 0 1.45rem;
  border-bottom: 1px solid var(--line);
}
.facts div { text-align: center; }
.facts div + div { border-left: 1px solid var(--line); }
.facts dt { font: 700 2.2rem/1.05 Georgia, var(--serif); color: var(--red); }
.facts dt span { font: 700 1rem var(--serif); color: var(--ink); }
.facts dd { margin-top: .52rem; color: var(--muted); font-size: .9rem; }
.notice { margin-top: .8rem; color: var(--red); }

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 28%) minmax(0, 1fr);
  min-height: 37.5rem;
  border: 1px solid var(--line);
  background: var(--paper);
}
.quiz-art {
  position: relative;
  isolation: isolate;
  min-height: 100%;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, #f8ecda14 25%, #f8ecda99 65%, #f8ecda 92%),
    url("assets/ink-landscape.jpg") 65% 50% / cover;
}
.quiz-art::after { content: ""; position: absolute; inset: .55rem; z-index: -1; border: 1px solid #98795169; }
.quiz-art-caption { position: absolute; bottom: 2.3rem; inset-inline: .9rem; text-align: center; }
.quiz-art-caption p { margin: .75rem 0 .4rem; font: 700 1.8rem var(--serif); letter-spacing: .12em; }
.quiz-art-caption span { font-size: .9rem; color: #514d42; }
.quiz-panel { width: 100%; max-width: 56rem; padding: clamp(1.45rem, 4.4vw, 3.65rem); margin-inline: auto; }
.progress-row { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .88rem; }
.progress-row span { color: var(--red); font-weight: 700; font-variant-numeric: tabular-nums; }
progress {
  display: block;
  width: 100%;
  height: .38rem;
  margin-top: .65rem;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: #e9dfce;
  color: var(--red);
}
progress::-webkit-progress-bar { background: #e9dfce; }
progress::-webkit-progress-value { background: var(--red); transition: width .28s ease; }
progress::-moz-progress-bar { background: var(--red); }
.question-in { animation: question-in .28s ease-out both; }
.question-meta { margin-top: 1.8rem; }
.quiz-panel h1 { margin: .7rem 0 1.25rem; font-size: clamp(1.55rem, 2.83vw, 2.42rem); line-height: 1.36; }
.quiz-panel fieldset { display: grid; gap: .62rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.option { position: relative; display: block; cursor: pointer; }
.option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.option-body {
  display: grid;
  grid-template-columns: 1.85rem minmax(0, 1fr) 1rem;
  align-items: center;
  min-height: 3.4rem;
  gap: .77rem;
  padding: .58rem .87rem;
  border: 1px solid var(--line);
  background: #fefaf2;
  line-height: 1.48;
  transition: background .15s ease, border-color .15s ease;
}
.option:hover .option-body { border-color: #96745f; }
.option-letter {
  display: grid;
  place-items: center;
  width: 1.82rem;
  height: 1.82rem;
  background: #f0e8d9;
  color: #6b4d3e;
  font: 700 .92rem Georgia, serif;
}
.option-indicator { width: 1rem; height: 1rem; border-radius: 50%; border: 1px solid #9b8a73; }
.option input:checked + .option-body { border-color: var(--red); background: #f8eee1; }
.option input:checked + .option-body .option-letter { background: var(--red); color: #fff9ee; }
.option input:checked + .option-body .option-indicator {
  border-color: var(--red);
  background: radial-gradient(circle, var(--red) 0 42%, transparent 49%);
}
.form-message { min-height: 1.7rem; margin-top: .4rem; color: var(--red); font-size: .88rem; line-height: 1.5; }
.form-message:not(:empty) { margin-bottom: .35rem; }
.quiz-actions { display: flex; justify-content: space-between; gap: .6rem; }
.quiz-actions .button { min-width: 7.5rem; }

.result-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.2rem, 5.6vw, 5.25rem);
  --result-color: var(--red);
}
.result-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 32rem;
  aspect-ratio: 4 / 5;
  display: flex;
  border: 1px solid #bda98b;
  background: #fbf1df;
}
.result-card::after {
  position: absolute;
  content: "";
  inset: .55rem;
  z-index: -1;
  border: 1px solid #98795169;
  pointer-events: none;
}
.result-card-art {
  inset: 0;
  background:
    linear-gradient(180deg, #fbf1df14 0%, #fbf1df29 37%, #fbf1dfe6 70%, #fbf1df 88%),
    linear-gradient(90deg, #fbf1df 0%, #fbf1df30 74%, transparent 100%),
    url("assets/ink-landscape.jpg") 62% center / cover;
}
.result-card-content { display: flex; flex-direction: column; align-items: start; width: 100%; padding: clamp(1.75rem, 4.1vw, 3.2rem); }
.result-card .eyebrow { color: var(--result-color); }
.result-card h1 { margin-top: .95rem; color: var(--ink); font-size: clamp(3.25rem, 6.3vw, 5.5rem); line-height: 1.08; letter-spacing: .055em; }
.result-meta { margin-top: .58rem; color: var(--result-color); font-size: 1rem; font-weight: 650; letter-spacing: .12em; }
.result-seal {
  display: grid;
  place-items: center;
  width: 3.5rem;
  aspect-ratio: 1;
  margin-top: clamp(1.5rem, 4vw, 3rem);
  border: 3px double currentColor;
  color: var(--result-color);
  background: #fbf1dfb5;
  font: 700 2.07rem/1 var(--serif);
  transform: rotate(-7deg);
}
.result-card blockquote {
  margin-top: auto;
  padding-top: 1.6rem;
  color: #30291f;
  font: 700 clamp(1.32rem, 2.7vw, 1.9rem)/1.5 var(--serif);
  text-wrap: pretty;
}
.result-traits { display: flex; flex-wrap: wrap; gap: .46rem; margin: 1.15rem 0 0; padding: 0; list-style: none; }
.result-traits li {
  border: 1px solid #c3ab8b;
  padding: .26rem .55rem;
  background: #fbf2e2d9;
  color: #594636;
  font-size: .85rem;
}
.card-signature { margin-top: 1.25rem; padding-top: .75rem; border-top: 1px solid #c9b593; color: #62503d; font-size: .81rem; }
.card-signature span { margin-inline: .18rem; }
.result-panel { padding-block: .65rem .25rem; }
.result-panel h2 { font-size: clamp(1.85rem, 3.45vw, 2.75rem); letter-spacing: .04em; }
.result-description { margin-top: .9rem; color: #4d493c; line-height: 1.78; }
.result-details { margin-top: 1.4rem; border-top: 1px solid var(--line); }
.result-details section { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.result-details h3 { margin-bottom: .45rem; color: var(--result-color); font-size: 1.18rem; }
.result-details p { color: #49463a; line-height: 1.65; }
.answer-reading { margin: 1.35rem 0 2rem; padding: 1.1rem 1.2rem; background: #f2eddf; border-left: 3px solid var(--result-color); }
.answer-reading h3 { font-size: 1.2rem; color: var(--result-color); }
.answer-reading ol { margin: .65rem 0 0; padding: 0; list-style: none; }
.answer-reading li + li { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.answer-reading small { color: #655c4b; }
.answer-reading p, .answer-reading blockquote { margin: .35rem 0 0; line-height: 1.7; }
.answer-reading blockquote { font-family: var(--serif); color: var(--result-color); }
.result-details #result-chapters p { line-height: 1.95; }
@media (min-width: 921px) and (min-height: 760px) {
  .result-card { position: sticky; top: 1rem; }
}
.result-details .easter-egg { background: #f1e8d9; padding-inline: .85rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.35rem; }
.share-message { min-height: 0; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .55rem 1rem;
  padding-block: .4rem 1.1rem;
  color: var(--muted);
  font-size: .81rem;
  line-height: 1.6;
}
.site-footer p:first-child { font: 700 .95rem var(--serif); color: #4f4539; letter-spacing: .1em; }

dialog {
  width: min(100% - 2rem, 31rem);
  max-height: calc(100% - 2rem);
  padding: 1.8rem 2rem;
  border: 1px solid #bca98e;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1rem 4rem #2d271b33;
}
dialog::backdrop { background: #281f1a70; }
dialog h2 { margin-top: .55rem; font-size: 1.85rem; }
dialog p:not(.eyebrow) { margin-top: .9rem; line-height: 1.7; }
.dialog-close { position: absolute; top: .45rem; right: .55rem; width: 2.5rem; height: 2.5rem; border: 0; background: transparent; color: var(--red); font-size: 1.75rem; }

@keyframes screen-in { from { opacity: 0; transform: translateY(.48rem); } to { opacity: 1; transform: translateY(0); } }
@keyframes question-in { from { opacity: 0; transform: translateX(.4rem); } to { opacity: 1; transform: translateX(0); } }

@media (max-width: 920px) {
  .shell { width: calc(100% - 3rem); }
  .hero-art { left: 34%; }
  .result-layout { gap: 1.5rem; }
}

@media (max-width: 680px) {
  .shell { width: calc(100% - 1.5rem); }
  .site-header { min-height: 3.75rem; }
  .brand { gap: .52rem; font-size: 1.18rem; }
  .brand-seal { width: 2.02rem; height: 2.02rem; font-size: .8rem; }
  main { padding-block: .9rem .95rem; }
  .hero { align-items: start; min-height: 32rem; }
  .hero-copy { padding: 2.25rem 1.12rem; }
  .hero h1 { margin-top: .9rem; font-size: clamp(1.85rem, 8.2vw, 3.2rem); }
  .hero-art {
    inset: 14% 0 0;
    background:
      linear-gradient(180deg, #fbf2e2 0%, #fbf2e2e6 37%, #fbf2e255 65%, transparent 94%),
      linear-gradient(90deg, #fbf2e2 0%, #fbf2e29c 25%, transparent 76%),
      url("assets/ink-landscape.jpg") right 57% / auto 111% no-repeat,
      #fbf2e2;
  }
  .hero-description { font-size: .96rem; line-height: 1.64; margin-top: .95rem; }
  .start-button { margin-top: 1.2rem; }
  .facts { padding: .95rem 0; }
  .facts dt { font-size: 1.6rem; }
  .facts dt span { font-size: .83rem; }
  .facts dd { margin-top: .4rem; font-size: .8rem; }
  .quiz-layout { display: block; min-height: 0; }
  .quiz-art { display: none; }
  .quiz-panel { padding: 1rem .85rem 1.18rem; }
  .question-meta { margin-top: 1.35rem; }
  .quiz-panel h1 { margin-bottom: 1rem; }
  .option-body { gap: .58rem; padding-inline: .6rem; }
  .result-layout { grid-template-columns: minmax(0, 1fr); gap: 1.08rem; }
  .result-card { width: min(100%, 31rem); margin-inline: auto; min-height: 25rem; }
  .result-panel { padding-inline: .2rem; }
  .result-panel h2 { font-size: 1.85rem; }
  .site-footer { gap: .24rem .65rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
