:root {
  color-scheme: light;
  --paper: #f6f2e8;
  --ivory: #fcf9f0;
  --ink: #192b26;
  --forest: #224238;
  --moss: #55645a;
  --line: #d9d2c1;
  --red: #a23c2c;
  --song: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(ellipse at 82% 11%, #e8e4d4 0, transparent 43%),
    repeating-linear-gradient(115deg, #49381802 0 1px, transparent 1px 5px),
    var(--paper);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, .option:has(input:focus-visible) {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}
h1[tabindex="-1"]:focus { outline: none; }

.site-shell {
  width: min(100% - 96px, 1192px);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}
.site-header, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header { min-height: 88px; border-bottom: 1px solid var(--line); }
.site-footer { min-height: 66px; border-top: 1px solid var(--line); color: var(--moss); font-size: .75rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 700 1.27rem var(--song);
  letter-spacing: .16em;
}
.brand-seal {
  display: grid;
  width: 36px;
  aspect-ratio: 1;
  place-items: center;
  background: var(--red);
  border-radius: 5px 3px 5px 3px;
  outline: 1px solid #ffffff7d;
  outline-offset: -4px;
  color: var(--ivory);
  font-size: 1.09rem;
  letter-spacing: 0;
}
.edition { color: var(--moss); font-size: .79rem; letter-spacing: .12em; }
main { flex: 1; display: grid; align-items: center; }
.view { animation: enter .35s ease both; }
@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(30px, 5vw, 78px);
  padding-block: clamp(32px, 5.5vw, 75px);
}
.hero-content { padding-left: clamp(0px, 2vw, 21px); }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--red);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .16em;
}
.eyebrow > span:first-child { width: 24px; height: 1px; background: currentColor; flex: none; }
.hero h1 {
  margin: 23px 0 24px;
  font: 700 clamp(2rem, 3.6vw, 3.35rem)/1.24 var(--song);
  letter-spacing: -.05em;
}
.hero h1 em { color: var(--forest); font-style: normal; }
.mobile-break { display: none; }
.hero-description {
  max-width: 29em;
  margin: 0 0 29px;
  color: var(--moss);
  font-size: clamp(.95rem, 1.32vw, 1.08rem);
  line-height: 1.9;
}
.primary, .quiet {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 49px;
  padding: 11px 17px;
  border-radius: 4px;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.4;
  transition: background .19s ease, border-color .19s ease, box-shadow .19s ease;
}
.primary { border: 1px solid var(--forest); background: var(--forest); color: #fff9ea; }
.primary:hover { background: #31584a; box-shadow: 0 5px 16px #1b392626; }
.primary:disabled { background: #e4ded1; border-color: #e4ded1; color: #5c5d53; box-shadow: none; }
.hero .primary { justify-content: space-between; min-width: 178px; min-height: 54px; padding-inline: 20px; }
.arrow { font-family: system-ui, sans-serif; font-size: 1.2em; line-height: 1; }
.quiet { border: 1px solid var(--line); background: transparent; color: var(--forest); }
.quiet:hover { border-color: #8d9a8c; background: #e8eddf; }
.quiet:disabled { opacity: .55; border-color: var(--line); background: transparent; }
.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  width: fit-content;
  margin: 32px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.hero-meta div { display: flex; flex-direction: column; padding-inline: clamp(12px, 2.3vw, 25px); }
.hero-meta div:first-child { padding-left: 0; }
.hero-meta div + div { border-left: 1px solid var(--line); }
.hero-meta dd { order: -1; margin: 0 0 5px; font: 700 1.32rem/1.2 var(--song); }
.hero-meta dt { color: var(--moss); font-size: .72rem; }
.hero-art {
  min-width: 0;
  margin: 0;
  padding: 9px;
  border: 1px solid #c5b69c;
  background: #f8f1e2;
  box-shadow: 0 16px 48px #4b3f2720;
}
.art-frame { position: relative; aspect-ratio: 1.01; overflow: hidden; background: #d4d8c5; }
.art-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 51%; }
.art-inscription {
  position: absolute;
  inset: 8% auto auto 6%;
  padding: .55em .38em .35em;
  writing-mode: vertical-rl;
  font: 700 clamp(.84rem, 1.4vw, 1.12rem)/1.3 var(--song);
  letter-spacing: .28em;
  color: var(--ink);
  background: #f8f0dddc;
  border: 1px solid #8d7a5d70;
}
.art-seal {
  position: absolute;
  bottom: 6%;
  right: 6%;
  padding: .36em .47em;
  border: 1px solid #fff7de9c;
  outline: 2px solid var(--red);
  background: var(--red);
  color: #fff3da;
  font: 700 .83rem/1.1 var(--song);
}

.quiz { width: min(100%, 680px); margin: 43px auto 52px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.question-count { margin: 0; color: var(--moss); font: 700 1rem var(--song); font-variant-numeric: tabular-nums; }
#question-number { color: var(--ink); font-size: 1.36rem; }
progress {
  display: block;
  width: 100%;
  height: 5px;
  margin: 13px 0 19px;
  appearance: none;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #e2dbcb;
  color: var(--forest);
}
progress::-webkit-progress-bar { background: #e2dbcb; }
progress::-webkit-progress-value { background: var(--forest); border-radius: 10px; transition: width .25s ease; }
progress::-moz-progress-bar { background: var(--forest); border-radius: 10px; }
.question-paper {
  padding: clamp(19px, 4vw, 40px);
  border: 1px solid var(--line);
  background: var(--ivory);
  box-shadow: 0 12px 40px #40382212;
}
.question-paper fieldset { min-width: 0; margin: 0; padding: 0; border: 0; animation: enter .26s ease both; }
#question-title { margin: 0 0 23px; font: 700 clamp(1.35rem, 3.4vw, 2rem)/1.5 var(--song); }
.options { display: grid; gap: 10px; }
.option {
  position: relative;
  display: grid;
  grid-template-columns: 33px 1fr 15px;
  gap: 11px;
  align-items: center;
  min-height: 57px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f8f5ec;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.option:hover { border-color: #8d9a8c; }
.option:has(input:checked) { border-color: var(--forest); background: #e9eee3; }
.option input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.option-letter {
  display: grid;
  place-items: center;
  width: 30px;
  aspect-ratio: 1;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--forest);
  font: 700 .96rem var(--song);
}
.option input:checked + .option-letter { background: var(--forest); color: var(--ivory); border-color: var(--forest); }
.option-text { font-size: .94rem; line-height: 1.55; }
.option-dot { width: 14px; height: 14px; border: 1px solid #808d80; border-radius: 50%; }
.option input:checked ~ .option-dot { border-color: var(--forest); background: radial-gradient(circle, var(--forest) 0 42%, transparent 46%); }
.question-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

.results { width: min(100%, 820px); margin: 36px auto 42px; }
.result-card {
  --result-accent: #294b3e;
  --result-tint: #e9eee1;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  min-height: 355px;
  padding: clamp(24px, 5.4vw, 59px);
  border: 1px solid #bdb39c;
  outline: 1px solid #bdb39c;
  outline-offset: -8px;
  background: var(--ivory);
}
.result-card[data-profile="L"] { --result-accent: #853b44; --result-tint: #f0e2e1; }
.result-card[data-profile="E"] { --result-accent: #6d4b33; --result-tint: #eee4d4; }
.result-card[data-profile="J"] { --result-accent: #80392e; --result-tint: #f1e0d6; }
.result-card[data-profile="I"] { --result-accent: #394b74; --result-tint: #e3e8f1; }
.result-card[data-profile="A"] { --result-accent: #454a52; --result-tint: #e7e8e9; }
.result-card[data-profile="F"] { --result-accent: #53602c; --result-tint: #e9ecd8; }
.result-card[data-profile="C"] { --result-accent: #30606a; --result-tint: #dfebec; }
.result-art {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, var(--ivory) 16%, #fcf9f0f2 35%, #fcf9f065 77%, #fcf9f04a),
    url("ink-landscape.jpg") right 58% / 79% auto no-repeat,
    var(--result-tint);
}
.result-identity { align-self: center; max-width: 35rem; }
.result-role { margin: 23px 0 2px; color: var(--result-accent); font-size: .81rem; font-weight: 700; letter-spacing: .17em; }
.result-name { margin: 0; color: var(--result-accent); font: 700 clamp(3.05rem, 9.5vw, 5.6rem)/1.16 var(--song); letter-spacing: .025em; }
.result-quote { margin: 14px 0 19px; font: 700 clamp(1.05rem, 2.8vw, 1.37rem)/1.6 var(--song); }
.result-traits { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 0; list-style: none; }
.result-traits li { padding: 5px 8px; border: 1px solid var(--result-accent); background: var(--result-tint); border-radius: 3px; color: var(--result-accent); font-size: .75rem; }
.result-seal {
  position: absolute;
  right: clamp(16px, 3vw, 29px);
  bottom: clamp(16px, 3vw, 29px);
  padding: .37em .49em;
  border: 1px solid var(--result-accent);
  box-shadow: inset 0 0 0 2px var(--ivory), inset 0 0 0 3px var(--result-accent);
  background: var(--ivory);
  color: var(--result-accent);
  font: 700 .83rem/1.18 var(--song);
}
.result-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.result-details section { padding: 17px; border: 1px solid var(--line); background: #fcf9f0a8; }
.result-details h2 { margin: 0 0 8px; color: var(--forest); font: 700 1.12rem/1.3 var(--song); }
.result-details p { margin: 0; color: var(--moss); font-size: .88rem; line-height: 1.7; }
.result-note, .share-tip { margin: 13px 0 0; color: var(--moss); font-size: .76rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }

dialog {
  width: min(100% - 24px, 540px);
  max-height: calc(100% - 24px);
  overflow: auto;
  padding: clamp(12px, 3.5vw, 22px);
  border: 1px solid #bdb39c;
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop { background: #162721aa; }
.share-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.share-top h2 { margin: 0; font: 700 1.15rem var(--song); }
.close-share { min-height: 40px; padding: 6px 12px; font-size: .8rem; }
dialog .result-card { aspect-ratio: 4 / 5; min-height: 0; padding: 26px 20px 50px; }
dialog .result-art {
  background:
    linear-gradient(0deg, var(--ivory) 6%, #fcf9f0fc 30%, #fcf9f0bb 58%, #fcf9f000 94%),
    url("ink-landscape.jpg") center top / cover no-repeat,
    var(--result-tint);
}
dialog .result-identity { align-self: flex-end; }
dialog .result-name { font-size: clamp(2.4rem, 9vw, 4.8rem); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
.noscript-note { color: var(--red); }

@media (max-width: 1000px) {
  .mobile-break { display: initial; }
  .hero h1 { letter-spacing: -.035em; }
}
@media (max-width: 680px) {
  .site-shell { width: calc(100% - 32px); }
  .site-header { min-height: 63px; }
  .site-footer { min-height: 53px; }
  .brand { font-size: 1rem; gap: 8px; white-space: nowrap; }
  .brand-seal { width: 29px; font-size: .87rem; }
  .edition { font-size: .69rem; letter-spacing: .03em; text-align: right; }
  .hero { grid-template-columns: 1fr; gap: 23px; padding-block: 25px; }
  .hero-content { padding-left: 0; }
  .hero h1 { margin: 13px 0; font-size: clamp(1.7rem, 7.1vw, 2.9rem); }
  .mobile-break { display: none; }
  .hero-description { margin-bottom: 16px; }
  .hero .primary { min-height: 48px; }
  .hero-meta { margin-top: 19px; padding-top: 12px; }
  .hero-meta dd { font-size: 1.13rem; }
  .hero-art { padding: 6px; }
  .art-frame { aspect-ratio: 1.68; }
  .art-frame img { object-position: 50% 42%; }
  .quiz { margin: 22px auto 29px; }
  #question-title { margin-bottom: 15px; }
  .question-nav { margin-top: 16px; }
  .option { min-height: 55px; padding: 8px; gap: 9px; grid-template-columns: 30px 1fr 14px; }
  .option-text { font-size: .9rem; }
  .results { margin: 22px auto 29px; }
  .result-card { min-height: 330px; padding-bottom: 52px; }
  .result-art { background-size: auto, cover; }
  .result-details { grid-template-columns: 1fr; gap: 8px; }
  .result-details section { padding: 13px; }
}
@media (max-width: 355px) {
  .hero h1 { font-size: 1.6rem; }
  .option { grid-template-columns: 27px 1fr 14px; }
  .option-letter { width: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
