@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root {
  --ink: #0d0d0d;
  --violet: #8000ff;
  --magenta: #ff00ff;
  --txt: #e7e1f4;
  --dim: #a79ac2;
  --line: rgba(128, 0, 255, 0.34);
  --line-soft: rgba(128, 0, 255, 0.16);
  --glow: 0 0 22px rgba(255, 0, 255, 0.42), 0 0 58px rgba(128, 0, 255, 0.3);
}

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

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

body {
  margin: 0;
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(255, 0, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 255, 0.055) 1px, transparent 1px);
  background-size: 54px 54px;
  color: var(--txt);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Noto Sans SC', sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  overflow-x: clip;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(128, 0, 255, 0.1) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  opacity: 0.55;
  mix-blend-mode: screen;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
ul, menu { list-style: none; margin: 0; padding: 0; }

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

/* ---------- 顶部横条 ---------- */
.hud-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 4vw;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(128, 0, 255, 0.12), rgba(13, 13, 13, 0.9));
  position: relative;
  z-index: 45;
}

.brand {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.2em;
  color: #fff;
  text-shadow: var(--glow);
  padding: 0.55rem 0.4rem;
  white-space: nowrap;
  justify-self: center;
}

.menu { justify-self: start; position: relative; }
.menu-r { justify-self: end; }

.menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: var(--txt);
  cursor: pointer;
  background: rgba(13, 13, 13, 0.7);
  user-select: none;
}

.menu > summary::-webkit-details-marker { display: none; }

.menu > summary::after {
  content: "▾";
  margin-left: 0.45rem;
  color: var(--magenta);
  font-size: 0.8rem;
}

.menu[open] > summary {
  color: var(--magenta);
  border-color: var(--magenta);
  box-shadow: 0 0 18px rgba(255, 0, 255, 0.35) inset;
}

.menu > menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  min-width: 13rem;
  padding: 0.35rem;
  background: rgba(13, 13, 13, 0.98);
  border: 1px solid var(--magenta);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.72);
  z-index: 65;
}

.menu-r > menu { left: auto; right: 0; }

.menu > menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.8rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

.menu > menu li:last-child a { border-bottom: 0; }

.menu > menu a:hover {
  color: var(--magenta);
  background: rgba(255, 0, 255, 0.08);
}

/* ---------- 粘性锚点条 ---------- */
.rail {
  position: sticky;
  top: 0;
  z-index: 35;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(13, 13, 13, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

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

.rail-list {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  padding: 0 4vw;
  white-space: nowrap;
  width: max-content;
}

.rail-list a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 0.75rem;
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--dim);
  border-bottom: 2px solid transparent;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  color: var(--magenta);
  border-bottom-color: var(--magenta);
  text-shadow: 0 0 12px rgba(255, 0, 255, 0.6);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - 128px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 4.5rem 5vw 3.5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-ghost {
  position: absolute;
  right: 1vw;
  bottom: -0.12em;
  font-size: clamp(3.6rem, 15vw, 12rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 0, 255, 0.22);
  white-space: nowrap;
  max-width: 100%;
  pointer-events: none;
}

.hero-box {
  position: relative;
  z-index: 2;
  max-width: min(32ch, 100%);
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 6.6vw, 4.4rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: 0.015em;
  color: #fff;
  text-shadow: var(--glow);
  animation: glitch 8s infinite;
}

.lead {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--dim);
  overflow-wrap: anywhere;
}

@keyframes glitch {
  0%, 90%, 100% { transform: none; }
  92% { transform: skewX(-1.4deg) translateX(-3px); text-shadow: -3px 0 var(--violet), 3px 0 var(--magenta); }
  95% { transform: skewX(1.1deg) translateX(3px); text-shadow: 3px 0 var(--violet), -3px 0 var(--magenta); }
  98% { transform: none; }
}

/* ---------- 主体栅格 ---------- */
.stage {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 2.4rem;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 5vw 4rem;
}

.side {
  position: sticky;
  top: 4.2rem;
  border-top: 2px solid var(--magenta);
  padding-top: 0.9rem;
}

.side h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  color: var(--magenta);
  text-shadow: 0 0 14px rgba(255, 0, 255, 0.5);
}

.side .subtitle {
  margin: 0.3rem 0 0.9rem;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--dim);
}

.side-list li { margin-bottom: 0.2rem; }

.side-list a {
  display: block;
  min-height: 44px;
  padding: 0.55rem 0 0.55rem 0.8rem;
  border-left: 2px solid var(--line);
  font-size: 0.98rem;
  color: var(--txt);
}

.side-list a:hover {
  border-left-color: var(--magenta);
  color: var(--magenta);
  background: rgba(255, 0, 255, 0.07);
}

.wrap { min-width: 0; }

.content { min-width: 0; }

/* ---------- 正文 ---------- */
section { font-size: 1rem; }

section > div {
  padding: 1.7rem 0 2rem;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 5.6rem;
}

section > div:first-child {
  border-top: 0;
  padding-top: 0.2rem;
}

.js section > div {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease var(--d, 0ms), transform 0.55s ease var(--d, 0ms);
}

.js section > div.in {
  opacity: 1;
  transform: none;
}

section h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 3.2vw, 1.95rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: #fff;
}

section h2::before {
  content: "▚";
  margin-right: 0.5rem;
  color: var(--magenta);
  font-size: 0.85em;
}

section h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.15rem;
  line-height: 1.4;
  color: #fff;
  letter-spacing: 0.02em;
}

section p {
  margin: 0 0 1.05rem;
  line-height: 1.92;
  color: #ded7ee;
  max-width: 68ch;
}

section p.subtitle,
section .subtitle {
  margin-bottom: 1.1rem;
  color: var(--magenta);
  letter-spacing: 0.1em;
  font-size: 1rem;
}

section ul,
section ol {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
  max-width: 68ch;
}

section ul { list-style: square; }
section ol { list-style: decimal; }

section li { margin: 0.35rem 0; line-height: 1.85; }

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

section a {
  color: var(--magenta);
  border-bottom: 1px dotted var(--magenta);
}

section a:hover { text-shadow: 0 0 12px rgba(255, 0, 255, 0.7); }

section strong { color: #fff; }

section blockquote {
  margin: 0 0 1.1rem;
  padding: 0.6rem 1rem;
  border-left: 3px solid var(--violet);
  background: rgba(128, 0, 255, 0.08);
  color: #cfc6e2;
}

section blockquote p { margin-bottom: 0.4rem; }

section table {
  width: 100%;
  margin: 0 0 1.2rem;
  border-collapse: collapse;
  font-size: 0.98rem;
}

section th,
section td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

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

section code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.92em;
  background: rgba(255, 0, 255, 0.1);
  padding: 0.1em 0.35em;
}

section img {
  display: block;
  border: 1px solid var(--line);
  margin: 0 0 1.1rem;
}

section figure { margin: 0 0 1.2rem; }
section figcaption { font-size: 0.95rem; color: var(--dim); margin-top: 0.4rem; }

/* ---------- 页脚 ---------- */
footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(128, 0, 255, 0.08), rgba(13, 13, 13, 1));
  padding: 3rem 5vw 1.4rem;
}

.fgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  max-width: 1180px;
  margin: 0 auto;
}

footer address {
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 0, 255, 0.4);
  line-height: 1.9;
}

footer address .host {
  display: block;
  margin-top: 0.35rem;
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--dim);
  word-break: break-all;
}

.ftitle {
  margin: 0 0 0.7rem;
  font-size: 0.9rem;
  letter-spacing: 0.26em;
  color: var(--magenta);
}

.fnote {
  margin: 0 0 0.7rem;
  color: var(--dim);
  font-size: 0.98rem;
  line-height: 1.8;
}

.fnote a { border-bottom: 1px dotted var(--line); }
.fnote a:hover { color: var(--magenta); }

.flist a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.98rem;
  color: var(--txt);
  border-bottom: 1px solid var(--line-soft);
}

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

.sub { display: grid; gap: 0.5rem; }

.sub input {
  width: 100%;
  min-height: 44px;
  padding: 0 0.75rem;
  background: #0b0b0b;
  border: 1px solid var(--line);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
}

.sub input::placeholder { color: #7e7396; }

.sub input:focus { border-color: var(--magenta); }

.sub button {
  min-height: 44px;
  border: 0;
  background: linear-gradient(90deg, var(--violet), var(--magenta));
  color: #0d0d0d;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  cursor: pointer;
}

.sub button:hover { box-shadow: 0 0 22px rgba(255, 0, 255, 0.55); }

.copy {
  max-width: 1180px;
  margin: 2.4rem auto 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.94rem;
  letter-spacing: 0.14em;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
    padding: 2rem 5vw 3rem;
  }

  .side {
    position: static;
    border-top-width: 1px;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 1rem;
  }

  .side-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }

  .side-list li { margin: 0; }

  .side-list a {
    border-left: 0;
    border: 1px solid var(--line-soft);
    padding: 0.4rem 0.7rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
  }

  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem; }
}

@media (max-width: 520px) {
  html { font-size: 16.5px; }

  .hud-top { padding: 0.55rem 3vw; gap: 0.35rem; }

  .brand { font-size: 0.95rem; letter-spacing: 0.12em; }

  .menu > summary { padding: 0 0.6rem; font-size: 0.9rem; }

  .menu > menu { min-width: 11rem; }

  .rail-list { padding: 0 3vw; }

  .hero {
    min-height: calc(100svh - 122px);
    padding: 3rem 5vw 3rem;
  }

  .lead { font-size: 1rem; }

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

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

  h1 { animation: none; }

  .js section > div {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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