:root {
  --ink: #261717;
  --deep: #1b1010;
  --red: #ff0000;
  --rose: #ff1493;
  --paper: #f8ece8;
  --soft: #ecd6d1;
  --dim: #c8a4a0;
  --line: rgba(255, 20, 147, 0.34);
  --panel: rgba(56, 32, 34, 0.6);
  --railw: 252px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--paper);
  font: 17px/1.65 system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(40% 34% at 16% 18%, rgba(255, 0, 0, 0.58), transparent 66%),
    radial-gradient(42% 38% at 80% 12%, rgba(255, 20, 147, 0.55), transparent 68%),
    radial-gradient(50% 44% at 64% 78%, rgba(255, 60, 120, 0.4), transparent 70%),
    radial-gradient(38% 30% at 28% 88%, rgba(255, 0, 0, 0.34), transparent 72%);
  background-size: 200% 200%;
  filter: blur(40px) saturate(1.25);
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: aurora 11s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 28%, #000, transparent 92%);
  mask-image: radial-gradient(circle at 50% 28%, #000, transparent 92%);
}

@keyframes aurora {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 62%; }
}

@keyframes rise {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: none; }
}

/* 侧栏 */
.nav-check {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

.burger {
  display: none;
}

.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--railw);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px 28px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(38, 23, 23, 0.97), rgba(27, 15, 17, 0.94));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(9px);
}

.mark-link {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid var(--rose);
  border-radius: 12px;
  background: rgba(255, 20, 147, 0.14);
  text-decoration: none;
  overflow: hidden;
}

.mark-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mark-txt {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  line-height: 1.1;
  color: #fff;
  letter-spacing: 1px;
}

.find {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.find-label {
  font-size: 16px;
  color: var(--dim);
  letter-spacing: 0.22em;
}

.find-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.find-input::placeholder {
  color: rgba(200, 164, 160, 0.8);
}

.find-input:focus {
  outline: 2px solid var(--rose);
  outline-offset: 1px;
}

.rail-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: n;
  display: grid;
  gap: 4px;
}

.rail-nav li {
  counter-increment: n;
  animation: rise 0.45s ease both;
}

.rail-nav li:nth-child(2) { animation-delay: 0.05s; }
.rail-nav li:nth-child(3) { animation-delay: 0.1s; }
.rail-nav li:nth-child(4) { animation-delay: 0.15s; }
.rail-nav li:nth-child(5) { animation-delay: 0.2s; }
.rail-nav li:nth-child(6) { animation-delay: 0.25s; }
.rail-nav li:nth-child(7) { animation-delay: 0.3s; }

.rail-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 10px;
  font-size: 16px;
  color: var(--soft);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;
}

.rail-nav a::before {
  content: counter(n, decimal-leading-zero);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  color: var(--rose);
  flex: none;
}

.rail-nav a:hover,
.rail-nav a:focus-visible {
  color: #fff;
  background: rgba(255, 20, 147, 0.16);
  border-color: var(--line);
  transform: translateX(3px);
}

li[hidden] {
  display: none;
}

/* 主体 */
main {
  margin-left: var(--railw);
  padding: 0 clamp(16px, 3vw, 44px) 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 34px;
  align-items: start;
}

div {
  min-width: 0;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 22px;
  align-items: center;
  min-height: 45vh;
  padding: 30px 0 42px;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 30px;
  bottom: 10px;
  height: 6px;
  background: linear-gradient(90deg, var(--red), var(--rose) 45%, rgba(255, 20, 147, 0));
  transform: skewY(-1.6deg);
  border-radius: 4px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.62rem, 3.5vw, 2.9rem);
  line-height: 1.26;
  letter-spacing: 0.01em;
  text-shadow: 0 0 26px rgba(255, 20, 147, 0.4);
}

.collage {
  position: relative;
  height: min(38vh, 300px);
}

.shot {
  position: absolute;
  overflow: hidden;
  border: 2px solid rgba(255, 20, 147, 0.6);
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(255, 0, 0, 0.38), rgba(255, 20, 147, 0.26));
}

.shot-img,
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shot-a {
  inset: 0 28% 18% 0;
  transform: rotate(-2.5deg);
}

.shot-b {
  inset: 24% 0 0 32%;
  transform: rotate(2deg);
  border-color: rgba(255, 0, 0, 0.55);
}

div > section {
  margin: 0 0 26px;
  padding: 24px clamp(16px, 2.4vw, 30px) 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel), rgba(32, 19, 19, 0.62));
  scroll-margin-top: 78px;
}

div > section h2 {
  position: relative;
  margin: 0 0 0.62em;
  padding-left: 15px;
  font-size: clamp(1.26rem, 2.3vw, 1.62rem);
  line-height: 1.35;
}

div > section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--red), var(--rose));
}

div section h3,
div section h4 {
  margin: 1.3em 0 0.5em;
  line-height: 1.4;
}

div section h3 {
  font-size: 1.14rem;
  color: #fff;
}

div p {
  margin: 0 0 0.9em;
  color: var(--soft);
}

div section ul,
div section ol {
  padding-left: 1.35em;
  color: var(--soft);
}

div section li {
  margin: 0.35em 0;
}

div a {
  color: #ffa3ce;
  text-underline-offset: 3px;
}

div blockquote {
  margin: 1em 0;
  padding: 10px 0 10px 16px;
  border-left: 3px solid var(--rose);
  color: var(--dim);
}

/* 右侧栏 */
.side {
  position: sticky;
  top: 24px;
  margin-top: 30px;
  padding: 18px 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(38, 23, 23, 0.76);
  backdrop-filter: blur(6px);
}

.tiny {
  display: block;
  font-family: "VT323", monospace;
  font-size: 17px;
  letter-spacing: 0.32em;
  color: var(--rose);
}

.side-title {
  margin: 0.15em 0 0.7em;
  font-size: 1.18rem;
  line-height: 1.4;
}

.toc {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 2px;
}

.toc li {
  animation: rise 0.45s ease both;
}

.toc li:nth-child(2) { animation-delay: 0.05s; }
.toc li:nth-child(3) { animation-delay: 0.1s; }
.toc li:nth-child(4) { animation-delay: 0.15s; }
.toc li:nth-child(5) { animation-delay: 0.2s; }
.toc li:nth-child(6) { animation-delay: 0.25s; }
.toc li:nth-child(7) { animation-delay: 0.3s; }

.toc a {
  display: block;
  min-height: 44px;
  padding: 10px 6px;
  font-size: 16px;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 20, 147, 0.22);
  transition: color 0.2s, padding-left 0.2s;
}

.toc a:hover,
.toc a:focus-visible {
  color: #fff;
  padding-left: 12px;
}

.to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 16px;
  color: var(--paper);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 20, 147, 0.12);
  transition: background 0.2s;
}

.to-top:hover,
.to-top:focus-visible {
  background: rgba(255, 20, 147, 0.24);
}

/* 页脚 */
.foot {
  margin-left: var(--railw);
  padding: 18px clamp(16px, 3vw, 44px) 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  border-top: 1px solid var(--line);
  font-size: 16px;
}

.foot-brand {
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
}

.foot-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
}

.foot-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--dim);
  text-decoration: none;
  font-size: 16px;
}

.foot-links a:hover,
.foot-links a:focus-visible {
  color: #fff;
}

.foot-cr {
  margin-left: auto;
  font-size: 16px;
  color: var(--dim);
}

@media (max-width: 900px) {
  main,
  .foot {
    margin-left: 0;
  }

  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .rail {
    width: 272px;
    max-width: calc(100vw - 44px);
    transform: translateX(-105%);
    transition: transform 0.26s ease;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
  }

  .nav-check:checked ~ .rail {
    transform: none;
  }

  .burger {
    display: flex;
    align-items: center;
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 40;
    min-height: 44px;
    padding: 0 16px;
    font-size: 16px;
    color: var(--paper);
    background: rgba(38, 23, 23, 0.94);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 62px 0 38px;
    gap: 16px;
  }

  .hero::after {
    right: 12px;
  }

  .collage {
    height: 152px;
  }

  .shot-a {
    inset: 0 34% 12% 0;
  }

  .shot-b {
    inset: 16% 0 0 36%;
  }

  .side {
    position: static;
    margin-top: 0;
  }

  .foot-cr {
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  .hero::after {
    right: 0;
  }

  .collage {
    height: 136px;
  }
}

@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;
  }
}

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