@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&family=Noto+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --ink: #0d0d0d;
  --ink-2: #141018;
  --ink-3: #1b1622;
  --violet: #8000ff;
  --magenta: #ff00ff;
  --text: #ece7f5;
  --muted: #a79dbb;
  --line: rgba(128, 0, 255, 0.32);
  --line-soft: rgba(128, 0, 255, 0.18);
  --glow-v: 0 0 14px rgba(128, 0, 255, 0.55);
  --glow-m: 0 0 14px rgba(255, 0, 255, 0.5);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Be Vietnam Pro", "Noto Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --max: 1180px;
  --radius: 18px;
}

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

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

body {
  margin: 0;
  background-color: var(--ink);
  background-image:
    radial-gradient(920px 520px at 10% -10%, rgba(128, 0, 255, 0.22), transparent 70%),
    radial-gradient(720px 460px at 94% 2%, rgba(255, 0, 255, 0.16), transparent 72%),
    linear-gradient(180deg, rgba(255, 0, 255, 0.04), transparent 320px);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.78;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #d79bff;
}

::selection {
  background: var(--magenta);
  color: #0d0d0d;
}

/* ---------- 顶部 HUD 导航 ---------- */

.hud {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px clamp(16px, 4vw, 40px) 14px;
  background: rgba(13, 13, 13, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  color: #fff;
}

.brand-logo {
  width: auto;
  height: 28px;
  filter: drop-shadow(0 0 8px rgba(255, 0, 255, 0.6));
}

.brand-text {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-shadow: var(--glow-v);
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--violet), var(--magenta));
  color: #10100f;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(255, 0, 255, 0.62);
}

.hud-nav {
  max-width: var(--max);
  margin: 10px auto 0;
}

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

.hud-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 1rem;
  text-decoration: none;
  background: rgba(128, 0, 255, 0.08);
  transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.hud-list a:hover,
.hud-list a:focus-visible {
  border-color: var(--magenta);
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 0, 255, 0.45);
}

/* ---------- 布局骨架 ---------- */

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) clamp(48px, 7vw, 88px);
}

.sheet {
  min-width: 0;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 3vw, 32px);
  min-height: 45vh;
  padding: clamp(22px, 4vw, 46px) 0 clamp(16px, 3vw, 28px);
}

.hero-copy {
  min-width: 0;
}

.hero h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.9rem, 5.4vw, 3.25rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-shadow: 0 0 26px rgba(255, 0, 255, 0.38), 3px 0 0 rgba(128, 0, 255, 0.55);
  animation: glitch 7s steps(1) infinite;
}

@keyframes glitch {
  0%, 90%, 100% { transform: skewX(0deg); }
  91% { transform: skewX(-2.4deg); }
  93% { transform: skewX(2.4deg); }
  95% { transform: skewX(0deg); }
}

.lede {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.72;
}

.hero-art {
  justify-self: end;
  filter: drop-shadow(0 0 22px rgba(255, 0, 255, 0.36));
  will-change: transform;
}

.hero-glyph {
  width: clamp(84px, 12vw, 124px);
  height: auto;
  animation: spin 26s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- 正文 ---------- */

.prose {
  min-width: 0;
}

.prose section {
  padding: clamp(26px, 4vw, 44px) 0;
  border-top: 1px solid var(--line-soft);
}

.prose section:first-of-type {
  border-top: 0;
}

.prose section[id] {
  scroll-margin-top: 168px;
}

.prose h2 {
  margin: 0 0 0.65em;
  padding-left: 14px;
  border-left: 3px solid var(--violet);
  font-size: clamp(1.45rem, 3.4vw, 2.05rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  text-shadow: 0 0 18px rgba(128, 0, 255, 0.5);
}

.prose h3 {
  margin: 1.6em 0 0.5em;
  font-size: 1.2rem;
  line-height: 1.4;
  color: #f2e9ff;
}

.prose small {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: var(--magenta);
  text-shadow: var(--glow-m);
}

.prose p {
  margin: 0 0 1.1em;
  max-width: 68ch;
}

.prose ul,
.prose ol {
  margin: 0 0 1.2em;
  padding-left: 1.35em;
}

.prose li {
  margin-bottom: 0.45em;
}

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

.prose a {
  color: #e2b6ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: #fff;
  text-shadow: var(--glow-m);
}

.prose strong {
  color: #fff;
  font-weight: 600;
}

.prose blockquote {
  margin: 0 0 1.2em;
  padding: 12px 18px;
  border-left: 2px solid var(--magenta);
  background: rgba(255, 0, 255, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #e8dff6;
}

.prose pre {
  overflow-x: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0a0a0c;
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.6;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.95em;
  color: #f4c6ff;
}

.prose table {
  width: 100%;
  margin-bottom: 1.2em;
  border-collapse: collapse;
  font-size: 1rem;
}

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

.prose th {
  background: rgba(128, 0, 255, 0.14);
}

/* ---------- 右侧栏 ---------- */

.rail {
  position: sticky;
  top: 168px;
  padding: 18px;
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--magenta);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(128, 0, 255, 0.12), rgba(13, 13, 13, 0.72));
  box-shadow: 0 0 26px rgba(128, 0, 255, 0.18);
}

.rail small {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.24em;
  color: var(--magenta);
  text-shadow: var(--glow-m);
}

.rail-title {
  margin: 0 0 12px;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-list li {
  animation: rise 0.5s ease both;
}

.rail-list li:nth-child(1) { animation-delay: 0.04s; }
.rail-list li:nth-child(2) { animation-delay: 0.09s; }
.rail-list li:nth-child(3) { animation-delay: 0.14s; }
.rail-list li:nth-child(4) { animation-delay: 0.19s; }
.rail-list li:nth-child(5) { animation-delay: 0.24s; }
.rail-list li:nth-child(6) { animation-delay: 0.29s; }
.rail-list li:nth-child(7) { animation-delay: 0.34s; }

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.rail-list a:hover,
.rail-list a.is-active,
.rail-list a:focus-visible {
  color: #fff;
  background: linear-gradient(90deg, rgba(128, 0, 255, 0.42), rgba(255, 0, 255, 0.1));
  box-shadow: inset 0 0 0 1px var(--line);
}

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

.foot {
  border-top: 1px solid var(--line);
  background: #0a0a0c;
  padding: clamp(30px, 5vw, 58px) clamp(16px, 4vw, 40px) 22px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: 24px;
  max-width: var(--max);
  margin: 0 auto;
}

.foot-name {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: var(--glow-v);
}

.foot-desc {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.foot-col {
  margin: 0;
  min-width: 0;
}

.foot-col dt {
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.18em;
  color: var(--magenta);
}

.foot-col dd {
  margin: 0;
}

.foot-col a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--text);
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot-col a:hover {
  color: #fff;
  border-bottom-color: var(--magenta);
}

.foot-base {
  max-width: var(--max);
  margin: 26px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  color: var(--muted);
}

.foot-base p {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

/* ---------- 回到顶部 ---------- */

.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 65;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #16111d;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.to-top.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.to-top:hover {
  border-color: var(--magenta);
  box-shadow: 0 0 18px rgba(255, 0, 255, 0.42);
}

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

@media (max-width: 960px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    top: auto;
    order: 2;
  }

  .prose section[id] {
    scroll-margin-top: 190px;
  }
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-top: clamp(20px, 6vw, 32px);
  }

  .hero-art {
    justify-self: start;
    grid-row: 1;
  }

  .hero-glyph {
    width: 72px;
  }

  .foot-grid {
    grid-template-columns: 1fr 1fr;
  }

  .foot-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 460px) {
  .hud-list {
    gap: 6px;
  }

  .hud-list a {
    padding: 0 11px;
    font-size: 1rem;
  }

  .cta {
    padding: 0 14px;
  }

  .foot-grid {
    grid-template-columns: 1fr;
  }
}

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