:root {
  --bg: #090d12;
  --panel: #101720;
  --line: #293543;
  --text: #eef3f7;
  --muted: #93a2b1;
  --red: #ef4b4b;
  --blue: #3ca8ff;
  --gold: #e7bd63;
  --shadow: 0 24px 60px #0009;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, #203447 0, transparent 30%),
    linear-gradient(#090d12, #0b1016 55%, #080b0f);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .07;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
button, input, select { font: inherit; }
.shell { width: min(1480px, calc(100% - 32px)); margin: auto; }
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 850; letter-spacing: .08em; }
.crest { width: 30px; height: auto; filter: drop-shadow(0 0 10px #e6242988); }
.brand small { color: var(--muted); font-weight: 500; letter-spacing: .04em; }
.counter { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  gap: 28px;
  padding: 24px 0 20px;
  align-items: center;
}
.eyebrow {
  color: var(--gold);
  font: 700 .7rem/1.2 ui-monospace, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.intro h1 {
  font-size: clamp(2.35rem, 4.3vw, 4.7rem);
  line-height: .95;
  letter-spacing: -.055em;
  margin: 8px 0 10px;
  max-width: 940px;
  white-space: nowrap;
}
.intro h1 span { display: inline; color: transparent; -webkit-text-stroke: 1px #8ba0b3; }
.intro p { color: #b8c4cf; font-size: .92rem; line-height: 1.55; max-width: 760px; margin: 0; }
.brief {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 640px;
}
.portrait-stage { display: grid; place-items: center; }
.portrait-ring {
  position: relative;
  width: min(520px, 100%);
  aspect-ratio: 1;
  container-type: size;
}
.ring-track {
  position: absolute;
  inset: 8%;
  border: 1px solid #ffffff24;
  border-radius: 50%;
  box-shadow: inset 0 0 40px #3ca8ff22, 0 0 50px #ef4b4b14;
}
.ring-track.inner { inset: 27%; border-style: dashed; border-color: #e7bd6355; }
.ring-spin { position: absolute; inset: 0; animation: ring-spin 46s linear infinite; }
.ring-node {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18cqmin;
  height: 18cqmin;
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(-38cqmin);
}
.ring-face {
  width: 100%;
  height: 100%;
  padding: 3px;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(from 30deg, var(--blue), white, var(--blue) 40%, #102033 70%, var(--blue));
  animation: ring-counter 46s linear infinite;
  box-shadow: 0 8px 22px #000a;
  cursor: pointer;
}
.ring-face.villain {
  background: conic-gradient(from 30deg, var(--red), #ffd0d0, var(--red) 40%, #2a1012 70%, var(--red));
}
.ring-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  border: 3px solid #090d12;
  border-radius: 50%;
  background: #17181f;
  display: block;
}
.portrait-ring:hover .ring-spin,
.portrait-ring:hover .ring-face,
.portrait-ring:focus-within .ring-spin,
.portrait-ring:focus-within .ring-face { animation-play-state: paused; }
.ring-core {
  position: absolute;
  inset: 31%;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  border-radius: 50%;
  background: radial-gradient(circle, #121820ee, #090d12f2 72%);
  pointer-events: none;
}
.ring-core .kicker {
  margin: 0 0 8px;
  color: var(--red);
  font: 700 .68rem/1 ui-monospace, monospace;
  letter-spacing: .18em;
}
.ring-core strong {
  font: 800 clamp(1.5rem, 3vw, 2.15rem)/1.05 "PingFang SC", "Arial Narrow", sans-serif;
  letter-spacing: -.03em;
}
.ring-core span { margin-top: 6px; color: var(--muted); font: .74rem/1.3 ui-monospace, monospace; }
@keyframes ring-spin { to { transform: rotate(360deg); } }
@keyframes ring-counter { to { transform: rotate(-360deg); } }
.metric strong { display: block; font: 800 1.35rem/1 ui-monospace, monospace; color: var(--text); }
.metric span { display: block; margin-top: 5px; font-size: .72rem; color: var(--muted); white-space: nowrap; }

.controls {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #090d12e8;
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: 0 14px 40px #0006;
}
.controls select {
  color: var(--text);
  background: #0d131a;
  border: 1px solid #303d4c;
  border-radius: 12px;
  padding: 12px;
}
.search { flex: 1; min-width: 180px; position: relative; }
.search input {
  width: 100%;
  color: var(--text);
  background: #0d131a;
  border: 1px solid #303d4c;
  border-radius: 12px;
  padding: 12px 42px 12px 15px;
  outline: 0;
}
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #3ca8ff22; }
.search kbd {
  position: absolute;
  right: 12px;
  top: 11px;
  color: #718292;
  border: 1px solid #344353;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: .7rem;
}
.filters { display: flex; gap: 8px; overflow: auto; scrollbar-width: none; }
.filter {
  white-space: nowrap;
  border: 1px solid #344353;
  background: #111923;
  color: #aebbc6;
  border-radius: 10px;
  padding: 10px 13px;
  cursor: pointer;
  transition: .2s;
}
.filter:hover, .filter.active { color: #fff; border-color: #668096; background: #263341; }
.filter[data-filter="hero"].active { border-color: var(--blue); color: #d9efff; }
.filter[data-filter="villain"].active { border-color: var(--red); color: #ffe0e0; }

.section-head { display: flex; justify-content: space-between; align-items: end; margin: 34px 0 18px; }
.section-head h2 { font-size: 1.08rem; margin: 0; letter-spacing: .08em; }
.section-head span { font: 500 .8rem ui-monospace, monospace; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; padding-bottom: 0; }
.card {
  position: relative;
  min-height: 370px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  isolation: isolate;
  content-visibility: auto;
  contain-intrinsic-size: 370px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-5px); border-color: #65788a; box-shadow: 0 18px 45px #0008; }
.card:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.photo { position: absolute; inset: 0; background: linear-gradient(135deg, #202b35, #0a0f15); overflow: hidden; }
.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  filter: saturate(.96) contrast(1.08) brightness(1.06);
  opacity: 0;
  transition: transform .5s, opacity .35s;
}
.photo img.loaded { opacity: 1; }
.card:hover img.loaded { transform: scale(1.035); }
.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 42%, #07101966 61%, #071019f7 91%);
}
.fallback {
  height: 100%;
  display: grid;
  place-items: center;
  font: 900 6rem ui-monospace, monospace;
  color: #ffffff0b;
  text-transform: uppercase;
}
.fallback.hidden { visibility: hidden; }
.card-content { position: absolute; inset: auto 0 0; padding: 20px; z-index: 2; text-shadow: 0 2px 8px #000; }
.tags { display: flex; gap: 6px; margin-bottom: 9px; flex-wrap: wrap; }
.tag {
  font: 700 .66rem ui-monospace, monospace;
  letter-spacing: .08em;
  padding: 4px 7px;
  border-radius: 5px;
  background: #000b;
  color: #ced8e0;
  border: 1px solid #ffffff33;
  text-shadow: none;
}
.tag.hero { color: #90d3ff; border-color: #2c8ac4; }
.tag.villain { color: #ff9696; border-color: #b53d3d; }
.card h3 { font-size: 1.38rem; margin: 0 0 4px; letter-spacing: -.02em; }
.en { font: 500 .75rem ui-monospace, monospace; color: #b7c4cf; }
.teaser {
  color: #d0d8df;
  font-size: .82rem;
  line-height: 1.5;
  margin: 10px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.empty {
  grid-column: 1 / -1;
  padding: 90px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
}
.load-more-wrap { display: flex; justify-content: center; padding: 22px 0 70px; }
.load-more { border: 1px solid #3e5367; border-radius: 10px; background: #121d27; color: #d8e3eb; padding: 12px 20px; cursor: pointer; }
.load-more:hover { border-color: #7893aa; background: #1c2a37; }

.view-switch {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px;
  width: max-content;
  max-width: 100%;
  overflow: auto;
  background: #0d141c;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.view-tab { border: 0; background: transparent; color: #8fa0af; border-radius: 9px; padding: 10px 16px; white-space: nowrap; cursor: pointer; }
.view-tab.active { background: #263544; color: #fff; box-shadow: inset 0 0 0 1px #5b7185; }
.view { display: none; }
.view.active { display: block; }
.view-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 28px 0 20px; }
.view-intro h2 { font-size: clamp(1.8rem, 4vw, 3.2rem); margin: 0 0 8px; letter-spacing: -.04em; }
.view-intro p { margin: 0; max-width: 680px; color: #9dacb9; line-height: 1.7; }

.timeline { position: relative; padding: 10px 0 64px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 106px;
  top: 20px;
  bottom: 70px;
  width: 1px;
  background: linear-gradient(var(--gold), #4a6075, var(--blue));
}
.time-row { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 46px; position: relative; margin: 0 0 22px; }
.time-year { font: 900 1.2rem ui-monospace, monospace; color: var(--gold); padding-top: 22px; text-align: right; }
.time-year::after {
  content: "";
  position: absolute;
  left: 100px;
  top: 27px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: #090d12;
  box-shadow: 0 0 18px #e7bd6377;
}
.time-card {
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #101720;
  display: grid;
  grid-template-columns: minmax(230px, .42fr) 1fr;
}
.time-image { position: relative; min-height: 240px; background: #17212b; overflow: hidden; }
.time-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8) contrast(1.08); }
.time-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 45%, #101720); }
.time-copy { padding: 28px 30px; }
.time-copy h3 { font-size: 1.55rem; margin: 0 0 4px; }
.time-sub { color: #7890a5; font: 600 .75rem ui-monospace, monospace; margin-bottom: 14px; }
.time-copy p { color: #bdc8d1; line-height: 1.7; margin: 0 0 14px; }
.time-events { display: flex; gap: 7px; flex-wrap: wrap; }
.time-events span { font-size: .76rem; padding: 6px 9px; background: #1a2631; border: 1px solid #344555; border-radius: 8px; color: #bdc9d2; }

.graph-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #0d141c;
  border: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
}
.graph-toolbar label { font-size: .8rem; color: #91a2b1; }
.graph-toolbar select {
  flex: 1;
  max-width: 360px;
  background: #111b25;
  border: 1px solid #394b5b;
  color: #fff;
  border-radius: 9px;
  padding: 9px 11px;
}
.graph-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  min-height: 620px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  overflow: hidden;
  background: radial-gradient(circle at center, #172432, #090e14 68%);
}
#relationGraph { width: 100%; height: 620px; display: block; }
.graph-side { border-left: 1px solid var(--line); padding: 24px; background: #0d141ccc; }
.graph-side h3 { font-size: 1.45rem; margin: 0 0 4px; }
.graph-side .en { margin-bottom: 18px; }
.graph-side p { color: #aebbc6; line-height: 1.65; font-size: .86rem; }
.graph-legend { display: grid; gap: 9px; margin-top: 22px; }
.graph-legend span { font-size: .76rem; color: #91a0ad; }
.graph-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.node { cursor: pointer; }
.node circle { stroke-width: 2; transition: filter .2s; }
.node:hover circle { filter: drop-shadow(0 0 8px currentColor); }
.node text { fill: #eef3f7; font: 700 12px "PingFang SC", sans-serif; text-anchor: middle; pointer-events: none; }
.edge { stroke: #52687a; stroke-width: 1.3; }
.edge-label { fill: #8da0b0; font: 10px "PingFang SC", sans-serif; text-anchor: middle; }
.graph-hint { font-size: .73rem; color: #718292; margin-left: auto; }

dialog {
  position: relative;
  width: min(960px, calc(100% - 24px));
  max-height: 90vh;
  border: 1px solid #405164;
  border-radius: 22px;
  padding: 0;
  background: #101720;
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: auto;
}
dialog::backdrop { background: #020406d9; backdrop-filter: blur(7px); }
.detail-hero {
  position: relative;
  width: 100%;
  min-height: 480px;
  display: flex;
  align-items: end;
  overflow: hidden;
  cursor: zoom-in;
}
.detail-hero:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.detail-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  filter: saturate(.95) contrast(1.06) brightness(1.04);
}
.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 35%, #101720 96%), linear-gradient(90deg, #10172055, transparent);
  pointer-events: none;
}
.detail-title { position: relative; z-index: 2; padding: 34px; width: min(680px, 100%); pointer-events: none; }
.detail-title h2 { font-size: clamp(2.6rem, 7vw, 5rem); line-height: .95; margin: 10px 0; letter-spacing: -.055em; }
.detail-title p { margin: 0; color: #c4ced6; }
.close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 8;
  margin: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #607181;
  background: #0a1015dd;
  color: #fff;
  cursor: pointer;
  font-size: 1.3rem;
  box-shadow: 0 5px 18px #0008;
}
.detail-body { padding: 8px 34px 38px; display: grid; grid-template-columns: 1.4fr .6fr; gap: 36px; }
.detail-body h3 { color: var(--gold); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; margin: 22px 0 10px; }
.detail-body p, .detail-body li { color: #bec9d2; line-height: 1.72; }
.detail-body ul { padding-left: 18px; }
.detail-gallery { display: block; margin: 22px 0 8px; }
.detail-gallery h3 { margin: 0 0 10px; }
.detail-gallery-row { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 12px; }
.gallery-thumb {
  display: block;
  width: 200px;
  flex: 0 0 200px;
  max-width: 100%;
  padding: 0;
  border: 1px solid #3b4d5d;
  border-radius: 13px;
  background: #0b1117;
  overflow: hidden;
  cursor: zoom-in;
}
.gallery-thumb img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: center; transition: transform .25s; }
.gallery-thumb:hover img { transform: scale(1.02); }
.gallery-thumb:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.gallery-caption { display: block; padding: 9px 12px; color: #aebdca; font-size: .76rem; text-align: left; }
.facts { border-left: 1px solid var(--line); padding-left: 25px; }
.fact { padding: 13px 0; border-bottom: 1px solid var(--line); }
.fact span { display: block; color: #748697; font-size: .7rem; margin-bottom: 4px; }
.rels { display: flex; flex-wrap: wrap; gap: 7px; }
.rel { background: #1b2632; border: 1px solid #344658; border-radius: 999px; padding: 7px 10px; font-size: .78rem; color: #c6d1d9; }
.source-link { display: block; color: #86c9ff; text-decoration: none; margin: 8px 0; font-size: .82rem; }
.source-link:hover { text-decoration: underline; }
.source-disclaimer { font-size: .7rem; color: #738494; }
.image-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 30px;
  background: #020406f2;
  overflow: hidden;
  cursor: zoom-out;
}
.image-viewer[open] { display: grid; place-items: center; }
.image-viewer::backdrop { background: #020406f2; backdrop-filter: blur(12px); }
.image-viewer img {
  display: block;
  max-width: calc(100vw - 60px);
  max-height: calc(100vh - 60px);
  width: auto;
  height: auto;
  object-fit: contain;
  filter: none;
  box-shadow: 0 24px 80px #000;
  border-radius: 8px;
}
.image-viewer .close { position: fixed; top: 20px; right: 20px; }
.viewer-nav{position:fixed;top:50%;transform:translateY(-50%);z-index:10;width:52px;height:52px;border-radius:50%;border:1px solid #ffffff33;background:#0c1218cc;color:#fff;cursor:pointer;font-size:1.8rem;line-height:1}
.viewer-nav.prev{left:max(16px,3vw)}.viewer-nav.next{right:max(16px,3vw)}
.viewer-nav:hover{background:#1a2836;border-color:#8aa4b8}
.viewer-caption{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:10;padding:8px 16px;border-radius:999px;background:#0c1218cc;border:1px solid #ffffff22;color:#c5d0d8;font:600 .8rem ui-monospace,monospace;white-space:nowrap;max-width:calc(100vw - 40px);overflow:hidden;text-overflow:ellipsis;pointer-events:none}
@media(max-width:720px){.viewer-nav{width:42px;height:42px;font-size:1.4rem}.viewer-caption{bottom:14px;font-size:.72rem}}
.detail-nav{position:fixed;top:50%;transform:translateY(-50%);z-index:9;width:46px;height:46px;border-radius:50%;border:1px solid #ffffff33;background:#0c1218cc;color:#fff;cursor:pointer;font-size:1.5rem;line-height:1;display:none}
.detail-nav.prev{left:max(10px,2vw)}.detail-nav.next{right:max(10px,2vw)}
.detail-nav:hover{background:#1a2836;border-color:#8aa4b8}
dialog.car-mode .detail-nav{display:block}
@media(max-width:720px){.detail-nav{width:40px;height:40px;font-size:1.25rem}}
.note {
  margin: 0 0 38px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #8fa0af;
  font-size: .78rem;
  line-height: 1.7;
  background: #0d131a;
}
.legend { display: flex; gap: 16px; flex-wrap: wrap; }
.dot::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  margin-right: 7px;
}
.dot.red::before { background: var(--red); }

body.deck-on .intro, body.deck-on .note { display: none; }
body.deck-on .view-switch { margin-bottom: 10px; }
#deckView.active { display: block; }
.deck-stage {
  position: relative;
  height: calc(100dvh - 128px);
  min-height: 520px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  perspective: 980px;
  perspective-origin: 50% 42%;
  background:
    radial-gradient(ellipse at 50% 42%, #1c3044 0%, transparent 46%),
    linear-gradient(#070b10, #0a1016 72%);
  touch-action: none;
  cursor: grab;
  user-select: none;
  outline: none;
}
.deck-stage:active { cursor: grabbing; }
.deck-stage:focus-visible { box-shadow: inset 0 0 0 2px #3ca8ff88; }
.deck-floor {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: min(720px, 62vw);
  height: 90px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, #000c, transparent 70%);
  pointer-events: none;
}
.deck-ring {
  position: absolute;
  inset: 0;
  transform: rotateX(14deg);
  transform-style: preserve-3d;
  pointer-events: none;
}
.deck-card {
  position: absolute;
  left: 50%;
  top: 48%;
  border-radius: 22px;
  overflow: hidden;
  background: #101820;
  border: 1px solid #ffffff24;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  pointer-events: auto;
  box-shadow: 0 24px 70px #000a;
}
.deck-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  filter: saturate(.96) contrast(1.06) brightness(1.04);
  pointer-events: none;
  -webkit-user-drag: none;
}
.deck-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 900 7rem ui-monospace, monospace;
  color: #ffffff14;
}
.deck-fallback.hidden { visibility: hidden; }
.deck-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #05080cf0 0%, #05080cb0 22%, transparent 52%);
  pointer-events: none;
}
.deck-dim { position: absolute; inset: 0; background: #02060c; pointer-events: none; }
.deck-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 28px 24px; pointer-events: none; }
.deck-copy h2 { margin: 8px 0 4px; font-size: clamp(1.8rem, 3.4vw, 3.15rem); letter-spacing: -.04em; line-height: .95; }
.deck-meta {
  margin: 0;
  color: #c5d0d8;
  font: 500 .78rem ui-monospace, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deck-sum {
  margin: 10px 0 0;
  color: #d5dee6;
  font-size: .92rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deck-nav {
  position: absolute;
  top: 46%;
  z-index: 30;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border-radius: 50%;
  border: 1px solid #ffffff33;
  background: #0c1218cc;
  color: #fff;
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
}
.deck-nav.prev { left: max(16px, 4vw); }
.deck-nav.next { right: max(16px, 4vw); }
.deck-nav:hover { background: #1a2836; border-color: #8aa4b8; }
.deck-hud {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  pointer-events: none;
  color: #9aabba;
  font: 600 .78rem ui-monospace, monospace;
  letter-spacing: .06em;
}
.deck-progress {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 14px;
  height: 2px;
  background: #ffffff18;
  border-radius: 2px;
  overflow: hidden;
  z-index: 30;
  pointer-events: none;
}
.deck-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  transform-origin: left center;
}

@media (max-width: 1040px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .intro { grid-template-columns: 1fr; gap: 16px; padding: 20px 0 16px; }
  .intro h1 { font-size: clamp(2.3rem, 7vw, 4.2rem); }
  .portrait-ring { width: min(420px, 100%); }
  .controls { flex-direction: column; align-items: stretch; }
  .filters { padding-bottom: 1px; }
  .graph-shell { grid-template-columns: 1fr; }
  .graph-side { border-left: 0; border-top: 1px solid var(--line); }
  .controls { display: contents; position: static; background: none; border: 0; box-shadow: none; padding: 0; }
  #catalogView.active { display: flex; flex-direction: column; gap: 10px; }
  #catalogView > .section-head { margin-top: 8px; }
  .filters {
    position: sticky;
    top: 0;
    z-index: 12;
    margin: 0;
    padding: 8px 2px;
    background: #090d12f2;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
  }
}
@media (max-width: 720px) {
  .shell { width: min(100% - 20px, 1480px); }
  .topbar { height: 52px; }
  .brand small { display: none; }
  .crest { width: 26px; }
  .intro { padding: 16px 0 14px; gap: 14px; }
  .intro h1 { font-size: clamp(2rem, 10.5vw, 3.1rem); margin: 6px 0 8px; white-space: normal; }
  .intro p { font-size: .86rem; line-height: 1.45; }
  .brief { grid-template-columns: repeat(4, 1fr); gap: 8px; padding-top: 12px; }
  .metric strong { font-size: 1.05rem; }
  .metric span { font-size: .64rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { min-height: 280px; }
  .card-content { padding: 14px; }
  .card h3 { font-size: 1.15rem; }
  .detail-hero { min-height: 330px; }
  .detail-title { padding: 24px; }
  .detail-body { grid-template-columns: 1fr; padding: 0 24px 30px; }
  .facts { border-left: 0; border-top: 1px solid var(--line); padding: 8px 0 0; }
  .view-intro { align-items: start; flex-direction: column; }
  .time-row { grid-template-columns: 48px 1fr; gap: 28px; }
  .timeline::before { left: 61px; }
  .time-year { font-size: .85rem; }
  .time-year::after { left: 55px; }
  .time-card { grid-template-columns: 1fr; }
  .time-image { min-height: 200px; }
  .time-image::after { background: linear-gradient(to bottom, transparent 50%, #101720); }
  .graph-toolbar { align-items: stretch; flex-direction: column; }
  .graph-hint { margin-left: 0; }
  #relationGraph { height: 520px; }
  .deck-stage { height: calc(100dvh - 118px); min-height: 460px; }
  .deck-copy { padding: 16px 16px 14px; }
  .deck-copy h2 { font-size: 1.7rem; }
  .deck-sum { font-size: .8rem; }
  .deck-nav { width: 40px; height: 40px; font-size: 1.4rem; }
  .deck-hint { display: none; }
}
@media (max-width: 450px) {
  .counter { display: none; }
  .brief { grid-template-columns: repeat(2, 1fr); }
  .card { min-height: 250px; contain-intrinsic-size: 250px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .card { min-height: 180px; contain-intrinsic-size: 180px; }
  .card-content { padding: 10px; }
  .card h3 { font-size: 1rem; }
}
@media (orientation: landscape) and (max-height: 520px) and (min-width: 740px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-height: 560px) {
  .deck-stage { height: calc(100dvh - 136px); min-height: 0; }
  .deck-copy { padding: 12px 14px 10px; }
  .deck-copy h2 { font-size: 1.45rem; }
  .deck-sum { -webkit-line-clamp: 1; margin-top: 6px; }
  .deck-hud { top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .ring-spin, .ring-face { animation: none; }
}
