:root {
  --paper: #f5efdf;
  --ink: #292b26;
  --muted: #777466;
  --red: #8c3327;
  --gold: #a17a3d;
  --line: #d9cdb5;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --sans: "PingFang SC", "Microsoft YaHei", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  background-image: radial-gradient(#85745012 0.7px, transparent 0.7px);
  background-size: 5px 5px;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  font: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #bb8b43;
  outline-offset: 5px;
}
body:has(dialog[open]) {
  overflow: hidden;
}
.site-header {
  max-width: 1240px;
  margin: auto;
  padding: 25px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: bold;
  letter-spacing: 3px;
}
.seal {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  background: var(--red);
  color: var(--paper);
  border-radius: 3px;
  font-size: 26px;
  transform: rotate(-3deg);
  outline: 1px solid var(--red);
  outline-offset: 3px;
}
.brand-sub {
  margin-left: 17px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 400;
  color: var(--muted);
}
.text-button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 10px 0;
  font-size: 13px;
  letter-spacing: 1px;
}
.text-button:hover {
  color: var(--red);
}
.hero {
  max-width: 1240px;
  margin: 0 auto;
  min-height: 620px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}
.hero-art {
  position: absolute;
  inset: 0 0 0 32%;
  width: 68%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -2;
  mix-blend-mode: multiply;
}
.hero:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, var(--paper) 1%, #f5efdfef 30%, #f5efdf08 62%),
    linear-gradient(0deg, var(--paper), transparent 18%);
}
.hero-copy {
  padding: 90px 40px 64px;
  max-width: 620px;
}
.eyebrow {
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3.4px;
  margin: 0 0 23px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(44px, 5vw, 70px);
  line-height: 1.26;
  letter-spacing: 2px;
  margin: 0 0 24px;
  font-weight: 800;
}
.hero h1 em {
  font-style: normal;
  color: var(--red);
}
.hero-desc {
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 1px;
  color: #686557;
  margin-bottom: 28px;
}
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  min-height: 53px;
  padding: 14px 26px;
  text-decoration: none;
  border: 1px solid var(--red);
  background: var(--red);
  color: #fff6e5;
  font-size: 15px;
  letter-spacing: 2px;
  border-radius: 2px;
  transition:
    background 0.18s,
    transform 0.18s;
}
.primary-button:hover {
  background: #70271f;
  transform: translateY(-1px);
}
.secondary-button {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
  letter-spacing: 1px;
}
.secondary-button:hover {
  background: #e8dfcc;
}
.hero-meta {
  display: flex;
  gap: 20px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 19px;
  letter-spacing: 1px;
}
.hero-note {
  font-size: 11px;
  color: var(--muted);
  margin: 15px 0 0;
}
.resume-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.restart-small {
  border: 0;
  background: none;
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 10px 0;
  font-size: 12px;
}
.hero-mark {
  position: absolute;
  right: 32px;
  top: 40px;
  writing-mode: vertical-rl;
  letter-spacing: 5px;
  font-family: var(--serif);
  font-size: 13px;
  color: #796748;
}
.intro-band {
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 0;
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 42px;
  border-bottom: 1px solid var(--line);
}
.intro-item {
  display: flex;
  align-items: center;
  gap: 18px;
}
.intro-symbol {
  font-family: var(--serif);
  font-size: 36px;
  color: var(--gold);
  line-height: 1;
}
.intro-item h3 {
  font-family: var(--serif);
  font-size: 17px;
  margin: 0 0 7px;
  letter-spacing: 1px;
}
.intro-item p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.7;
}
.characters-section {
  max-width: 1160px;
  margin: 56px auto 70px;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 22px;
}
.section-heading h2 {
  font-family: var(--serif);
  font-size: 28px;
  margin: 0;
  letter-spacing: 2px;
}
.section-heading .eyebrow {
  margin-bottom: 10px;
}
.character-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-left: 1px solid var(--line);
}
.mini-character {
  padding: 24px 12px;
  border: 1px solid var(--line);
  border-left: 0;
  text-align: center;
  background: #fff9ed55;
}
.character-glyph {
  font-family: var(--serif);
  font-size: 38px;
  color: var(--red);
  width: 65px;
  height: 65px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  background: #e8decb;
  border-radius: 50%;
  border: 1px solid #c7b696;
  box-shadow: inset 0 0 0 5px var(--paper);
}
.mini-character h3 {
  font-family: var(--serif);
  margin: 0 0 8px;
  font-size: 18px;
}
.mini-character p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
.site-footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px 0 30px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.site-footer > span {
  font-family: var(--serif);
  font-size: 13px;
  white-space: nowrap;
}
.site-footer p {
  margin: 0;
  text-align: right;
}
.quiz-shell {
  max-width: 760px;
  margin: 52px auto 80px;
  min-height: 560px;
  padding: 0 24px;
}
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--muted);
}
.quiz-top strong {
  color: var(--red);
  font-size: 23px;
  font-family: var(--serif);
  margin-right: 4px;
}
.progress {
  height: 3px;
  background: #ded4c0;
  margin-bottom: 50px;
}
.progress-fill {
  height: 100%;
  background: var(--red);
  transition: width 0.25s;
}
.chapter {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 14px;
}
.question-title {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.65;
  margin: 0 0 12px;
  font-weight: 600;
}
.question-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0 0 30px;
}
.options {
  display: grid;
  gap: 12px;
}
.option {
  border: 1px solid var(--line);
  background: #fffaf04d;
  min-height: 62px;
  text-align: left;
  padding: 15px 20px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 17px;
  line-height: 1.5;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.option:hover {
  border-color: var(--gold);
  background: #ede4d2;
}
.option[aria-checked="true"] {
  border-color: var(--red);
  background: #8c33270b;
}
.option-key {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 12px;
  color: var(--muted);
}
.option[aria-checked="true"] .option-key {
  color: var(--paper);
  background: var(--red);
  border-color: var(--red);
}
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
}
.quiz-save-note {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 29px;
}
.result-shell {
  max-width: 1050px;
  margin: 50px auto 70px;
  padding: 0 28px;
}
.result-heading {
  text-align: center;
}
.result-heading .eyebrow {
  margin-bottom: 15px;
}
.result-heading > p:last-child {
  font-size: 13px;
  color: var(--muted);
}
.result-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 32px 0;
  border: 1px solid #bdac8e;
  outline: 1px solid #d5c6aa;
  outline-offset: 5px;
  background: #fff9ec77;
  position: relative;
}
.result-person {
  padding: 40px;
  border-right: 1px solid var(--line);
  background: radial-gradient(
    ellipse at bottom left,
    #ad742520,
    transparent 65%
  );
}
.result-kicker {
  font-size: 12px;
  color: var(--red);
  letter-spacing: 2px;
}
.result-person h1 {
  font-family: var(--serif);
  font-size: 66px;
  margin: 12px 0 8px;
  letter-spacing: 8px;
  font-weight: 800;
}
.work {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 25px;
}
.result-quote {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.6;
  color: var(--red);
  margin: 0 0 24px;
}
.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag {
  border: 1px solid #c7b696;
  padding: 6px 10px;
  font-size: 11px;
  color: #736044;
}
.radar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px 14px;
}
.radar-wrap canvas {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
}
.radar-caption {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 12px;
}
.result-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 42px;
  margin: 45px 0 30px;
}
.reading h2 {
  font-family: var(--serif);
  font-size: 20px;
  margin: 0 0 13px;
  color: var(--ink);
  letter-spacing: 2px;
}
.reading p {
  font-size: 14px;
  line-height: 1.95;
  color: #696456;
  margin: 0;
}
.reading.wide {
  grid-column: 1/-1;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.second-match {
  padding: 18px 22px;
  background: #e9e1cf80;
  display: flex;
  gap: 18px;
  align-items: center;
}
.second-match > span {
  font-size: 28px;
  font-family: var(--serif);
  color: var(--gold);
}
.second-match p {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
.second-match strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
}
.result-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 35px;
  flex-wrap: wrap;
}
.result-disclaimer {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.9;
  margin-top: 24px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  width: min(850px, calc(100vw - 32px));
  max-height: 88dvh;
  padding: 30px;
  box-shadow: 0 20px 100px #201e1740;
}
dialog::backdrop {
  background: #29251dcc;
  backdrop-filter: blur(5px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 15px;
  margin-bottom: 25px;
}
.dialog-head .eyebrow {
  margin-bottom: 12px;
}
.dialog-head h2 {
  font-family: var(--serif);
  font-size: 25px;
  margin: 0;
}
.icon-button {
  border: 1px solid var(--line);
  background: none;
  color: var(--muted);
  width: 32px;
  height: 32px;
  font-size: 24px;
  flex-shrink: 0;
}
.atlas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.atlas-card {
  border: 1px solid var(--line);
  padding: 20px;
  background: #fff8e83d;
}
.atlas-card h3 {
  font-family: var(--serif);
  font-size: 23px;
  margin: 0 0 9px;
}
.atlas-card .work {
  margin-bottom: 12px;
}
.atlas-card p:last-child {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}
.small-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin: 20px 0 0;
}
#share-dialog {
  max-width: 480px;
}
#share-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}
#share-dialog .primary-button {
  width: 100%;
  margin-top: 15px;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 24px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  max-width: 90vw;
  text-align: center;
}
#toast.visible {
  opacity: 1;
}
.fade-in {
  animation: appear 0.35s ease-out;
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (min-width: 1500px) {
  .hero {
    min-height: 660px;
  }
  .hero-copy {
    padding-top: 110px;
  }
}
@media (max-width: 1000px) {
  .intro-band,
  .characters-section,
  .site-footer {
    margin-left: 30px;
    margin-right: 30px;
  }
  .intro-band {
    gap: 20px;
  }
  .intro-item {
    gap: 12px;
  }
  .hero-art {
    inset: 0 0 0 25%;
    width: 75%;
    object-position: 45%;
  }
  .hero-copy {
    padding-left: 30px;
  }
  .hero h1 {
    font-size: 55px;
  }
  .character-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .mini-character:nth-child(n + 4) {
    border-top: 0;
  }
  .site-header {
    padding: 24px 30px;
  }
}
@media (max-width: 600px) {
  .site-header {
    padding: 20px 22px;
  }
  .brand {
    font-size: 21px;
    gap: 11px;
  }
  .seal {
    width: 29px;
    height: 32px;
    font-size: 23px;
  }
  .brand-sub {
    display: none;
  }
  .text-button {
    font-size: 12px;
  }
  .hero {
    min-height: 720px;
  }
  .hero-art {
    inset: auto 0 0;
    width: 100%;
    height: 68%;
    object-position: 50% 80%;
  }
  .hero:after {
    background: linear-gradient(
      180deg,
      var(--paper) 0%,
      #f5efdfed 27%,
      #f5efdf55 47%,
      transparent 63%,
      var(--paper) 100%
    );
  }
  .hero-copy {
    padding: 43px 24px 300px;
    max-width: 100%;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 2.6px;
    margin-bottom: 18px;
  }
  .hero h1 {
    font-size: 43px;
    line-height: 1.3;
    letter-spacing: 1px;
    margin-bottom: 17px;
  }
  .hero-desc {
    font-size: 13px;
    line-height: 1.85;
    margin-bottom: 20px;
  }
  .hero-mark {
    top: auto;
    bottom: 95px;
    right: 18px;
    font-size: 11px;
    letter-spacing: 4px;
  }
  .hero-meta {
    font-size: 10px;
    gap: 16px;
    margin-top: 14px;
  }
  .hero-note {
    font-size: 10px;
  }
  .primary-button,
  .secondary-button {
    min-height: 50px;
    font-size: 14px;
  }
  .intro-band {
    grid-template-columns: 1fr;
    gap: 23px;
    padding: 25px 0;
    margin: 0 24px;
  }
  .intro-item {
    gap: 19px;
  }
  .intro-symbol {
    font-size: 29px;
    min-width: 40px;
  }
  .intro-item h3 {
    font-size: 16px;
  }
  .characters-section {
    margin: 35px 24px 45px;
  }
  .section-heading h2 {
    font-size: 24px;
  }
  .section-heading {
    align-items: center;
  }
  .character-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .mini-character {
    padding: 20px 7px;
  }
  .character-glyph {
    width: 49px;
    height: 49px;
    font-size: 29px;
    margin-bottom: 15px;
  }
  .mini-character h3 {
    font-size: 16px;
  }
  .mini-character p {
    font-size: 10px;
  }
  .site-footer {
    display: block;
    margin: 0 24px;
    padding: 20px 0;
  }
  .site-footer p {
    text-align: left;
    margin-top: 9px;
    font-size: 10px;
  }
  .quiz-shell {
    margin: 30px auto 50px;
    padding: 0 22px;
    min-height: 550px;
  }
  .progress {
    margin-bottom: 34px;
  }
  .question-title {
    font-size: 24px;
  }
  .question-hint {
    margin-bottom: 24px;
  }
  .option {
    padding: 14px 15px;
    min-height: 61px;
    font-size: 14px;
    gap: 13px;
  }
  .quiz-nav {
    gap: 15px;
  }
  .quiz-nav .primary-button {
    gap: 15px;
  }
  .result-shell {
    padding: 0 22px;
    margin: 34px auto 45px;
  }
  .result-board {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }
  .result-person {
    padding: 28px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .result-person h1 {
    font-size: 56px;
  }
  .result-quote {
    font-size: 22px;
    margin-bottom: 18px;
  }
  .radar-wrap {
    padding: 12px 10px;
  }
  .radar-wrap canvas {
    max-width: 300px;
  }
  .result-content {
    grid-template-columns: 1fr;
    gap: 26px;
    margin-top: 34px;
  }
  .reading.wide {
    grid-column: auto;
  }
  .reading p {
    font-size: 13px;
  }
  .result-actions {
    gap: 10px;
  }
  .result-actions button {
    flex: 1;
    padding: 13px 14px;
    gap: 8px;
    font-size: 13px;
  }
  .result-heading > p:last-child {
    font-size: 12px;
  }
  .atlas-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .atlas-card {
    padding: 15px 12px;
  }
  .atlas-card h3 {
    font-size: 21px;
  }
  .atlas-card p:last-child {
    font-size: 11px;
  }
  dialog {
    padding: 22px 18px;
  }
  .dialog-head h2 {
    font-size: 21px;
  }
  .second-match {
    padding: 16px;
  }
  .result-disclaimer {
    text-align: left;
  }
  .result-heading .eyebrow {
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
