@import url('https://fonts.googleapis.com/css2?family=Lexend+Mega:wght@100..900&family=Public+Sans:wght@100..900&display=swap');

:root {
  --violet: #6514ff;
  --magenta: #bf00ff;
  --ink: #1c1726;
  --deep: #120e19;
  --paper: #f7f4ff;
  --glass: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.16);
  --rail: 282px;
  --radius: 28px;
  --font-h: 'Lexend Mega', 'Public Sans', system-ui, sans-serif;
  --font-b: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font-b);
  font-size: 17px;
  line-height: 1.75;
  color: var(--paper);
  background-color: var(--ink);
  background-image:
    radial-gradient(1100px 720px at 88% -12%, rgba(191, 0, 255, 0.36), transparent 62%),
    radial-gradient(900px 700px at -6% 104%, rgba(101, 20, 255, 0.44), transparent 58%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
  background-image:
    radial-gradient(circle at center, rgba(191, 0, 255, 0.32) 1px, transparent 1.7px),
    radial-gradient(circle at center, rgba(101, 20, 255, 0.26) 1px, transparent 1.7px);
  background-size: 34px 34px, 68px 68px;
  background-position: 0 0, 17px 17px;
  animation: drift 32s linear infinite;
}

@keyframes drift {
  to {
    background-position: 34px 68px, -51px 85px;
  }
}

body.sheet-open {
  overflow: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-h);
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--magenta);
  outline-offset: 3px;
}

.page {
  position: relative;
  z-index: 1;
  padding-left: var(--rail);
  min-height: 100vh;
}

/* 左侧固定竖排导航 */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px 20px;
  overflow-y: auto;
  background: rgba(16, 12, 24, 0.8);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--line);
}

.rail-brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--font-h);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
}

.rail-brand img {
  height: 26px;
  width: auto;
  border-radius: 8px;
}

.rail-brand span {
  background-image: linear-gradient(100deg, #fff 30%, var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.rail-nav ul,
.sheet-nav ul,
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: navi;
}

.rail-nav ul {
  display: grid;
  gap: 4px;
}

.rail-nav li,
.sheet-nav li,
.toc li {
  counter-increment: navi;
}

.rail-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 16px;
  line-height: 1.35;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background 0.22s, border-color 0.22s, transform 0.22s;
}

.rail-nav a::before {
  content: counter(navi, decimal-leading-zero);
  font-family: var(--font-h);
  font-size: 16px;
  color: var(--magenta);
  opacity: 0.85;
  min-width: 22px;
}

.rail-nav a:hover,
.rail-nav a.on {
  background: rgba(191, 0, 255, 0.22);
  border-color: rgba(191, 0, 255, 0.55);
  transform: translateX(3px);
}

.rail-tools {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.search {
  display: flex;
  gap: 8px;
}

.search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  font-size: 16px;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.search button {
  height: 44px;
  padding: 0 13px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  transition: filter 0.2s;
}

.search button:hover {
  filter: brightness(1.15);
}

.burger {
  height: 46px;
  font-family: var(--font-h);
  font-size: 16px;
  color: var(--paper);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: background 0.2s, color 0.2s;
}

.burger:hover {
  background: var(--magenta);
  color: #fff;
}

/* 全屏遮罩菜单 */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(12, 9, 18, 0.95);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.26s ease, visibility 0.26s ease;
}

body.sheet-open .sheet {
  opacity: 1;
  visibility: visible;
}

.sheet-close {
  position: absolute;
  top: 20px;
  right: 20px;
  min-height: 44px;
  padding: 0 18px;
  font-size: 16px;
  color: var(--paper);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.sheet-nav ul {
  display: grid;
  gap: 2px;
  text-align: center;
}

.sheet-nav a {
  display: block;
  min-height: 48px;
  padding: 12px 26px;
  font-family: var(--font-h);
  font-size: clamp(19px, 3.6vw, 30px);
  line-height: 1.4;
  border-radius: 16px;
  transition: background 0.22s;
}

.sheet-nav a::before {
  content: counter(navi, decimal-leading-zero);
  font-size: 16px;
  color: var(--magenta);
  margin-right: 8px;
}

.sheet-nav a:hover {
  background: rgba(191, 0, 255, 0.2);
}

main {
  max-width: 1180px;
  margin-right: auto;
  padding: 0 clamp(18px, 4vw, 60px) 64px;
}

/* 英雄区：文在上、图在下，右对齐 */
.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(20px, 4vw, 40px);
  padding: clamp(44px, 9vh, 96px) 0 0;
  text-align: right;
}

.hero-copy {
  align-self: stretch;
}

.hero h1 {
  margin: 0;
  font-size: clamp(33px, 6vw, 82px);
  line-height: 1.07;
  font-weight: 800;
  text-wrap: balance;
  background-image: linear-gradient(96deg, #ffffff 22%, #e0ccff 58%, var(--magenta) 98%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-figure {
  position: relative;
  margin: 0;
  width: 100%;
  aspect-ratio: 21 / 8;
  min-height: clamp(190px, 26vw, 320px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--violet), var(--magenta));
  box-shadow: 0 30px 64px -34px rgba(101, 20, 255, 0.95);
}

.hero-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-art {
  position: absolute;
  inset: -35%;
  background: conic-gradient(from 90deg, #6514ff, #bf00ff, #2a1140, #6514ff);
  animation: spin 22s linear infinite;
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.55) 1px, transparent 1.6px);
  background-size: 22px 22px;
  mix-blend-mode: overlay;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* 介绍条：目录在左 */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
  grid-template-areas:
    "toc title"
    "toc sub";
  align-content: start;
  column-gap: clamp(20px, 3vw, 44px);
  row-gap: 6px;
  margin-top: clamp(48px, 8vw, 88px);
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.intro h2 {
  grid-area: title;
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.22;
  font-weight: 800;
}

.intro .subtitle {
  grid-area: sub;
  margin: 0;
  max-width: 62ch;
  font-size: 17px;
  line-height: 1.78;
  color: rgba(247, 244, 255, 0.8);
}

.intro .toc {
  grid-area: toc;
  padding-right: 10px;
  border-right: 1px dashed rgba(191, 0, 255, 0.38);
}

.toc h3 {
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: 0.16em;
  color: var(--magenta);
}

.toc ul {
  display: grid;
  gap: 2px;
}

.toc a {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-height: 40px;
  padding: 6px 4px;
  font-size: 16px;
  line-height: 1.4;
  border-radius: 10px;
  transition: background 0.2s, color 0.2s;
}

.toc a::before {
  content: counter(navi, decimal-leading-zero);
  font-family: var(--font-h);
  font-size: 16px;
  color: var(--magenta);
  opacity: 0.7;
}

.toc a:hover {
  background: rgba(191, 0, 255, 0.16);
}

/* 正文 */
.doc {
  margin-top: clamp(48px, 7vw, 88px);
}

.prose {
  max-width: 78ch;
}

.prose > article {
  position: relative;
  overflow: hidden;
  margin-bottom: clamp(32px, 5vw, 56px);
  padding: clamp(22px, 3.4vw, 40px);
  scroll-margin-top: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.028));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.prose > article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 86px;
  background: linear-gradient(180deg, var(--violet), var(--magenta));
  border-radius: 0 8px 8px 0;
}

.prose > article:nth-child(even)::before {
  background: linear-gradient(180deg, var(--magenta), var(--violet));
}

.prose > article:last-child {
  margin-bottom: 0;
}

.prose > article.hit {
  animation: hit 1s ease;
}

@keyframes hit {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(191, 0, 255, 0);
  }
  40% {
    box-shadow: 0 0 0 5px rgba(191, 0, 255, 0.6);
  }
}

.prose h2 {
  margin: 0 0 16px;
  font-size: clamp(21px, 3vw, 32px);
  line-height: 1.28;
  font-weight: 800;
  color: #fff;
}

.prose h3 {
  margin: 26px 0 10px;
  font-size: 19px;
  line-height: 1.4;
}

.prose h4 {
  margin: 22px 0 8px;
  font-size: 17px;
  line-height: 1.5;
  font-family: var(--font-h);
}

.prose p {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 9px;
}

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

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

.prose img {
  height: auto;
  margin: 18px 0;
  border-radius: 18px;
}

.prose blockquote {
  margin: 22px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--magenta);
  border-radius: 0 16px 16px 0;
  background: rgba(191, 0, 255, 0.1);
}

.prose strong {
  color: #fff;
}

.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.prose pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.4);
}

.prose article > *:last-child {
  margin-bottom: 0;
}

/* 页脚单行四栏 */
.foot {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1.2fr 1.2fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  padding: clamp(28px, 4vw, 46px) clamp(18px, 4vw, 60px) 30px;
  border-top: 1px solid var(--line);
  background: rgba(14, 10, 20, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.foot-brand a {
  display: inline-block;
  min-height: 40px;
  padding: 6px 0;
  font-family: var(--font-h);
  font-size: 19px;
  line-height: 1.4;
  font-weight: 800;
}

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

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
  font-size: 16px;
  color: rgba(247, 244, 255, 0.82);
}

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

.foot-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  color: rgba(247, 244, 255, 0.82);
}

.sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sub input {
  flex: 1 1 130px;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  font-size: 16px;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.sub button {
  height: 44px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
}

.sub button:hover {
  filter: brightness(1.15);
}

.foot-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.copy {
  margin: 0;
  font-size: 16px;
  color: rgba(247, 244, 255, 0.72);
}

.foot-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  padding: 0;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 16px;
  color: rgba(247, 244, 255, 0.86);
  border-bottom: 1px solid rgba(191, 0, 255, 0.5);
}

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

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.62s ease, transform 0.62s cubic-bezier(0.2, 0.7, 0.3, 1);
}

[data-reveal].in {
  opacity: 1;
  transform: none;
}

@media (max-width: 900px) {
  .page {
    padding-left: 0;
  }

  .rail {
    position: sticky;
    top: 0;
    inset: auto;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-nav {
    display: none;
  }

  .rail-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .rail-brand a {
    font-size: 17px;
  }

  .rail-tools {
    margin-top: 0;
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
  }

  .search {
    flex: 0 1 150px;
  }

  .burger {
    padding: 0 14px;
  }

  main {
    padding-inline: 16px;
  }

  .hero {
    min-height: 62vh;
    padding-top: 34px;
    text-align: left;
  }

  .intro {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "sub"
      "toc";
    margin-top: 40px;
  }

  .intro .toc {
    margin-top: 12px;
    padding: 14px 0 0;
    padding-right: 0;
    border-right: 0;
    border-top: 1px dashed rgba(191, 0, 255, 0.38);
  }

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

  .foot-form,
  .foot-legal {
    grid-column: span 2;
  }

  .foot-legal {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .search {
    display: none;
  }

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

  .foot-form,
  .foot-legal {
    grid-column: auto;
  }
}

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

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

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