@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Crimson+Pro:wght@400;500;600;700&display=swap');

:root {
  --ink: #0d0d0d;
  --ink2: #100b18;
  --panel: #150e21;
  --main: #8000ff;
  --acc: #ff00ff;
  --txt: #ece6f7;
  --dim: #a696c4;
  --line: rgba(128, 0, 255, 0.34);
  --acc-line: rgba(255, 0, 255, 0.4);
  --f-body: 'Crimson Pro', Georgia, 'Songti SC', 'Noto Serif SC', serif;
  --f-mono: 'Atkinson Hyperlegible', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--txt);
  font: 400 17px/1.7 var(--f-body);
  background:
    radial-gradient(1100px 560px at 82% -12%, rgba(255, 0, 255, 0.13), transparent 62%),
    radial-gradient(880px 520px at -8% 6%, rgba(128, 0, 255, 0.18), transparent 66%),
    var(--ink);
  background-attachment: scroll;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.5;
  background: repeating-linear-gradient(
    180deg,
    rgba(200, 170, 255, 0.06) 0 1px,
    rgba(0, 0, 0, 0) 1px 3px
  );
}

a {
  color: var(--acc);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
}

/* ---------- 顶栏 ---------- */

.hud-head {
  position: sticky;
  top: 0;
  z-index: 70;
  background: rgba(11, 9, 16, 0.94);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
}

.hud-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
}

.sigil {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 42px;
  border: 1px solid var(--acc-line);
  border-radius: 4px;
  background: linear-gradient(145deg, rgba(128, 0, 255, 0.34), rgba(255, 0, 255, 0.16));
  clip-path: polygon(0 0, 100% 0, 100% 72%, 78% 100%, 0 100%);
  text-decoration: none;
  box-shadow: 0 0 14px rgba(255, 0, 255, 0.28);
}

.sigil-mark {
  font: 700 18px/1 var(--f-mono);
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.85);
}

.logo-img {
  max-height: 30px;
  width: auto;
  display: block;
}

.finder {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.finder-input {
  width: 100%;
  max-width: 340px;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--txt);
  font: 400 16px/1.4 var(--f-mono);
  letter-spacing: 0.02em;
  background: #0a0710;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
}

.finder-input::placeholder {
  color: #8f7fae;
}

.finder-input:focus-visible {
  border-color: var(--acc);
  box-shadow: 0 0 0 2px rgba(255, 0, 255, 0.25);
}

.pillbar {
  overflow-x: auto;
  scrollbar-width: thin;
  border-top: 1px dashed rgba(255, 0, 255, 0.2);
  padding: 0 12px 9px;
}

.pillbar p {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 7px 0 2px;
}

.pillbar a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 15px;
  white-space: nowrap;
  color: var(--txt);
  font: 400 16px/1 var(--f-mono);
  letter-spacing: 0.05em;
  text-decoration: none;
  background: #110b1a;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.pillbar a:hover,
.pillbar a:focus-visible {
  color: #fff;
  border-color: var(--acc);
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(255, 0, 255, 0.35);
}

.pillbar a.is-off {
  display: none;
}

/* ---------- 骨架 ---------- */

main {
  display: block;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- 头图区 ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 45vh;
  padding: 26px 0 22px;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--main), var(--acc), var(--main));
  transform: skewY(-0.7deg);
  opacity: 0.85;
}

.hero-copy {
  max-width: 44ch;
  text-align: left;
}

.kicker {
  margin: 0 0 10px;
  font: 700 16px/1.4 var(--f-mono);
  letter-spacing: 0.22em;
  color: var(--acc);
  text-shadow: 0 0 12px rgba(255, 0, 255, 0.55);
}

.hero h1 {
  margin: 0 0 14px;
  font: 700 clamp(2rem, 7vw, 3.3rem) / 1.12 var(--f-body);
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 0, 255, 0.5), 0 0 48px rgba(128, 0, 255, 0.42);
}

.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-t);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: screen;
}

.glitch::before {
  color: var(--acc);
  animation: glitchA 3.6s steps(1) infinite;
}

.glitch::after {
  color: var(--main);
  animation: glitchB 4.4s steps(1) infinite;
}

@keyframes glitchA {
  0%, 90%, 100% { transform: translate(0, 0); }
  91% { transform: translate(-2px, 1px) skewX(-4deg); }
  95% { transform: translate(2px, -1px); }
}

@keyframes glitchB {
  0%, 88%, 100% { transform: translate(0, 0); }
  90% { transform: translate(2px, -2px) skewX(3deg); }
  94% { transform: translate(-1px, 1px); }
}

.hero-desc {
  margin: 0;
  color: var(--dim);
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-visual {
  margin-top: 20px;
  height: 26vh;
  min-height: 148px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(118deg, rgba(128, 0, 255, 0.4), rgba(255, 0, 255, 0.16) 62%, rgba(13, 13, 13, 0.2));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 22px));
}

.hero-shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.grid-fx {
  display: block;
  width: 100%;
  height: 100%;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 0, 255, 0.28) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(180deg, rgba(128, 0, 255, 0.3) 0 1px, transparent 1px 34px);
}

/* ---------- 正文与侧栏 ---------- */

.body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 30px;
  align-items: start;
  padding: 30px 0 44px;
}

.prose {
  min-width: 0;
  font-size: 17px;
  line-height: 1.78;
}

.prose article[id] {
  scroll-margin-top: 138px;
  padding: 26px 0 6px;
  border-top: 1px solid rgba(128, 0, 255, 0.18);
  animation: rise 0.55s ease both;
}

.prose article[id]:first-of-type {
  border-top: 0;
  padding-top: 4px;
}

.prose article[id]:nth-of-type(2) { animation-delay: 0.05s; }
.prose article[id]:nth-of-type(3) { animation-delay: 0.1s; }
.prose article[id]:nth-of-type(4) { animation-delay: 0.15s; }
.prose article[id]:nth-of-type(5) { animation-delay: 0.2s; }
.prose article[id]:nth-of-type(6) { animation-delay: 0.25s; }
.prose article[id]:nth-of-type(7) { animation-delay: 0.3s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.prose h2 {
  margin: 0 0 12px;
  padding-left: 13px;
  border-left: 4px solid var(--acc);
  font: 700 1.42rem/1.3 var(--f-body);
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 0, 255, 0.42);
  letter-spacing: 0.01em;
}

.prose h3 {
  margin: 22px 0 8px;
  font: 700 1.15rem/1.4 var(--f-mono);
  color: var(--acc);
  letter-spacing: 0.03em;
}

.prose p {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 1.3em;
}

.prose li {
  margin: 0 0 8px;
}

.prose li::marker {
  color: var(--acc);
}

.prose strong {
  color: #fff;
}

.prose blockquote {
  margin: 20px 0;
  padding: 12px 16px;
  border-left: 2px solid var(--main);
  background: rgba(128, 0, 255, 0.1);
  border-radius: 0 4px 4px 0;
  color: #ded3f2;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose a {
  color: var(--acc);
  text-decoration: underline;
  text-decoration-color: rgba(255, 0, 255, 0.45);
}

.prose a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

.prose table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 9px 11px;
  border: 1px solid var(--line);
  text-align: left;
}

.prose th {
  background: rgba(128, 0, 255, 0.16);
  font-family: var(--f-mono);
}

.rail {
  position: sticky;
  top: 132px;
  padding: 16px 14px 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  border-bottom: 3px solid var(--acc);
  background: linear-gradient(170deg, rgba(21, 14, 33, 0.95), rgba(13, 13, 13, 0.9));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

.rail-head {
  margin: 0 0 6px;
  font: 700 17px/1.4 var(--f-mono);
  letter-spacing: 0.12em;
  color: var(--acc);
  text-shadow: 0 0 12px rgba(255, 0, 255, 0.5);
}

.subtitle {
  margin: 0 0 14px;
  font: 400 16px/1.5 var(--f-body);
  color: var(--dim);
}

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

.rail-list li {
  border-bottom: 2px solid rgba(128, 0, 255, 0.4);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.rail-list li:hover {
  border-bottom-color: var(--acc);
  background: rgba(255, 0, 255, 0.08);
}

.rail-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 7px 9px;
  color: var(--txt);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
}

.rail-list .idx {
  flex: 0 0 auto;
  font: 700 15px/1 var(--f-mono);
  color: var(--acc);
  opacity: 0.85;
}

.rail-list .lbl {
  min-width: 0;
}

/* ---------- 页脚 ---------- */

.tail {
  margin-top: 20px;
  padding: 26px 16px 38px;
  text-align: center;
  background: #0a0810;
  border-top: 1px solid var(--line);
}

.tail p {
  margin: 0 0 4px;
  font: 400 16px/1.6 var(--f-mono);
  letter-spacing: 0.1em;
  color: var(--dim);
}

.tail small {
  display: block;
  font-size: 16px;
  line-height: 1.6;
}

.tail small a {
  display: inline-block;
  min-height: 40px;
  line-height: 40px;
  padding: 0 12px;
  color: var(--acc);
  text-decoration: none;
}

.tail small a:hover {
  color: #fff;
}

/* ---------- 断点 ---------- */

@media (max-width: 860px) {
  .body-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .rail {
    position: static;
  }

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

@media (max-width: 640px) {
  body {
    font-size: 17px;
  }

  .hero {
    min-height: 45vh;
    padding-top: 20px;
  }

  .hero-copy {
    max-width: none;
  }

  .hero-visual {
    height: 22vh;
    min-height: 130px;
  }

  .prose article[id] {
    scroll-margin-top: 146px;
  }

  .prose h2 {
    font-size: 1.3rem;
  }

  .finder-input {
    max-width: none;
  }
}

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

  .glitch::before,
  .glitch::after,
  .prose article[id] {
    animation: none;
  }

  .hero-shot {
    transform: none !important;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
