@import url('https://fonts.googleapis.com/css2?family=Cormorant+Infant:wght@300;400;500;600;700&family=Great+Vibes&display=swap');

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

:root {
  --wine: #ff0000;
  --pink: #ff006e;
  --ink: #1a1a2e;
  --bg: #07070d;
  --panel: #12121f;
  --panel-2: #0c0c17;
  --text: #f3eef8;
  --muted: #b5adc8;
  --line: rgba(255, 0, 110, .42);
  --line-soft: rgba(255, 0, 110, .22);
  --glow: 0 0 12px rgba(255, 0, 110, .65);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "PingFang SC", monospace;
  --serif: "Cormorant Infant", Georgia, "Songti SC", "SimSun", "Times New Roman", serif;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.75;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, .05) 0,
    rgba(255, 255, 255, .05) 1px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 0, 0) 3px
  );
  opacity: .55;
}

a { color: var(--pink); }
a:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; border-radius: 6px; }

/* ---------- 顶部：品牌居中，菜单分列两侧 ---------- */
.mast {
  position: relative;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(rgba(255, 0, 110, .16) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(180deg, rgba(26, 26, 46, .95), rgba(7, 7, 13, .85));
}

.mast-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px clamp(12px, 3vw, 28px);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mast-side {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
}

.mast-side-r { justify-content: flex-end; }

.mast-side a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 9px;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: .01em;
  color: var(--muted);
  text-decoration: none;
  border-radius: 10px;
  transition: color .18s ease, text-shadow .18s ease, background .18s ease;
}

.mast-side a:hover { color: #fff; text-shadow: var(--glow); background: rgba(255, 0, 110, .1); }

.brand {
  flex: 0 0 auto;
  padding: 6px 18px;
  font-family: "Great Vibes", "Cormorant Infant", Georgia, serif;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  text-shadow: 0 0 16px rgba(255, 0, 110, .75), 0 0 34px rgba(255, 0, 0, .35);
}

.mast-cta {
  margin-left: 6px;
  padding: 0 14px !important;
  border: 1px solid var(--pink);
  border-radius: 999px;
  color: var(--pink) !important;
  letter-spacing: .12em;
}

.mast-cta:hover { background: rgba(255, 0, 110, .18) !important; color: #fff !important; }

/* ---------- 主体：左侧锚点栏 + 右列正文 ---------- */
.stage {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(14px, 2vw, 26px) clamp(14px, 4vw, 32px) 0;
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr);
  gap: clamp(16px, 2.5vw, 34px);
  align-items: start;
}

.rail {
  position: sticky;
  top: 16px;
  z-index: 6;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #141424, #0a0a14);
}

.rail-h {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .3em;
  color: var(--pink);
  text-shadow: var(--glow);
}

.rail-h2 { margin-top: 14px; }

.rail-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.3;
  color: var(--text);
  text-decoration: none;
  border-left: 2px solid var(--line-soft);
  border-radius: 0 10px 10px 0;
  transition: color .18s ease, background .18s ease, border-color .18s ease, text-shadow .18s ease;
}

.rail-nav a:hover,
.rail-nav a.is-on {
  color: #fff;
  border-left-color: var(--wine);
  background: rgba(255, 0, 110, .14);
  text-shadow: 0 0 10px rgba(255, 0, 110, .8);
}

.rail-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--pink);
  text-decoration: none;
  border: 1px dashed rgba(255, 0, 110, .55);
  border-radius: 12px;
  transition: background .18s ease, color .18s ease;
}

.rail-cta:hover { background: rgba(255, 0, 110, .16); color: #fff; }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: clamp(38px, 8vh, 86px) 0 clamp(26px, 5vh, 52px);
  border-bottom: 1px solid var(--line-soft);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  opacity: .45;
  background-image: radial-gradient(rgba(255, 0, 110, .3) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .15));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .15));
}

.hero > * { position: relative; }

.kicker {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .4em;
  color: var(--pink);
  text-shadow: var(--glow);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.3rem, 7vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: .01em;
  color: #fff;
  text-shadow: 0 0 16px rgba(255, 0, 110, .55), 0 0 46px rgba(255, 0, 0, .35);
  animation: glitch 7s ease-in-out infinite;
}

@keyframes glitch {
  0%, 88%, 100% {
    transform: none;
    text-shadow: 0 0 16px rgba(255, 0, 110, .55), 0 0 46px rgba(255, 0, 0, .35);
  }
  90% {
    transform: skewX(-1.8deg) translateX(-2px);
    text-shadow: -3px 0 rgba(255, 0, 110, .85), 3px 0 rgba(0, 128, 255, .75);
  }
  93% {
    transform: skewX(2deg) translateX(2px);
    text-shadow: 3px 0 rgba(255, 0, 110, .85), -3px 0 rgba(0, 200, 255, .75);
  }
  96% { transform: none; }
}

.hero-lead {
  max-width: 46ch;
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
}

.hero-fig {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 150px;
  max-height: 46vh;
  margin: clamp(22px, 4vh, 42px) 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 0, 110, .12) 0 2px, transparent 2px 12px),
    linear-gradient(120deg, #151527, #0b0b16);
}

.hero-fig img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- 正文 ---------- */
.doc { padding-top: clamp(20px, 3vw, 34px); }

main article[id] {
  position: relative;
  overflow-x: auto;
  margin: 0 0 clamp(18px, 2.6vw, 28px);
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #131324, #0d0d18);
  scroll-margin-top: 92px;
  transition: border-color .25s ease, box-shadow .25s ease;
}

main article[id]:hover {
  border-color: rgba(255, 0, 110, .78);
  box-shadow: 0 0 0 1px rgba(255, 0, 110, .18), 0 0 28px rgba(255, 0, 110, .16);
}

.prose {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text);
  overflow-wrap: break-word;
}

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

.prose h2,
.prose h3 {
  margin: 0 0 .55em;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.22;
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 0, 110, .45);
}

.prose h2 { font-size: clamp(1.5rem, 3.4vw, 2.05rem); }
.prose h3 { font-size: clamp(1.2rem, 2.4vw, 1.45rem); }
.prose h2 span, .prose h3 span { display: inline; }

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

.prose a { color: var(--pink); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: #fff; }

.prose blockquote {
  margin: 1em 0;
  padding: .3em 0 .3em 1em;
  border-left: 2px solid var(--pink);
  color: var(--muted);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1em 0;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { border: 1px solid var(--line-soft); padding: 8px 10px; text-align: left; }
.prose code {
  font-family: var(--mono);
  font-size: .92em;
  padding: .1em .35em;
  border-radius: 6px;
  background: rgba(255, 0, 110, .16);
}

.to-top-wrap { display: flex; justify-content: center; margin: 4px 0 8px; }

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.to-top:hover { color: #fff; border-color: var(--pink); box-shadow: 0 0 22px rgba(255, 0, 110, .35); }

/* ---------- 页脚 ---------- */
.foot {
  max-width: 1180px;
  margin: clamp(26px, 5vw, 54px) auto 0;
  padding: 20px clamp(14px, 4vw, 32px) 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 18px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.foot address {
  font-style: normal;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: .14em;
  color: var(--muted);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--muted);
  text-decoration: none;
  transition: color .18s ease, text-shadow .18s ease;
}

.foot-links a:hover { color: var(--pink); text-shadow: var(--glow); }

/* ---------- 窄屏 ---------- */
@media (max-width: 880px) {
  .mast-in { flex-wrap: wrap; justify-content: center; }
  .brand { order: -1; flex: 1 0 100%; text-align: center; }
  .mast-side { flex: 1 1 100%; justify-content: center; flex-wrap: wrap; }
  .mast-side-r { justify-content: center; }

  .stage { display: block; }
  .rail {
    top: 0;
    margin-bottom: 14px;
    padding: 8px 10px;
    border-radius: 0 0 18px 18px;
    background: linear-gradient(180deg, rgba(20, 20, 36, .98), rgba(10, 10, 20, .96));
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
  .rail-h, .rail-h2, .rail-cta { display: none; }
  .rail-nav ul { flex-direction: row; gap: 6px; overflow-x: auto; }
  .rail-nav a {
    white-space: nowrap;
    border-left: 0;
    border-bottom: 2px solid var(--line-soft);
    border-radius: 10px 10px 0 0;
  }
  .rail-nav a:hover, .rail-nav a.is-on { border-left: 0; border-bottom-color: var(--wine); }
  main article[id] { scroll-margin-top: 78px; }
}

@media (max-width: 420px) {
  .mast-side a { padding: 0 7px; font-size: 16px; }
  .hero { min-height: 88vh; }
}

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

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