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

:root {
  --ink: #0d0d0d;
  --panel: rgba(17, 13, 23, 0.74);
  --violet: #8000ff;
  --magenta: #ff00ff;
  --line: rgba(128, 0, 255, 0.34);
  --line-hot: rgba(255, 0, 255, 0.5);
  --text: #e7dff5;
  --muted: #a595c1;
  --head: "Lexend", "Source Sans 3", -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --sans: "Source Sans 3", -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Courier New", 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:
    radial-gradient(920px 520px at 10% -12%, rgba(128, 0, 255, 0.24), transparent 62%),
    radial-gradient(700px 460px at 96% 6%, rgba(255, 0, 255, 0.16), transparent 64%),
    linear-gradient(180deg, rgba(13, 13, 13, 0) 0%, #0d0d0d 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.78;
  overflow-x: hidden;
}

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

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

hr {
  border: 0;
  height: 1px;
  margin: 14px 0;
  background: linear-gradient(90deg, var(--magenta), rgba(128, 0, 255, 0.06));
}

/* 顶栏 */
.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(11, 9, 15, 0.86);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  max-width: 68%;
  color: #ffffff;
  text-decoration: none;
  font-family: var(--head);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-shadow: 0 0 14px rgba(255, 0, 255, 0.55);
}

.brand-logo {
  display: block;
  max-height: 26px;
  width: auto;
}

.brand-txt {
  overflow-wrap: anywhere;
}

.burger {
  flex: none;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--magenta);
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(255, 0, 255, 0.14), rgba(128, 0, 255, 0.1));
  color: #ffd9ff;
  font-family: var(--head);
  font-size: 16px;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.burger:hover {
  background: rgba(255, 0, 255, 0.24);
  color: #ffffff;
}

/* 全屏菜单面板 */
.menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px 22px 40px;
  background:
    repeating-linear-gradient(0deg, rgba(128, 0, 255, 0.06) 0 2px, rgba(0, 0, 0, 0) 2px 6px),
    rgba(9, 7, 12, 0.975);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.26s ease, transform 0.26s ease, visibility 0.26s linear;
}

.menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.menu-list {
  counter-reset: mi;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  width: min(560px, 100%);
}

.menu-list a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--violet);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(128, 0, 255, 0.16), rgba(128, 0, 255, 0.02));
  color: #eadcff;
  text-decoration: none;
  font-family: var(--head);
  font-size: 18px;
  letter-spacing: 0.02em;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.menu-list a::before {
  counter-increment: mi;
  content: counter(mi, decimal-leading-zero);
  margin-right: 14px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--magenta);
  opacity: 0.85;
}

.menu-list a:hover {
  border-color: var(--magenta);
  border-left-color: var(--magenta);
  color: #ffffff;
  transform: translateX(4px);
}

/* 头部区 */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 45vh;
  padding: 88px 20px 52px;
  text-align: center;
  border-bottom: 1px solid var(--line-hot);
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 6px;
  background: linear-gradient(90deg, rgba(128, 0, 255, 0), var(--violet) 22%, var(--magenta) 62%, rgba(255, 0, 255, 0));
  transform: skewY(-1.1deg);
  transform-origin: left center;
  filter: drop-shadow(0 0 10px rgba(255, 0, 255, 0.65));
}

.hero h1 {
  margin: 0;
  max-width: 20ch;
  font-family: var(--head);
  font-weight: 600;
  font-size: clamp(2.1rem, 7.6vw, 4.2rem);
  line-height: 1.14;
  letter-spacing: -0.005em;
  color: #ffffff;
  text-shadow: 0 0 22px rgba(255, 0, 255, 0.42), 0 0 52px rgba(128, 0, 255, 0.34);
  animation: glitch 7.5s steps(1, end) infinite;
}

@keyframes glitch {
  0%, 91%, 100% {
    transform: none;
    text-shadow: 0 0 22px rgba(255, 0, 255, 0.42), 0 0 52px rgba(128, 0, 255, 0.34);
  }
  92% {
    transform: skewX(-0.9deg) translateX(-3px);
    text-shadow: -3px 0 0 var(--magenta), 3px 0 0 var(--violet);
  }
  94% {
    transform: skewX(0.8deg) translateX(3px);
    text-shadow: 3px 0 0 var(--magenta), -3px 0 0 var(--violet);
  }
  96% {
    transform: none;
    text-shadow: -2px 0 0 var(--magenta), 2px 0 0 var(--violet);
  }
}

/* 主体骨架 */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 20px 72px;
}

.panel {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

/* 左侧栏 */
.rail {
  position: sticky;
  top: 80px;
  padding: 18px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.rail h2 {
  margin: 0 0 2px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: #e6d5ff;
}

.rail hr {
  margin: 10px 0 8px;
}

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 2px 7px 12px;
  border-left: 1px solid rgba(128, 0, 255, 0.24);
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.5;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.rail-list a:hover {
  color: #ffffff;
  border-left-color: var(--magenta);
  background: linear-gradient(90deg, rgba(255, 0, 255, 0.12), rgba(255, 0, 255, 0));
}

/* 正文 */
.prose {
  counter-reset: sec;
  min-width: 0;
}

.prose > article {
  counter-increment: sec;
  position: relative;
  margin: 0 0 30px;
  padding: 26px 22px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  scroll-margin-top: 84px;
}

.prose > article::before,
.prose > article::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.prose > article::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--magenta);
  border-left: 2px solid var(--magenta);
  border-top-left-radius: 10px;
}

.prose > article::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid var(--violet);
  border-bottom: 2px solid var(--violet);
  border-bottom-right-radius: 10px;
}

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

.prose h2 {
  margin: 0 0 4px;
  font-family: var(--head);
  font-weight: 600;
  font-size: clamp(1.34rem, 3.4vw, 1.88rem);
  line-height: 1.32;
  color: #ffffff;
  letter-spacing: 0.005em;
}

.prose h2::before {
  content: counter(sec, decimal-leading-zero);
  margin-right: 0.62em;
  font-family: var(--mono);
  font-size: 0.68em;
  letter-spacing: 0.12em;
  color: var(--magenta);
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.75);
}

.prose h3 {
  margin: 26px 0 6px;
  font-family: var(--head);
  font-weight: 500;
  font-size: 1.16rem;
  line-height: 1.4;
  color: #f2e6ff;
}

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

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

.prose a {
  color: #dcb4ff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 0, 255, 0.6);
  text-underline-offset: 3px;
}

.prose a:hover {
  color: #ffffff;
  text-decoration-color: var(--magenta);
}

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

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

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

.prose blockquote {
  margin: 20px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--violet);
  background: rgba(128, 0, 255, 0.1);
  color: #d9cbee;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(128, 0, 255, 0.18);
  font-family: var(--mono);
  font-size: 0.92em;
  color: #f6dcff;
}

.prose pre {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #09070d;
  overflow-x: auto;
  line-height: 1.6;
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: 15px;
}

.prose table {
  width: 100%;
  margin: 0 0 18px;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 9px 12px;
  border: 1px solid rgba(128, 0, 255, 0.28);
  text-align: left;
}

.prose th {
  background: rgba(128, 0, 255, 0.16);
  color: #f2e6ff;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}

/* 页脚 */
.foot {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 30px;
  align-items: start;
  padding: 44px max(20px, calc((100% - 1180px) / 2)) 34px;
  border-top: 1px solid var(--line-hot);
  background: linear-gradient(180deg, rgba(128, 0, 255, 0.1), rgba(13, 13, 13, 0) 72%);
}

.giant {
  margin: 0;
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(1.7rem, 6.4vw, 3.2rem);
  line-height: 1.14;
  letter-spacing: 0.01em;
  color: #ffffff;
  overflow-wrap: anywhere;
  text-shadow: 0 0 26px rgba(128, 0, 255, 0.6), 0 0 8px rgba(255, 0, 255, 0.32);
}

.foot-b h2 {
  margin: 0 0 2px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: #e6d5ff;
}

.foot-b hr {
  margin: 10px 0 10px;
}

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

.foot-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
  border-bottom: 1px dashed rgba(128, 0, 255, 0.2);
}

.foot-list a:hover {
  color: #ffffff;
}

.foot-c {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.copy {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.totop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #e9d9ff;
  text-decoration: none;
  font-size: 16px;
  letter-spacing: 0.08em;
}

.totop:hover {
  border-color: var(--magenta);
  color: #ffffff;
}

/* 入场动效 */
.js-rev .prose > article,
.js-rev .rail,
.js-rev .foot > article {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js-rev .prose > article.is-in,
.js-rev .rail.is-in,
.js-rev .foot > article.is-in {
  opacity: 1;
  transform: none;
}

@media (max-width: 880px) {
  .panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .rail {
    position: static;
  }

  .rail-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

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

  .foot-c {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    border-top: 1px solid rgba(128, 0, 255, 0.22);
    padding-top: 18px;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }

  .hero {
    padding: 78px 18px 44px;
    min-height: 42vh;
  }

  .wrap {
    padding: 26px 14px 56px;
  }

  .prose > article {
    padding: 22px 16px 20px;
  }

  .rail-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 16px;
    padding-right: 16px;
  }

  .foot-c {
    grid-column: auto;
  }
}

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

  .hero h1 {
    animation: none;
  }

  .js-rev .prose > article,
  .js-rev .rail,
  .js-rev .foot > article {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .menu,
  .menu-list a,
  .burger {
    transition: none;
  }
}

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