:root {
  color-scheme: light;
  --ink: #171916;
  --muted: #70746d;
  --paper: #f1efe8;
  --white: #fbfaf6;
  --line: #c8c6bc;
  --orange: #d83a24;
  --orange-dark: #9f2717;
  --cyan: #2e918d;
  --yellow: #f7ce54;
  --night: #20282b;
  --green: #4f765e;
  --red: #a43c32;
  --shadow: 0 18px 42px rgb(24 27 24 / 10%);
}

* { box-sizing: border-box; }

html {
  min-width: 0;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  letter-spacing: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgb(23 25 22 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(23 25 22 / 4%) 1px, transparent 1px);
  background-size: 24px 24px;
}

button,
input { font: inherit; }

button { color: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.app-shell {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 44px;
  gap: 24px;
  align-items: center;
  min-height: 68px;
  border-bottom: 2px solid var(--ink);
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 50px;
  height: 50px;
  overflow: hidden;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 4px;
  transform: rotate(-3deg);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand small { display: block; }

.brand strong {
  font-size: 20px;
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.topbar-progress {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 12px;
  min-width: 190px;
  align-items: baseline;
}

.topbar-progress > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.topbar-progress > strong {
  justify-self: end;
  font: 900 17px "Arial Narrow", Arial, sans-serif;
}

.progress-track,
.timer-track {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  background: #d6d3c9;
}

.progress-track span,
.timer-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--orange);
  transition: width 400ms ease;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--white);
  border-color: var(--ink);
}

.icon-button svg,
.action-button svg,
.share-button svg,
.text-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button.muted .sound-wave { opacity: 0; }

.case-strip {
  display: grid;
  grid-template-columns: repeat(10, minmax(72px, 1fr));
  gap: 6px;
  margin: 14px 0 30px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.case-tab {
  position: relative;
  display: grid;
  min-width: 76px;
  min-height: 58px;
  padding: 8px;
  align-content: space-between;
  text-align: left;
  background: rgb(251 250 246 / 66%);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}

.case-tab:hover:not(:disabled),
.case-tab.active {
  background: var(--white);
  border-color: var(--ink);
}

.case-tab.active { box-shadow: inset 0 -4px var(--orange); }

.case-tab:disabled {
  color: #a2a49d;
  cursor: not-allowed;
}

.case-tab .tab-number {
  font: 900 16px "Arial Narrow", Arial, sans-serif;
}

.case-tab .tab-title {
  overflow: hidden;
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-tab.solved::after {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  content: "";
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 30px;
  align-items: start;
}

.case-file { min-width: 0; }

.case-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow,
.section-label,
.result-kicker {
  display: block;
  color: var(--orange-dark);
  font-size: 10px;
  font-weight: 900;
}

.case-heading h1 {
  margin: 7px 0 0;
  font-family: Georgia, "Microsoft YaHei", serif;
  font-size: 48px;
  line-height: 1.05;
}

.case-status {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 900;
  border: 2px solid var(--orange);
  transform: rotate(3deg);
}

.case-status.closed {
  color: var(--green);
  border-color: var(--green);
}

.case-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  min-height: 178px;
  margin-bottom: 18px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 6px solid var(--ink);
  border-radius: 0 5px 5px 0;
  box-shadow: var(--shadow);
}

.brief-copy {
  padding: 25px 28px;
}

.brief-copy p {
  max-width: 680px;
  margin: 12px 0 15px;
  color: #444942;
  font-size: 14px;
  line-height: 1.75;
}

.brief-copy > strong {
  display: inline-block;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 3px solid var(--yellow);
}

.case-art {
  display: grid;
  min-height: 178px;
  place-items: center;
  background: var(--night);
  border-left: 1px solid var(--ink);
}

.case-art svg {
  width: 84%;
  height: 150px;
}

.art-line {
  fill: none;
  stroke: #d9ddd9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.art-fill { fill: var(--orange); stroke: #111719; stroke-width: 2; }
.art-accent { fill: var(--yellow); stroke: #111719; stroke-width: 2; }
.art-muted { fill: #4a575a; stroke: #111719; stroke-width: 2; }
.art-cyan { fill: var(--cyan); stroke: #111719; stroke-width: 2; }

.evidence-stage {
  position: relative;
  min-height: 370px;
  padding: 24px;
  overflow: hidden;
  background: #242c2f;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: inset 0 -70px #1b2123;
}

.evidence-stage::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px);
  background-size: 100% 52px;
  content: "";
  pointer-events: none;
}

.stage-content {
  position: relative;
  z-index: 1;
}

.stage-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  color: #d7dcda;
}

.stage-title strong { font-size: 13px; }

.stage-title span {
  color: #899590;
  font: 10px monospace;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.evidence-card,
.suspect-card,
.manuscript-card,
.dream-fragment,
.narrative-button {
  position: relative;
  min-width: 0;
  min-height: 142px;
  padding: 15px;
  color: var(--ink);
  text-align: left;
  background: #e7e3d7;
  border: 1px solid #0f1314;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease;
}

.evidence-card:hover,
.suspect-card:hover,
.manuscript-card:hover,
.dream-fragment:hover,
.narrative-button:hover { transform: translateY(-3px); }

.evidence-card.inspected,
.suspect-card.inspected,
.manuscript-card.inspected,
.dream-fragment.inspected,
.narrative-button.inspected {
  background: #f8f5ea;
  box-shadow: inset 0 -5px var(--cyan);
}

.evidence-card .evidence-code,
.suspect-card .evidence-code,
.manuscript-card .evidence-code {
  display: block;
  margin-bottom: 13px;
  color: var(--orange-dark);
  font: 900 9px monospace;
}

.evidence-card strong,
.suspect-card strong,
.manuscript-card strong,
.dream-fragment strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.evidence-card p,
.suspect-card p,
.manuscript-card p,
.dream-fragment p,
.narrative-button p {
  margin: 0;
  color: #555a53;
  font-size: 11px;
  line-height: 1.55;
}

.evidence-card .reveal,
.suspect-card .reveal,
.manuscript-card .reveal,
.dream-fragment .reveal {
  display: block;
  margin-top: 11px;
  padding-top: 9px;
  color: var(--orange-dark);
  font-size: 10px;
  font-weight: 800;
  border-top: 1px dashed #99988e;
  opacity: 0;
}

.inspected .reveal { opacity: 1; }

.blank-sheet {
  color: transparent;
  background-image: repeating-linear-gradient(transparent 0 20px, #c8c5b9 21px);
  user-select: none;
}

.blank-sheet::after {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: var(--red);
  font: 900 11px monospace;
  content: "内容缺失";
  transform: rotate(-4deg);
}

.timeline-layout {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  gap: 14px;
  align-items: stretch;
}

.room-panel {
  padding: 18px;
  color: var(--ink);
  background: #e6e2d7;
  border: 1px solid #0f1314;
}

.room-panel h3 { margin: 0 0 15px; font-size: 17px; }

.witness-button {
  width: 100%;
  min-height: 64px;
  padding: 10px;
  color: #dce1de;
  text-align: left;
  background: #313b3e;
  border: 0;
  border-left: 4px solid var(--cyan);
  cursor: pointer;
}

.witness-button + .witness-button { margin-top: 9px; }
.witness-button.inspected { border-left-color: var(--yellow); }
.witness-button small { display: block; margin-top: 5px; color: #9ca8a3; }

.broken-video {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: #bec6c2;
  font: 900 10px monospace;
  background: #111719;
  border: 1px solid #596367;
  cursor: pointer;
}

.broken-video.inspected { color: var(--orange); border-color: var(--orange); }

.signal-bars { display: flex; gap: 4px; align-items: flex-end; height: 55px; }
.signal-bars i { display: block; width: 7px; background: #667174; }
.signal-bars i:nth-child(1) { height: 20%; }
.signal-bars i:nth-child(2) { height: 76%; }
.signal-bars i:nth-child(3) { height: 38%; }
.signal-bars i:nth-child(4) { height: 92%; }
.signal-bars i:nth-child(5) { height: 50%; }

.analysis-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.analysis-sample {
  min-height: 255px;
  padding: 18px;
  background: #ebe7da;
  border: 1px solid #101516;
  cursor: pointer;
}

.analysis-sample.inspected { box-shadow: inset 0 -6px var(--cyan); }
.analysis-sample h3 { margin: 0 0 14px; font-size: 14px; }

.handwriting {
  min-height: 105px;
  padding: 12px;
  font-family: KaiTi, serif;
  line-height: 1.8;
  background: #f8f5ec;
  border: 1px solid #bbb8ad;
  transform: rotate(-1deg);
}

.match-meter { display: flex; gap: 4px; margin-top: 18px; }
.match-meter i { flex: 1; height: 8px; background: var(--green); }
.match-meter i:nth-child(n+4) { background: var(--red); }

.fingerprint {
  width: 92px;
  height: 112px;
  margin: 18px auto;
  border: 9px double #71776f;
  border-radius: 50% 50% 46% 46%;
  opacity: 0.35;
}

.safe-layout {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 18px;
}

.clue-scraps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.clue-scrap {
  min-height: 76px;
  padding: 13px;
  color: var(--ink);
  text-align: left;
  background: #e7e3d7;
  border: 1px solid #0f1314;
  cursor: pointer;
}

.clue-scrap:nth-child(2n) { transform: rotate(1deg); }
.clue-scrap.inspected { background: #fff9dc; }
.clue-scrap small { display: block; margin-top: 7px; color: #777c75; }

.safe-console {
  padding: 18px;
  background: #111719;
  border: 1px solid #657073;
}

.safe-console h3 { margin: 0 0 13px; color: #dbe1dd; font-size: 13px; }
.candidate-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.code-input {
  width: 100%;
  height: 48px;
  color: var(--yellow);
  font: 900 22px monospace;
  text-align: center;
  background: #273034;
  border: 1px solid #677276;
  border-radius: 2px;
}

.proof-button,
.trace-button,
.verify-button {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  background: var(--yellow);
  border: 1px solid #0f1314;
  cursor: pointer;
}

.proof-result {
  min-height: 38px;
  margin: 10px 0 0;
  color: #9da8a3;
  font-size: 10px;
  line-height: 1.5;
}

.suspect-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.suspect-card { min-height: 225px; }
.suspect-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  place-items: center;
  color: #dce2de;
  font: 900 20px Georgia, serif;
  background: #384346;
  border-radius: 50%;
}

.cycle-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 240px;
  gap: 20px;
  align-items: center;
}

.cycle-map {
  position: relative;
  min-height: 270px;
}

.cycle-node {
  position: absolute;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  color: var(--ink);
  font-weight: 900;
  background: #e5e1d5;
  border: 2px solid #101516;
  border-radius: 50%;
}

.cycle-node.active { background: var(--yellow); box-shadow: 0 0 0 6px rgb(247 206 84 / 18%); }
.cycle-node-a { top: 8px; left: calc(50% - 41px); }
.cycle-node-b { right: 12%; bottom: 15px; }
.cycle-node-c { bottom: 15px; left: 12%; }

.cycle-arrow {
  position: absolute;
  color: #899590;
  font: 900 29px Georgia, serif;
}

.arrow-ab { top: 83px; right: 24%; transform: rotate(50deg); }
.arrow-bc { right: 46%; bottom: 6px; }
.arrow-ca { top: 84px; left: 23%; transform: rotate(-50deg); }

.trace-log {
  min-height: 200px;
  padding: 17px;
  color: #d7deda;
  background: #111719;
  border: 1px solid #626d70;
}

.trace-log h3 { margin: 0 0 12px; font-size: 13px; }
.trace-log ol { min-height: 96px; margin: 0; padding-left: 20px; color: #9da9a4; font: 11px/1.7 monospace; }

.video-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) 0.8fr; gap: 16px; }
.video-monitor { padding: 14px; background: #0d1213; border: 1px solid #667174; }
.video-screen {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  background: #576064;
  filter: contrast(0.88);
}

.video-screen::before {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(0deg, rgb(255 255 255 / 5%) 0 1px, transparent 1px 4px);
  content: "";
}

.figure {
  position: absolute;
  bottom: 33px;
  width: 48px;
  height: 112px;
  background: #1b2022;
  border-radius: 45% 45% 14% 14%;
  filter: blur(5px);
}

.figure::before { position: absolute; top: -25px; left: 10px; width: 29px; height: 29px; background: #1b2022; border-radius: 50%; content: ""; }
.figure-left { left: 31%; transform: rotate(9deg); }
.figure-right { right: 28%; transform: rotate(-8deg); }
.video-time { position: absolute; top: 10px; right: 10px; color: #d9dedb; font: 10px monospace; }
.scrubber { width: 100%; margin-top: 14px; accent-color: var(--orange); }
.frame-status { color: #98a49f; font: 10px monospace; }

.narrative-list { display: grid; gap: 10px; }
.narrative-button { min-height: 128px; }
.narrative-button strong { display: block; margin-bottom: 9px; }

.ledger-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.ledger-paper { padding: 18px; color: var(--ink); background: #e9e5d9; border: 1px solid #101516; }
.ledger-paper h3 { margin: 0 0 14px; font-family: Georgia, serif; }
.ledger-table { width: 100%; border-collapse: collapse; font: 12px monospace; }
.ledger-table th,
.ledger-table td { padding: 9px 5px; border-bottom: 1px solid #b8b6ac; text-align: left; }
.ledger-table .missing { color: var(--red); font-weight: 900; }

.equation-box { padding: 18px; color: #d8dfdb; background: #101617; border: 1px solid #667174; }
.equation-box h3 { margin: 0 0 11px; font-size: 13px; }
.solution-row { display: grid; grid-template-columns: 28px repeat(3, 1fr); gap: 6px; align-items: center; margin-top: 8px; }
.solution-row input { min-width: 0; height: 38px; padding: 4px; color: var(--yellow); font: 900 13px monospace; text-align: center; background: #273034; border: 1px solid #687376; }
.equation-note { color: #98a49f; font: 10px/1.55 monospace; }

.dream-layout { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.dream-fragment { min-height: 225px; overflow: hidden; }
.dream-symbol { display: grid; height: 70px; margin: -15px -15px 14px; place-items: center; color: #dfe4e1; font: 900 28px Georgia, serif; background: #4b565a; }
.dream-fragment.inspected::after { position: absolute; right: 10px; bottom: 10px; padding: 4px 7px; color: var(--red); font-size: 9px; font-weight: 900; border: 2px solid var(--red); content: "无法验证"; transform: rotate(-5deg); }

.manuscript-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.manuscript-card { min-height: 125px; }
.final-message {
  display: none;
  margin-top: 15px;
  padding: 17px;
  color: var(--ink);
  font-family: Georgia, "Microsoft YaHei", serif;
  font-size: 16px;
  line-height: 1.7;
  background: var(--yellow);
  border: 2px solid var(--ink);
}
.final-message.visible { display: block; }

.verdict-section { margin-top: 22px; }

.verdict-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.verdict-heading h2 { margin: 6px 0 0; font-size: 18px; }

.evidence-progress {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.evidence-progress.ready { color: var(--green); }

.verdict-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.verdict-button {
  position: relative;
  min-height: 56px;
  padding: 11px 36px 11px 14px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}

.verdict-button::after {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 9px;
  height: 9px;
  border: 1px solid #878b84;
  border-radius: 50%;
  content: "";
  transform: translateY(-50%);
}

.verdict-button:hover { border-color: var(--ink); }
.verdict-button.wrong { color: var(--red); border-color: var(--red); }
.verdict-button.locked { color: #858981; background: #e8e5dc; }
.verdict-button:disabled { color: #989b94; background: #e8e5dc; cursor: not-allowed; }

.case-actions { display: flex; gap: 10px; margin-top: 16px; }

.action-button,
.share-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  font-size: 12px;
  font-weight: 900;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}

.action-button:hover,
.share-button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.action-button:active,
.share-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.action-button-quiet { background: var(--white); box-shadow: none; }

.investigation-rail { padding-top: 4px; }
.record-section { padding: 19px 0; border-bottom: 1px solid var(--line); }
.record-section:first-child { padding-top: 0; }

.countdown {
  display: block;
  margin: 8px 0 10px;
  font: 900 45px "Arial Narrow", Arial, sans-serif;
  line-height: 1;
}

.countdown.urgent { color: var(--orange-dark); }
.timer-track { margin-bottom: 8px; }
.timer-track span { width: 100%; background: var(--cyan); }
.timer-section p { margin: 0; color: var(--muted); font-size: 10px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; }
.metric { min-width: 0; padding: 0 8px; border-right: 1px solid var(--line); }
.metric:first-child { padding-left: 0; }
.metric:last-child { padding-right: 0; border-right: 0; }
.metric span,
.result-metrics small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.metric strong { font: 900 18px "Arial Narrow", Arial, sans-serif; }

.hint-list { display: grid; gap: 9px; margin-top: 12px; }
.hint-list p { margin: 0; padding-left: 11px; color: #444942; font-size: 11px; line-height: 1.6; border-left: 3px solid var(--yellow); }
.hint-list .empty-hint { padding-left: 0; color: var(--muted); border-left: 0; }
.archive-section blockquote { margin: 12px 0 0; color: #4d514c; font-family: Georgia, "Microsoft YaHei", serif; font-size: 14px; line-height: 1.6; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: min(370px, calc(100% - 40px));
  padding: 12px 15px;
  color: var(--white);
  font-size: 12px;
  background: var(--ink);
  border-left: 4px solid var(--orange);
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible { opacity: 1; transform: translateY(0); }

.coach-overlay {
  position: fixed;
  inset: 0;
  z-index: 84;
  background: rgb(23 25 22 / 18%);
  pointer-events: auto;
}

.coach-overlay[hidden],
.coachmark[hidden] { display: none; }

.coachmark {
  position: fixed;
  z-index: 90;
  width: min(350px, calc(100% - 28px));
  padding: 17px;
  color: var(--ink);
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: 7px 7px 0 var(--orange);
}

.coachmark::after {
  position: absolute;
  left: 28px;
  width: 16px;
  height: 16px;
  background: var(--white);
  content: "";
  transform: rotate(45deg);
}

.coachmark.arrow-up::after {
  top: -10px;
  border-top: 3px solid var(--ink);
  border-left: 3px solid var(--ink);
}

.coachmark.arrow-down::after {
  bottom: -10px;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}

.coach-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.coach-topline > span {
  color: var(--orange-dark);
  font: 900 10px monospace;
}

.coach-close { width: 30px; height: 30px; border-color: var(--line); }
.coach-close:hover { background: #ece9df; border-color: var(--ink); }
.coachmark > strong { display: block; font-size: 18px; }
.coachmark > p { margin: 9px 0 14px; color: #4b504a; font-size: 12px; line-height: 1.7; }

.coach-next {
  display: inline-flex;
  min-height: 40px;
  padding: 0 13px;
  align-items: center;
  gap: 7px;
  color: var(--white);
  font-size: 11px;
  font-weight: 900;
  background: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--orange);
  cursor: pointer;
}

.tour-highlight {
  position: relative;
  z-index: 86;
  outline: 4px solid var(--yellow);
  outline-offset: 5px;
}

.result-dialog {
  width: min(470px, calc(100% - 32px));
  padding: 32px;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 10px 10px 0 var(--ink);
  text-align: center;
}

.result-dialog::backdrop { background: rgb(18 21 19 / 68%); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 12px; right: 12px; }
.result-logo {
  display: block;
  width: 112px;
  height: 112px;
  margin: 18px auto;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 5px 5px 0 var(--orange);
  transform: rotate(-4deg);
}
.result-dialog h2 { margin: 0; font-family: Georgia, "Microsoft YaHei", serif; font-size: 25px; }
.result-dialog > p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.result-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin: 23px 0; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-metrics span + span { border-left: 1px solid var(--line); }
.result-metrics strong { display: block; font-size: 19px; }
.share-button { width: 100%; color: var(--white); background: var(--ink); box-shadow: 4px 4px 0 var(--orange); }
.text-button { display: inline-flex; min-height: 38px; margin-top: 12px; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; background: transparent; border: 0; cursor: pointer; }
.result-dialog .share-note { min-height: 18px; margin: 5px 0 0; font-size: 10px; }

/* High-impact archive treatment */
.page-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: 9px;
  background: var(--orange);
  border-right: 2px solid var(--ink);
  pointer-events: none;
}

body::after {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: -1;
  width: 180px;
  height: 180px;
  background-image: repeating-linear-gradient(135deg, transparent 0 12px, rgb(23 25 22 / 6%) 12px 20px);
  content: "";
}

.app-shell {
  width: min(1320px, calc(100% - 56px));
  padding-top: 18px;
}

.topbar {
  position: relative;
  min-height: 82px;
  padding: 12px 16px;
  color: var(--white);
  background: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 7px 7px 0 var(--orange);
}

.topbar::after {
  position: absolute;
  right: 0;
  bottom: -9px;
  width: 31%;
  height: 7px;
  background: var(--yellow);
  content: "";
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-color: var(--white);
  box-shadow: 3px 3px 0 var(--orange);
}

.brand strong { font-size: 25px; }
.brand small { color: #adb5b0; }
.topbar-progress > span { color: #adb5b0; }
.progress-track { background: #434a46; }
.topbar .icon-button { color: var(--white); border-color: #5c625e; }
.topbar .icon-button:hover { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }

.archive-ticker {
  display: flex;
  height: 24px;
  margin: 12px 0 8px;
  padding: 0 14px;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  color: var(--ink);
  font: 900 9px/1 monospace;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--orange);
  border: 2px solid var(--ink);
}

.archive-ticker i {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: var(--yellow);
  border: 1px solid var(--ink);
  transform: rotate(45deg);
}

.case-strip {
  gap: 4px;
  margin: 0 0 34px;
  padding: 8px;
  background: var(--night);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 rgb(23 25 22 / 18%);
}

.case-tab {
  min-height: 66px;
  color: #d7ddd9;
  background: #313a3d;
  border-color: #515b5e;
  border-radius: 1px;
}

.case-tab:hover:not(:disabled) {
  color: var(--ink);
  background: var(--yellow);
  border-color: var(--yellow);
}

.case-tab.active {
  color: var(--ink);
  background: var(--white);
  border-color: var(--white);
  box-shadow: inset 0 -7px var(--orange);
}

.case-tab:disabled {
  color: #727b78;
  background: #262d2f;
}

.case-tab .tab-number { font-size: 21px; }
.case-tab .tab-title { font-size: 9px; }

.game-layout {
  grid-template-columns: minmax(0, 1fr) 284px;
  gap: 36px;
}

.case-file {
  animation: case-enter 420ms cubic-bezier(.2, .8, .2, 1) both;
}

.case-heading {
  position: relative;
  min-height: 126px;
  margin-bottom: 20px;
  padding: 23px 150px 20px 27px;
  align-items: center;
  overflow: hidden;
  color: var(--white);
  background: var(--ink);
  border-left: 10px solid var(--orange);
  box-shadow: 7px 7px 0 var(--yellow);
}

.case-heading::after {
  position: absolute;
  right: 114px;
  bottom: 0;
  width: 2px;
  height: 100%;
  background: rgb(255 255 255 / 13%);
  content: "";
  transform: rotate(14deg);
}

.case-heading > div {
  position: relative;
  z-index: 2;
}

.case-heading .eyebrow { color: var(--yellow); font-size: 11px; }
.case-heading h1 {
  max-width: 760px;
  margin-top: 10px;
  color: var(--white);
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: 52px;
  line-height: 1;
}

.case-ghost {
  position: absolute;
  top: -27px;
  right: 24px;
  color: var(--orange);
  font: 900 152px/.9 Impact, "Arial Black", sans-serif;
  opacity: .92;
  pointer-events: none;
}

.case-status {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 20px;
  color: var(--orange-dark);
  background: var(--white);
  border-color: var(--orange);
  box-shadow: 3px 3px 0 var(--orange);
  transform: rotate(-4deg);
}

.case-status.closed {
  color: var(--white);
  background: var(--green);
  border-color: var(--white);
}

.case-brief {
  grid-template-columns: minmax(0, 1fr) 310px;
  min-height: 216px;
  margin-bottom: 24px;
  border: 2px solid var(--ink);
  border-left: 10px solid var(--orange);
  border-radius: 0;
  box-shadow: 8px 8px 0 rgb(23 25 22 / 14%);
}

.brief-copy {
  position: relative;
  padding: 31px 34px;
}

.brief-classification {
  position: absolute;
  top: 14px;
  right: 17px;
  color: rgb(164 60 50 / 28%);
  font: 900 17px Impact, sans-serif;
  transform: rotate(-5deg);
}

.brief-copy p {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.9;
}

.brief-copy > strong {
  padding: 7px 10px;
  background: var(--yellow);
  border-bottom: 0;
  box-shadow: 4px 4px 0 var(--ink);
}

.case-art {
  position: relative;
  min-height: 216px;
  background-color: var(--night);
  background-image: repeating-linear-gradient(90deg, transparent 0 23px, rgb(255 255 255 / 4%) 23px 24px);
  border-left: 2px solid var(--ink);
}

.case-art::before,
.case-art::after {
  position: absolute;
  z-index: 2;
  width: 10px;
  height: 10px;
  background: var(--orange);
  border: 2px solid #111;
  border-radius: 50%;
  content: "";
}

.case-art::before { top: 13px; left: 13px; }
.case-art::after { right: 13px; bottom: 13px; }
.case-art svg { width: 88%; height: 186px; filter: drop-shadow(8px 10px 0 rgb(0 0 0 / 22%)); }

.evidence-stage {
  min-height: 420px;
  padding: 29px;
  background: #1d2426;
  border: 3px solid var(--ink);
  border-top: 11px solid var(--orange);
  border-radius: 0;
  box-shadow: 9px 9px 0 var(--ink);
}

.evidence-stage::after {
  position: absolute;
  right: -36px;
  bottom: 22px;
  z-index: 0;
  width: 170px;
  height: 28px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  content: "EVIDENCE / DO NOT ASSUME";
  color: var(--ink);
  font: 900 8px/26px monospace;
  text-align: center;
  transform: rotate(-12deg);
}

.stage-title {
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #566063;
}

.stage-title strong { color: var(--yellow); font-size: 15px; }

.stage-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.guide-toggle,
.context-guide button,
.coach-close {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 50%;
  cursor: pointer;
}

.guide-toggle {
  color: var(--yellow);
  border-color: #687275;
}

.guide-toggle:hover { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }

.guide-toggle svg,
.context-guide button svg,
.coachmark svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.context-guide {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 720px;
  margin: -4px 0 25px;
  padding: 12px 13px;
  align-items: center;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--orange);
}

.context-guide::after {
  position: absolute;
  top: -10px;
  right: 13px;
  width: 15px;
  height: 15px;
  background: var(--yellow);
  border-top: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
  content: "";
  transform: rotate(45deg);
}

.context-guide.is-hidden { display: none; }

.context-guide-label {
  padding: 4px 6px;
  color: var(--white);
  font-size: 9px;
  font-weight: 900;
  background: var(--orange-dark);
}

.context-guide p {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.6;
}

.context-guide button {
  width: 28px;
  height: 28px;
  border-color: rgb(23 25 22 / 35%);
}

.context-guide button:hover { background: var(--white); border-color: var(--ink); }

.guide-active [data-evidence]:not(.inspected),
.guide-active .code-input,
.guide-active .solution-row input,
.guide-active .scrubber,
.guide-active [data-action="trace-cycle"],
.guide-active [data-action="prove-password"],
.guide-active [data-action="verify-ledger"] {
  outline: 2px solid rgb(247 206 84 / 74%);
  outline-offset: 2px;
}

.evidence-grid,
.suspect-grid,
.dream-layout,
.manuscript-grid { gap: 16px; }

.evidence-grid {
  grid-template-columns: 1.25fr 1fr 1fr;
  grid-template-rows: repeat(2, minmax(132px, auto));
}

.evidence-grid > :first-child { grid-row: 1 / 3; }
.evidence-grid > :nth-child(4) { grid-column: 2 / 4; }

.evidence-card,
.suspect-card,
.manuscript-card,
.dream-fragment,
.narrative-button {
  border: 2px solid #0f1314;
  border-radius: 1px;
  box-shadow: 5px 6px 0 rgb(0 0 0 / 27%);
}

.evidence-grid > :nth-child(odd),
.suspect-grid > :nth-child(odd),
.dream-layout > :nth-child(odd) { transform: rotate(-1deg); }

.evidence-grid > :nth-child(even),
.suspect-grid > :nth-child(even),
.dream-layout > :nth-child(even) { transform: rotate(1deg); }

.evidence-card:hover,
.suspect-card:hover,
.manuscript-card:hover,
.dream-fragment:hover,
.narrative-button:hover {
  z-index: 3;
  transform: translateY(-4px) rotate(0);
  box-shadow: 6px 7px 0 rgb(0 0 0 / 32%);
}

.evidence-card.inspected,
.suspect-card.inspected,
.manuscript-card.inspected,
.dream-fragment.inspected,
.narrative-button.inspected {
  box-shadow: inset 0 -8px var(--cyan), 5px 6px 0 rgb(0 0 0 / 27%);
}

.evidence-card.inspected::before,
.suspect-card.inspected::before,
.manuscript-card.inspected::before,
.narrative-button.inspected::before {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 3px 5px;
  color: var(--orange-dark);
  font: 900 8px monospace;
  border: 2px solid var(--orange);
  content: "已核验";
  transform: rotate(-7deg);
}

.verdict-section {
  position: relative;
  margin-top: 34px;
  padding: 27px;
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 var(--orange);
}

.verdict-section::before {
  position: absolute;
  top: -14px;
  left: 24px;
  width: 88px;
  height: 24px;
  background: rgb(247 206 84 / 78%);
  border-right: 1px solid rgb(23 25 22 / 30%);
  border-left: 1px solid rgb(23 25 22 / 30%);
  content: "";
  transform: rotate(-2deg);
}

.verdict-heading h2 { font-size: 23px; }

.evidence-progress {
  padding: 7px 10px;
  color: var(--white);
  background: var(--ink);
}

.evidence-progress.ready { color: var(--ink); background: var(--yellow); }

.verdict-options { gap: 12px; }

.verdict-button {
  min-height: 64px;
  padding-left: 17px;
  font-weight: 800;
  background: #f5f2e8;
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 120ms ease, background-color 120ms ease;
}

.verdict-button:hover {
  background: var(--yellow);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.verdict-button.locked { color: #777b75; background: #ddd9cf; box-shadow: none; }

.case-actions { margin-top: 20px; }
.action-button { min-height: 48px; padding: 0 19px; font-size: 13px; border-width: 2px; border-radius: 0; }

.investigation-rail {
  position: sticky;
  top: 16px;
  padding-top: 0;
}

.mobile-statusbar { display: none; }

.record-section {
  margin-bottom: 12px;
  padding: 19px;
  background: rgb(251 250 246 / 84%);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgb(23 25 22 / 13%);
}

.record-section:first-child { padding-top: 21px; }

.timer-section {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background: var(--ink);
  border-top: 9px solid var(--orange);
  box-shadow: 7px 7px 0 var(--yellow);
}

.timer-section::after {
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--orange);
  font: 900 39px/1 Impact, sans-serif;
  content: "LIMIT";
  opacity: .25;
}

.timer-section .section-label { color: var(--yellow); }
.countdown { margin: 12px 0; font-size: 58px; }
.countdown.urgent { color: var(--yellow); }
.timer-track { background: #4c5450; }
.timer-track span { background: var(--orange); }
.timer-section p { color: #aeb7b2; }

.metrics-section { border-left: 7px solid var(--cyan); }
.hint-section { background: #fff9dd; border-left: 7px solid var(--yellow); }
.archive-section { color: var(--white); background: #384345; border-left: 7px solid var(--orange); }
.archive-section .section-label { color: var(--yellow); }
.archive-section blockquote { color: #edf0ed; }

.result-dialog {
  padding: 38px 36px 32px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-top: 12px solid var(--orange);
  border-radius: 0;
  box-shadow: 13px 13px 0 var(--ink);
  background-color: var(--white);
  background-image: linear-gradient(rgb(23 25 22 / 4%) 1px, transparent 1px);
  background-size: 100% 24px;
}

.result-logo {
  position: absolute;
  top: 17px;
  left: 17px;
  width: 58px;
  height: 58px;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 2px;
  box-shadow: 4px 4px 0 var(--orange);
  transform: rotate(-5deg);
}

.result-kicker {
  min-height: 30px;
  padding-left: 62px;
  text-align: left;
}

.result-verdict-mark {
  display: grid;
  width: 220px;
  min-height: 94px;
  margin: 17px auto 24px;
  place-items: center;
  align-content: center;
  color: var(--orange-dark);
  background: rgb(251 250 246 / 74%);
  border: 6px double var(--orange);
  transform: rotate(-4deg);
}

.result-verdict-mark strong {
  font-family: "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: 32px;
  line-height: 1;
}

.result-verdict-mark span {
  margin-top: 7px;
  font: 900 9px monospace;
  letter-spacing: 0;
}

.result-dialog h2 { font-size: 30px; }
.share-button { min-height: 51px; border-radius: 0; }

@keyframes case-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 920px) {
  .game-layout { grid-template-columns: 1fr; }
  .investigation-rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .record-section { padding-top: 0; border-bottom: 0; }
  .countdown { font-size: 36px; }
}

@media (max-width: 700px) {
  .app-shell { width: min(100% - 24px, 600px); padding-top: 12px; }
  .topbar { grid-template-columns: 1fr auto; gap: 12px; }
  .topbar-progress { grid-row: 2; grid-column: 1 / -1; margin-bottom: 9px; }
  .brand-mark { width: 44px; height: 44px; }
  .brand strong { font-size: 17px; }
  .case-strip { margin: 10px 0 22px; grid-template-columns: repeat(10, 74px); }
  .case-heading h1 { font-size: 32px; }
  .case-brief { grid-template-columns: 1fr; }
  .brief-copy { padding: 20px; }
  .case-art { min-height: 118px; border-top: 1px solid var(--ink); border-left: 0; }
  .case-art svg { height: 105px; }
  .evidence-stage { min-height: 390px; padding: 16px; }
  .evidence-grid,
  .suspect-grid,
  .dream-layout { grid-template-columns: repeat(2, 1fr); }
  .timeline-layout,
  .safe-layout,
  .cycle-layout,
  .video-layout,
  .ledger-layout { grid-template-columns: 1fr; }
  .timeline-layout { grid-template-columns: 1fr 90px 1fr; }
  .analysis-tabs { grid-template-columns: 1fr; }
  .analysis-sample { min-height: 160px; }
  .safe-console { order: -1; }
  .cycle-map { min-height: 250px; }
  .video-screen { min-height: 190px; }
  .manuscript-grid { grid-template-columns: repeat(2, 1fr); }
  .verdict-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .verdict-options { grid-template-columns: 1fr; }
  .case-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .action-button { padding: 0 9px; }
  .investigation-rail { grid-template-columns: 1fr; gap: 0; }
  .record-section { padding: 17px 0; border-bottom: 1px solid var(--line); }
  .record-section:first-child { padding-top: 0; }
  .result-dialog { padding: 28px 20px 23px; box-shadow: 6px 6px 0 var(--ink); }
}

@media (max-width: 420px) {
  .timeline-layout { grid-template-columns: 1fr; }
  .broken-video { min-height: 100px; }
  .evidence-card,
  .suspect-card,
  .dream-fragment { min-height: 165px; }
  .suspect-grid,
  .dream-layout { grid-template-columns: 1fr; }
  .manuscript-card { min-height: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 920px) {
  .investigation-rail { position: static; }
  .record-section,
  .record-section:first-child { padding: 17px; border: 2px solid var(--ink); }
  .timer-section { border-top: 8px solid var(--orange); }
  .countdown { font-size: 42px; }
}

@media (max-width: 700px) {
  .page-rail { width: 6px; }
  .app-shell { width: calc(100% - 24px); padding-top: 10px; }
  .topbar { min-height: 72px; padding: 10px 11px; box-shadow: 5px 5px 0 var(--orange); }
  .icon-button { width: 44px; height: 44px; }
  .brand-mark { width: 46px; height: 46px; }
  .brand strong { font-size: 19px; }
  .archive-ticker { height: 21px; margin-top: 10px; padding-inline: 10px; gap: 10px; }
  .archive-ticker span:nth-of-type(n + 3),
  .archive-ticker i:nth-of-type(n + 2) { display: none; }
  .case-strip {
    margin: 0 0 18px;
    padding: 6px;
    scroll-padding-left: 6px;
    scroll-snap-type: x mandatory;
    box-shadow: 4px 4px 0 rgb(23 25 22 / 18%);
  }
  .case-tab { scroll-snap-align: start; }
  .case-tab { min-height: 60px; }
  .case-heading {
    min-height: 106px;
    margin-bottom: 11px;
    padding: 20px 70px 17px 17px;
    border-left-width: 7px;
    box-shadow: 5px 5px 0 var(--yellow);
  }
  .case-heading h1 { font-size: 32px; line-height: 1.08; }
  .case-heading::after { right: 66px; }
  .case-ghost { top: 8px; right: 8px; font-size: 76px; opacity: .68; }
  .case-status { top: 10px; right: 9px; padding: 5px 7px; font-size: 9px; box-shadow: 2px 2px 0 var(--orange); }
  .mobile-statusbar {
    position: sticky;
    top: 7px;
    z-index: 45;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 5px 10px;
    min-height: 52px;
    margin-bottom: 13px;
    padding: 7px 10px;
    align-items: center;
    color: var(--ink);
    font-size: 9px;
    font-weight: 800;
    background: var(--yellow);
    border: 2px solid var(--ink);
    box-shadow: 4px 4px 0 var(--orange);
  }
  .mobile-statusbar strong { font: 900 21px "Arial Narrow", Arial, sans-serif; }
  .mobile-statusbar > span:last-of-type { justify-self: end; }
  .mobile-timer-track { grid-column: 1 / -1; height: 3px; overflow: hidden; background: rgb(23 25 22 / 20%); }
  .mobile-timer-track span { display: block; width: 100%; height: 100%; background: var(--ink); transition: width 300ms linear; }
  .mobile-statusbar.urgent { color: var(--white); background: var(--orange); }
  .mobile-statusbar.urgent .mobile-timer-track { background: rgb(255 255 255 / 25%); }
  .mobile-statusbar.urgent .mobile-timer-track span { background: var(--white); }
  .mobile-statusbar.critical { animation: timer-alert 900ms ease-in-out infinite alternate; }
  .case-brief { grid-template-columns: minmax(0, 1fr) 108px; min-height: 194px; margin-bottom: 19px; border-left-width: 7px; box-shadow: 5px 5px 0 rgb(23 25 22 / 14%); }
  .brief-copy { padding: 25px 16px 19px; }
  .brief-classification { top: 10px; right: 12px; font-size: 13px; }
  .brief-copy p { margin-top: 14px; font-size: 13px; line-height: 1.65; }
  .brief-copy > strong { font-size: 12px; box-shadow: 3px 3px 0 var(--ink); }
  .case-art { min-height: 194px; border-top: 0; border-left: 2px solid var(--ink); }
  .case-art svg { width: 118px; height: 106px; }
  .evidence-stage { min-height: 405px; padding: 17px; border-top-width: 8px; box-shadow: 5px 6px 0 var(--ink); }
  .stage-tools > span { display: none; }
  .context-guide { margin-bottom: 20px; padding: 10px; }
  .context-guide p { font-size: 10px; }
  .coachmark { box-shadow: 5px 5px 0 var(--orange); }
  .coachmark::after { display: none; }
  .evidence-stage::after { right: -20px; bottom: 13px; }
  .stage-title { margin-bottom: 18px; }
  .evidence-grid,
  .suspect-grid,
  .dream-layout,
  .manuscript-grid { gap: 12px; }
  .evidence-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: auto; }
  .evidence-grid > :first-child { grid-row: auto; }
  .evidence-grid > :nth-child(4) { grid-column: auto; }
  .evidence-card,
  .suspect-card,
  .manuscript-card,
  .dream-fragment,
  .narrative-button { box-shadow: 3px 4px 0 rgb(0 0 0 / 27%); }
  .verdict-section { margin-top: 25px; padding: 22px 16px 18px; border-width: 2px; box-shadow: 5px 5px 0 var(--orange); }
  .verdict-heading h2 { font-size: 21px; }
  .evidence-progress { padding: 6px 8px; }
  .verdict-button { min-height: 61px; box-shadow: 2px 2px 0 var(--ink); }
  .case-actions { margin-top: 16px; }
  .record-section,
  .record-section:first-child { margin-bottom: 10px; padding: 17px; }
  .timer-section { padding-top: 18px; }
  .countdown { font-size: 48px; }
  .result-dialog { padding: 31px 20px 25px; border-top-width: 9px; box-shadow: 7px 7px 0 var(--ink); }
  .result-logo { width: 54px; height: 54px; box-shadow: 4px 4px 0 var(--orange); }
  .result-kicker { padding-left: 61px; }
  .result-verdict-mark { width: 205px; min-height: 88px; }
  .result-verdict-mark strong { font-size: 29px; }
  .result-dialog h2 { font-size: 26px; }
}

@media (max-width: 480px) {
  .timeline-layout { grid-template-columns: 1fr; }
  .broken-video { min-height: 105px; }
}

@media (max-width: 360px) {
  .evidence-grid { grid-template-columns: 1fr; }
  .case-actions { grid-template-columns: 1fr; }
  .action-button { width: 100%; white-space: nowrap; }
  .case-brief { grid-template-columns: 1fr 88px; }
  .case-art svg { width: 96px; }
}

@keyframes timer-alert {
  from { transform: translateY(0); }
  to { transform: translateY(2px); }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-statusbar.critical { animation: none; }
}

/* Focused archival palette */
:root {
  --ink: #252522;
  --muted: #6e6b64;
  --paper: #f1efe9;
  --white: #fffdfa;
  --line: #c5c0b7;
  --orange: #d64834;
  --orange-dark: #922d23;
  --cyan: #61645f;
  --yellow: #e9e4d9;
  --night: #555954;
  --green: #4e5751;
  --red: #922d23;
  --shadow: 0 18px 42px rgb(37 37 34 / 12%);
}

body {
  background-color: var(--paper);
  background-image:
    linear-gradient(rgb(37 37 34 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(37 37 34 / 5%) 1px, transparent 1px);
}

.page-rail {
  background: var(--orange);
}

.topbar {
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 240px) minmax(150px, 190px) 44px;
  gap: 18px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 7px 7px 0 var(--orange);
}

.topbar::after {
  background: var(--orange);
}

.brand-mark {
  background: var(--white);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--orange);
}

.brand strong { color: var(--ink); }
.brand small { color: var(--muted); }

.topbar-timer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  min-width: 0;
  padding: 9px 12px;
  align-items: center;
  color: var(--ink);
  background: #f0e8e3;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.topbar-timer > span {
  font-size: 10px;
  font-weight: 900;
}

.topbar-timer .countdown {
  margin: 0;
  color: var(--orange-dark);
  font: 900 30px/1 "Arial Narrow", Arial, sans-serif;
}

.topbar-timer .countdown.urgent { color: var(--orange-dark); }
.topbar-timer .countdown.critical { animation: timer-alert 650ms ease-in-out infinite alternate; }
.topbar-timer .timer-track { grid-column: 1 / -1; height: 4px; background: rgb(36 37 31 / 20%); }
.topbar-timer .timer-track span { background: var(--orange); }
.topbar-timer p { display: none; }

.topbar-progress > span { color: var(--muted); }
.progress-track { background: rgb(36 37 31 / 28%); }
.progress-track span { background: var(--orange); }
.topbar .icon-button { color: var(--ink); border-color: var(--ink); background: var(--white); }
.topbar .icon-button:hover { color: var(--white); background: var(--ink); border-color: var(--ink); }

.archive-ticker {
  margin-bottom: 26px;
  color: var(--white);
  background: var(--ink);
}

.archive-ticker i { background: var(--orange); }

.game-layout {
  grid-template-columns: minmax(0, 1fr) 284px;
}

.case-heading {
  color: var(--ink);
  background: #e7e2d8;
  border-left-color: var(--orange);
  box-shadow: 7px 7px 0 var(--ink);
}

.case-heading::after { background: rgb(36 37 31 / 16%); }
.case-heading .eyebrow { color: var(--orange-dark); }
.case-heading h1 { color: var(--ink); }
.case-ghost { color: var(--orange); opacity: .16; }
.case-status { color: var(--white); background: var(--orange-dark); border-color: var(--ink); }
.case-status.closed { color: var(--white); background: var(--orange-dark); border-color: var(--ink); }
.case-tab.solved::after { background: var(--orange); }

.case-brief {
  background: var(--white);
  border-left-color: var(--orange);
  box-shadow: 7px 7px 0 rgb(37 37 34 / 15%);
}

.case-art {
  background: var(--night);
}

.brief-copy > strong { background: #f0d9d5; }
.art-line { stroke: var(--white); }
.art-muted { fill: #777b76; }

.evidence-stage {
  color: var(--ink);
  background: #e6e4de;
  border-color: var(--ink);
  border-top-color: var(--orange);
  box-shadow: 9px 9px 0 var(--ink);
}

.evidence-stage::before {
  background-image:
    linear-gradient(rgb(36 37 31 / 7%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(36 37 31 / 5%) 1px, transparent 1px);
  background-size: 52px 52px;
}

.stage-title { color: var(--ink); border-bottom-color: rgb(36 37 31 / 25%); }
.stage-title strong { color: var(--orange-dark); }
.stage-title span { color: #52635f; }
.guide-toggle { color: var(--orange-dark); border-color: var(--orange-dark); background: var(--white); }

.evidence-card,
.suspect-card,
.manuscript-card,
.dream-fragment,
.narrative-button,
.room-panel,
.analysis-sample,
.clue-scrap {
  background: var(--white);
}

.evidence-card.inspected,
.suspect-card.inspected,
.manuscript-card.inspected,
.dream-fragment.inspected,
.narrative-button.inspected {
  background: #f3e5e1;
  box-shadow: inset 0 -8px var(--orange), 5px 6px 0 rgb(0 0 0 / 27%);
}

.verdict-section {
  background: var(--white);
  box-shadow: 8px 8px 0 var(--orange);
}

.verdict-section::before { background: #d8d4c9; }
.evidence-progress.ready { color: var(--orange-dark); background: #f0d9d5; }
.verdict-button { background: #f7f4ee; }
.verdict-button:hover { background: #f0d9d5; }
.verdict-button.locked { color: #77746d; background: #e5e1d9; }

.record-section { background: var(--white); }
.metrics-section { border-left-color: var(--ink); box-shadow: 5px 5px 0 rgb(37 37 34 / 15%); }
.hint-section { background: #f2eee7; border-left-color: var(--orange); box-shadow: 5px 5px 0 rgb(37 37 34 / 12%); }
.archive-section { color: var(--white); background: var(--ink); border-left-color: var(--orange); box-shadow: 5px 5px 0 rgb(37 37 34 / 18%); }
.archive-section .section-label { color: #d9d3c8; }
.archive-section blockquote { color: var(--white); }

.case-index {
  margin-top: 52px;
  padding: 24px;
  background: #dedbd4;
  border: 3px solid var(--ink);
  box-shadow: 9px 9px 0 var(--ink);
}

.case-index-heading {
  display: flex;
  margin-bottom: 16px;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.case-index-heading .section-label { color: var(--orange-dark); }
.case-index-heading h2 { margin: 4px 0 0; color: var(--ink); font: 900 28px/1 "Arial Black", "Microsoft YaHei", sans-serif; }
.case-index-heading p { margin: 0; color: var(--muted); font-size: 11px; font-weight: 800; }

.case-index .case-strip {
  margin: 0;
  padding: 7px;
  background: rgb(255 253 250 / 55%);
  box-shadow: none;
}

.case-index .case-tab {
  color: var(--ink);
  background: var(--white);
  border-color: var(--ink);
}

.case-index .case-tab:hover:not(:disabled) { background: #f0e4e0; border-color: var(--ink); }
.case-index .case-tab.active { color: var(--white); background: var(--orange); border-color: var(--ink); box-shadow: inset 0 -7px var(--orange-dark); }
.case-index .case-tab:disabled { color: #89867f; background: #cfcbc3; border-color: #aaa69e; }

@media (max-width: 920px) {
  .topbar { grid-template-columns: minmax(230px, 1fr) minmax(180px, 220px) 150px 44px; gap: 12px; }
  .game-layout { grid-template-columns: 1fr; }
  .investigation-rail { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) 44px;
    box-shadow: 5px 5px 0 var(--orange);
  }
  .brand { grid-column: 1; grid-row: 1; }
  .topbar .icon-button { grid-column: 2; grid-row: 1; }
  .topbar-timer { grid-column: 1 / -1; grid-row: 2; }
  .topbar-progress { grid-column: 1 / -1; grid-row: 3; margin: 3px 0 7px; }
  .topbar-progress > span { color: var(--muted); }
  .archive-ticker { margin-bottom: 18px; }
  .case-heading { box-shadow: 5px 5px 0 var(--ink); }
  .case-brief { box-shadow: 5px 5px 0 rgb(37 37 34 / 15%); }
  .evidence-stage { box-shadow: 5px 6px 0 var(--ink); }
  .investigation-rail { grid-template-columns: 1fr; }
  .case-index { margin-top: 34px; padding: 16px 12px 14px; box-shadow: 6px 6px 0 var(--orange); }
  .case-index-heading { margin-bottom: 12px; align-items: start; }
  .case-index-heading h2 { font-size: 23px; }
  .case-index-heading p { max-width: 125px; text-align: right; line-height: 1.45; }
  .case-index .case-strip {
    grid-template-columns: repeat(10, 74px);
    margin: 0;
    scroll-padding-left: 7px;
  }
}

@media (max-width: 360px) {
  .topbar-timer .countdown { font-size: 27px; }
  .case-index-heading p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar-timer .countdown.critical { animation: none; }
}
