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

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

:root {
  --bg: #07050d;
  --ink: #1c1726;
  --panel: #120c1f;
  --pri: #6514ff;
  --sec: #bf00ff;
  --txt: #efe9ff;
  --dim: #a99cc9;
  --line: rgba(191, 0, 255, 0.28);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --r: 4px;
  --bar: 64px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1.72;
  font-weight: 400;
  overflow-x: hidden;
  letter-spacing: 0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: -40% -40%;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(58deg, rgba(101, 20, 255, 0.13) 0 2px, transparent 2px 92px),
    repeating-linear-gradient(-58deg, rgba(191, 0, 255, 0.10) 0 2px, transparent 2px 132px);
  animation: drift 30s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 40vh at 15% 0%, rgba(101, 20, 255, 0.30), transparent 70%),
    radial-gradient(50vw 45vh at 90% 20%, rgba(191, 0, 255, 0.18), transparent 72%);
}

@keyframes drift {
  to { transform: translate3d(92px, 132px, 0); }
}

main, .masthead, .belt, .foot { position: relative; z-index: 1; }

a { color: var(--sec); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--sec); outline-offset: 3px; }

.mark-img { width: 26px; height: 26px; object-fit: contain; display: block; }

/* ---------- 顶部横条 ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--bar);
  padding: 8px 14px;
  background: rgba(7, 5, 13, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brandmark {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r);
  border: 1px solid var(--pri);
  background: linear-gradient(140deg, var(--pri), var(--sec));
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 18px;
  box-shadow: 0 0 22px rgba(101, 20, 255, 0.6);
}

.brandmark:hover { background: linear-gradient(140deg, var(--sec), #fff0ff); color: var(--ink); }
.mark-glyph { line-height: 1; }

.topnav { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topnav a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 16px;
  color: var(--dim);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--r);
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.topnav a::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--pri);
  transform: rotate(45deg);
  transition: background 0.22s ease, transform 0.22s ease;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: #fff;
  background: rgba(191, 0, 255, 0.14);
  border-color: var(--sec);
}

.topnav a:hover::before { background: #fff; transform: rotate(135deg); }

/* ---------- 二级粘性锚点条 ---------- */
.belt {
  position: sticky;
  top: var(--bar);
  z-index: 35;
  display: flex;
  overflow-x: auto;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.belt::-webkit-scrollbar { display: none; }

.belt a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 16px;
  color: var(--dim);
  text-decoration: none;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.2s ease, background 0.2s ease;
}

.belt b { color: var(--sec); font-weight: 500; }
.belt a:hover { color: #fff; background: rgba(101, 20, 255, 0.32); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 45vh;
  padding: 52px 18px 60px;
  overflow: hidden;
  border-bottom: 2px solid var(--pri);
  isolation: isolate;
}

.ghost {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-size: clamp(118px, 32vw, 290px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(191, 0, 255, 0.26);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.hero h1 {
  position: relative;
  z-index: 3;
  margin: 0;
  max-width: 22ch;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.16;
  letter-spacing: -0.025em;
  text-align: center;
  text-shadow: 0 0 42px rgba(101, 20, 255, 0.75), 0 0 12px rgba(0, 0, 0, 0.9);
}

.tile {
  position: absolute;
  z-index: 1;
  margin: 0;
  width: min(30vw, 210px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 2px solid var(--pri);
  border-radius: var(--r);
  background: linear-gradient(160deg, var(--pri), var(--ink));
  box-shadow: 0 20px 46px rgba(101, 20, 255, 0.4);
}

.tile-a {
  left: 4%;
  top: 9%;
  transform: rotate(-4deg) translateY(var(--py, 0px));
}

.tile-b {
  right: 4%;
  bottom: 7%;
  transform: rotate(5deg) translateY(var(--py, 0px));
  border-color: var(--sec);
  box-shadow: 0 20px 46px rgba(191, 0, 255, 0.36);
}

.tile-img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.2) contrast(1.06); }

.shard {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(45deg, var(--sec) 0 7px, transparent 7px 16px),
    linear-gradient(180deg, #000, var(--pri));
}

.shard-b { background: repeating-linear-gradient(-45deg, #fff6ff 0 5px, transparent 5px 13px), linear-gradient(180deg, var(--sec), #1a0030); }

/* ---------- 骨架 ---------- */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 302px;
  gap: 52px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 60px 20px 84px;
}

main [id] { scroll-margin-top: 132px; }

/* ---------- 正文 ---------- */
.flow { min-width: 0; }

.flow div {
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.flow div:first-child { border-top: 0; padding-top: 0; }
.flow div:last-child { padding-bottom: 0; }

.flow small {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  letter-spacing: 0.32em;
  color: var(--sec);
}

.flow h2 {
  margin: 0 0 18px;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.24;
  letter-spacing: -0.015em;
}

.flow h2::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 12px;
  background: var(--sec);
  vertical-align: 0.12em;
  box-shadow: 0 0 16px var(--sec);
}

.flow h3 {
  margin: 32px 0 12px;
  font-size: 21px;
  line-height: 1.35;
  color: #fff;
  border-bottom: 1px dashed rgba(191, 0, 255, 0.35);
  padding-bottom: 8px;
}

.flow p { margin: 0 0 18px; color: #ded5f5; }
.flow p:last-child { margin-bottom: 0; }

.flow ul, .flow ol { margin: 0 0 18px; padding-left: 1.35em; }
.flow li { margin-bottom: 8px; }
.flow li::marker { color: var(--sec); }
.flow strong { color: #fff; }

.flow a { color: var(--sec); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.flow a:hover { color: #fff; }

.flow figure {
  margin: 26px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
}
.flow figure img { width: 100%; height: auto; display: block; }

.flow aside {
  margin: 26px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--pri);
  border-radius: var(--r);
  background: rgba(101, 20, 255, 0.12);
}
.flow aside p:last-child { margin-bottom: 0; }

.flow blockquote {
  margin: 26px 0;
  padding: 16px 20px;
  background: var(--ink);
  border-left: 3px solid var(--sec);
  border-radius: var(--r);
  color: #e9e1ff;
}
.flow blockquote p:last-child { margin-bottom: 0; }

.flow table {
  display: block;
  overflow-x: auto;
  width: 100%;
  margin: 26px 0;
  border-collapse: collapse;
  font-size: 16px;
}
.flow th, .flow td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.flow th { background: rgba(101, 20, 255, 0.18); color: #fff; font-weight: 500; }

.flow hr { border: 0; height: 2px; margin: 30px 0; background: linear-gradient(90deg, var(--pri), var(--sec), transparent); }

/* ---------- 右侧栏 ---------- */
.rail {
  position: sticky;
  top: 128px;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(101, 20, 255, 0.18), rgba(28, 23, 38, 0.72));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

.eyebrow {
  display: block;
  font-size: 16px;
  letter-spacing: 0.3em;
  color: var(--sec);
}

.rail-h { margin: 2px 0 12px; font-size: 21px; line-height: 1.3; }

.toc { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 16px;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--sec); font-size: 16px; }
.toc a:hover { color: #fff; padding-left: 4px; }

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 20px;
  padding: 52px 20px 26px;
  border-top: 2px solid var(--pri);
  background: linear-gradient(180deg, rgba(101, 20, 255, 0.18), #05030a 70%);
}

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

.foot dl { margin: 0; }
.foot dt { margin-bottom: 10px; font-size: 16px; letter-spacing: 0.26em; color: var(--sec); }
.foot dd { margin: 0; color: var(--dim); font-size: 16px; }
.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}
.foot dd a:hover { color: #fff; transform: translateX(4px); }

.bigmark {
  max-width: 1180px;
  margin: 0 auto 28px;
  font-size: clamp(40px, 11vw, 118px);
  line-height: 0.96;
  letter-spacing: -0.05em;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 2px rgba(191, 0, 255, 0.6);
  word-break: break-word;
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 16px;
  color: var(--dim);
  text-align: center;
}
.foot-base p { margin: 0; }

/* ---------- 进入动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.reveal.seen { opacity: 1; transform: none; }

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 44px 18px 64px; }
  .rail { position: static; }
  .foot-cols { gap: 28px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .tile { width: 86px; opacity: 0.92; }
  .tile-a { left: 3%; top: 6%; }
  .tile-b { right: 3%; bottom: 5%; }
  .hero { padding: 44px 14px 50px; min-height: 46vh; }
  .ghost { font-size: 116px; }
  .flow div { padding: 32px 0; }
  .foot-cols { grid-template-columns: minmax(0, 1fr); gap: 22px; margin-bottom: 30px; }
  .foot { padding: 42px 16px 22px; }
  .masthead { padding: 8px 10px; }
  .belt a, .topnav a { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tile { transform: rotate(-4deg); }
  .tile-b { transform: rotate(5deg); }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

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