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

:root {
  --ink: #0d0d0d;
  --ink-2: #140b1d;
  --violet: #8000ff;
  --pink: #ff00ff;
  --text: #e9defa;
  --dim: #af9fc6;
  --line: rgba(128, 0, 255, 0.34);
  --line-2: rgba(255, 0, 255, 0.34);
  --r: 10px;
  --glow: 0 0 10px rgba(255, 0, 255, 0.55);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  padding-left: 252px;
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(128, 0, 255, 0.17), transparent 62%),
    radial-gradient(70% 55% at 0% 100%, rgba(255, 0, 255, 0.1), transparent 66%),
    var(--ink);
  background-attachment: fixed;
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", "PingFang SC", "Microsoft YaHei", monospace;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

a:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

/* ---------- 左侧控制台 ---------- */

.pylon {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 252px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px 26px;
  overflow-y: auto;
  border-right: 1px solid var(--line-2);
  background: linear-gradient(180deg, #160024 0%, #0d0d0d 72%);
}

.onair {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--pink);
  border-radius: 999px;
  color: var(--pink);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-align: center;
  text-shadow: var(--glow);
}

.onair::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: var(--glow);
  vertical-align: middle;
}

.sigil {
  display: block;
  padding: 4px 2px 8px;
  color: #ffffff;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-shadow: 0 0 16px rgba(128, 0, 255, 0.9), 0 0 4px rgba(255, 0, 255, 0.6);
  border-bottom: 1px dashed var(--line);
}

.channels {
  margin-top: 4px;
}

.channels p {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.channels a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #dccbff;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.channels a:hover,
.channels a:focus-visible {
  color: #ffffff;
  border-color: var(--pink);
  background: rgba(255, 0, 255, 0.09);
  box-shadow: 0 0 14px rgba(255, 0, 255, 0.35);
  text-shadow: var(--glow);
}

/* ---------- 主舞台 ---------- */

.stage {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  align-items: start;
}

.rail {
  position: sticky;
  top: 24px;
  padding: 26px 16px 30px 24px;
  border-right: 1px solid rgba(255, 0, 255, 0.14);
}

.rail small {
  display: block;
  color: var(--pink);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-shadow: var(--glow);
}

.rail h2 {
  margin: 0.2rem 0 0.9rem;
  color: #ffffff;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-left: 2px solid var(--line);
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--dim);
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  color: #ffffff;
  border-left-color: var(--pink);
  background: rgba(128, 0, 255, 0.14);
}

main {
  min-width: 0;
  padding-bottom: 40px;
}

/* ---------- 开场 ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(18px, 3vw, 38px);
  align-items: center;
  min-height: 45vh;
  padding: clamp(22px, 4vw, 46px) clamp(18px, 4vw, 48px);
}

h1 {
  margin: 0 0 0.7rem;
  color: #ffffff;
  font-size: clamp(1.85rem, 4.4vw, 3rem);
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-shadow: 0 0 22px rgba(128, 0, 255, 0.9), 0 0 8px rgba(255, 0, 255, 0.5);
  animation: glitch 8s ease-in-out infinite;
}

@keyframes glitch {
  0%, 91%, 100% { transform: none; }
  93% { transform: translate(-3px, 0) skewX(-3deg); }
  95% { transform: translate(3px, -1px) skewX(2deg); }
  97% { transform: translate(-1px, 1px); }
}

.lede {
  max-width: 46ch;
  margin: 0;
  color: var(--dim);
  font-size: 1rem;
}

.hud {
  position: relative;
  max-width: 100%;
  margin: 0;
  padding: 18px 16px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(128, 0, 255, 0.18), transparent 62%),
    #100a18;
}

.badge {
  position: absolute;
  top: -13px;
  right: 12px;
  padding: 2px 10px;
  border: 1px solid var(--pink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--pink);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-shadow: var(--glow);
}

.hero-img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 12px;
  border-radius: 6px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 96px;
}

.bars span {
  flex: 1;
  min-height: 6px;
  height: calc(var(--h) * 1%);
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--pink), var(--violet) 68%, rgba(128, 0, 255, 0.1));
  animation: pump 1.5s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -0.09s);
}

@keyframes pump {
  from { height: 16%; }
  to { height: calc(var(--h) * 1%); }
}

/* ---------- 正文章节 ---------- */

main > section[id] {
  padding: clamp(26px, 4vw, 52px) clamp(18px, 4vw, 48px);
  border-top: 1px solid rgba(128, 0, 255, 0.18);
  scroll-margin-top: 130px;
}

main h2 {
  margin: 0 0 0.7rem;
  color: #ffffff;
  font-size: clamp(1.32rem, 2.7vw, 1.8rem);
  line-height: 1.35;
  text-shadow: 0 0 14px rgba(255, 0, 255, 0.35);
}

main h3 {
  margin: 1.5rem 0 0.5rem;
  color: #f4eaff;
  font-size: 1.15rem;
  line-height: 1.45;
}

main p {
  max-width: 68ch;
  margin: 0 0 1rem;
}

main small {
  display: block;
  margin-bottom: 0.22rem;
  color: var(--pink);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-shadow: var(--glow);
}

main small + h2,
main small + h3 {
  margin-top: 0;
}

main ul,
main ol {
  max-width: 68ch;
  padding-left: 1.35rem;
}

main li {
  margin: 0.35rem 0;
}

main a {
  color: var(--pink);
  text-underline-offset: 3px;
}

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

main figure {
  margin: 1.2rem 0;
}

main blockquote {
  margin: 1.3rem 0;
  padding: 10px 16px;
  border-left: 2px solid var(--pink);
  background: rgba(255, 0, 255, 0.06);
  color: #f2e7ff;
}

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

main table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

main th,
main td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

main th {
  background: rgba(128, 0, 255, 0.14);
  color: #ffffff;
}

code,
pre {
  font-family: inherit;
  background: rgba(128, 0, 255, 0.14);
  border-radius: 4px;
}

code {
  padding: 1px 5px;
}

pre {
  padding: 12px;
  overflow-x: auto;
}

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

.sign {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 22px clamp(18px, 4vw, 48px) 30px;
  border-top: 1px solid var(--line-2);
  color: var(--dim);
  font-size: 0.9rem;
}

.sign p {
  margin: 0;
}

.sign small {
  color: var(--violet);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
}

/* ---------- 动效 ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal-on main > section:not(.hero) {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .reveal-on main > section.in {
    opacity: 1;
    transform: none;
  }

  .reveal-on .rail-list li {
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }

  .reveal-on .rail-list li.in {
    opacity: 1;
    transform: none;
  }

  .reveal-on .rail-list li:nth-child(1) { transition-delay: 0.02s; }
  .reveal-on .rail-list li:nth-child(2) { transition-delay: 0.06s; }
  .reveal-on .rail-list li:nth-child(3) { transition-delay: 0.1s; }
  .reveal-on .rail-list li:nth-child(4) { transition-delay: 0.14s; }
  .reveal-on .rail-list li:nth-child(5) { transition-delay: 0.18s; }
  .reveal-on .rail-list li:nth-child(6) { transition-delay: 0.22s; }
  .reveal-on .rail-list li:nth-child(7) { transition-delay: 0.26s; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- 窄屏 ---------- */

@media (max-width: 920px) {
  body {
    padding-left: 0;
  }

  .pylon {
    position: sticky;
    top: 0;
    bottom: auto;
    width: auto;
    z-index: 55;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 9px 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line-2);
    background: #0d0d0d;
  }

  .onair {
    order: 0;
    font-size: 0.74rem;
    letter-spacing: 0.14em;
  }

  .sigil {
    order: 1;
    padding: 2px 0;
    border-bottom: 0;
    font-size: 1.05rem;
  }

  .channels {
    order: 3;
    width: 100%;
    margin-top: 0;
  }

  .channels p {
    flex-direction: row;
    gap: 8px;
    padding-bottom: 3px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .channels a {
    min-height: 42px;
    padding: 8px 14px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .stage {
    display: flex;
    flex-direction: column;
  }

  main {
    order: 1;
    width: 100%;
  }

  .rail {
    order: 2;
    position: static;
    width: 100%;
    padding: 20px 16px 24px;
    border-right: 0;
    border-top: 1px solid rgba(255, 0, 255, 0.14);
  }

  .rail-list {
    grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  }

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

  .hud {
    max-width: 430px;
  }

  main > section[id] {
    scroll-margin-top: 124px;
  }
}

@media (max-width: 420px) {
  .bars {
    height: 74px;
  }

  main p,
  .lede {
    max-width: none;
  }
}

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