@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --ink: #0d0d0d;
  --ink-2: #121018;
  --ink-3: #171122;
  --violet: #8000ff;
  --magenta: #ff00ff;
  --line: #2b2140;
  --text: #ded7ea;
  --dim: #9c92b0;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- 背景层：网格 / 点阵 / 扫描线 ---------- */
.fx-grid {
  position: fixed;
  inset: -10% 0 0 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(128, 0, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 0, 255, 0.1) 1px, transparent 1px),
    radial-gradient(rgba(255, 0, 255, 0.18) 1px, transparent 1px);
  background-size: 88px 88px, 88px 88px, 22px 22px;
  opacity: 0.68;
}

.fx-scan {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.3) 0 1px,
    rgba(0, 0, 0, 0) 1px 3px
  );
  opacity: 0.5;
}

/* ---------- 头部 ---------- */
.hud-head {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.5rem clamp(1rem, 4vw, 2.5rem) 0.55rem;
  background: linear-gradient(180deg, rgba(13, 13, 13, 0.97), rgba(13, 13, 13, 0.84));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(7px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand {
  display: inline-block;
  padding: 0.3rem 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-decoration: none;
  text-shadow: 0 0 12px rgba(128, 0, 255, 0.9), 0 0 26px rgba(255, 0, 255, 0.42);
}

.brand-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--violet), var(--magenta) 55%, transparent);
}

.nav-dock {
  margin-top: 0.2rem;
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-top: 0.3rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(128, 0, 255, 0.12);
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  cursor: pointer;
  list-style: none;
}

.nav-toggle::-webkit-details-marker {
  display: none;
}

.nav-toggle::after {
  content: '展开';
  color: var(--magenta);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.nav-dock[open] .nav-toggle::after {
  content: '收起';
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: block;
  padding: 0.55rem 0.1rem;
  color: var(--dim);
  font-size: 0.95rem;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #fff;
  border-bottom-color: var(--magenta);
  text-shadow: 0 0 10px var(--magenta);
}

@media (min-width: 860px) {
  .nav-toggle {
    display: none;
  }
}

@media (max-width: 859px) {
  .nav-menu {
    flex-direction: column;
    gap: 0;
    padding-bottom: 0.35rem;
  }

  .nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    border-bottom: 1px solid var(--line);
  }
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(168px, 216px) minmax(0, 1fr);
  gap: clamp(1.2rem, 4vw, 3rem);
  align-items: start;
  min-height: 70vh;
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.4rem) clamp(1rem, 4vw, 2.5rem) clamp(2.4rem, 5vw, 3.2rem);
  border-bottom: 1px solid var(--line);
}

.side {
  position: sticky;
  top: 132px;
  padding: 0.9rem 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--violet);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(128, 0, 255, 0.14), rgba(13, 13, 13, 0));
}

.side h2 {
  margin: 0 0 0.5rem;
  color: var(--magenta);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.26em;
}

.side hr {
  height: 1px;
  margin: 0 0 0.7rem;
  border: 0;
  background: linear-gradient(90deg, var(--magenta), transparent);
}

.side-list {
  display: grid;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-link {
  display: block;
  padding: 0.5rem 0.55rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  text-decoration: none;
  border-left: 2px solid transparent;
}

.side-link:hover,
.side-link:focus-visible {
  color: #fff;
  background: rgba(255, 0, 255, 0.08);
  border-left-color: var(--magenta);
}

.hero-copy {
  padding-bottom: 2.6rem;
}

.hero-copy h1 {
  margin: 0 0 1.1rem;
  color: #fff;
  font-size: clamp(2.1rem, 7vw, 4.5rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  text-shadow: 0 0 18px rgba(128, 0, 255, 0.75), 0 0 44px rgba(255, 0, 255, 0.34);
  animation: glitch 6s steps(1, end) infinite;
}

@keyframes glitch {
  0%, 90%, 100% {
    transform: none;
    text-shadow: 0 0 18px rgba(128, 0, 255, 0.75), 0 0 44px rgba(255, 0, 255, 0.34);
  }
  92% {
    transform: skewX(-1.6deg) translateX(-2px);
    text-shadow: 3px 0 var(--magenta), -3px 0 var(--violet);
  }
  95% {
    transform: skewX(1.4deg) translateX(2px);
    text-shadow: -3px 0 var(--magenta), 3px 0 var(--violet);
  }
  97% {
    transform: none;
  }
}

.lede {
  max-width: 52ch;
  margin: 0;
  color: var(--dim);
  font-size: 1rem;
  line-height: 1.85;
}

.hud-plot {
  position: absolute;
  right: clamp(1rem, 4vw, 2.5rem);
  bottom: 1.3rem;
  max-width: calc(100% - 2rem);
  margin: 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 0, 255, 0.06);
  color: var(--magenta);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 18px rgba(255, 0, 255, 0.18);
  overflow-wrap: anywhere;
}

.hud-plot code {
  font-family: inherit;
  font-size: inherit;
}

@media (max-width: 859px) {
  .hero {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-top: 1.6rem;
  }

  .hero-copy {
    order: 1;
    padding-bottom: 0.4rem;
  }

  .side {
    order: 2;
    position: static;
    width: 100%;
  }

  .hud-plot {
    order: 3;
    position: static;
    align-self: flex-start;
  }
}

/* ---------- 正文区块（page.content 内的 section） ---------- */
main > section:not(.hero) {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: clamp(1.4rem, 4vw, 2.4rem) auto;
  padding: clamp(1.3rem, 4vw, 2.4rem) clamp(1rem, 4vw, 2.2rem);
  background: linear-gradient(180deg, var(--ink-2), #0f0d14);
  border: 1px solid var(--line);
  border-radius: 10px;
  border-bottom: 3px solid var(--violet);
  box-shadow: 0 18px 44px -34px rgba(128, 0, 255, 0.95);
  scroll-margin-top: 120px;
}

main > section:not(.hero)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 3px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(90deg, var(--violet), var(--magenta) 60%, transparent);
}

main > section:not(.hero) h2 {
  margin: 0 0 0.8rem;
  padding-left: 0.7rem;
  border-left: 4px solid var(--magenta);
  color: #fff;
  font-size: clamp(1.28rem, 3.6vw, 1.85rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0.01em;
  text-shadow: 0 0 14px rgba(128, 0, 255, 0.62);
  overflow-wrap: anywhere;
}

main > section:not(.hero) h3 {
  margin: 1.6rem 0 0.6rem;
  color: #efd8ff;
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

main > section:not(.hero) hr {
  height: 1px;
  margin: 0 0 1.3rem;
  border: 0;
  background: linear-gradient(90deg, var(--magenta), var(--violet) 42%, transparent);
}

main > section:not(.hero) p {
  margin: 0 0 1.05rem;
  line-height: 1.9;
}

main > section:not(.hero) a {
  color: #e8ccff;
  text-decoration: none;
  border-bottom: 1px dashed var(--violet);
}

main > section:not(.hero) a:hover {
  color: #fff;
  border-bottom-color: var(--magenta);
  text-shadow: 0 0 10px var(--magenta);
}

main > section:not(.hero) strong {
  color: #fff;
  font-weight: 500;
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.4);
}

main > section:not(.hero) ul,
main > section:not(.hero) ol {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
}

main > section:not(.hero) ul {
  padding-left: 0;
  list-style: none;
}

main > section:not(.hero) ul > li {
  position: relative;
  padding-left: 1.3rem;
  margin: 0.35rem 0;
}

main > section:not(.hero) ul > li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--magenta);
}

main > section:not(.hero) ol > li {
  margin: 0.35rem 0;
}

main > section:not(.hero) blockquote {
  margin: 0 0 1.2rem;
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--violet);
  border-radius: 0 10px 10px 0;
  background: rgba(128, 0, 255, 0.08);
  color: #e9e2f4;
}

main > section:not(.hero) blockquote p:last-child {
  margin-bottom: 0;
}

main > section:not(.hero) figure {
  margin: 0 0 1.2rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink-3);
}

main > section:not(.hero) figcaption {
  margin-top: 0.5rem;
  color: var(--dim);
  font-size: 0.86rem;
}

main > section:not(.hero) aside {
  margin: 0 0 1.2rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  border-left: 3px solid var(--magenta);
  background: rgba(255, 0, 255, 0.06);
  font-size: 0.94rem;
}

main > section:not(.hero) img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

main > section:not(.hero) time {
  display: inline-block;
  padding: 0.1rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 0, 255, 0.07);
  color: var(--magenta);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
}

main > section:not(.hero) code {
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: rgba(128, 0, 255, 0.16);
  color: #f0dcff;
  font-family: inherit;
  font-size: 0.94em;
}

/* ---------- 页脚 ---------- */
.base {
  position: relative;
  z-index: 1;
  margin-top: clamp(2.4rem, 6vw, 3.6rem);
  padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1rem, 4vw, 2.5rem) 1.4rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(128, 0, 255, 0.1), transparent 62%);
}

.base-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.2rem, 4vw, 3rem);
  max-width: 1040px;
  margin: 0 auto;
  align-items: start;
}

.base-logo {
  display: inline-block;
  padding: 0.4rem 0;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-decoration: none;
  text-shadow: 0 0 12px rgba(128, 0, 255, 0.85);
}

.base address {
  margin-top: 0.45rem;
  color: var(--dim);
  font-size: 0.9rem;
  font-style: normal;
  line-height: 1.75;
}

.base-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.1rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.base-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--dim);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.base-link:hover,
.base-link:focus-visible {
  color: #fff;
  border-bottom-color: var(--magenta);
}

.base-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  max-width: 1040px;
  margin: 1.7rem auto 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  text-align: center;
}

.base-copy {
  margin: 0;
  color: var(--dim);
  font-size: 0.84rem;
  letter-spacing: 0.1em;
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--magenta);
  font-size: 0.85rem;
  text-decoration: none;
}

.to-top:hover,
.to-top:focus-visible {
  border-color: var(--magenta);
  box-shadow: 0 0 16px rgba(255, 0, 255, 0.35);
}

@media (max-width: 719px) {
  .base-cols {
    grid-template-columns: 1fr;
  }
}

/* ---------- 动效 ---------- */
.rv {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.rv.in {
  opacity: 1;
  transform: none;
}

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

  .hero-copy h1 {
    animation: none;
  }

  .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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