@import url('https://fonts.googleapis.com/css2?family=Karla:wght@300;400;500;600;700&family=Playfair+Display+SC:wght@400;700&display=swap');

:root {
  --ink: #0d0d0d;
  --ink-2: #141018;
  --ink-3: #100c15;
  --violet: #8000ff;
  --magenta: #ff00ff;
  --acid: #8bffc4;
  --text: #efe8ff;
  --muted: #a79dc0;
  --line: rgba(180, 120, 255, 0.24);
  --radius: 28px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --serif: "Playfair Display SC", Georgia, "Songti SC", "Source Han Serif SC", serif;
  --sans: Karla, "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

body {
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(900px 520px at 78% -8%, rgba(128, 0, 255, 0.28), transparent 68%),
    radial-gradient(680px 460px at 4% 10%, rgba(255, 0, 255, 0.14), transparent 62%),
    var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.72;
  min-height: 100vh;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 18px;
}

a { color: inherit; }

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

::selection {
  background: var(--magenta);
  color: #fff;
}

/* 顶栏 */
.hud-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 11px clamp(14px, 3vw, 34px);
  background: rgba(13, 13, 13, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 6px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0 16px rgba(128, 0, 255, 0.9), 0 0 4px var(--magenta);
}

.brand-mark {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(140deg, var(--violet), var(--magenta));
  box-shadow: 0 0 14px var(--magenta);
  transform: rotate(45deg);
}

.nav-wrap {
  position: relative;
  margin-left: auto;
}

.nav-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(128, 0, 255, 0.14);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
}

.nav-switch::-webkit-details-marker { display: none; }

.nav-bars {
  width: 16px;
  height: 2px;
  background: var(--magenta);
  box-shadow: 0 5px 0 var(--magenta), 0 -5px 0 var(--magenta);
  box-shadow: 0 5px 0 var(--magenta), 0 -5px 0 var(--magenta);
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2px;
}

.nav-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s, background 0.2s, text-shadow 0.2s;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  color: #fff;
  background: rgba(255, 0, 255, 0.16);
  text-shadow: 0 0 14px var(--magenta);
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--violet), var(--magenta));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0 22px rgba(255, 0, 255, 0.45);
}

.cta:hover { box-shadow: 0 0 30px rgba(255, 0, 255, 0.8); }

/* 首屏 */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding: clamp(44px, 9vh, 100px) 20px clamp(70px, 13vh, 130px);
  text-align: center;
  isolation: isolate;
}

.hero-glow {
  position: absolute;
  inset: -25% -12%;
  z-index: -1;
  filter: blur(24px);
  will-change: transform;
  background:
    radial-gradient(42% 42% at 50% 46%, rgba(128, 0, 255, 0.5), transparent 72%),
    radial-gradient(28% 28% at 72% 32%, rgba(255, 0, 255, 0.32), transparent 72%);
}

.hero-inner { position: relative; }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.34em;
  color: #e6d6ff;
}

.tick {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--acid);
  box-shadow: 0 0 12px var(--acid);
}

.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.2rem, 7.8vw, 5rem);
  line-height: 1.14;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.8), 0 0 34px rgba(128, 0, 255, 0.75), 0 0 90px rgba(128, 0, 255, 0.5);
}

.glitch { position: relative; }

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

.glitch::before {
  color: var(--magenta);
  clip-path: polygon(0 0, 100% 0, 100% 46%, 0 46%);
  animation: glitchA 5s steps(1) infinite;
  opacity: 0.85;
}

.glitch::after {
  color: var(--acid);
  clip-path: polygon(0 54%, 100% 54%, 100% 100%, 0 100%);
  animation: glitchB 6.5s steps(1) infinite;
  opacity: 0.6;
}

@keyframes glitchA {
  0%, 90%, 100% { transform: translate(-2px, 0); opacity: 0.85; }
  91% { transform: translate(-7px, -2px); opacity: 0.6; }
  94% { transform: translate(5px, 1px); }
}

@keyframes glitchB {
  0%, 88%, 100% { transform: translate(2px, 0); opacity: 0.6; }
  89% { transform: translate(6px, 2px); }
  93% { transform: translate(-4px, -1px); }
}

.hero-cut {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -46px;
  height: 92px;
  background: linear-gradient(90deg, var(--violet), var(--magenta), var(--violet));
  transform: skewY(-3.5deg);
  opacity: 0.9;
  box-shadow: 0 0 70px rgba(255, 0, 255, 0.45);
}

/* 主体 */
main { padding: 0 clamp(14px, 3vw, 34px) 70px; }

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: clamp(28px, 6vh, 64px);
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(20px, 4vw, 54px);
  align-items: start;
}

/* 侧栏 */
.rail {
  position: sticky;
  top: 88px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 16, 24, 0.74);
  box-shadow: inset 0 0 0 1px rgba(255, 0, 255, 0.07);
}

.rail small {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--acid);
}

.rail h2 {
  margin: 0.2em 0 0.7em;
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.1em;
  color: #fff;
}

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

.rail-list li {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.5s ease forwards;
  animation-delay: calc(var(--i, 0) * 55ms);
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 10px;
  border-left: 2px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  color: #fff;
  border-left-color: var(--magenta);
  background: rgba(128, 0, 255, 0.18);
  text-shadow: 0 0 12px var(--magenta);
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* 正文 */
.prose {
  min-width: 0;
  max-width: 760px;
}

.prose > section {
  position: relative;
  margin: 0 0 26px;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 16, 24, 0.55);
  scroll-margin-top: 96px;
}

.prose > section::after {
  content: "";
  position: absolute;
  left: clamp(20px, 3vw, 34px);
  right: clamp(20px, 3vw, 34px);
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--magenta), var(--violet), transparent);
  box-shadow: 0 0 14px var(--magenta);
}

.prose small {
  display: block;
  margin-bottom: 0.42em;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--acid);
}

.prose h2 {
  margin: 0 0 0.65em;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3.4vw, 2rem);
  line-height: 1.28;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 0 20px rgba(128, 0, 255, 0.6);
}

.prose h2::after {
  content: "";
  display: block;
  width: 62px;
  height: 3px;
  margin-top: 13px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--violet), var(--magenta));
  box-shadow: 0 0 12px var(--magenta);
}

.prose h3 {
  margin: 1.5em 0 0.5em;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: #f4ecff;
}

.prose p {
  margin: 0 0 1.05em;
  color: #ded6f2;
}

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

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

.prose a:hover {
  color: #fff;
  text-shadow: 0 0 12px var(--magenta);
}

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

.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--magenta); }
.prose strong { color: #fff; }

.prose blockquote {
  margin: 1.3em 0;
  padding: 15px 20px;
  border-left: 3px solid var(--magenta);
  border-radius: 0 18px 18px 0;
  background: rgba(128, 0, 255, 0.14);
}

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

.prose code,
.prose pre { font-family: var(--mono); }

.prose pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--ink-3);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

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

/* 页脚 */
.site-foot {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(128, 0, 255, 0.14), transparent 62%);
  padding: clamp(30px, 6vw, 56px) clamp(14px, 3vw, 34px) 26px;
}

.foot-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: clamp(18px, 3vw, 36px);
}

.foot-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 0, 255, 0.65);
}

.foot-line {
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--violet), var(--magenta));
  box-shadow: 0 0 12px var(--magenta);
}

.foot-col { margin: 0; }

.foot-col dt {
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--acid);
}

.foot-col dd { margin: 0; }

.foot-col a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s, text-shadow 0.2s;
}

.foot-col a:hover,
.foot-col a:focus-visible {
  color: #fff;
  text-shadow: 0 0 12px var(--magenta);
}

.sub {
  position: relative;
  max-width: 1180px;
  margin: clamp(26px, 5vw, 44px) auto 0;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 16, 24, 0.72);
}

.sub::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--magenta), transparent);
  box-shadow: 0 0 12px var(--magenta);
}

.sub-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--acid);
}

.sub-input {
  flex: 1 1 190px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ink-3);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.sub-btn {
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(120deg, var(--violet), var(--magenta));
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.45);
}

.copy {
  max-width: 1180px;
  margin: 22px auto 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* 回到顶部 */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 70;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 13, 13, 0.88);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.to-top.is-on {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 980px) {
  .nav-switch { display: inline-flex; }

  .nav-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 5;
    width: min(80vw, 320px);
    flex-direction: column;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--ink-3);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.7);
  }

  .nav-menu a { justify-content: flex-start; }
}

@media (min-width: 981px) {
  .nav-switch { display: none; }
  .nav-menu { flex-direction: row; }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .prose table { display: block; overflow-x: auto; }
  .hero { min-height: 62vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rail-list li { opacity: 1; transform: none; animation: none; }
  .glitch::before,
  .glitch::after { animation: none; }
  .to-top,
  .nav-menu a,
  .rail-list a { transition: none; }
}

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