:root {
  color-scheme: dark;
  --ink: #070b0e;
  --panel: #0c1115;
  --panel-2: #10171b;
  --paper: #d9d5c9;
  --paper-dim: #999990;
  --line: #273037;
  --line-hot: #6e3033;
  --red: #a33a3d;
  --red-bright: #d45b5e;
  --blue: #7597a1;
  --focus: #e7c889;
  --shadow: rgba(0, 0, 0, 0.42);
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", Georgia, serif;
  --sans: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", "Roboto Mono", "Noto Sans Mono CJK SC", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    radial-gradient(circle at 82% 3%, rgba(77, 111, 120, 0.12), transparent 34rem),
    var(--ink);
  background-size: 100% 4px, 48px 48px, auto, auto;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.72;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 50;
  left: 1rem;
  top: 1rem;
  padding: 0.6rem 0.85rem;
  color: var(--ink);
  background: var(--focus);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}

.archive-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: inherit;
  text-decoration: none;
}

.archive-mark strong,
.archive-mark small {
  display: block;
}

.archive-mark strong {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.22em;
}

.archive-mark small,
.eyebrow,
.section-code,
.choice-count,
.footer-note,
.risk-seal span,
.quiet-button {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.archive-mark small {
  margin-top: 0.1rem;
  color: var(--paper-dim);
}

.archive-glyph {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-hot);
  color: var(--red-bright);
  font-family: var(--serif);
  font-size: 1.15rem;
  transform: rotate(-2deg);
}

.top-actions {
  display: flex;
  gap: 0.6rem;
}

.quiet-button {
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--paper-dim);
}

.quiet-button:not(:disabled):hover {
  border-color: var(--line);
  color: var(--paper);
  cursor: pointer;
}

.quiet-button:disabled {
  opacity: 0.62;
}

.quiet-button span {
  color: var(--red-bright);
}

main {
  padding: clamp(28px, 6vw, 72px) 0 32px;
}

.case-cabinet {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 14px;
  padding: 1px;
  border: 1px solid var(--line);
  background: var(--line);
  overflow: hidden;
}

.case-tab {
  position: relative;
  min-width: 0;
  min-height: 88px;
  padding: 0.9rem 0.8rem;
  border: 0;
  background: var(--panel-2);
  cursor: pointer;
  text-align: left;
}

.case-tab:hover {
  background: #162027;
}

.case-tab.is-active {
  background: linear-gradient(150deg, rgba(163, 58, 61, 0.17), rgba(117, 151, 161, 0.05)), var(--panel-2);
  box-shadow: inset 0 -2px var(--red-bright);
}

.case-tab span,
.case-tab strong,
.case-tab small {
  display: block;
}

.case-tab span,
.case-tab small {
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

.case-tab strong {
  margin: 0.32rem 0 0.45rem;
  overflow: hidden;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 0.96rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-tab.is-active span,
.case-tab.is-active small {
  color: var(--red-bright);
}

.case-frame {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.018), transparent 38%), var(--panel);
  box-shadow: 0 28px 80px var(--shadow);
}

.case-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0 70%, rgba(255, 255, 255, 0.014));
  mix-blend-mode: screen;
}

.case-index {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  color: var(--paper-dim);
  overflow: hidden;
}

.case-index::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 34%;
  width: 1px;
  height: 120px;
  background: var(--line-hot);
}

.vertical-label {
  align-self: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  writing-mode: vertical-rl;
}

.index-bottom {
  text-align: center;
}

.index-bottom span {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
}

.index-bottom strong {
  display: block;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.1;
}

.case-body {
  min-width: 0;
  padding: clamp(24px, 6vw, 72px);
}

.case-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.eyebrow,
.section-code {
  margin: 0 0 0.65rem;
  color: var(--blue);
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 500;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.6rem, 7vw, 5.7rem);
  line-height: 1;
  letter-spacing: 0.06em;
}

.risk-seal {
  width: 108px;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  text-align: center;
  border: 2px solid var(--line-hot);
  color: var(--red-bright);
  transform: rotate(4deg);
}

.risk-seal span,
.risk-seal strong {
  display: block;
}

.risk-seal strong {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.15em;
}

.case-rule {
  display: flex;
  align-items: center;
  height: 70px;
}

.case-rule::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 1px solid var(--red);
  transform: rotate(45deg);
}

.case-rule span {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--line-hot), var(--line) 38%, transparent);
}

.briefing {
  width: min(760px, 100%);
}

.briefing h2 {
  margin-bottom: 1.5rem;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.45;
}

.briefing > p:not(.section-code) {
  color: #bbb8ae;
  font-family: var(--serif);
  font-size: 1.08rem;
}

.notice {
  margin-bottom: 1.2rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--blue);
  color: #c8d8db;
  background: rgba(117, 151, 161, 0.08);
  font-size: 0.9rem;
}

.notice-warning {
  border-color: var(--line-hot);
  color: #e3babc;
  background: rgba(163, 58, 61, 0.08);
}

.case-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr)) auto;
  gap: 1px;
  margin: 0 0 2.4rem;
  border: 1px solid var(--line);
  background: var(--line);
}

.case-status > div,
.status-action {
  min-height: 72px;
  padding: 0.75rem 1rem;
  background: var(--panel-2);
}

.case-status span,
.case-status strong {
  display: block;
}

.case-status span {
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.case-status strong {
  margin-top: 0.16rem;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
}

.status-action {
  min-width: 150px;
  border: 0;
  color: #c7d4d6;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.76rem;
}

.status-action:hover {
  background: #162027;
}

.case-log:empty {
  display: none;
}

.case-log {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
}

.log-entry {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1.2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
  animation: enter 320ms ease both;
  scroll-margin-top: 1.5rem;
}

.log-time-part {
  display: block;
}

.log-time-part + .log-time-part {
  margin-top: 0.2rem;
  opacity: 0.85;
}

.log-time {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

.log-entry h3 {
  margin: 0 0 0.65rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
}

.log-entry p {
  max-width: 680px;
  margin-bottom: 0;
  color: #c3c0b6;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.manuscript {
  max-width: 720px;
  color: #c3c0b6;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.78;
}

.manuscript p {
  margin: 0 0 1rem;
}

.manuscript .manuscript-label {
  margin: 1.45rem 0 0.35rem;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.manuscript blockquote {
  margin: 1rem 0 1.2rem;
  padding: 0.8rem 1rem;
  border-left: 2px solid var(--line-hot);
  color: #d5d0c2;
  background: rgba(163, 58, 61, 0.045);
}

.manuscript ul {
  margin: 0.55rem 0 1.15rem;
  padding-left: 1.25rem;
}

.manuscript li {
  margin: 0.38rem 0;
}

.manuscript hr {
  height: 1px;
  margin: 1.4rem 0;
  border: 0;
  background: var(--line);
}

.manuscript code {
  padding: 0.08rem 0.28rem;
  color: #c8d8db;
  background: rgba(117, 151, 161, 0.08);
  font: 0.78em/1.4 var(--mono);
}

.log-entry .log-kind {
  display: inline-block;
  margin-bottom: 0.55rem;
  color: var(--red-bright);
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.08em;
}

.log-entry .choice-record {
  width: fit-content;
  margin-top: 0.9rem;
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--line);
  color: var(--paper-dim);
  font-family: var(--sans);
  font-size: 0.82rem;
}

.seen-label {
  display: none;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.collapse-seen .log-entry.was-seen:not(.changed-entry):not(.always-expanded) .log-content > h3,
.collapse-seen .log-entry.was-seen:not(.changed-entry):not(.always-expanded) .log-content > p,
.collapse-seen .log-entry.was-seen:not(.changed-entry):not(.always-expanded) .log-content > .manuscript,
.collapse-seen .log-entry.was-seen:not(.changed-entry):not(.always-expanded) .log-content > .log-kind {
  display: none;
}

.collapse-seen .log-entry.was-seen:not(.changed-entry):not(.always-expanded) .seen-label {
  display: block;
}

.intake-panel,
.choice-dock {
  margin-top: clamp(36px, 7vw, 76px);
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.intake-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.intake-panel h2 {
  margin-bottom: 0.4rem;
  font-size: 1.35rem;
}

.intake-panel p:last-child {
  margin-bottom: 0;
  color: var(--paper-dim);
}

.primary-action {
  flex: 0 0 auto;
  min-width: 215px;
  min-height: 82px;
  padding: 0.9rem 1.25rem;
  border: 1px solid var(--red-bright);
  background: linear-gradient(135deg, rgba(163, 58, 61, 0.28), rgba(163, 58, 61, 0.08));
  cursor: pointer;
  text-align: left;
}

.primary-action:hover {
  background-color: rgba(163, 58, 61, 0.18);
}

.primary-action span,
.primary-action small {
  display: block;
}

.primary-action span {
  font-family: var(--serif);
  font-size: 1.18rem;
  letter-spacing: 0.1em;
}

.primary-action small {
  margin-top: 0.25rem;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.choice-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.choice-count {
  color: var(--paper-dim);
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.choices.choice-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-button {
  min-height: 132px;
  padding: 1.1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  text-align: left;
}

.choice-button:hover {
  border-color: var(--blue);
  background: rgba(117, 151, 161, 0.07);
}

.choice-button strong,
.choice-button span {
  display: block;
}

.choice-button strong {
  margin-bottom: 0.5rem;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 500;
}

.choice-button span {
  color: var(--paper-dim);
  font-size: 0.9rem;
  line-height: 1.55;
}

.choice-button small {
  display: block;
  margin-top: 0.8rem;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.choice-button.is-danger {
  border-color: var(--line-hot);
}

.choice-button.is-selected {
  border-color: var(--red-bright);
  background: rgba(163, 58, 61, 0.1);
}

.hypothesis-summary {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--paper-dim);
}

.hypothesis-summary button {
  border: 0;
  border-bottom: 1px solid var(--blue);
  background: transparent;
  color: #b9cccf;
  cursor: pointer;
}

.result-panel {
  margin-top: clamp(44px, 8vw, 86px);
  padding-top: clamp(32px, 6vw, 62px);
  border-top: 1px solid var(--line-hot);
}

.result-card {
  position: relative;
  overflow: hidden;
  width: min(820px, 100%);
  padding: clamp(20px, 5vw, 42px);
  border: 1px solid #485258;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.035), transparent 42%),
    repeating-linear-gradient(0deg, transparent, transparent 4px, rgba(255, 255, 255, 0.012) 5px),
    #11181c;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}

.result-card::after {
  content: "ARCHIVE COPY";
  position: absolute;
  right: -22px;
  bottom: 22px;
  color: rgba(212, 91, 94, 0.15);
  font-family: var(--mono);
  font-size: clamp(1.8rem, 5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  transform: rotate(-5deg);
}

.card-topline,
.card-metrics {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.card-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: 2.2rem 0;
}

.card-body p {
  margin-bottom: 0.4rem;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.card-body h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0.08em;
}

.result-route {
  margin-top: 0.75rem !important;
  color: var(--blue) !important;
}

.result-stamp {
  flex: 0 0 auto;
  width: 108px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 3px double var(--red-bright);
  color: var(--red-bright);
  font-family: var(--serif);
  font-size: 1.55rem;
  letter-spacing: 0.08em;
  transform: rotate(5deg);
}

.result-card blockquote {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 0 2rem;
  color: #d0ccc0;
  font-family: var(--serif);
  font-size: clamp(1rem, 2.4vw, 1.3rem);
}

.ending-copy {
  width: min(720px, 100%);
  margin: clamp(38px, 7vw, 70px) 0;
}

.ending-kicker {
  margin-bottom: 0.5rem;
  color: var(--red-bright);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.09em;
}

.ending-copy h2 {
  margin-bottom: 1.4rem;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
}

.ending-copy #ending-body p {
  color: #c7c3b8;
  font-family: var(--serif);
  font-size: 1.08rem;
}

.share-box {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.8fr);
  gap: 2rem;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.share-box #share-preview {
  margin-bottom: 0;
  color: var(--paper-dim);
  white-space: pre-line;
}

.result-actions {
  display: grid;
  gap: 0.65rem;
}

.secondary-action,
.dialog-close {
  min-height: 46px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.secondary-action:hover,
.dialog-close:hover {
  border-color: var(--blue);
  background: rgba(117, 151, 161, 0.06);
}

.copy-fallback {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 120px;
  padding: 0.8rem;
  border: 1px solid var(--line-hot);
  color: var(--paper);
  background: var(--ink);
  font: 0.9rem/1.6 var(--mono);
  resize: vertical;
}

.replay-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.primary-action.compact {
  width: 100%;
  min-width: 0;
  min-height: 72px;
}

.quiet-primary {
  border-color: var(--line);
  background: rgba(117, 151, 161, 0.05);
}

dialog {
  color: var(--paper);
}

dialog::backdrop {
  background: rgba(2, 4, 6, 0.8);
  backdrop-filter: blur(4px);
}

.archive-dialog,
.confirm-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 40px));
  margin: auto;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid #465159;
  background: var(--panel);
  box-shadow: 0 32px 100px #000;
}

.archive-wide {
  width: min(920px, calc(100% - 28px));
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.dialog-heading h2 {
  margin-bottom: 0;
  font-size: 1.8rem;
}

.dialog-close {
  flex: 0 0 auto;
  min-height: 42px;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.dialog-intro {
  margin: 1.2rem 0 1.5rem;
  color: var(--paper-dim);
}

.evidence-columns {
  display: grid;
  gap: 1rem;
}

.evidence-group {
  padding: 1rem;
  border: 1px solid var(--line);
}

.evidence-group h3 {
  margin: 0 0 0.6rem;
  color: var(--blue);
  font: 0.75rem/1.4 var(--mono);
  letter-spacing: 0.08em;
}

.evidence-item {
  padding: 0.65rem 0;
  border-top: 1px solid rgba(39, 48, 55, 0.65);
}

.evidence-item:first-of-type {
  border-top: 0;
}

.evidence-item strong,
.evidence-item span {
  display: block;
}

.evidence-item strong {
  font-family: var(--serif);
  font-weight: 500;
}

.evidence-item span {
  color: var(--paper-dim);
  font-size: 0.88rem;
}

.empty-state {
  padding: 2rem 1rem;
  border: 1px dashed var(--line);
  color: var(--paper-dim);
  text-align: center;
}

.archive-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.archive-card {
  padding: 1.15rem;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.archive-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.archive-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 500;
}

.archive-card .mini-stamp {
  color: var(--red-bright);
  font-family: var(--serif);
}

.archive-card p,
.archive-card time {
  color: var(--paper-dim);
  font-size: 0.82rem;
}

.archive-card details {
  margin-top: 0.9rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.archive-card summary {
  color: #bccdd0;
  cursor: pointer;
}

.archive-card details p {
  margin: 0.6rem 0 0;
  color: #bdb9af;
}

.archive-card .archive-private-copy {
  max-height: 320px;
  margin-top: 0.8rem;
  padding-right: 0.35rem;
  overflow: auto;
  font-size: 0.9rem;
}

.archive-open {
  margin-top: 0.9rem;
  padding: 0.42rem 0;
  border: 0;
  border-bottom: 1px solid var(--blue);
  color: #b9cccf;
  background: transparent;
  cursor: pointer;
  font: 0.72rem/1.4 var(--mono);
}

.setting-list {
  display: grid;
}

.setting-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 78px;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.setting-list strong,
.setting-list small {
  display: block;
}

.setting-list strong {
  font-family: var(--serif);
  font-weight: 500;
}

.setting-list small {
  color: var(--paper-dim);
  font-size: 0.8rem;
}

.setting-list input {
  width: 22px;
  height: 22px;
  accent-color: var(--red);
}

.danger-link {
  margin-top: 1.4rem;
  padding: 0.55rem 0;
  border: 0;
  border-bottom: 1px solid var(--line-hot);
  color: #d99294;
  background: transparent;
  cursor: pointer;
}

.confirm-dialog h2 {
  margin-bottom: 0.8rem;
  font-size: 1.8rem;
}

.confirm-dialog > p:not(.section-code) {
  color: var(--paper-dim);
}

#confirm-copy {
  max-height: min(55vh, 520px);
  overflow: auto;
}

#confirm-copy .credential-preview {
  margin: 1.2rem 0 0;
  padding: 0.8rem;
  border: 1px solid var(--line-hot);
  color: #d8b7b8;
  background: rgba(163, 58, 61, 0.06);
  font: 0.74rem/1.6 var(--mono);
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 0.8rem 1rem;
  border: 1px solid var(--blue);
  color: var(--paper);
  background: #121b20;
  box-shadow: 0 12px 40px #000;
}

.large-text .briefing > p:not(.section-code),
.large-text .log-entry p,
.large-text .ending-copy #ending-body p,
.large-text .manuscript {
  font-size: 1.22rem;
}

.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

.footer-note {
  min-height: 84px;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  color: #686e70;
}

[hidden] {
  display: none !important;
}

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 22px, 680px);
  }

  .topbar {
    min-height: 76px;
  }

  .archive-mark small,
  .case-index {
    display: none;
  }

  .case-frame {
    grid-template-columns: minmax(0, 1fr);
  }

  .case-cabinet {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .case-body {
    padding: 22px;
  }

  .risk-seal {
    width: 80px;
  }

  .case-rule {
    height: 46px;
  }

  .intake-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action {
    width: 100%;
  }

  .choices {
    grid-template-columns: 1fr;
  }

  .choices.choice-grid-2 {
    grid-template-columns: 1fr;
  }

  .choice-button {
    min-height: auto;
  }

  .log-entry {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  /* 窄屏时地标签回到一行，用 / 分隔 */
  .log-time-part {
    display: inline;
  }

  .log-time-part + .log-time-part {
    margin-top: 0;
    opacity: 1;
  }

  .log-time-part + .log-time-part::before {
    content: " / ";
    opacity: 0.6;
  }

  .case-status {
    grid-template-columns: repeat(3, 1fr);
  }

  .status-action {
    grid-column: 1 / -1;
  }

  .share-box {
    grid-template-columns: 1fr;
  }

  .archive-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .archive-glyph {
    width: 36px;
    height: 36px;
  }

  .archive-mark strong {
    font-size: 0.93rem;
  }

  .case-cabinet {
    display: flex;
    margin-inline: -11px;
    padding-inline: 11px;
    border-inline: 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .case-tab {
    flex: 0 0 132px;
    scroll-snap-align: start;
  }

  .quiet-button {
    padding-inline: 0.4rem;
  }

  h1 {
    max-width: 12ch;
    font-size: 2rem;
    line-height: 1.16;
    white-space: normal;
  }

  .case-heading {
    gap: 0.7rem;
  }

  .risk-seal {
    width: 68px;
    border-width: 1px;
  }

  .risk-seal span {
    font-size: 0.62rem;
  }

  .risk-seal strong {
    font-size: 1rem;
  }

  .footer-note {
    flex-direction: column;
    justify-content: flex-start;
  }

  .top-actions {
    gap: 0;
  }

  .top-actions .quiet-button {
    font-size: 0.7rem;
  }

  .case-status {
    grid-template-columns: 1fr 1fr;
  }

  .case-status > div:nth-child(3) {
    grid-column: 1 / -1;
  }

  .card-body {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-stamp {
    width: 82px;
  }

  .card-metrics,
  .replay-actions,
  .confirm-actions {
    grid-template-columns: 1fr;
  }

  .card-metrics {
    display: grid;
  }

  .archive-dialog,
  .confirm-dialog {
    max-height: calc(100vh - 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* unfiled-cloud-save v1 */
.save-code-block {
  margin: 1.4rem 0 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  display: grid;
  gap: 0.6rem;
}

.save-code-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

.save-code-value {
  margin: 0;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.08em;
  word-break: break-all;
}

.save-code-note,
.save-code-status {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.6;
  opacity: 0.75;
}

.save-code-restore {
  display: grid;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.save-code-restore input {
  padding: 0.55rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
}

.content-warning {
  margin: 0.9rem 0 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted, #6b6b6b);
  opacity: 0.85;
}

/* ---------- 进入封面 ---------- */
.title-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(24px, 6vw, 64px);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 50% 22%, rgba(163, 58, 61, 0.14), transparent 30rem),
    radial-gradient(circle at 78% 88%, rgba(77, 111, 120, 0.12), transparent 26rem),
    var(--ink);
  background-size: 100% 4px, auto, auto, auto;
  opacity: 1;
  transition: opacity 420ms ease;
}

.title-screen.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.title-screen-inner {
  display: grid;
  justify-items: center;
  gap: 1.15rem;
  text-align: center;
  max-width: 44rem;
}

.title-screen-glyph {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-hot);
  color: var(--red-bright);
  font-family: var(--serif);
  font-size: 1.7rem;
  transform: rotate(-2deg);
  margin-bottom: 0.6rem;
}

.title-screen-en {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(2.1rem, 9vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--paper);
}

.title-screen-cn {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 4.6vw, 2.15rem);
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: var(--paper);
}

.title-screen-line {
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  color: var(--blue);
}

.title-screen-line span {
  color: var(--red-bright);
  margin-right: 0.4em;
}

.title-screen-index {
  list-style: none;
  margin: 0.9rem 0 0.3rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.title-screen-index li {
  min-width: 2.6rem;
  padding: 0.28rem 0.1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--paper-dim);
}

.title-screen-index li.is-open {
  border-bottom-color: var(--line-hot);
  color: var(--paper);
}

.title-screen-index li.is-blank {
  color: transparent;
}

.title-screen-enter {
  margin-top: 1.1rem;
  min-width: 248px;
  min-height: 0;
  padding: 1.05rem 2.4rem;
  text-align: center;
}

.title-screen-enter span {
  text-align: center;
}

@media (max-width: 430px) {
  .title-screen-index li {
    min-width: 2.2rem;
    font-size: 0.74rem;
  }
}

.reduce-motion .title-screen {
  transition: none;
}

/* 弹窗打开时锁住背景滚动，并保住原来的阅读位置 */
html.dialog-open body {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  padding-right: var(--scrollbar-gutter, 0px);
}
