:root {
  --bg: #07080b;
  --panel: #10131a;
  --panel-strong: #171b24;
  --ink: #f6f8fc;
  --muted: #aab5c7;
  --line: rgba(255, 255, 255, 0.16);
  --error: #ff2635;
  --orange: #ff9300;
  --acid: #a6ff39;
  --cyan: #39d5ff;
  --violet: #b974ff;
  --gold: #ffd35a;
  --pad: clamp(16px, 3vw, 38px);
  --gap: clamp(16px, 2.2vw, 32px);
  --shadow: 0 22px 62px rgba(0, 0, 0, 0.48);

  /* === 字體系統：3 套字體，避免混搭過度 === */
  --font-sans: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-serif: "Noto Serif TC", "Source Han Serif TC", "PMingLiU", serif;
  --font-mono: "Share Tech Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
  /* 別名：display / deco 統一回到 sans，減少視覺噪音 */
  --font-display: var(--font-sans);
  --font-deco: var(--font-mono);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(0deg, rgba(6, 5, 7, 0.92) 0 9%, transparent 28%),
    radial-gradient(ellipse at 52% 92%, rgba(255, 38, 53, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(255, 38, 53, 0.16), transparent 32%),
    linear-gradient(225deg, rgba(57, 213, 255, 0.12), transparent 38%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 10px),
    linear-gradient(135deg, #07080b 0%, #151017 48%, #061018 100%);
  font-family: var(--font-sans);
  letter-spacing: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

@supports (overflow: clip) {
  html {
    overflow-x: hidden;
  }

  body {
    overflow-x: hidden;
  }
}

body::before {
  content: "ERROR ERROR ERROR ERROR";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 2vh;
  z-index: -1;
  color: rgba(255, 38, 53, 0.06);
  font-size: 8rem;
  font-weight: 1000;
  line-height: 0.82;
  text-align: right;
  transform: rotate(-8deg);
  pointer-events: none;
}

/* === 背景大小不一的 ERROR 浮字雲（JS 動態填充） === */
.error-cloud {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.error-cloud .err {
  position: absolute;
  left: var(--ex, 50%);
  top: var(--ey, 50%);
  color: rgba(255, 38, 53, 0.05);
  font-family: var(--font-serif);
  font-size: var(--es, 2rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  transform: translate(-50%, -50%) rotate(var(--er, 0deg));
  white-space: nowrap;
  user-select: none;
  animation: errorPulse var(--ed, 10s) ease-in-out infinite;
  animation-delay: var(--edelay, 0s);
}

@keyframes errorPulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.7; }
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  background:
    linear-gradient(90deg, rgba(255, 38, 53, 0.1) 0 1px, transparent 1px 12px),
    linear-gradient(0deg, rgba(57, 213, 255, 0.08) 0 1px, transparent 1px 16px),
    repeating-conic-gradient(from 45deg, rgba(255, 255, 255, 0.08) 0 8deg, transparent 8deg 18deg);
  mix-blend-mode: screen;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 72%);
}

button,
input {
  font: inherit;
}

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

.noise-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(255, 255, 255, 0.22) 3px),
    repeating-linear-gradient(90deg, rgba(255, 38, 53, 0.1) 0 1px, transparent 2px 9px);
  mix-blend-mode: screen;
  contain: paint;
}

.particle-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.72;
  contain: paint;
}

.jump-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-content: center;
  gap: 16px;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 50%, rgba(166, 255, 57, 0.26), transparent 22%),
    linear-gradient(90deg, rgba(255, 38, 53, 0.98), rgba(6, 8, 11, 0.98) 48%, rgba(57, 213, 255, 0.76)),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.3) 0 8px, rgba(255, 255, 255, 0.11) 9px 14px, transparent 15px 26px),
    repeating-conic-gradient(from 45deg, rgba(255, 255, 255, 0.18) 0 7deg, transparent 7deg 18deg);
  opacity: 0;
  visibility: hidden;
  transform: translateX(115%);
  text-align: center;
  pointer-events: none;
  overflow: hidden;
  contain: paint;
  max-width: 100%;
}

.jump-overlay::before,
.jump-overlay::after {
  content: "ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR";
  position: absolute;
  left: 0;
  right: 0;
  color: rgba(166, 255, 57, 0.22);
  font-size: 4rem;
  font-weight: 1000;
  line-height: 0.9;
  word-spacing: 0.4em;
  transform: rotate(-8deg);
}

.jump-overlay::before {
  top: 8vh;
}

.jump-overlay::after {
  bottom: 8vh;
  color: rgba(57, 213, 255, 0.2);
  transform: rotate(7deg);
}

.error-rain {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: space-around;
  color: rgba(255, 255, 255, 0.2);
  font-size: 3rem;
  font-weight: 1000;
  line-height: 1.15;
  text-align: left;
  text-transform: uppercase;
  word-spacing: 0.5em;
  padding: 20px;
  max-width: 100%;
  overflow: hidden;
  transform: skewX(-9deg);
}

.jump-overlay span {
  font-size: 11rem;
  font-weight: 1000;
  line-height: 0.82;
  text-shadow: 6px 0 var(--cyan), -6px 0 #050507;
}

.jump-overlay small {
  color: var(--acid);
  font-size: 1.22rem;
  font-weight: 1000;
}

.jump-fragment {
  position: absolute;
  left: var(--frag-x, 50%);
  top: var(--frag-y, 50%);
  width: var(--frag-w, 120px);
  height: var(--frag-h, 12px);
  color: rgba(255, 255, 255, 0.86);
  background:
    repeating-linear-gradient(90deg, var(--error) 0 8px, #050507 8px 13px, var(--cyan) 13px 18px),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(255, 255, 255, 0.92) 2px 4px);
  box-shadow: 0 0 36px rgba(255, 38, 53, 0.68);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 1000;
  line-height: 1;
  overflow: hidden;
  mix-blend-mode: screen;
  opacity: 0;
  transform: translateX(120vw) skewX(var(--frag-skew, -12deg));
  animation: transferFragment 980ms steps(4, end) both;
}

body.is-jumping .jump-overlay {
  opacity: 1;
  visibility: visible;
  animation: errorSweep 1120ms cubic-bezier(0.18, 0.86, 0.28, 1) both;
}

body.is-jumping .main-stage {
  animation: stageDislocate 960ms steps(3, end) both;
}

/* === Header：簡潔品牌列（一行設計，無多餘裝飾） === */
.system-bar {
  position: relative;
  z-index: 10;
  color: var(--ink);
  background: rgba(8, 10, 14, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.bar-main {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad);
  max-width: 1440px;
  margin: 0 auto;
}

.bar-brand {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bar-brand strong {
  color: #fff;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.bar-brand span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.top-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 4px;
  transition: color 160ms ease;
}

.top-action::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 2px;
  background: var(--error);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 200ms ease;
}

.top-action:hover,
.top-action.active {
  color: #fff;
}

.top-action:hover::after,
.top-action.active::after {
  transform: scaleX(1);
}

.site-shell {
  position: relative;
  z-index: 50;
  display: block;
  min-height: 100vh;
  max-width: 100%;
}

/* sidebar 為懸浮（fixed）覆蓋層，不再佔據版面寬度；開啟時蓋在主內容上方 */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 46;
  width: min(88vw, 420px);
  height: 100dvh;
  padding: clamp(14px, 2vw, 24px);
  border-right: 1px solid var(--line);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 38, 53, 0.09), rgba(57, 213, 255, 0.04)),
    rgba(7, 8, 11, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: 24px 0 56px rgba(0, 0, 0, 0.56);
  overflow: auto;
  transform: translateX(0);
  transition: transform 220ms ease, opacity 180ms ease;
}

body.sidebar-fixed .sidebar {
  /* 已是 fixed，保留 class 以便其他樣式相容 */
  top: 0;
}

body.sidebar-hidden .sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-104%);
}

/* sidebar 開啟時加半透明遮罩，提示懸浮層 */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(4, 6, 10, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.seal {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.seal-mark {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 3px solid var(--error);
  border-radius: 8px;
  color: var(--error);
  background: rgba(255, 38, 53, 0.12);
  box-shadow: 0 0 28px rgba(255, 38, 53, 0.28);
  font-family: var(--font-deco);
  font-size: 0.96rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px rgba(255, 38, 53, 0.65);
}

.seal strong {
  display: block;
  font-size: 1.18rem;
  line-height: 1.25;
}

.seal span:last-child {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--acid);
  font-size: 0.86rem;
  font-weight: 1000;
}

.sidebar-note,
.legend {
  border: 1px solid rgba(57, 213, 255, 0.24);
  border-radius: 8px;
  background: rgba(57, 213, 255, 0.06);
  padding: 14px;
}

.sidebar-note strong,
.legend h2 {
  display: block;
  margin: 0;
  color: var(--cyan);
  font-size: 1rem;
  line-height: 1.35;
}

.sidebar-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.legend {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.side-archive {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.sidebar .archive-tools {
  grid-template-columns: 1fr;
  padding: 12px;
}

.sidebar .tier-filters {
  justify-content: flex-start;
}

.sidebar .tier-button {
  min-height: 44px;
  font-size: 0.86rem;
  padding: 8px 10px;
}

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

.sidebar .nav-button {
  min-height: 112px;
}

.legend span {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: #dbe3ef;
  font-size: 0.95rem;
  line-height: 1.5;
}

.dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 999px;
}

.dot.omega {
  background: var(--error);
}

.dot.volatile {
  background: var(--orange);
}

.dot.stable {
  background: var(--cyan);
}

.sidebar-toggle {
  position: fixed;
  top: 116px;
  /* sidebar 開啟時 toggle 緊貼 sidebar 右緣（sidebar 寬 min(88vw, 420px)） */
  left: min(calc(88vw - 20px), 400px);
  z-index: 47;
  display: grid;
  place-items: center;
  width: 38px;
  height: 48px;
  border: 1px solid rgba(255, 38, 53, 0.72);
  border-radius: 0 8px 8px 0;
  color: var(--acid);
  background:
    linear-gradient(90deg, rgba(255, 38, 53, 0.62), rgba(6, 8, 11, 0.92)),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(255, 255, 255, 0.12) 8px);
  box-shadow: 0 0 26px rgba(255, 38, 53, 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transform: none;
  transition: left 220ms ease, transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.sidebar-toggle:hover {
  border-color: var(--acid);
  background:
    linear-gradient(90deg, rgba(166, 255, 57, 0.32), rgba(6, 8, 11, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(255, 255, 255, 0.16) 8px);
}

.sidebar-toggle span {
  display: block;
  width: 11px;
  height: 11px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  filter: drop-shadow(0 0 10px rgba(166, 255, 57, 0.9));
  transform: rotate(225deg);
  transition: transform 220ms ease;
}

.sidebar-toggle::before,
.sidebar-toggle::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

body.sidebar-hidden .sidebar-toggle {
  left: 10px;
  border-radius: 8px;
}

body.archive-page .main-stage {
  max-width: 1280px;
  margin-inline: auto;
}

/* archive 頁 sidebar 收起時，toggle 貼齊左上 */
body.archive-page.sidebar-hidden .sidebar-toggle {
  top: 108px;
  left: 12px;
  opacity: 0.72;
}

body.archive-page .paper-panel {
  background:
    linear-gradient(90deg, rgba(255, 38, 53, 0.16) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, rgba(21, 25, 33, 0.96), rgba(9, 11, 16, 0.94));
}

body.archive-page .paper-panel::before {
  opacity: 0.18;
}

body.sidebar-hidden .sidebar-toggle span {
  transform: rotate(45deg);
}

.main-stage {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
}

.hero {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  max-width: 100%;
  border-bottom: 5px solid var(--error);
}

.hero img {
  display: block;
  width: 100%;
  height: 500px;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.26) contrast(1.22) brightness(0.68);
  transform: scale(1.02);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 8, 11, 0.94), rgba(7, 8, 11, 0.26) 58%, rgba(255, 38, 53, 0.28)),
    repeating-linear-gradient(0deg, transparent 0 10px, rgba(255, 255, 255, 0.055) 11px);
}

.hero-copy {
  position: absolute;
  left: clamp(20px, 5vw, 82px);
  bottom: clamp(28px, 5vw, 70px);
  z-index: 1;
  max-width: min(900px, 88vw);
}

.hero-copy h1 {
  position: relative;
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-size: 4.6rem;
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-shadow: 3px 0 var(--error), -3px 0 var(--cyan), 0 16px 36px rgba(0, 0, 0, 0.66);
  overflow-wrap: anywhere;
  isolation: isolate;
}

.hero-copy h1.title-glitching {
  animation: titleSignalBreak var(--burst-life, 560ms) steps(3, end) both;
}

.title-noise-channel {
  position: absolute;
  inset: 0;
  z-index: 1;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.title-noise-channel.red {
  color: var(--error);
}

.title-noise-channel.cyan {
  color: var(--cyan);
}

.hero-copy h1.title-glitching .title-noise-channel.red {
  animation: rgbTearRed var(--burst-life, 560ms) steps(2, end) both;
}

.hero-copy h1.title-glitching .title-noise-channel.cyan {
  animation: rgbTearCyan var(--burst-life, 560ms) steps(2, end) both;
}

.title-mosaic-layer {
  position: absolute;
  inset: -10% -2%;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  contain: paint;
}

.title-mosaic {
  position: absolute;
  display: block;
  width: var(--mosaic-w, 18%);
  height: var(--mosaic-h, 20px);
  left: var(--mosaic-x, 0);
  top: var(--mosaic-y, 0);
  color: hsl(var(--mosaic-hue, 350) 100% 62%);
  background:
    repeating-linear-gradient(90deg, hsl(var(--mosaic-hue, 350) 100% 58%) 0 2px, #050507 2px 5px, var(--cyan) 5px 7px, transparent 7px 11px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.92) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 38%, rgba(166, 255, 57, 0.26));
  box-shadow: 0 0 14px hsl(var(--mosaic-hue, 350) 100% 58% / 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  font-family: var(--font-mono);
  font-size: var(--mosaic-font, 1rem);
  font-weight: 1000;
  line-height: 1;
  image-rendering: pixelated;
  mix-blend-mode: screen;
  opacity: 0;
  overflow: hidden;
  text-shadow: 2px 0 var(--error), -2px 0 var(--cyan);
  transform: translate(var(--mosaic-dx, 0), var(--mosaic-dy, 0)) skewX(var(--mosaic-skew, 0deg));
  animation: mosaicBlink var(--mosaic-life, 420ms) steps(2, end) both;
}

.hero-copy p:last-child {
  max-width: 800px;
  margin: 0;
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.6;
}

body[data-file]:not([data-file="bureau"]) .hero,
body[data-file]:not([data-file="bureau"]) .case-index {
  display: none;
}

.case-index {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 3vw, 36px) var(--pad);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 38, 53, 0.16), rgba(57, 213, 255, 0.08)),
    rgba(7, 8, 11, 0.78);
}

.case-index-head {
  display: grid;
  gap: 6px;
}

.case-index-head span {
  color: var(--acid);
  font-size: 0.88rem;
  font-weight: 1000;
}

.case-index-head h2 {
  margin: 0;
  font-size: 2.7rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.case-index-head p {
  max-width: 980px;
  margin: 0;
  color: #c9d2e1;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.7;
}

.archive-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: end;
  border: 1px solid rgba(57, 213, 255, 0.26);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 14px),
    rgba(255, 255, 255, 0.045);
  padding: 14px;
}

.search-box {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.search-box span {
  color: var(--cyan);
  font-size: 0.88rem;
  font-weight: 1000;
}

.search-box input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.36);
  font-size: 1rem;
  padding: 10px 12px;
}

.search-box input::placeholder {
  color: rgba(170, 181, 199, 0.72);
}

.tier-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tier-button {
  min-height: 44px;
  border: 1px solid rgba(166, 255, 57, 0.32);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(166, 255, 57, 0.06);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 1000;
  padding: 8px 12px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.tier-button:hover,
.tier-button.active {
  color: #050507;
  border-color: var(--acid);
  background: var(--acid);
  transform: translateY(-1px);
}

.nav-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 188px), 1fr));
  gap: 12px;
}

.nav-group {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  margin-bottom: 10px;
}

.nav-group h3 {
  margin: 4px 0 0;
  border-left: 5px solid var(--error);
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1.2;
  padding-left: 10px;
}

.nav-button {
  --nav-glow: rgba(255, 38, 53, 0.24);
  position: relative;
  display: grid;
  min-height: 144px;
  align-content: space-between;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(16, 19, 26, 0.96);
  text-align: left;
  cursor: pointer;
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.nav-button[data-case-tier="omega"] {
  --nav-glow: rgba(255, 38, 53, 0.32);
}

.nav-button[data-case-tier="volatile"] {
  --nav-glow: rgba(255, 147, 0, 0.28);
}

.nav-button[data-case-tier="stable"] {
  --nav-glow: rgba(57, 213, 255, 0.24);
}

.nav-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, var(--nav-glow), transparent 42%),
    linear-gradient(120deg, transparent 0 44%, rgba(166, 255, 57, 0.18) 45% 47%, transparent 48%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.nav-button::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 2px;
  background: linear-gradient(90deg, var(--error), var(--acid));
  transform: scaleX(0.45);
  transform-origin: right;
  transition: transform 180ms ease;
}

.nav-button:hover,
.nav-button.active {
  border-color: rgba(166, 255, 57, 0.72);
  background: rgba(18, 24, 31, 0.98);
  box-shadow: 0 0 26px rgba(166, 255, 57, 0.16), inset 0 0 0 1px rgba(166, 255, 57, 0.18);
  transform: translateY(-4px);
}

.nav-button:hover::before,
.nav-button.active::before {
  opacity: 1;
}

.nav-button:hover::after,
.nav-button.active::after {
  transform: scaleX(1);
}

.nav-index {
  position: relative;
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  color: #050507;
  background: var(--acid);
  font-size: 0.76rem;
  font-weight: 1000;
  padding: 4px 8px;
}

.nav-button strong {
  position: relative;
  display: block;
  margin-top: 12px;
  font-size: 1.16rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.nav-button small {
  position: relative;
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.3;
}

.empty-index {
  grid-column: 1 / -1;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.24);
  font-size: 1.08rem;
  font-weight: 850;
  padding: 20px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(310px, 0.72fr);
  gap: var(--gap);
  padding: var(--pad);
  max-width: 100%;
}

.paper-panel,
.evidence-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 38, 53, 0.16) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03)),
    var(--panel);
  box-shadow: var(--shadow);
}

.paper-panel::before,
.evidence-panel::before,
.character-profile::before,
.terminal-dossier::before {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.paper-panel::before {
  inset: 0;
  background:
    url("assets/forensic-document-marks.png") right 18px top 18px / min(72%, 720px) auto no-repeat,
    radial-gradient(circle at 94% 12%, rgba(255, 38, 53, 0.18), transparent 22%),
    linear-gradient(135deg, rgba(255, 38, 53, 0.08), transparent 36%);
  opacity: 0.34;
  mix-blend-mode: screen;
}

.paper-panel::after,
.report-section::after,
.abstract::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  right: 18px;
  bottom: 14px;
  width: min(46%, 360px);
  height: min(42%, 280px);
  background: url("assets/forensic-document-marks.png") right bottom / contain no-repeat;
  opacity: 0.16;
  transform: rotate(4deg);
  mix-blend-mode: screen;
}

.paper-panel > *,
.evidence-panel > * {
  position: relative;
  z-index: 1;
}

.report-section,
.abstract {
  position: relative;
  overflow: hidden;
}

.report-section > *,
.abstract > * {
  position: relative;
  z-index: 1;
}

.evidence-panel::before {
  right: -42px;
  bottom: -28px;
  width: 320px;
  height: 250px;
  background: url("assets/forensic-document-marks.png") right bottom / contain no-repeat;
  opacity: 0.2;
  transform: rotate(8deg);
}

.character-profile::before {
  left: 48%;
  bottom: -40px;
  width: 300px;
  height: 230px;
  background: url("assets/forensic-document-marks.png") right bottom / contain no-repeat;
  opacity: 0.18;
  transform: rotate(-18deg);
}

.terminal-dossier {
  position: relative;
}

.terminal-dossier::before {
  left: 18px;
  top: 16px;
  width: 120px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(110, 0, 14, 0.42), transparent);
  opacity: 0.18;
  transform: rotate(7deg);
}

.paper-panel {
  padding: clamp(18px, 3vw, 34px);
  opacity: 1;
  animation: panelIn 420ms ease both;
}

.dossier-layout {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
}

.file-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.58fr);
  gap: var(--gap);
  align-items: center;
}

.file-image {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 420px;
  min-height: 0;
  justify-self: center;
  border: 2px solid rgba(255, 38, 53, 0.64);
  border-radius: 8px;
  background-image:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.28)),
    url("assets/anomaly-sheet.png");
  background-size: 500% auto;
  background-position: var(--sprite-x) var(--sprite-y);
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 34px rgba(255, 38, 53, 0.24);
}

.file-intro {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px;
  margin-top: 18px;
}

.quick-facts span {
  display: grid;
  gap: 4px;
  min-height: 64px;
  border: 1px solid rgba(166, 255, 57, 0.26);
  border-left: 5px solid var(--acid);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.24);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.3;
  padding: 10px 12px;
}

.quick-facts strong {
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.hex-media {
  position: relative;
  overflow: hidden;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}

.hex-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(166, 255, 57, 0.2), transparent 26%),
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(255, 255, 255, 0.07) 10px);
  mix-blend-mode: screen;
  pointer-events: none;
}

.overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: var(--gap);
  align-items: center;
  border: 1px solid rgba(255, 38, 53, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 38, 53, 0.18), rgba(57, 213, 255, 0.08)),
    repeating-linear-gradient(-45deg, transparent 0 18px, rgba(255, 255, 255, 0.04) 19px 28px);
  padding: clamp(16px, 2.4vw, 28px);
}

.overview-hero h2 {
  margin-top: 12px;
}

.system-board,
.level-ladder {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

/* === levels 頁全新設計：純說明、無分數雷達 === */
body[data-page-type="levels"] .content-grid {
  grid-template-columns: 1fr;
}

body[data-page-type="levels"] .evidence-panel {
  display: none;
}

.levels-hero {
  padding: clamp(12px, 2vw, 24px) 0 clamp(16px, 2.4vw, 28px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: clamp(20px, 3vw, 32px);
}

.levels-hero .eyebrow {
  margin: 0 0 8px;
  color: var(--error);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
}

.levels-hero h2 {
  margin: 0 0 12px;
  color: #fff;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.levels-lead {
  margin: 0 0 18px;
  color: #d8deea;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.7;
  max-width: 60ch;
}

.levels-criteria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px 24px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.025);
}

.levels-criteria > div {
  display: grid;
  gap: 2px;
}

.levels-criteria dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.levels-criteria dd {
  margin: 0;
  color: #e6ecf6;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* 階梯主體：垂直時間軸 */
.level-ladder {
  display: grid;
  gap: clamp(14px, 2vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: level-step;
}

.level-step {
  position: relative;
  display: grid;
  grid-template-columns: clamp(110px, 18vw, 168px) minmax(0, 1fr);
  gap: clamp(16px, 2.5vw, 28px);
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--level-color, var(--muted));
  border-radius: 4px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--level-color, #aab5c7) 8%, transparent), transparent 60%),
    rgba(8, 10, 14, 0.6);
}

.level-step.lv-0     { --level-color: #6f7a8a; }
.level-step.lv-1     { --level-color: #4ad6ff; }
.level-step.lv-2     { --level-color: #59c45c; }
.level-step.lv-3     { --level-color: #f6d54a; }
.level-step.lv-4     { --level-color: #ff9b3d; }
.level-step.lv-5     { --level-color: #ff4d6d; }
.level-step.lv-omega { --level-color: #ff2635; }

.level-step-mark {
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: center;
  padding-top: 4px;
}

.level-code {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  min-width: 64px;
  padding: 6px 14px;
  border: 1px solid var(--level-color);
  border-radius: 2px;
  color: var(--level-color);
  background: color-mix(in srgb, var(--level-color) 16%, transparent);
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.scope-glyph {
  width: clamp(80px, 12vw, 116px);
  height: clamp(80px, 12vw, 116px);
  color: var(--level-color);
}

.level-step-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.level-step-body h3 {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: clamp(1.2rem, 1.8vw, 1.46rem);
  font-weight: 900;
  line-height: 1.25;
}

.level-scope {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: clamp(0.84rem, 1vw, 0.94rem);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.level-step-body > p {
  margin: 0;
  color: #d8deea;
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 1.2vw, 1rem);
  line-height: 1.7;
  max-width: 70ch;
}

.level-cases {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.level-cases > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-right: 4px;
}

.level-case-chip {
  border: 1px solid color-mix(in srgb, var(--level-color) 40%, transparent);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--level-color);
  background: color-mix(in srgb, var(--level-color) 8%, transparent);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.level-case-chip:hover,
.level-case-chip:focus-visible {
  background: var(--level-color);
  border-color: var(--level-color);
  color: #0a0c10;
  outline: none;
}

.level-cases-empty em {
  color: var(--muted);
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 0.88rem;
}

@media (max-width: 640px) {
  .level-step {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .level-step-mark {
    grid-template-columns: auto auto;
    justify-items: start;
    align-items: center;
    gap: 14px;
  }

  .scope-glyph {
    width: 64px;
    height: 64px;
  }
}

.archive-map {
  margin-top: 22px;
  border: 1px solid rgba(57, 213, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(57, 213, 255, 0.08), rgba(255, 38, 53, 0.08)),
    rgba(255, 255, 255, 0.04);
  padding: clamp(16px, 2vw, 24px);
}

.archive-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}

.archive-card.nav-button {
  width: 100%;
  min-height: 148px;
  border-left: 6px solid var(--error);
  padding: 18px;
  text-align: left;
}

.archive-card {
  position: relative;
  display: grid;
  min-height: 150px;
  align-content: space-between;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 6px solid var(--error);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.24);
  cursor: pointer;
  padding: 14px;
  text-align: left;
}

.archive-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 44%, rgba(166, 255, 57, 0.18) 45% 47%, transparent 48%),
    radial-gradient(circle at 82% 24%, rgba(255, 38, 53, 0.22), transparent 32%);
  opacity: 0;
  transition: opacity 160ms ease;
}

.archive-card:hover::before {
  opacity: 1;
}

.archive-card > * {
  position: relative;
  z-index: 1;
}

.archive-card span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  color: #050507;
  background: var(--acid);
  font-size: 0.78rem;
  font-weight: 1000;
  padding: 4px 8px;
}

.archive-card .nav-index {
  position: relative;
  background: var(--acid);
}

.archive-card strong {
  display: block;
  margin-top: 14px;
  font-size: 1.34rem;
  line-height: 1.22;
}

.archive-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.35;
}

.archive-card b {
  display: inline-flex;
  width: fit-content;
  margin-top: 14px;
  border: 1px solid rgba(255, 38, 53, 0.45);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(255, 38, 53, 0.1);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  padding: 5px 11px;
}

/* archive-card 風險色彩（直觀顯示風險高低） */
.archive-card.risk-critical { border-left-color: #ff2635; }
.archive-card.risk-critical b { color: #fff; border-color: #ff2635; background: rgba(255, 38, 53, 0.32); }
.archive-card.risk-high     { border-left-color: var(--orange); }
.archive-card.risk-high b   { color: #fff2dd; border-color: var(--orange); background: rgba(255, 147, 0, 0.24); }
.archive-card.risk-mid      { border-left-color: var(--gold); }
.archive-card.risk-mid b    { color: #2a1f00; border-color: var(--gold); background: rgba(255, 211, 90, 0.7); }
.archive-card.risk-low      { border-left-color: var(--cyan); }
.archive-card.risk-low b    { color: #e3f8ff; border-color: var(--cyan); background: rgba(57, 213, 255, 0.22); }

.system-board {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.system-board article,
.level-ladder article {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.2);
  padding: 16px;
}

.system-board span,
.level-ladder span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 36px;
  border-radius: 8px;
  color: #050507;
  background: var(--acid);
  font-size: 0.9rem;
  font-weight: 1000;
  padding: 6px 10px;
}

.system-board strong {
  display: block;
  margin-top: 12px;
  color: var(--error);
  font-size: 3.6rem;
  line-height: 0.95;
  text-shadow: 1px 1px 0 #050507;
}

.system-board p,
.level-ladder p {
  margin: 8px 0 0;
  color: #e0e6f0;
  font-size: 1.04rem;
  line-height: 1.72;
}

.level-ladder article {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border-left: 6px solid var(--error);
}

.level-ladder h3 {
  margin: 0;
  color: var(--gold);
  font-size: 1.42rem;
  line-height: 1.25;
}

.level-ladder strong {
  display: block;
  margin-top: 4px;
  color: var(--cyan);
  font-size: 1rem;
  line-height: 1.35;
}

.hex-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: center;
  margin-top: 22px;
  border: 1px solid rgba(166, 255, 57, 0.32);
  border-radius: 8px;
  background:
    radial-gradient(circle at 78% 34%, rgba(166, 255, 57, 0.2), transparent 28%),
    linear-gradient(135deg, rgba(57, 213, 255, 0.12), rgba(255, 38, 53, 0.08)),
    rgba(255, 255, 255, 0.045);
  padding: clamp(16px, 2.2vw, 24px);
}

.dose-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  min-width: 124px;
  border: 1px solid rgba(255, 38, 53, 0.8);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, #ff1028, #9b000d 58%, #250006),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 7px);
  box-shadow: 0 0 22px rgba(255, 16, 40, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  padding: 10px 12px;
}

.dose-badge span,
.dose-badge small {
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 1000;
  line-height: 1.15;
  text-transform: uppercase;
}

.dose-badge strong {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-shadow: 1px 1px 0 #050507, 0 0 14px rgba(255, 255, 255, 0.45);
}

.dose-badge small {
  justify-self: end;
  color: var(--acid);
  letter-spacing: 0.04em;
}

/* 直觀風險色彩：critical / high / mid / low（取代抽象的 SR/UR/SSR） */
.dose-badge.risk-critical {
  border-color: rgba(255, 38, 53, 0.95);
  background:
    linear-gradient(135deg, #ff2635, #9b000d 58%, #250006),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 7px);
  box-shadow: 0 0 28px rgba(255, 38, 53, 0.55);
}

.dose-badge.risk-high {
  border-color: rgba(255, 155, 61, 0.92);
  background:
    linear-gradient(135deg, #ff9b3d, #c45a00 58%, #2e1500),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 7px);
  box-shadow: 0 0 26px rgba(255, 155, 61, 0.4);
}

.dose-badge.risk-mid {
  border-color: rgba(246, 213, 74, 0.88);
  background:
    linear-gradient(135deg, #f6d54a, #b08600 58%, #2a1f00),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 7px);
  box-shadow: 0 0 24px rgba(246, 213, 74, 0.34);
  color: #1a1300;
}

.dose-badge.risk-low {
  border-color: rgba(74, 214, 255, 0.88);
  background:
    linear-gradient(135deg, #4ad6ff, #006b8d 58%, #001a25),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 7px);
  box-shadow: 0 0 24px rgba(74, 214, 255, 0.34);
}

.rank-panel,
.ability-block {
  position: relative;
  display: grid;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 38, 53, 0.54);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 16, 40, 0.18), rgba(6, 8, 11, 0.76)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 13px);
  box-shadow: 0 0 28px rgba(255, 38, 53, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 18px;
}

.rank-panel {
  grid-template-columns: minmax(210px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.rank-panel::before,
.ability-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 38%, rgba(166, 255, 57, 0.16) 39% 41%, transparent 42%),
    radial-gradient(circle at 12% 50%, rgba(255, 38, 53, 0.22), transparent 28%);
  pointer-events: none;
}

.rank-head {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: flex-end;
  gap: 12px;
}

.rank-mark {
  position: relative;
  color: #fff;
  font-family: var(--font-display);
  font-size: 5rem;
  font-style: italic;
  font-weight: 1000;
  line-height: 0.88;
  letter-spacing: 0.01em;
  text-shadow: 2px 2px 0 #050507, 0 0 18px rgba(255, 38, 53, 0.55);
  transform: skewX(-4deg);
}

.rank-copy,
.rank-score,
.ability-block > * {
  position: relative;
  z-index: 1;
}

.rank-copy span,
.ability-block span {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  border-radius: 999px;
  color: #050507;
  background: var(--acid);
  font-size: 0.78rem;
  font-weight: 1000;
  padding: 4px 9px;
}

.rank-copy strong {
  display: block;
  color: var(--gold);
  font-size: 1.42rem;
  line-height: 1.22;
}

.rank-copy p,
.ability-block p {
  margin: 8px 0 0;
  color: #e6ebf3;
  font-size: 1.06rem;
  line-height: 1.75;
}

.rank-score {
  display: grid;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: var(--error);
  background:
    linear-gradient(90deg, rgba(255, 38, 53, 0.24), rgba(0, 0, 0, 0.55)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 7px);
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 1000;
  line-height: 1;
  padding: 8px 10px;
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(255, 38, 53, 0.95);
  transform: skewX(-6deg);
}

.rank-score em {
  color: #ff2635;
  font-size: 1.4rem;
  font-style: normal;
  letter-spacing: 0;
}

.rank-score span {
  color: var(--acid);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.rank-panel.rank-xr,
.dose-badge.rank-xr {
  border-color: rgba(255, 38, 53, 0.96);
  box-shadow: 0 0 38px rgba(255, 38, 53, 0.42);
}

.rank-panel.rank-hidden,
.dose-badge.rank-hidden {
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 46px rgba(255, 255, 255, 0.28), 0 0 70px rgba(255, 38, 53, 0.34);
}

.rank-panel.rank-ur,
.dose-badge.rank-ur {
  border-color: rgba(255, 147, 0, 0.9);
  box-shadow: 0 0 34px rgba(255, 147, 0, 0.28);
}

.rank-panel.rank-ssr,
.dose-badge.rank-ssr {
  border-color: rgba(255, 211, 90, 0.88);
  box-shadow: 0 0 32px rgba(255, 211, 90, 0.24);
}

.rank-panel.rank-sr,
.dose-badge.rank-sr {
  border-color: rgba(185, 116, 255, 0.86);
  box-shadow: 0 0 32px rgba(185, 116, 255, 0.24);
}

.rank-panel.rank-r,
.dose-badge.rank-r {
  border-color: rgba(57, 213, 255, 0.68);
  box-shadow: 0 0 28px rgba(57, 213, 255, 0.18);
}

.ability-block {
  border-color: rgba(166, 255, 57, 0.42);
  background:
    linear-gradient(135deg, rgba(166, 255, 57, 0.13), rgba(255, 38, 53, 0.1)),
    rgba(0, 0, 0, 0.2);
}

.ability-block h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--acid);
  font-size: 1.5rem;
  line-height: 1.2;
}

.hex-panel.character {
  border-color: rgba(185, 116, 255, 0.46);
  background:
    radial-gradient(circle at 76% 28%, rgba(185, 116, 255, 0.22), transparent 28%),
    linear-gradient(135deg, rgba(185, 116, 255, 0.16), rgba(57, 213, 255, 0.07)),
    rgba(255, 255, 255, 0.045);
}

.hex-copy span {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  color: #050507;
  background: var(--acid);
  font-size: 0.82rem;
  font-weight: 1000;
  padding: 5px 10px;
}

.hex-panel .hex-copy {
  padding-right: 168px;
}

.hex-copy h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.92rem;
  line-height: 1.12;
}

.hex-copy p {
  margin: 0;
  color: #c9d2e1;
  font-size: 1.04rem;
  line-height: 1.65;
}

.radar-chart {
  width: 100%;
  max-width: 240px;
  justify-self: end;
  overflow: visible;
  filter: drop-shadow(0 0 18px rgba(166, 255, 57, 0.2));
}

.radar-ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1;
}

.radar-axis {
  stroke: rgba(57, 213, 255, 0.24);
  stroke-width: 1;
}

.radar-value {
  fill: rgba(255, 38, 53, 0.34);
  stroke: var(--acid);
  stroke-width: 3;
}

.radar-core {
  fill: var(--acid);
}

.radar-label {
  fill: #f6f8fc;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(7, 8, 11, 0.92);
  stroke-width: 4px;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.stamp,
.classification,
.case-number {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.stamp {
  color: #050507;
  background: var(--error);
  animation: pulseError 3.4s ease-in-out infinite;
}

.classification,
.case-number {
  color: var(--acid);
  border: 1px solid rgba(166, 255, 57, 0.5);
  background: rgba(166, 255, 57, 0.08);
}

.file-code {
  margin: 0 0 8px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 1.08rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px rgba(57, 213, 255, 0.55);
}

.paper-panel h2 {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: 3.4rem;
  line-height: 1.06;
  font-weight: 900;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.subtitle {
  margin: 0;
  color: #c9d2e1;
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.7;
}

.abstract,
.danger-callout,
.report-section,
.character-dossier,
.terminal-dossier,
.timeline-block,
.meme-lab {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(16px, 2vw, 24px);
  background: rgba(255, 255, 255, 0.055);
}

.abstract {
  border-left: 8px solid var(--gold);
  background: linear-gradient(135deg, rgba(255, 211, 90, 0.14), rgba(255, 255, 255, 0.04));
}

.character-dossier {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: stretch;
  border-color: rgba(185, 116, 255, 0.5);
  background:
    linear-gradient(135deg, rgba(185, 116, 255, 0.18), rgba(57, 213, 255, 0.06)),
    rgba(255, 255, 255, 0.055);
}

.character-cg {
  aspect-ratio: 1 / 1;
  width: 100%;
  min-height: 0;
  border: 2px solid rgba(185, 116, 255, 0.58);
  border-radius: 8px;
  background-image:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.24)),
    url("assets/character-sheet.png");
  background-size: 500% auto;
  background-position: var(--char-x) var(--char-y);
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 34px rgba(185, 116, 255, 0.24);
}

.character-cg.custom-cg {
  background-image:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.3)),
    var(--char-asset);
  background-size: cover, contain;
  background-position: center, center;
  background-repeat: no-repeat;
  background-color: rgba(5, 7, 10, 0.92);
}

.character-cg.hex-media {
  clip-path: none;
}

.character-cg.hex-media::after {
  background:
    linear-gradient(135deg, rgba(255, 38, 53, 0.12), transparent 28%),
    repeating-linear-gradient(0deg, transparent 0 10px, rgba(255, 255, 255, 0.055) 11px);
}

.character-copy {
  min-width: 0;
}

.character-copy span {
  display: inline-flex;
  margin-bottom: 12px;
  border-radius: 999px;
  color: #050507;
  background: var(--violet);
  font-size: 0.86rem;
  font-weight: 1000;
  padding: 5px 10px;
}

.character-copy h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 2.3rem;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.character-copy strong {
  display: block;
  color: var(--cyan);
  font-size: 1.28rem;
  line-height: 1.35;
}

.character-copy blockquote {
  margin: 18px 0;
  border-left: 6px solid var(--violet);
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1.6;
  padding-left: 16px;
}

.character-copy em {
  display: block;
  margin: 0 0 10px;
  color: var(--violet);
  font-style: normal;
  font-size: 1rem;
  font-weight: 1000;
}

.character-copy p {
  margin: 0;
  color: #e2e8f2;
  font-size: 1.1rem;
  line-height: 1.85;
}

.inline-jump,
.action-card {
  min-height: 44px;
  border: 1px solid rgba(166, 255, 57, 0.5);
  border-radius: 8px;
  color: var(--acid);
  background: rgba(166, 255, 57, 0.08);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 1000;
  text-align: left;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.inline-jump {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  padding: 10px 14px;
}

.inline-jump:hover,
.action-card:hover {
  border-color: var(--error);
  background: rgba(255, 38, 53, 0.15);
  transform: translateY(-1px);
}

.character-profile {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: center;
  border: 1px solid rgba(185, 116, 255, 0.5);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(185, 116, 255, 0.18), rgba(255, 38, 53, 0.08)),
    rgba(255, 255, 255, 0.045);
  padding: clamp(16px, 2.2vw, 24px);
}

.character-profile blockquote {
  margin: 20px 0 0;
  border-left: 6px solid var(--violet);
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 1.24rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1.6;
  padding-left: 16px;
}

.abstract strong,
.danger-callout span,
.report-section h3,
.lab-title h3,
.evidence-box h3 {
  display: block;
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 1.22rem;
  font-weight: 1000;
}

.abstract p,
.danger-callout p,
.report-section p,
.rating-card p,
.evidence-list li {
  margin: 0;
  color: #e0e6f0;
  font-size: 1.08rem;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.danger-callout {
  border-color: rgba(255, 38, 53, 0.58);
  background:
    linear-gradient(90deg, rgba(255, 38, 53, 0.24), rgba(255, 147, 0, 0.1)),
    repeating-linear-gradient(-45deg, transparent 0 12px, rgba(255, 255, 255, 0.045) 13px 22px);
}

.danger-callout span {
  color: var(--error);
}

.terminal-dossier {
  border-color: rgba(57, 213, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(57, 213, 255, 0.08), rgba(0, 0, 0, 0.18)),
    repeating-linear-gradient(0deg, transparent 0 12px, rgba(57, 213, 255, 0.04) 13px);
}

.terminal-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(57, 213, 255, 0.24);
  padding-bottom: 12px;
}

.terminal-head span,
.terminal-head strong,
.terminal-grid strong {
  font-family: var(--font-mono);
}

.terminal-head span {
  color: var(--cyan);
  font-size: 0.92rem;
  font-weight: 1000;
}

.terminal-head strong {
  color: var(--acid);
  font-size: 0.92rem;
  font-weight: 1000;
}

.hazard-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.hazard-strip span {
  border: 1px solid rgba(255, 38, 53, 0.42);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 38, 53, 0.12);
  font-size: 0.9rem;
  font-weight: 1000;
  padding: 6px 10px;
}

.terminal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}

.terminal-grid article {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 5px solid var(--cyan);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  padding: 14px;
}

.terminal-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 1000;
}

.terminal-grid strong {
  display: block;
  margin: 6px 0 8px;
  color: var(--cyan);
  font-size: 1.12rem;
}

.terminal-grid p {
  margin: 0;
  color: #e0e6f0;
  font-size: 1rem;
  line-height: 1.7;
}

.report-section h3 {
  color: var(--cyan);
}

.timeline-block {
  border-color: rgba(255, 211, 90, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 211, 90, 0.1), rgba(255, 255, 255, 0.04)),
    rgba(0, 0, 0, 0.08);
}

.timeline-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-list li {
  display: grid;
  grid-template-columns: minmax(90px, 0.28fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
}

.timeline-list span {
  color: var(--gold);
  font-size: 1.04rem;
  font-weight: 1000;
  line-height: 1.4;
}

.timeline-list p {
  margin: 0;
  color: #e0e6f0;
  font-size: 1.06rem;
  line-height: 1.7;
}

.meme-lab {
  border: 2px solid rgba(166, 255, 57, 0.44);
  background:
    linear-gradient(135deg, rgba(166, 255, 57, 0.14), rgba(7, 12, 9, 0.72)),
    rgba(7, 12, 9, 0.72);
}

.lab-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.lab-title h3 {
  margin: 0;
  color: var(--acid);
}

.lab-title span {
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 1000;
}

.meme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 14px;
}

.meme-card {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  border: 1px solid rgba(166, 255, 57, 0.32);
  border-radius: 8px;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 0 10px, transparent 11px 20px),
    rgba(255, 255, 255, 0.06);
  padding: 16px;
}

.meme-card::before {
  content: attr(data-label);
  display: inline-flex;
  margin-bottom: 14px;
  border-radius: 999px;
  color: #050507;
  background: var(--acid);
  font-size: 0.78rem;
  font-weight: 1000;
  padding: 4px 9px;
}

.meme-card strong {
  display: block;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.52;
  overflow-wrap: anywhere;
}

.evidence-panel {
  align-self: start;
  position: relative;
  padding: 18px;
}

.evidence-title {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(255, 38, 53, 0.6);
  padding-bottom: 14px;
}

.evidence-title .dose-badge {
  position: static;
  margin-left: auto;
}

.evidence-title h2 {
  margin: 0;
  font-size: 1.46rem;
  line-height: 1.25;
}

.evidence-subtitle {
  margin: -4px 0 16px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.55;
}

.rating-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.rank-scale {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.rank-scale div {
  display: grid;
  grid-template-columns: 54px minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 5px solid var(--error);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
}

.rank-scale strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-style: italic;
  letter-spacing: 0.02em;
  text-shadow: 1px 1px 0 #050507;
}

.rank-scale span {
  color: var(--acid);
  font-size: 0.78rem;
  font-weight: 1000;
}

.rank-scale p {
  margin: 0;
  color: #d8deea;
  font-size: 0.86rem;
  line-height: 1.25;
}

.rating-card {
  border: 1px solid var(--line);
  border-left: 6px solid var(--error);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 14px;
}

.rating-card span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.rating-card strong {
  display: block;
  margin: 5px 0 4px;
  color: var(--acid);
  font-size: 1.3rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.rating-card.compact-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 12px;
}

.rating-card.compact-score strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  margin: 0;
  color: var(--gold);
  font-size: 1.05rem;
}

.rating-card.compact-score p {
  font-size: 0.92rem;
  line-height: 1.35;
}

.rating-card b {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 1rem;
}

/* === 強化版分數卡：取代普通黑字 === */
.score-card {
  position: relative;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid var(--tier, var(--acid));
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--tier, #a6ff39) 14%, transparent) 0%, transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 6px),
    rgba(7, 9, 13, 0.78);
  padding: 12px 14px 14px;
  overflow: hidden;
  isolation: isolate;
}

.score-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--tier, #a6ff39) 28%, transparent), transparent 38%);
  pointer-events: none;
}

.score-card.score-critical { --tier: #ff2635; }
.score-card.score-high     { --tier: #ff9b3d; }
.score-card.score-mid      { --tier: #f6d54a; }
.score-card.score-low      { --tier: #4ad6ff; }

.score-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.score-label {
  color: #e6ecf6;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.score-verdict {
  color: var(--tier, var(--acid));
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 8px color-mix(in srgb, var(--tier, #a6ff39) 70%, transparent);
}

.score-readout {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 0.9;
}

.score-value {
  color: #fff;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 1000;
  font-style: italic;
  letter-spacing: 0.01em;
  text-shadow:
    0 0 14px color-mix(in srgb, var(--tier, #a6ff39) 70%, transparent),
    1px 1px 0 #050507;
}

.score-unit {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 900;
}

.score-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.score-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--score, 0%);
  border-radius: 999px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--tier, #a6ff39) 80%, #fff) 0%, var(--tier, #a6ff39) 100%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--tier, #a6ff39) 80%, transparent);
}

.score-bar-grid {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 9.5%, rgba(0, 0, 0, 0.45) 9.5% 10%);
  pointer-events: none;
}

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

.score-segments .seg {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 200ms ease;
}

.score-segments .seg.on {
  background: var(--tier, var(--acid));
  box-shadow: 0 0 6px color-mix(in srgb, var(--tier, #a6ff39) 70%, transparent);
}

.evidence-box {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.evidence-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence-list li {
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 12px;
}

/* === Footer：簡潔三欄分區（無切角、無紅章、無跑馬燈） === */
.fixed-footer {
  position: relative;
  z-index: 10;
  margin-top: 80px;
  color: var(--muted);
  background: rgba(8, 10, 14, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-sans);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 36px;
  padding: 40px var(--pad);
  max-width: 1440px;
  margin: 0 auto;
}

.footer-block {
  display: grid;
  gap: 12px;
}

.footer-block > strong {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trust-list,
.cert-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust-list li,
.cert-list li {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.55;
}

.trust-list li.checked {
  color: var(--error);
  font-weight: 700;
}

.sync-note {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* 全站連結 sitemap：給爬蟲與無腳本訪客 */
.site-links {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--pad) 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.site-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 24px;
  padding-top: 24px;
}

.site-links-grid section {
  display: grid;
  gap: 6px;
}

.site-links-grid strong {
  color: #e6ecf6;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.site-links-grid a {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  text-decoration: none;
  line-height: 1.5;
  transition: color 150ms ease;
}

.site-links-grid a:hover,
.site-links-grid a:focus-visible {
  color: var(--error);
  text-decoration: underline;
}

@keyframes panelIn {
  from {
    transform: translateY(18px) scale(0.985);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

@keyframes pulseError {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 38, 53, 0);
  }
  50% {
    box-shadow: 0 0 24px rgba(255, 38, 53, 0.62);
  }
}

@keyframes titleSignalBreak {
  0% {
    transform: none;
  }
  14% {
    transform: translate(5px, -2px) skewX(-7deg);
  }
  28% {
    transform: translate(-6px, 2px) skewX(5deg);
  }
  42% {
    transform: translate(3px, 1px);
  }
  64% {
    transform: translate(-2px, -1px) skewX(-3deg);
  }
  100% {
    transform: none;
  }
}

@keyframes rgbTearRed {
  0%,
  100% {
    opacity: 0;
    transform: translate(0, 0);
    clip-path: inset(0 0 0 0);
  }
  18% {
    opacity: 0.78;
    transform: translate(8px, -2px);
    clip-path: inset(0 0 62% 0);
  }
  46% {
    opacity: 0.52;
    transform: translate(-5px, 2px);
    clip-path: inset(38% 0 28% 0);
  }
  72% {
    opacity: 0.68;
    transform: translate(6px, 1px);
    clip-path: inset(72% 0 4% 0);
  }
}

@keyframes rgbTearCyan {
  0%,
  100% {
    opacity: 0;
    transform: translate(0, 0);
    clip-path: inset(0 0 0 0);
  }
  16% {
    opacity: 0.72;
    transform: translate(-7px, 2px);
    clip-path: inset(70% 0 7% 0);
  }
  44% {
    opacity: 0.48;
    transform: translate(5px, -1px);
    clip-path: inset(18% 0 54% 0);
  }
  78% {
    opacity: 0.64;
    transform: translate(-4px, 1px);
    clip-path: inset(43% 0 35% 0);
  }
}

@keyframes mosaicBlink {
  0% {
    opacity: 0;
    filter: contrast(1);
  }
  16% {
    opacity: 0.46;
    filter: contrast(1.35) saturate(1.55);
  }
  48% {
    opacity: 0.22;
    transform: translate(calc(var(--mosaic-dx, 0) * -1), var(--mosaic-dy, 0)) skewX(calc(var(--mosaic-skew, 0deg) * -1));
  }
  70% {
    opacity: 0.48;
  }
  100% {
    opacity: 0;
    filter: contrast(2.2) saturate(2.2);
  }
}

@keyframes errorSweep {
  0% {
    opacity: 0;
    transform: translateX(112%) skewX(-11deg);
    clip-path: polygon(78% 0, 100% 0, 100% 100%, 68% 100%);
  }
  12% {
    opacity: 1;
  }
  45% {
    opacity: 1;
    transform: translateX(0) skewX(-2deg);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
  78% {
    opacity: 1;
    transform: translateX(-12%) skewX(3deg);
  }
  100% {
    opacity: 0;
    transform: translateX(-118%) skewX(9deg);
    clip-path: polygon(0 0, 28% 0, 18% 100%, 0 100%);
  }
}

@keyframes transferFragment {
  0% {
    opacity: 0;
    transform: translateX(120vw) skewX(var(--frag-skew, -12deg));
  }
  14% {
    opacity: 0.96;
  }
  62% {
    opacity: 0.78;
    transform: translateX(-18vw) skewX(calc(var(--frag-skew, -12deg) * -1));
  }
  100% {
    opacity: 0;
    transform: translateX(-122vw) skewX(var(--frag-skew, -12deg));
  }
}

@keyframes stageDislocate {
  0%,
  100% {
    filter: none;
    transform: none;
  }
  18% {
    filter: saturate(1.8) contrast(1.18);
    transform: translateX(-8px);
  }
  34% {
    filter: blur(1px) hue-rotate(-16deg);
    transform: translateX(10px);
  }
  56% {
    filter: contrast(1.35);
    transform: translateX(-4px) skewX(-1deg);
  }
}

@media (max-width: 1380px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .evidence-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  body.sidebar-hidden .site-shell {
    grid-template-columns: 1fr;
  }

  .main-stage {
    grid-column: 1;
    grid-row: 1;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 46;
    width: min(88vw, 360px);
    height: 100dvh;
    min-height: 0;
    border-top: 0;
    border-right: 1px solid var(--line);
    box-shadow: 24px 0 56px rgba(0, 0, 0, 0.56);
    transform: translateX(0);
  }

  body.sidebar-fixed .sidebar {
    position: fixed;
    height: 100dvh;
  }

  body.sidebar-hidden .sidebar {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-104%);
  }

  body.sidebar-open .sidebar {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }
}

@media (max-width: 780px) {
  .file-hero,
  .character-dossier,
  .character-profile,
  .overview-hero,
  .hex-panel {
    grid-template-columns: 1fr;
  }

  /* hex-panel 單欄時，dose-badge 改流內排列在 hex-copy 上方，避免覆蓋雷達圖 */
  .hex-panel .hex-copy {
    padding-right: 0;
    padding-top: 84px;
  }

  .dose-badge {
    left: 14px;
    right: auto;
    width: fit-content;
    min-width: 116px;
  }

  .radar-chart {
    justify-self: center;
  }

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

  .tier-filters {
    justify-content: flex-start;
  }

  .nav-list {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  }

  .nav-button {
    min-height: 124px;
  }

  .hero,
  .hero img {
    min-height: 560px;
    height: 560px;
  }

  .bar-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .bar-meta {
    display: none;
  }

  .top-actions {
    grid-column: 1 / -1;
    margin-top: 4px;
  }

  .bar-brand strong,
  .bar-brand span {
    overflow-wrap: anywhere;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .top-action {
    width: 100%;
    min-width: 0;
    text-align: center;
    padding-inline: 6px;
  }

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

  .rank-panel {
    grid-template-columns: 1fr;
  }

  .rank-mark {
    font-size: 4.5rem;
  }

  .sidebar-toggle {
    top: 118px;
    bottom: auto;
    left: 0;
    width: 32px;
    height: 46px;
    border-radius: 0 8px 8px 0;
    transform: none;
    z-index: 55;
    background:
      linear-gradient(90deg, rgba(255, 38, 53, 0.9), rgba(6, 8, 11, 0.96)),
      repeating-linear-gradient(0deg, transparent 0 6px, rgba(255, 255, 255, 0.16) 7px);
  }

  body.sidebar-hidden .sidebar-toggle {
    left: 0;
    border-radius: 0 8px 8px 0;
  }
}

@media (max-width: 520px) {
  .bar-warning-strip {
    height: 18px;
    font-size: 0.62rem;
    gap: 18px;
  }

  .bar-main {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  .bar-alert {
    justify-self: start;
  }

  .bar-brand strong {
    font-size: 0.86rem;
    line-height: 1.18;
  }

  .bar-brand span {
    font-size: 0.7rem;
  }

  .top-actions {
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
  }

  .top-action:nth-child(3) {
    grid-column: auto;
  }

  .top-action {
    min-height: 42px;
    padding-inline: 3px;
    font-size: 0.82rem;
  }

  .sidebar-toggle,
  body.archive-page .sidebar-toggle {
    top: 214px;
    z-index: 70;
  }

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

  .hero,
  .hero img {
    min-height: 420px;
    height: 420px;
  }

  .hero-copy {
    left: 18px;
    right: 18px;
    bottom: 28px;
    max-width: none;
  }

  .hero-copy h1 {
    font-size: 2.5rem;
    line-height: 1.1;
  }

  .hero-copy p:last-child {
    font-size: 1.02rem;
    line-height: 1.62;
  }

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

  .nav-button {
    min-height: 108px;
  }

  .content-grid {
    padding: 12px;
  }

  .paper-panel h2 {
    font-size: 2.1rem;
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  .subtitle {
    font-size: 1.06rem;
    line-height: 1.7;
  }

  .file-hero,
  .character-profile,
  .overview-hero,
  .hex-panel {
    gap: 16px;
  }

  .file-intro {
    order: 1;
  }

  .file-image {
    order: 2;
    max-width: 300px;
  }

  .character-profile > .character-cg {
    order: 2;
    max-width: 300px;
    justify-self: center;
  }

  .character-profile > div {
    order: 1;
  }

  .level-ladder article {
    grid-template-columns: 1fr;
  }

  .hex-panel {
    margin-top: 16px;
  }

  .hex-panel .hex-copy {
    padding-right: 0;
    padding-top: 84px;
  }

  .dose-badge {
    left: 14px;
    right: auto;
    width: fit-content;
    min-width: 116px;
  }

  .dose-badge strong {
    font-size: 2.1rem;
  }

  .paper-panel,
  .evidence-panel {
    border-radius: 8px;
  }
}

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

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

  .noise-layer {
    opacity: 0.04;
  }

  .particle-field,
  .title-mosaic-layer {
    display: none;
  }

  .jump-overlay {
    display: none;
  }
}
