:root {
  --ink: #0d0d0d;
  --violet: #8000ff;
  --magenta: #ff00ff;
  --paper: #ece7fb;
  --dim: #a99fce;
  --line: rgba(128, 0, 255, 0.32);
  --line-hot: rgba(255, 0, 255, 0.42);
  --glass: rgba(28, 14, 48, 0.55);
  --radius: 4px;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(255, 0, 255, 0.16), transparent 62%),
    radial-gradient(900px 480px at 6% 6%, rgba(128, 0, 255, 0.2), transparent 60%),
    linear-gradient(rgba(128, 0, 255, 0.07) 1px, transparent 1px) 0 0 / 46px 46px,
    linear-gradient(90deg, rgba(128, 0, 255, 0.07) 1px, transparent 1px) 0 0 / 46px 46px,
    var(--ink);
  color: var(--paper);
  font-family: "Didact Gothic", -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.5;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 3px);
}

h1, h2, h3, .brand, .cta-word, .rail-h {
  font-family: "Poiret One", "Didact Gothic", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 400;
}

a { color: var(--magenta); }

small {
  display: block;
  font-family: "Didact Gothic", sans-serif;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--magenta);
  margin: 0 0 6px;
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.55);
}

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 60;
  padding: 10px 16px;
  background: var(--violet);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top 0.2s ease;
}

.skip:focus { top: 8px; }

/* ---------- 头部 ---------- */
.hud-head {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--line-hot);
  background: linear-gradient(180deg, rgba(13, 13, 13, 0.97), rgba(13, 13, 13, 0.84));
  backdrop-filter: blur(10px);
}

.brand-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 0, 255, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 21px;
  letter-spacing: 0.22em;
  color: var(--paper);
  text-decoration: none;
  text-shadow: 0 0 14px rgba(128, 0, 255, 0.7);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.brand:hover,
.brand:focus-visible {
  color: var(--magenta);
  text-shadow: 0 0 16px var(--magenta);
}

.menu-wrap { padding: 6px 0 8px; }

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 14px;
  font-size: 16px;
  letter-spacing: 0.16em;
  color: var(--magenta);
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  background: rgba(255, 0, 255, 0.07);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.menu-btn::-webkit-details-marker { display: none; }

.menu-btn::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--magenta);
  border-bottom: 1px solid var(--magenta);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}

.menu-wrap:not([open]) .menu-btn::after {
  transform: rotate(-135deg) translateY(-2px);
}

.menu-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.menu-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  font-size: 16px;
  color: var(--dim);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.menu-list a:hover,
.menu-list a:focus-visible {
  color: #fff;
  border-color: var(--line-hot);
  background: rgba(128, 0, 255, 0.22);
  text-shadow: 0 0 10px var(--violet);
}

/* ---------- 舞台 ---------- */
.stage {
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr);
  gap: 22px 26px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 16px 44px;
}

.stage > article {
  grid-column: 2;
  scroll-margin-top: 152px;
}

.stage > .hero {
  grid-column: 1 / -1;
  scroll-margin-top: 100px;
}

.stage > .rail-sec {
  grid-column: 1;
  grid-row: 2 / span 30;
  position: sticky;
  top: 152px;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  align-items: center;
  gap: 24px;
  min-height: 45vh;
  padding: 26px 22px;
  overflow: hidden;
  text-align: center;
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 0, 255, 0.24) 1px, transparent 0) 0 0 / 18px 18px,
    linear-gradient(158deg, rgba(128, 0, 255, 0.2), rgba(13, 13, 13, 0.94) 70%);
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 38%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 0, 255, 0.16), transparent);
  animation: sweep 7s linear infinite;
}

@keyframes sweep {
  0% { left: -40%; }
  100% { left: 110%; }
}

.hero-copy { position: relative; z-index: 2; }

.glitch {
  margin: 0 0 14px;
  font-size: clamp(28px, 5.6vw, 56px);
  line-height: 1.24;
  letter-spacing: 0.09em;
  color: #fff;
  overflow-wrap: anywhere;
  text-shadow: 0 0 14px rgba(255, 0, 255, 0.75), 0 0 40px rgba(128, 0, 255, 0.5);
  animation: glitch 5.5s steps(1, end) infinite;
}

@keyframes glitch {
  0%, 88%, 100% {
    transform: none;
    text-shadow: 0 0 14px rgba(255, 0, 255, 0.75), 0 0 40px rgba(128, 0, 255, 0.5);
  }
  89% {
    transform: translate(-2px, 1px) skewX(-5deg);
    text-shadow: 3px 0 var(--violet), -3px 0 var(--magenta);
  }
  92% {
    transform: translate(2px, -1px) skewX(4deg);
    text-shadow: -3px 0 var(--violet), 3px 0 var(--magenta);
  }
  95% { transform: none; }
}

.hero-desc {
  margin: 0 auto;
  max-width: 34em;
  font-size: 17px;
  color: var(--dim);
}

.hero-art {
  position: relative;
  z-index: 2;
  margin: 0;
  min-height: 200px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 13, 13, 0.72);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 26px rgba(128, 0, 255, 0.35) inset;
}

.hero-art.is-empty {
  background:
    linear-gradient(135deg, rgba(128, 0, 255, 0.3), transparent 58%),
    repeating-linear-gradient(45deg, rgba(255, 0, 255, 0.16) 0 2px, transparent 2px 12px),
    rgba(13, 13, 13, 0.8);
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 4px);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.hero-img.on { opacity: 1; }

/* ---------- 侧栏 ---------- */
.rail {
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(8px);
}

.rail-h {
  margin: 0 0 10px;
  font-size: 19px;
  letter-spacing: 0.18em;
  color: #fff;
}

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 9px;
  font-size: 16px;
  color: var(--dim);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  color: #fff;
  border-left-color: var(--magenta);
  background: rgba(128, 0, 255, 0.2);
}

/* ---------- 正文面板 ---------- */
.stage > article:not(.hero):not(.rail-sec) {
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-hot);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(6px);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.stage > article:not(.hero):not(.rail-sec):hover {
  border-color: var(--line-hot);
  box-shadow: 0 0 22px rgba(255, 0, 255, 0.22);
  transform: translateY(-2px);
}

.stage > article h2 {
  margin: 6px 0 14px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.36;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 0, 255, 0.45);
}

.stage > article h3 {
  margin: 22px 0 10px;
  font-size: 19px;
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: #f3ecff;
}

.stage > article p { margin: 0 0 16px; }
.stage > article p:last-child { margin-bottom: 0; }

.stage > article ul,
.stage > article ol {
  margin: 0 0 16px;
  padding-left: 1.35em;
}

.stage > article li { margin: 0.32em 0; }
.stage > article strong { color: #fff; }

.stage > article a {
  color: var(--magenta);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.stage > article a:hover { color: #fff; text-shadow: 0 0 10px var(--magenta); }

.stage > article blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 2px solid var(--magenta);
  border-radius: var(--radius);
  background: rgba(255, 0, 255, 0.08);
  color: #f0e8ff;
}

.stage > article img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.stage > article figure { margin: 0 0 16px; }

.stage > article table {
  width: 100%;
  margin: 0 0 16px;
  border-collapse: collapse;
  font-size: 16px;
}

.stage > article th,
.stage > article td {
  padding: 9px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.stage > article th { background: rgba(128, 0, 255, 0.18); color: #fff; }

.stage > article code {
  padding: 1px 5px;
  font-size: 0.94em;
  border-radius: 3px;
  background: rgba(255, 0, 255, 0.14);
  color: #ffd9ff;
}

.stage > article pre {
  overflow-x: auto;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 13, 13, 0.85);
}

.stage > article pre code { background: none; padding: 0; }

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 12px;
  padding: 30px 16px 20px;
  border-top: 1px solid var(--line-hot);
  background: linear-gradient(180deg, rgba(128, 0, 255, 0.12), rgba(13, 13, 13, 0.98) 60%);
}

.foot-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto 26px;
  padding: 24px 22px;
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 0, 255, 0.2) 1px, transparent 0) 0 0 / 18px 18px,
    rgba(24, 12, 40, 0.6);
  backdrop-filter: blur(6px);
}

.cta-word {
  margin: 0;
  font-size: clamp(24px, 5vw, 44px);
  letter-spacing: 0.16em;
  color: #fff;
  text-shadow: 0 0 18px var(--magenta);
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  font-size: 16px;
  letter-spacing: 0.14em;
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--magenta);
  border-radius: var(--radius);
  background: rgba(255, 0, 255, 0.16);
  box-shadow: 0 0 16px rgba(255, 0, 255, 0.3);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.cta-btn:hover,
.cta-btn:focus-visible {
  background: var(--magenta);
  color: #16001c;
  box-shadow: 0 0 26px var(--magenta);
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
}

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

.fcol a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
  font-size: 16px;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.18s ease;
}

.fcol a:hover,
.fcol a:focus-visible { color: var(--magenta); }

.fcol-name {
  margin: 0;
  font-family: "Poiret One", sans-serif;
  font-size: 18px;
  letter-spacing: 0.14em;
  color: var(--paper);
}

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 24px auto 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 0, 255, 0.2);
  font-size: 16px;
  color: var(--dim);
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--dim);
  text-decoration: none;
}

.foot-links a:hover { color: var(--magenta); }

/* ---------- 断点 ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 18px 14px 34px;
  }

  .stage > article,
  .stage > .hero,
  .stage > .rail-sec { grid-column: 1; }

  .stage > .rail-sec { grid-row: auto; position: static; }

  .stage > article { scroll-margin-top: 148px; }

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

  .hero-art { min-height: 160px; aspect-ratio: 16 / 10; }

  .rail-list {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
  }

  .rail-list a {
    border: 1px solid var(--line);
    border-left-width: 1px;
    padding: 4px 11px;
  }

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

  .foot-cta { padding: 20px 16px; }

  .stage > article:not(.hero):not(.rail-sec) { padding: 20px 16px; }
}

@media (max-width: 420px) {
  .brand { font-size: 18px; letter-spacing: 0.16em; }
  .cta-word { font-size: 22px; letter-spacing: 0.1em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

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