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

:root {
  --neon: #87ff71;
  --cyan: #01cdfe;
  --ink: #192617;
  --pink: #ff71ce;
  --violet: #b967ff;
  --paper: #e9fbe5;
  --dim: #a7c5a3;
  --line: rgba(135, 255, 113, 0.18);
  --radius: 4px;
  --wrap: 1120px;
  --head: 'Calistoga', 'Songti SC', Georgia, serif;
  --body: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
}

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

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.68;
  color: var(--paper);
  background-color: #0b140d;
  background-image: repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 4px
    ),
    radial-gradient(circle at 82% -6%, rgba(185, 103, 255, 0.42), transparent 58%),
    radial-gradient(circle at 6% 104%, rgba(1, 205, 254, 0.22), transparent 52%),
    linear-gradient(180deg, #0a130c 0%, #16231a 42%, #0c1a17 100%);
  background-attachment: fixed, scroll, scroll, scroll;
}

::selection {
  background: var(--neon);
  color: var(--ink);
}

a {
  color: var(--neon);
}

img {
  max-width: 100%;
}

/* 页头 */
.masthead {
  position: relative;
  padding: 16px clamp(14px, 4vw, 40px) 4px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(25, 38, 23, 0.94), rgba(11, 20, 13, 0.55));
}

.brandrow {
  display: block;
}

.brand {
  display: inline-block;
  font-family: var(--head);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  line-height: 1.2;
  padding: 8px 0;
  min-height: 44px;
  color: var(--neon);
  text-decoration: none;
  text-shadow: 0 0 14px rgba(135, 255, 113, 0.55), 0 0 36px rgba(1, 205, 254, 0.3);
}

.brand:hover {
  color: #fff;
}

.punch {
  position: absolute;
  top: 20px;
  right: clamp(14px, 4vw, 40px);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--cyan);
  background: rgba(1, 205, 254, 0.12);
  color: var(--cyan);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.punch:hover,
.punch:focus-visible {
  background: var(--cyan);
  color: var(--ink);
  box-shadow: 0 0 22px rgba(1, 205, 254, 0.6);
}

.topnav {
  padding: 2px 0 10px;
}

.topnav p {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0;
}

.topnav a {
  display: inline-block;
  padding: 12px 10px;
  min-height: 44px;
  font-size: 1rem;
  color: #d9f4d4;
  text-decoration: none;
  border-radius: var(--radius);
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--neon);
  background: rgba(135, 255, 113, 0.1);
  border-bottom-color: var(--neon);
  text-shadow: 0 0 12px rgba(135, 255, 113, 0.75);
}

/* 粘性锚点条 */
.rail {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(9, 18, 12, 0.93);
  border-bottom: 1px solid rgba(1, 205, 254, 0.32);
  backdrop-filter: blur(8px);
}

.rail p {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0 clamp(10px, 4vw, 40px);
  overflow-x: auto;
  scrollbar-width: none;
}

.rail p::-webkit-scrollbar {
  display: none;
}

.rail a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 11px;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.rail a:hover,
.rail a.on {
  color: var(--neon);
  border-bottom-color: var(--neon);
  background: rgba(135, 255, 113, 0.09);
}

/* 主视觉 */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 45vh;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid rgba(1, 205, 254, 0.28);
  scroll-margin-top: 64px;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  margin: 0;
  background: linear-gradient(180deg, #ff71ce 0%, #b967ff 36%, #01cdfe 70%, #192617 100%);
}

.hero-media::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44%;
  background-image: linear-gradient(rgba(255, 255, 255, 0.45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.45) 1px, transparent 1px);
  background-size: 58px 26px;
  transform: perspective(220px) rotateX(58deg);
  transform-origin: bottom center;
  opacity: 0.45;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.15) contrast(1.05);
}

.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(25, 38, 23, 0.2), rgba(10, 19, 12, 0.86)),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0, rgba(255, 255, 255, 0.07) 1px, transparent 1px, transparent 4px);
}

.hero-wrap {
  position: relative;
  max-width: 880px;
  padding: 48px 20px;
  text-align: center;
}

h1 {
  position: relative;
  margin: 0;
  font-family: var(--head);
  font-weight: 400;
  font-size: clamp(2rem, 7vw, 3.5rem);
  line-height: 1.14;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 0 18px rgba(135, 255, 113, 0.6), 0 0 46px rgba(1, 205, 254, 0.42);
}

h1::before,
h1::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

h1::before {
  color: var(--cyan);
  opacity: 0.7;
  clip-path: polygon(0 6%, 100% 6%, 100% 44%, 0 44%);
  animation: glitch-a 6.5s steps(2, end) infinite;
}

h1::after {
  color: var(--pink);
  opacity: 0.6;
  clip-path: polygon(0 58%, 100% 58%, 100% 96%, 0 96%);
  animation: glitch-b 7.5s steps(2, end) infinite;
}

@keyframes glitch-a {
  0%, 88%, 100% { transform: translate(0, 0); }
  90% { transform: translate(-3px, -2px); }
  94% { transform: translate(3px, 1px); }
}

@keyframes glitch-b {
  0%, 86%, 100% { transform: translate(0, 0); }
  92% { transform: translate(3px, 2px); }
  96% { transform: translate(-2px, -1px); }
}

/* 主体 */
.board {
  display: grid;
  grid-template-columns: minmax(164px, 208px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(20px, 4vw, 46px);
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(26px, 5vw, 54px) clamp(16px, 4vw, 40px) clamp(38px, 6vw, 64px);
}

.side {
  position: sticky;
  top: 58px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--cyan);
}

.side small {
  display: block;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.16em;
  color: var(--cyan);
}

.side h2 {
  margin: 2px 0 10px;
  font-family: var(--head);
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--neon);
  text-shadow: 0 0 12px rgba(135, 255, 113, 0.5);
}

.side p {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.side a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 6px;
  font-size: 1rem;
  color: #cde8c8;
  text-decoration: none;
  border-radius: var(--radius);
  border-right: 2px solid transparent;
}

.side a:hover,
.side a.on {
  color: var(--neon);
  background: rgba(135, 255, 113, 0.1);
  border-right-color: var(--neon);
}

/* 正文 */
.prose {
  min-width: 0;
  max-width: 72ch;
}

.prose > div {
  margin: 0 0 clamp(18px, 3vw, 30px);
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--neon);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.014));
  scroll-margin-top: 70px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.prose > div:hover {
  border-color: rgba(135, 255, 113, 0.45);
  box-shadow: 0 0 0 1px rgba(1, 205, 254, 0.2), 0 14px 34px -22px rgba(1, 205, 254, 0.8);
}

.prose h2,
.prose h3 {
  font-family: var(--head);
  font-weight: 400;
  line-height: 1.28;
  margin: 0 0 0.5em;
  color: #fff;
  text-shadow: 0 0 14px rgba(1, 205, 254, 0.45);
}

.prose > div > h2:first-child,
.prose > div > h3:first-child {
  margin-top: 0;
}

.prose h2 {
  font-size: clamp(1.45rem, 3.6vw, 1.85rem);
}

.prose h3 {
  font-size: 1.2rem;
  color: var(--neon);
}

.prose small {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: var(--cyan);
}

.prose p {
  margin: 0 0 1em;
}

.prose ul,
.prose ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

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

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

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

.prose a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--neon);
  text-shadow: 0 0 10px rgba(135, 255, 113, 0.7);
}

.prose blockquote {
  margin: 0 0 1em;
  padding: 12px 0 12px 16px;
  border-left: 3px solid var(--violet);
  color: #e6f7e2;
  background: rgba(185, 103, 255, 0.08);
}

.prose figure {
  margin: 0 0 1em;
}

.prose figure img {
  border-radius: var(--radius);
}

.prose aside {
  margin: 0 0 1em;
  padding: 14px 16px;
  border: 1px dashed rgba(1, 205, 254, 0.5);
  border-radius: var(--radius);
  background: rgba(1, 205, 254, 0.06);
  font-size: 1rem;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.4em 0;
}

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* 页脚 */
footer {
  border-top: 1px solid rgba(1, 205, 254, 0.3);
  padding: clamp(24px, 5vw, 44px) clamp(16px, 4vw, 40px) 34px;
  text-align: center;
  background: linear-gradient(180deg, rgba(11, 20, 13, 0.2), rgba(185, 103, 255, 0.16));
}

footer p {
  margin: 0;
  font-family: var(--head);
  font-size: clamp(2.3rem, 12vw, 5.4rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: rgba(135, 255, 113, 0.18);
  -webkit-text-stroke: 1px rgba(135, 255, 113, 0.65);
  text-shadow: 0 0 30px rgba(1, 205, 254, 0.35);
}

footer small {
  display: block;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--dim);
}

@media (max-width: 780px) {
  .board {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
    padding: 14px 0 0;
    border-left: 0;
    border-top: 2px solid var(--cyan);
  }

  .side p {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
  }

  .side a {
    padding: 10px 12px;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(135, 255, 113, 0.25);
  }

  .hero-wrap {
    padding: 40px 18px;
  }
}

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

  .topnav a,
  .rail a,
  .side a {
    padding-left: 9px;
    padding-right: 9px;
  }

  .punch {
    padding: 10px 12px;
  }
}

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

  h1::before,
  h1::after {
    animation: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .prose > div {
    transition: none;
  }
}

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