@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Orbitron:wght@700;900&display=swap');

:root {
  --ink: #0d0d0d;
  --violet: #8000ff;
  --magenta: #ff00ff;
  --acid: #00ffa8;
  --txt: #e6dcff;
  --dim: #a294c9;
  --line: rgba(128, 0, 255, 0.38);
  --glow: 0 0 12px rgba(255, 0, 255, 0.6);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --disp: "Orbitron", "JetBrains Mono", ui-monospace, monospace;
}

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

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

body {
  margin: 0;
  background-color: var(--ink);
  background-image:
    linear-gradient(90deg, rgba(128, 0, 255, 0.075) 1px, transparent 1px),
    linear-gradient(0deg, rgba(128, 0, 255, 0.05) 1px, transparent 1px),
    radial-gradient(125% 70% at 82% 0%, rgba(255, 0, 255, 0.13), transparent 62%);
  background-size: 64px 64px, 64px 64px, 100% 100%;
  background-attachment: fixed, fixed, scroll;
  color: var(--txt);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
  opacity: 0.55;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--txt); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 顶部固定条 ---------- */
.hud {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(13, 13, 13, 0.94);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--disp);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.09em;
  color: #fff;
  text-decoration: none;
  text-shadow: var(--glow);
}

.brand::before {
  content: "";
  width: 8px; height: 8px;
  margin-right: 9px;
  background: var(--magenta);
  box-shadow: 0 0 10px var(--magenta);
  animation: blink 2.6s steps(1) infinite;
}

.nav { position: relative; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 16px;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--txt);
  border: 1px solid var(--violet);
  background: linear-gradient(180deg, rgba(128, 0, 255, 0.24), rgba(128, 0, 255, 0.05));
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  cursor: pointer;
  user-select: none;
}

.nav-btn::after { content: "＋"; color: var(--magenta); font-size: 14px; }

.nav-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(560px, 86vw);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
  padding: 16px;
  border: 1px solid var(--violet);
  background: #0f0f14;
  box-shadow: 0 26px 54px -20px rgba(255, 0, 255, 0.6);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.nav:hover .nav-panel,
.nav:focus-within .nav-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.nav-col { margin: 0; }
.nav-col dt {
  font-family: var(--disp);
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--acid);
  margin: 6px 0 4px;
}
.nav-col dd { margin: 0; }

.nav-col a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font-size: 16px;
  text-decoration: none;
  color: var(--dim);
  border-left: 2px solid transparent;
}

.nav-col a:hover,
.nav-col a:focus-visible {
  color: #fff;
  border-left-color: var(--magenta);
  background: rgba(255, 0, 255, 0.1);
  text-shadow: var(--glow);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  min-height: 70vh;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: 32px;
  padding: 40px 20px 48px;
}

.hero-media { order: 1; position: relative; }

.hero-img {
  width: 100%;
  border: 1px solid var(--violet);
  filter: saturate(1.15) contrast(1.05);
  box-shadow: 0 0 0 1px rgba(255, 0, 255, 0.26), 0 34px 64px -32px var(--violet);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%);
}

.hero-plate {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  background-image:
    repeating-linear-gradient(90deg, rgba(128, 0, 255, 0.18) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, rgba(255, 0, 255, 0.13) 0 1px, transparent 1px 22px),
    radial-gradient(circle at 50% 58%, rgba(255, 0, 255, 0.36), transparent 62%);
  box-shadow: inset 0 0 60px rgba(128, 0, 255, 0.35);
}
.hero-plate span {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--magenta), transparent);
  animation: scan 3.8s linear infinite;
}

.hero-copy {
  order: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 14px;
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--acid);
  border: 1px solid rgba(0, 255, 168, 0.5);
  background: rgba(0, 255, 168, 0.07);
  animation: float 5.5s ease-in-out infinite;
}
.badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 10px var(--acid);
}

h1 {
  margin: 0;
  font-family: var(--disp);
  font-weight: 900;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1.18;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 0, 255, 0.8), 0 0 46px rgba(128, 0, 255, 0.6);
  animation: glitch 7s infinite;
}

/* ---------- 主体：侧栏 + 正文 ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 64px;
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.rail {
  position: sticky;
  top: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #0f0f14;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
  box-shadow: 0 20px 44px -28px rgba(128, 0, 255, 0.9);
}

.eyebrow {
  display: block;
  font-size: 14px;
  letter-spacing: 0.24em;
  color: var(--magenta);
}
.rail-h {
  margin: 2px 0 10px;
  font-family: var(--disp);
  font-size: 16px;
  letter-spacing: 0.12em;
  color: #fff;
}
.rail-list { list-style: none; margin: 0; padding: 0; }
.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font-size: 16px;
  text-decoration: none;
  color: var(--dim);
  border-left: 2px solid transparent;
}
.rail-list a:hover {
  color: #fff;
  background: rgba(255, 0, 255, 0.1);
  border-left-color: var(--magenta);
}
.rail-list a.active {
  color: var(--acid);
  border-left-color: var(--acid);
  text-shadow: 0 0 10px rgba(0, 255, 168, 0.6);
}

.doc {
  min-width: 0;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #101015;
  box-shadow: 0 0 0 1px rgba(255, 0, 255, 0.1), 0 30px 66px -34px rgba(128, 0, 255, 0.95);
}

.prose { min-width: 0; overflow-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }

.prose div {
  margin: 0 0 26px;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #14141a;
  box-shadow: 0 18px 38px -26px rgba(255, 0, 255, 0.9);
  animation: rise 0.5s both;
}
.prose div[id] { scroll-margin-top: 92px; }
.prose div:nth-child(2) { animation-delay: 0.05s; }
.prose div:nth-child(3) { animation-delay: 0.1s; }
.prose div:nth-child(4) { animation-delay: 0.15s; }
.prose div:nth-child(5) { animation-delay: 0.2s; }
.prose div:nth-child(6) { animation-delay: 0.25s; }
.prose div:nth-child(7) { animation-delay: 0.3s; }
.prose div:last-child { margin-bottom: 0; }

.prose small {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  letter-spacing: 0.22em;
  color: var(--magenta);
}

.prose h2 {
  margin: 4px 0 12px;
  font-family: var(--disp);
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.32;
  color: #fff;
  text-shadow: 0 0 14px rgba(128, 0, 255, 0.9);
}
.prose h3 {
  margin: 18px 0 8px;
  font-family: var(--disp);
  font-size: 18px;
  color: #f1e8ff;
}
.prose p, .prose li { line-height: 1.85; }
.prose ul, .prose ol { padding-left: 22px; }
.prose a {
  color: var(--magenta);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose a:hover { color: #fff; text-shadow: var(--glow); }
.prose blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--violet);
  background: rgba(128, 0, 255, 0.1);
  color: #f3edff;
}
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  font-size: 16px;
}
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: rgba(128, 0, 255, 0.18); color: #fff; }
.prose img { margin: 12px 0; border: 1px solid var(--line); }
.prose hr { border: 0; height: 1px; margin: 22px 0; background: var(--line); }

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 52px;
  padding: 34px 20px 18px;
  border-top: 1px solid var(--line);
  background: #0a0a0e;
}

.foot-top {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1.15fr;
  gap: 22px;
  align-items: start;
}

.foot-col dl { margin: 0; }
.foot-col dt {
  margin-bottom: 6px;
  font-family: var(--disp);
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--acid);
}
.foot-col dd { margin: 0; }
.foot-col a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  text-decoration: none;
  color: var(--dim);
}
.foot-col a:hover { color: #fff; text-shadow: var(--glow); }

.sub { display: flex; flex-wrap: wrap; gap: 8px; }
.sub input {
  flex: 1 1 130px;
  min-height: 44px;
  padding: 0 10px;
  font: inherit;
  font-size: 16px;
  color: var(--txt);
  background: #111116;
  border: 1px solid var(--line);
}
.sub input:focus { outline: 1px solid var(--magenta); }
.sub button {
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #0d0d0d;
  border: 0;
  cursor: pointer;
  background: linear-gradient(180deg, var(--magenta), var(--violet));
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.foot-bottom {
  max-width: 1180px;
  margin: 22px auto 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.foot-bottom p { margin: 0; font-size: 16px; color: var(--dim); }
.totop {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--acid);
  text-decoration: none;
  letter-spacing: 0.12em;
}

/* ---------- 动效 ---------- */
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.25; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes scan { from { top: 0; } to { top: 100%; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes glitch {
  0%, 92%, 100% { transform: none; }
  93% { transform: skewX(-2.4deg) translateX(-3px); }
  94% { transform: skewX(1.8deg) translateX(2px); }
  95% { transform: none; }
  96% { transform: skewX(-1.2deg); }
  97% { transform: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hud { position: static; flex-wrap: wrap; padding: 10px 14px; }
  .nav { width: 100%; }
  .nav-btn { width: 100%; justify-content: space-between; }
  .nav-panel {
    position: static;
    width: 100%;
    margin-top: 8px;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
  }
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 20px;
    padding: 26px 14px 30px;
  }
  .hero-media { order: 1; }
  .hero-copy { order: 2; }
  .wrap { grid-template-columns: 1fr; gap: 18px; padding: 0 14px 44px; }
  .rail { position: static; }
  .doc { padding: 18px 14px; }
  .prose div[id] { scroll-margin-top: 20px; }
  .foot { padding: 28px 14px 16px; }
  .foot-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 430px) {
  .foot-top { grid-template-columns: 1fr; }
  .prose div { padding: 16px 13px; }
}

@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;
  }
  .prose div { opacity: 1; }
}

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