:root {
  color-scheme: dark;
  --bg: #11110f;
  --paper: #d8d2c5;
  --ink: #1a1916;
  --muted: #999488;
  --line: #34312c;
  --red: #8b1e1e;
  --red-bright: #bd3333;
  --max: 1040px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background-color: #080908;
  background-image:
    linear-gradient(180deg, rgba(5, 6, 6, .38), rgba(8, 8, 7, .9) 760px),
    url("/assets/archive-room-bg.jpg");
  background-position: center top;
  background-size: 100% 100%, max(1100px, 100vw) auto;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  z-index: 10;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    radial-gradient(circle at 50% 18%, transparent 0 18rem, rgba(0,0,0,.32) 50rem);
  background-size: 100% 4px, 100% 100%;
  pointer-events: none;
}

.noise { position: fixed; inset: 0; z-index: 11; pointer-events: none; box-shadow: inset 0 0 110px rgba(0,0,0,.7); }

a { color: inherit; }
button { font: inherit; }

.site-header, footer {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 42px;
  min-height: 88px;
  border-bottom: 1px solid #51443b;
  text-shadow: 0 2px 8px #000;
}

.brand { display: grid; text-decoration: none; line-height: .9; }
.brand > span { font-family: "Arial Narrow", Impact, sans-serif; font-size: 17px; letter-spacing: .08em; }
.brand strong { font-family: "Songti SC", SimSun, serif; font-size: 27px; letter-spacing: .16em; }
.site-description { margin: 0; color: #8d8780; font: 13px/1.7 "Songti SC", SimSun, serif; letter-spacing: .12em; transform: translateY(10px); }
.brand-mark, .eyebrow, .meta, .countdown, .stamp, .status, footer {
  font-family: "Courier New", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.brand-mark { padding: 4px 6px; color: var(--bg); background: var(--paper); font-size: 10px; font-weight: 700; }

nav { display: flex; align-items: center; gap: 24px; }
nav a { display: grid; place-items: center; gap: 3px; color: var(--muted); font-size: 12px; text-decoration: none; }
nav a:hover, nav a:focus-visible { color: var(--paper); }
nav i { position: relative; display: block; width: 27px; height: 22px; font-style: normal; }
.nav-home i { border: 2px solid currentColor; border-radius: 2px; border-top-width: 7px; }
.nav-terminal i { padding-top: 4px; border: 2px solid currentColor; border-radius: 2px; font: 9px/1 monospace; text-align: center; }
main { position: relative; z-index: 1; width: min(calc(100% - 40px), var(--max)); min-height: calc(100vh - 176px); margin: 0 auto; }
main:focus { outline: none; }

.hero { padding: 76px 0 62px; }
.hero-screen {
  position: relative;
  overflow: hidden;
  padding: 58px 390px 52px 48px;
  border: 1px solid #594840;
  background: linear-gradient(135deg, rgba(11,13,12,.92), rgba(23,11,11,.76));
  box-shadow: inset 0 0 55px #000, 0 18px 55px rgba(0,0,0,.5);
}
.hero-screen::before { display: block; margin-bottom: 22px; color: #9b7169; content: "EXPEDITION RECORD / OPEN"; font: 10px/1 "Courier New", monospace; letter-spacing: .18em; }
.hero-screen::after { position: absolute; inset: 0; border-top: 2px solid rgba(166,32,32,.55); content: ""; background: repeating-linear-gradient(0deg, transparent 0 5px, rgba(255,255,255,.012) 6px); pointer-events: none; }
.hero-label { margin: 0 0 12px; color: #b95a51; font-family: "Courier New", monospace; letter-spacing: .12em; }
.hero-screen h1 { position: relative; z-index: 1; text-shadow: 3px 4px 0 #3a0809, 0 0 22px rgba(255,255,255,.08); }
.hero-screen .lede, .hero-screen .button { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 22px; color: var(--red-bright); font-size: 12px; }
h1, h2, h3 { font-family: "Songti SC", SimSun, serif; font-weight: 600; }
h1 {  margin: 0; font-size: clamp(44px, 8vw, 88px); line-height: .98; letter-spacing: -.03em; }
.lede {  margin: 26px 0 34px; color: #aaa397; font-size: 17px; line-height: 1.9; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid #9a3535;
  color: #eee8dc;
  background: linear-gradient(180deg, #321718, #160d0d);
  box-shadow: inset 0 0 16px rgba(139,30,30,.3), 0 6px 22px rgba(0,0,0,.38);
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-2px); border-color: var(--red-bright); box-shadow: 0 0 18px rgba(189,51,51,.3); }
.button.secondary { color: var(--paper); background: transparent; border-color: var(--line); }
.button.secondary:hover { border-color: var(--paper); }
.button:focus-visible, .choice:focus-visible { outline: 3px solid var(--red-bright); outline-offset: 3px; }

.countdown-card { align-self: end; padding: 28px; border: 1px solid #493c36; background: rgba(8,9,8,.78); box-shadow: inset 0 0 28px #000; }
.countdown-card p { margin: 0; color: var(--muted); font-size: 12px; }
.countdown { display: block; margin: 16px 0; font-size: clamp(30px, 4vw, 48px); }
.countdown-card small { color: #6f6b63; }
.hero .countdown-card { position: absolute; right: 48px; bottom: 52px; z-index: 1; width: 290px; padding: 4px 0 4px 26px; border: 0; border-left: 1px solid #5f3b36; background: transparent; box-shadow: none; text-align: right; }

.outcome { padding: 38px 0 48px; border-top: 1px solid var(--red); }
.outcome > div { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; }
.outcome h2 { margin: 0; font-size: clamp(24px, 4vw, 38px); line-height: 1.45; }
.outcome div p { margin: 0; color: var(--muted); font-family: "Songti SC", SimSun, serif; font-size: 16px; line-height: 1.9; }

.section { padding: 52px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.section-head h2 { margin: 0; font-size: 28px; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }

.archive-list { display: grid; gap: 1px; background: #4c3b34; border: 1px solid #4c3b34; box-shadow: 0 18px 50px rgba(0,0,0,.38); }
.archive-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 82px;
  padding: 18px 22px;
  color: inherit;
  background: rgba(15,15,13,.92);
  text-decoration: none;
}
.archive-row:hover { background: rgba(48,21,20,.94); }
.archive-row .meta { color: #726d64; font-size: 11px; }
.archive-row h3 { margin: 3px 0 0; font-size: 18px; }
.status { color: var(--muted); font-size: 10px; }
.status.done { color: #a46d67; }

.reader { width: min(100%, 820px); margin: 54px auto 100px; padding: 48px 54px 70px; border: 1px solid #473a34; background: rgba(9,10,9,.9); box-shadow: 0 24px 80px #000, inset 0 0 65px rgba(0,0,0,.65); }
.back { display: inline-block; margin-bottom: 42px; color: var(--muted); font-size: 13px; text-decoration: none; }
.back:hover { color: var(--paper); }
.file-head { padding-bottom: 34px; border-bottom: 1px solid #57423b; }
.file-head h1 { margin: 12px 0 18px; font-size: clamp(38px, 7vw, 64px); }
.file-head .meta { color: var(--muted); font-size: 11px; }
.classification { float: right; padding: 8px 12px; border: 2px solid var(--red); color: #b15a52; transform: rotate(3deg); }

.story { padding: 42px 0; font-family: "Songti SC", SimSun, serif; font-size: 19px; line-height: 2.15; text-shadow: 0 2px 5px #000; }
.story p { margin: 0 0 1.6em; }
.story .ominous { color: #c0463e; }

.action-box { padding: 28px; border: 1px solid #583d39; background: linear-gradient(145deg, rgba(35,17,17,.9), rgba(15,14,12,.94)); }
.action-box h2 { margin: 0 0 10px; font-size: 23px; }
.action-box > p { color: var(--muted); line-height: 1.7; }
.choices { display: grid; gap: 12px; margin-top: 24px; }
.choice {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 17px;
  border: 1px solid var(--line);
  color: var(--paper);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.choice:hover:not(:disabled) { border-color: var(--red-bright); background: #211515; }
.choice:disabled { cursor: default; }
.choice .letter { color: var(--red-bright); font-family: "Courier New", monospace; }
.choice .percent { color: var(--muted); font-family: "Courier New", monospace; }
.choice.selected { border-color: var(--red); background: linear-gradient(90deg, #281515 var(--fill), transparent var(--fill)); }
.vote-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; }
.closed-result { margin-top: 24px; padding: 22px; border-left: 3px solid #983033; background: rgba(91,25,27,.2); }
.closed-result small { color: #b65a56; font: 10px "Courier New", monospace; letter-spacing: .12em; }
.closed-result h3 { margin: 12px 0; font-size: 19px; line-height: 1.6; }
.closed-result p { margin: 0; color: #aaa297; font: 15px/1.9 "Songti SC", SimSun, serif; }
.report-button { width: 100%; margin-top: 22px; }

.checkin { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 22px; }
.stamp { color: #b5625c; font-size: 13px; }

.cabinet { padding: 54px 0 100px; }
.cabinet-title { margin-bottom: 34px; text-align: center; text-shadow: 0 0 20px rgba(185,64,57,.3); }
.cabinet-title span { color: #a5766e; font: 12px "Courier New", monospace; letter-spacing: .25em; }
.cabinet-title h1 { margin: 6px auto 0; font-size: clamp(44px, 7vw, 72px); }
.cabinet-title p { margin: 8px 0 0; color: var(--muted); letter-spacing: .3em; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; background: none; border: 0; }
.stat { position: relative; padding: 42px 28px 24px; border: 1px solid #60433d; background: rgba(11,10,9,.9); box-shadow: inset 0 0 30px #000; }
.stat b { position: absolute; inset: 0 0 auto; padding: 7px 14px; color: #c9bbae; background: #291718; font-size: 12px; letter-spacing: .1em; }
.stat span { display: block; color: var(--muted); font-size: 12px; }
.stat strong { display: inline-block; margin-top: 10px; color: #d52e31; font-family: "Courier New", monospace; font-size: 48px; text-shadow: 0 0 10px rgba(221,35,40,.65); }
.stat em { margin-left: 8px; color: #a89d91; font-style: normal; }
.collection { padding: 28px 16px; border: 1px solid #493b35; background: rgba(8,8,7,.88); box-shadow: 0 20px 60px #000; }
.collection h2, .hidden-head { display: flex; justify-content: space-between; align-items: center; }
.collection h2 { margin: 0 0 22px; font-size: 24px; }
.file-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.file-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 180px; padding: 56px 26px 24px; overflow: hidden; border: 1px solid #59443d; border-left: 3px solid #86282a; color: var(--paper); background: linear-gradient(145deg, rgba(45,34,29,.96), rgba(16,15,13,.98)); text-align: left; text-decoration: none; box-shadow: inset 0 0 28px rgba(0,0,0,.5); }
.file-card::before { position: absolute; inset: 0 0 auto; padding: 11px 24px; border-bottom: 1px solid #4d3b35; color: #9c6b63; content: "CLASSIFIED DOSSIER"; font: 10px/1 "Courier New", monospace; letter-spacing: .16em; }
.file-card::after { position: absolute; top: 0; right: 0; border-width: 0 22px 22px 0; border-style: solid; border-color: transparent #0a0908 transparent transparent; content: ""; }
.file-card strong { font: 600 25px/1.25 "Songti SC", SimSun, serif; }
.file-card strong small { display: block; margin-top: 8px; color: var(--muted); font: 12px "Courier New", monospace; letter-spacing: .08em; }
.file-card > span { margin-top: auto; padding-top: 22px; color: #b87b72; font-size: 12px; letter-spacing: .08em; }
.file-card:hover { border-color: #8d3a38; background: linear-gradient(145deg, rgba(58,30,28,.98), rgba(18,15,13,.98)); }
.collection-empty { display: grid; grid-column: 1 / -1; place-items: center; min-height: 120px; margin: 0; border: 1px dashed #3f3530; color: var(--muted); text-align: center; }
.hidden-head { margin-top: 28px; padding-top: 25px; border-top: 1px solid #493b35; }
.hidden-head h2 { margin: 0; }
.restricted-files { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-top: 18px; }
.restricted-card { position: relative; display: flex; flex-direction: column; min-height: 210px; padding: 26px; overflow: hidden; border: 1px solid #542629; color: var(--muted); background: repeating-linear-gradient(0deg, rgba(179,25,30,.04) 0 2px, transparent 3px 8px), #140c0c; text-decoration: none; }
.restricted-card::after { position: absolute; right: -24px; bottom: -28px; color: rgba(172,35,39,.12); content: "封"; font: 900 120px/1 "Songti SC", SimSun, serif; transform: rotate(-12deg); }
.restricted-card small { color: #a84b4d; font: 10px "Courier New", monospace; letter-spacing: .12em; }
.restricted-card strong { position: relative; z-index: 1; margin: 25px 0 8px; color: #d3c8ba; font: 600 26px "Songti SC", SimSun, serif; }
.restricted-card span { position: relative; z-index: 1; font-size: 12px; line-height: 1.7; }
.restricted-card em { position: relative; z-index: 1; margin-top: auto; color: #c66a65; font-size: 12px; font-style: normal; }
.restricted-card.open:hover { border-color: #a53a3d; background-color: #211010; }
.restricted-card.redacted { filter: saturate(.45); }
.survival-progress { position: relative; z-index: 1; height: 3px; margin-top: auto; background: #312426; }
.survival-progress i { display: block; width: var(--progress); height: 100%; background: #a62c30; box-shadow: 0 0 10px #a62c30; }

.restricted-reader { border-color: #67292b; }
.restricted-summary { margin: 38px 0; padding: 24px; border-left: 3px solid #912c30; color: #bdb4a7; background: rgba(70,20,22,.16); font: 17px/2 "Songti SC", SimSun, serif; }
.evidence-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.evidence-list article { min-height: 150px; padding: 22px; border: 1px solid #443634; background: rgba(15,14,12,.78); }
.evidence-list small { color: #a54c4c; font: 10px "Courier New", monospace; letter-spacing: .12em; }
.evidence-list p { margin: 18px 0 0; color: #aaa297; font-family: "Songti SC", SimSun, serif; line-height: 1.85; }
.deduction { margin-top: 36px; padding: 28px; border: 1px solid #64272a; background: #170d0e; }
.deduction h2 { margin: 0; font-size: 23px; line-height: 1.6; }
.deduction details { margin-top: 24px; border-top: 1px solid #4d292b; }
.deduction summary { padding-top: 20px; color: #bd625e; cursor: pointer; }
.deduction details p { color: #aaa297; font: 16px/2 "Songti SC", SimSun, serif; }
.recovery { margin-top: 18px; padding: 20px; border: 1px solid #493b35; background: rgba(8,8,7,.9); }
.recovery-code { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.recovery-code code { overflow-wrap: anywhere; }
.recovery-code code small { display: block; margin-top: 5px; color: var(--muted); }
.gear { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 48px; min-height: 48px; padding: 0 13px; border: none; color: var(--paper); background: transparent; cursor: pointer; }
.gear svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gear .check-icon, .gear span:empty { display: none; }
.gear.copied { color: #b6c39b; border-color: #59634a; }
.gear.copied .copy-icon { display: none; }
.gear.copied .check-icon { display: block; }
.gear.copy-error { color: #d06a66; border-color: #743638; }
.gear span { font-size: 12px; white-space: nowrap; }
.recovery-manual { margin-top: 16px; color: var(--muted); }
.recovery-manual summary { cursor: pointer; }
.recovery-manual form > div { display: flex; gap: 10px; margin-top: 10px; }
.recovery-manual input { flex: 1; min-width: 0; padding: 12px; border: 1px solid #493b35; color: var(--paper); background: #0d0d0b; }
.recovery-note { color: #c36a64; }

.empty { padding: 80px 0; text-align: center; }
.empty .countdown-card { width: min(100%, 420px); margin: 42px auto 0; text-align: left; }
.empty-row { display: grid; gap: 8px; padding: 36px 22px; color: var(--muted); background: #151512; text-align: center; }
.empty-row strong { color: var(--paper); font-family: "Songti SC", SimSun, serif; font-size: 18px; }
.empty-row span { font-size: 13px; }
footer { display: flex; justify-content: space-between; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); color: #615e57; font-size: 9px; }

@media (max-width: 850px) {
  .hero-screen { min-height: 0; padding: 48px; }
  .hero .countdown-card { position: static; width: 100%; margin-top: 38px; padding: 24px 0 0; border-top: 1px solid #5f3b36; border-left: 0; text-align: right; }
}

@media (max-width: 700px) {
  .story {font-size: 16px;padding: 24px 0;}
  .brand {display: flex; gap: 12px;align-items: center;}
  .site-header { grid-template-columns: auto 1fr; gap: 12px 18px; min-height: 72px; padding: 15px 0 13px; }
  .brand strong { font-size: 18px; }
  .site-description { grid-column: 1 / -1; grid-row: 2; font-size: 11px; line-height: 1.5; letter-spacing: .08em; transform: none; }
  nav { justify-self: end; }
  nav { gap: 14px; }
  nav a { font-size: 12px; }
  body { background-position: 58% top; }
  .hero { padding: 38px 0 48px; }
  .hero-screen { padding: 38px 24px; }
  .outcome > div { grid-template-columns: 1fr; gap: 18px; }
  .countdown-card { padding-inline: 0; }
  .archive-row { grid-template-columns: 82px 1fr; padding: 16px; }
  .archive-row .status { display: none; }
  .reader { margin-top: 24px; padding: 32px 22px 50px; }
  .classification { float: none; display: inline-block; margin-bottom: 14px; }
  .checkin { align-items: stretch; flex-direction: column; }
  .stats { grid-template-columns: 1fr; }
  .file-cards { grid-template-columns: 1fr; }
  .restricted-files, .evidence-list { grid-template-columns: 1fr; }
  .restricted-card { min-height: 170px; }
  .recovery-code { grid-template-columns: minmax(0, 1fr) auto; }
  footer { flex-direction: column; }
}

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