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

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

:root {
  --ink: #0d0d0d;
  --ink-2: #141018;
  --ink-3: #0a0a0c;
  --violet: #8000ff;
  --magenta: #ff00ff;
  --paper: #ece7f5;
  --body: #cfc7dd;
  --dim: #a89ebd;
  --line: rgba(128, 0, 255, 0.3);
  --line-2: rgba(255, 0, 255, 0.18);
  --r: 10px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: Raleway, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --serif: Lora, Georgia, "Songti SC", "SimSun", serif;
}

html {
  scroll-behavior: smooth;
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--paper);
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(128, 0, 255, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px;
  background-attachment: fixed;
  overflow-x: hidden;
}

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

body.locked { overflow: hidden; }

img { max-width: 100%; }

.skip {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 95;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--magenta);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip:focus { top: 12px; }

/* ── 顶部两行 ── */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 12, 0.88);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
}

.brandrow {
  display: flex;
  align-items: center;
  padding: 8px clamp(16px, 4vw, 40px) 6px;
  border-bottom: 1px dashed var(--line-2);
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  min-height: 44px;
  text-decoration: none;
  color: #f7f0ff;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-shadow: 0 0 16px rgba(255, 0, 255, 0.55);
}
.brandmark:hover { color: #fff; text-shadow: 2px 0 rgba(255, 0, 255, 0.7), -2px 0 rgba(128, 0, 255, 0.7); }
.brand-logo { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line-2); }

.navrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px clamp(16px, 4vw, 40px) 10px;
}

.navtoggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--magenta);
  border-radius: 8px;
  background: rgba(255, 0, 255, 0.07);
  color: #ffd9ff;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: box-shadow 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.navtoggle:hover,
.navtoggle:focus-visible { box-shadow: 0 0 20px rgba(255, 0, 255, 0.6); color: #fff; background: rgba(255, 0, 255, 0.16); }

.bars { position: relative; width: 20px; height: 14px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.bars::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; border-top: 2px solid currentColor; }

.navrow-meta {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.16em;
  color: #9a7ec4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 全屏遮罩菜单 ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(20px, 5vw, 56px);
  overflow-y: auto;
  background:
    radial-gradient(circle at 15% 12%, rgba(128, 0, 255, 0.32), transparent 58%),
    radial-gradient(circle at 88% 82%, rgba(255, 0, 255, 0.2), transparent 55%),
    var(--ink-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.26s ease, transform 0.26s ease, visibility 0.26s;
}
.overlay.on { opacity: 1; visibility: visible; transform: none; }

.overlay-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.overlay-mark { font-family: var(--mono); font-size: 16px; letter-spacing: 0.24em; color: #b98cff; }

.overlay-close {
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: #e9dcff;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.2em;
  cursor: pointer;
}
.overlay-close:hover { border-color: var(--magenta); color: #fff; box-shadow: 0 0 18px rgba(255, 0, 255, 0.5); }

.overlay-nav ul { list-style: none; margin: 0; padding: 0; }
.overlay-nav li + li { border-top: 1px dashed var(--line-2); }
.overlay-nav a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-height: 56px;
  padding: 12px 4px;
  text-decoration: none;
  color: #e8e0f5;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 4.6vw, 2.1rem);
  line-height: 1.3;
  transition: color 0.2s ease, padding-left 0.2s ease, text-shadow 0.2s ease;
}
.overlay-nav a:hover { color: #fff; padding-left: 12px; text-shadow: 0 0 18px rgba(255, 0, 255, 0.8); }
.overlay-nav .ix { font-family: var(--mono); font-size: 16px; letter-spacing: 0.1em; color: var(--magenta); }

.overlay-foot { margin: auto 0 0; font-family: var(--mono); font-size: 16px; letter-spacing: 0.2em; color: #7d6a99; }

/* ── 首屏 ── */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 100svh;
  padding: 120px clamp(18px, 5vw, 72px) clamp(48px, 11vh, 110px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-frame {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(rgba(255, 0, 255, 0.24) 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: #08070b;
}
.hero-img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.22) contrast(1.08) saturate(1.15); }
.hero-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13, 13, 13, 0.45), rgba(13, 13, 13, 0.92) 82%),
    linear-gradient(90deg, rgba(13, 13, 13, 0.2), rgba(13, 13, 13, 0.86));
}

.hero-copy {
  position: relative;
  z-index: 2;
  margin-left: auto;
  max-width: 46rem;
  text-align: right;
}

.hero-eyebrow {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.32em;
  color: #ff7df0;
  text-shadow: 0 0 16px rgba(255, 0, 255, 0.6);
}

.hero-title {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(2rem, 5.6vw, 4.3rem);
  line-height: 1.14;
  letter-spacing: 0.01em;
  color: #fdf9ff;
  overflow-wrap: break-word;
  text-shadow: 2px 0 rgba(255, 0, 255, 0.55), -2px 0 rgba(128, 0, 255, 0.65), 0 0 34px rgba(128, 0, 255, 0.55);
  animation: glitch 8s steps(1) infinite;
}

.hero-desc {
  margin: 0 0 0 auto;
  max-width: 34rem;
  font-size: 17px;
  line-height: 1.7;
  color: #cbc0dd;
}

@keyframes glitch {
  0%, 100% { transform: none; }
  32% { transform: translate(-2px, 1px) skewX(-0.6deg); }
  34% { transform: translate(2px, -1px) skewX(0.6deg); }
  62% { transform: translate(-1px, -1px); }
  64% { transform: translate(1px, 1px); }
}

/* ── 主体 ── */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21rem;
  gap: clamp(22px, 3vw, 48px);
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(36px, 6vw, 80px) clamp(16px, 4vw, 40px);
}

.doc { min-width: 0; }

.prose {
  padding: clamp(18px, 3.4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, #16121d, #0f0c14);
  box-shadow: 0 24px 54px -30px rgba(128, 0, 255, 0.85), inset 0 0 70px -46px rgba(255, 0, 255, 0.7);
}

.prose > div { scroll-margin-top: 130px; }
.prose > div + div {
  margin-top: 2.4em;
  padding-top: 2em;
  border-top: 1px dashed var(--line-2);
}

.prose h2 {
  margin: 0 0 0.8em;
  padding-left: 14px;
  border-left: 3px solid var(--magenta);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3.4vw, 1.95rem);
  line-height: 1.32;
  color: #fdf7ff;
  text-shadow: 0 0 18px rgba(255, 0, 255, 0.35);
  overflow-wrap: break-word;
}
.prose h3 {
  margin: 1.6em 0 0.6em;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: #f0e6ff;
}
.prose p { margin: 0 0 1.1em; color: var(--body); }
.prose a { color: #ff8cf5; text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: #fff; text-shadow: 0 0 12px rgba(255, 0, 255, 0.7); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.35em; color: var(--body); }
.prose li { margin: 0.35em 0; }
.prose strong { color: #fff; }
.prose blockquote {
  margin: 1.4em 0;
  padding: 12px 18px;
  border-left: 3px solid var(--violet);
  border-radius: 0 8px 8px 0;
  background: rgba(128, 0, 255, 0.1);
  color: #ddd3f2;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.95em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(128, 0, 255, 0.18);
  color: #ffd9ff;
}
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 1.3em; }
.prose th, .prose td { padding: 9px 12px; border: 1px solid var(--line); text-align: left; }
.prose th { background: rgba(128, 0, 255, 0.14); color: #fff; }
.prose img { height: auto; border-radius: 8px; border: 1px solid var(--line-2); }

/* ── 右侧栏 ── */
.rail {
  position: sticky;
  top: 122px;
  align-self: start;
  padding-left: clamp(14px, 2vw, 24px);
  border-left: 1px solid var(--line);
}
.rail-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  color: #fff4ff;
  text-shadow: 0 0 14px rgba(255, 0, 255, 0.5);
}
.subtitle {
  margin: 4px 0 18px;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.12em;
  color: #b58cff;
}
.rail-nav ul { list-style: none; margin: 0; padding: 0; }
.rail-nav a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line-2);
  text-decoration: none;
  color: #d8cdea;
  font-size: 16px;
  transition: color 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
}
.rail-nav .ix { font-family: var(--mono); font-size: 16px; color: #7a57b8; }
.rail-nav a:hover { color: #fff; transform: translateX(4px); text-shadow: 0 0 12px rgba(255, 0, 255, 0.7); }

/* ── 页脚 ── */
.sitefoot {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  background: var(--ink-3);
}

.cta {
  padding: clamp(44px, 8vw, 96px) clamp(16px, 4vw, 40px);
  text-align: center;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 0%, rgba(128, 0, 255, 0.3), transparent 68%),
    repeating-linear-gradient(90deg, rgba(255, 0, 255, 0.06) 0 1px, transparent 1px 32px);
}
.cta-line {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 7vw, 3.6rem);
  line-height: 1.2;
  color: #fdf8ff;
  overflow-wrap: break-word;
  text-shadow: 2px 0 rgba(255, 0, 255, 0.5), -2px 0 rgba(128, 0, 255, 0.6), 0 0 30px rgba(128, 0, 255, 0.5);
}
.cta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 32px;
  border: 1px solid var(--magenta);
  border-radius: 8px;
  text-decoration: none;
  color: #ffdcff;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.24em;
  transition: box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.cta-link:hover { background: rgba(255, 0, 255, 0.16); color: #fff; box-shadow: 0 0 24px rgba(255, 0, 255, 0.6); }

.foot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 60px) clamp(16px, 4vw, 40px);
}
.foot-col { min-width: 0; }
.foot-col h3 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--magenta);
  text-shadow: 0 0 14px rgba(255, 0, 255, 0.55);
}
.foot-links { list-style: none; margin: 0; padding: 0; }
.foot-links a {
  display: block;
  min-height: 40px;
  padding: 9px 0;
  text-decoration: none;
  color: #cec3e2;
  font-size: 16px;
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.foot-links a:hover { color: #fff; padding-left: 6px; text-shadow: 0 0 12px rgba(255, 0, 255, 0.7); }
.foot-text { margin: 0; font-size: 16px; color: #b9aecb; overflow-wrap: break-word; }
.foot-vcard {
  font-style: normal;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.8;
  color: #b9aecb;
  overflow-wrap: break-word;
}

.colophon {
  padding: 22px clamp(16px, 4vw, 40px) 34px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.colophon p { margin: 0; font-size: 16px; color: #8f83a6; }
.colophon-meta { margin-top: 4px !important; font-family: var(--mono); letter-spacing: 0.18em; color: #6f6483; }

/* ── 动效 ── */
.js .prose > div[id] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.js .prose > div.is-in { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: static;
    padding: 22px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { min-height: 92svh; padding-top: 108px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .navrow-meta { display: none; }
  .prose { padding: 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-title { animation: none; }
  .js .prose > div[id] { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

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