:root {
  color-scheme: light;
  --paper: #f6eddd;
  --panel: #f9f0df;
  --ink: #211811;
  --wine: #681e27;
  --dark-wine: #4c151c;
  --line: #865458;
  --soft-line: #c1a79b;
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", SimSun, serif;
  --sans: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { max-width: 1320px; margin: 0 auto; padding: 0 28px 32px; }
button { font: inherit; cursor: pointer; }
button:focus-visible, label:has(input:focus-visible) { outline: 2px solid var(--wine); outline-offset: 4px; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }
.masthead {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 20px 4px 16px;
  border-bottom: 2px solid var(--wine);
  margin-bottom: 18px;
}
.masthead h1 { color: var(--wine); font-size: clamp(32px, 5vw, 52px); white-space: nowrap; letter-spacing: .08em; }
.masthead::before { content: ""; order: 1; flex: 1; height: 5px; border-block: 1px solid var(--wine); }
#case-nav { order: 2; display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: 7px; }
.case-tab {
  display: flex;
  gap: .45em;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: transparent;
  font-weight: 700;
  white-space: nowrap;
}
.case-tab[aria-current="step"], .primary { background: var(--wine); color: #fff8ec; border-color: var(--wine); }
.case-tab:hover:not([aria-current="step"]), .secondary:hover { background: #ebdcca; }
.case-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: stretch; gap: 14px; }
.dossier, .decision, .summary { border: 1px solid var(--line); background: var(--panel); }
.dossier { padding: 5px; }
.cover { display: block; width: 100%; height: auto; aspect-ratio: 2.14; object-fit: cover; object-position: center 51%; background: #523421; }
.dossier-body { padding: 13px 15px 17px; }
#case-title { font-size: clamp(29px, 4.4vw, 54px); line-height: 1.12; letter-spacing: .03em; border-bottom: 3px double var(--wine); padding-bottom: .18em; margin-bottom: .28em; }
#story { font-size: 17px; font-weight: 600; line-height: 1.7; }
.clue-heading { display: flex; align-items: center; margin: 17px 0 8px; }
.clue-heading::after { content: ""; flex: 1; border-top: 1px solid var(--wine); }
.clue-heading h3 { padding: 5px 15px 5px 10px; color: #fff8ec; background: var(--wine); font-size: 19px; border-radius: 0 8px 0 0; }
#clues { border: 1px solid var(--line); margin: 0; padding: 0; list-style: none; }
#clues li { display: flex; align-items: baseline; gap: 9px; padding: 9px 10px; font: 14px/1.55 var(--sans); }
#clues li + li { border-top: 1px solid var(--soft-line); }
.clue-number { flex: 0 0 21px; text-align: center; color: #fff8ec; background: var(--wine); font: 700 15px/1.35 var(--serif); }
.decision { padding: clamp(17px, 2.5vw, 32px); }
#answer-form { display: flex; flex-direction: column; min-height: 100%; }
#answer-form:has(.actions[hidden]) { min-height: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
#question { border-bottom: 3px double var(--wine); width: 100%; padding: 0 0 .42em; font-size: clamp(24px, 3.4vw, 46px); font-weight: 800; line-height: 1.28; }
#choices { display: grid; gap: 14px; padding-top: clamp(16px, 3vw, 34px); }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  font: 600 15px/1.5 var(--sans);
  cursor: pointer;
}
.choice input { flex: 0 0 auto; width: 19px; height: 19px; margin: 0; accent-color: var(--wine); }
.choice:has(input:checked) { background: #ecd7cb; }
.choice.correct { border: 2px solid #406047; background: #e4eadb; }
.choice.incorrect { border: 2px solid var(--wine); }
.choice-tag { margin-left: auto; font-size: 12px; white-space: nowrap; }
.actions { display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px; margin-top: auto; padding-top: 24px; }
.primary, .secondary { padding: 9px 12px; min-height: 48px; border: 1px solid var(--wine); border-radius: 3px; font-size: 19px; font-weight: 700; }
.primary:hover:not(:disabled) { background: var(--dark-wine); }
.primary:disabled { opacity: .55; }
.secondary { color: var(--wine); background: transparent; }
.hint, .result { margin-top: 16px; padding: 11px 12px; border-left: 3px solid var(--wine); background: #eee1ce; font: 14px/1.65 var(--sans); }
.result h3 { font-family: var(--serif); font-size: 22px; }
.result p { margin: 5px 0 12px; }
.result button { min-width: 116px; }
.summary { text-align: center; max-width: 600px; margin: 48px auto; padding: 36px 16px; }
.summary h2 { font-size: clamp(26px, 5vw, 44px); }
.summary p { margin: 12px 0 18px; font-family: var(--sans); }
.noscript { margin: 12px 0; }
@media (max-width: 1050px) {
  .masthead { gap: 14px; }
  .case-tab .tab-title { display: none; }
  .case-tab { min-width: 44px; }
}
@media (max-width: 700px) {
  body { padding: 0 12px 22px; }
  .masthead { flex-wrap: wrap; padding: 12px 2px 11px; margin-bottom: 11px; gap: 9px; }
  #case-nav { flex: 0 0 100%; }
  .case-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cover { aspect-ratio: 2.6; }
  .dossier-body { padding: 10px 9px 11px; }
  #story { font-size: 16px; }
  .choice { min-height: 52px; }
  #choices { gap: 8px; }
  .actions { padding-top: 15px; }
}

.case-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 13px;
  color: var(--wine);
  font: 700 13px/1.4 var(--sans);
}
.case-progress progress {
  appearance: none;
  width: min(33%, 200px);
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: #e7d4c4;
}
.case-progress progress::-webkit-progress-bar { background: #e7d4c4; }
.case-progress progress::-webkit-progress-value { background: var(--wine); }
.case-progress progress::-moz-progress-bar { background: var(--wine); }
.case-tab.is-complete:not([aria-current="step"]) { color: #395944; background: #e7eadc; }
.mobile-jump { display: none; }
#case-title, #question, #verdict { scroll-margin-block-start: 14px; }
.case-review { list-style: none; padding: 0; margin: 20px auto; max-width: 410px; }
.case-review li + li { border-top: 0; }
.case-review li { border: 1px solid var(--soft-line); }
.review-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 45px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: start;
  font: 600 15px/1.4 var(--sans);
}
.review-button:hover { background: #ebdcca; }
.review-button span:last-child { color: var(--wine); font-size: 13px; flex-shrink: 0; }
@media (min-width: 701px) {
  .decision { align-self: start; }
  #answer-form { min-height: 0; }
}
@media (max-width: 700px) {
  .case-progress { margin-bottom: 9px; }
  .cover { max-height: 124px; }
  .mobile-jump { display: block; margin-top: 10px; width: 100%; font-size: 16px; }
  .result .primary { width: 100%; }
}

.site-footer {
  margin: 22px 4px 0;
  color: #58443b;
  font: 13px/1.6 var(--sans);
}
.site-footer summary { cursor: pointer; }
.site-footer p { margin: 7px 0; }
