@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Noto+Serif+JP:wght@400;500;600;700&display=swap');

:root {
  --void: #0d0d0d;
  --ink: #e8e2f5;
  --ink-dim: #a99ec4;
  --violet: #8000ff;
  --magenta: #ff00ff;
  --plate: #16101f;
  --plate-2: #1d1428;
  --line: rgba(128, 0, 255, 0.3);
  --glow-v: 0 0 12px rgba(128, 0, 255, 0.6);
  --glow-m: 0 0 14px rgba(255, 0, 255, 0.5);
  --sans: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Microsoft YaHei', system-ui, sans-serif;
  --serif: 'Noto Serif JP', 'Yu Mincho', 'Songti SC', serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

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

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

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(128, 0, 255, 0.07) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 0%, rgba(128, 0, 255, 0.16), transparent 46%),
    radial-gradient(circle at 92% 8%, rgba(255, 0, 255, 0.12), transparent 42%);
}

[id] { scroll-margin-top: 156px; }

a { color: var(--ink); text-decoration: none; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.35em; }

/* ---------------- 顶栏 ---------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(13, 13, 13, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.hud { position: relative; }

.hud-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 0, 255, 0.09), transparent);
  animation: sweep 7s linear infinite;
}

@keyframes sweep {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.hud-bar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 22px;
}

.nav-a,
.nav-b {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.nav-b { justify-content: flex-end; }

.nav-cell { position: relative; }

.navlink {
  display: block;
  padding: 11px 13px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-dim);
  white-space: nowrap;
  border-radius: 4px;
  transition: color 0.18s ease, text-shadow 0.18s ease, background 0.18s ease;
}

.navlink:hover,
.navlink:focus-visible {
  color: #fff;
  background: rgba(128, 0, 255, 0.14);
  text-shadow: var(--glow-v);
}

.cta {
  display: block;
  margin-left: 6px;
  padding: 11px 20px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 700;
  color: #0d0d0d;
  white-space: nowrap;
  background: linear-gradient(120deg, var(--violet), var(--magenta));
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
  box-shadow: 0 0 18px rgba(255, 0, 255, 0.35);
}

.cta:hover { filter: brightness(1.15); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fff;
  text-shadow: 0 0 16px rgba(255, 0, 255, 0.7);
  white-space: nowrap;
}

.brand-mark { color: var(--magenta); text-shadow: var(--glow-m); }

.has-drop .drop {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.has-drop:hover .drop,
.has-drop:focus-within .drop {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.drop-box {
  display: grid;
  gap: 2px;
  min-width: 208px;
  padding: 10px;
  background: var(--plate);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line);
}

.drop-box a {
  padding: 9px 12px;
  font-size: 16px;
  color: var(--ink-dim);
  border-radius: 8px;
}

.drop-box a:hover { color: #fff; background: rgba(255, 0, 255, 0.12); }

.hud-edge {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--violet), var(--magenta), transparent);
  opacity: 0.7;
}

/* ---------------- 二级锚点条 ---------------- */
.anchor-rail {
  background: rgba(13, 13, 13, 0.96);
  border-bottom: 1px solid rgba(255, 0, 255, 0.16);
}

.anchor-rail nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 1280px;
  margin: 0 auto;
  padding: 6px 22px;
}

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

.anchor-rail a {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.3;
  color: #7d719a;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.anchor-rail a:hover { color: var(--ink); }

.anchor-rail a.on {
  color: var(--magenta);
  border-bottom-color: var(--magenta);
  text-shadow: var(--glow-m);
}

/* ---------------- 首屏 ---------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: 16vh 22px 0;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(128, 0, 255, 0.1), transparent 55%),
    var(--void);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(128, 0, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 0, 255, 0.14) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 22%, #000 12%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 22%, #000 12%, transparent 72%);
  opacity: 0.6;
}

.hero-inner {
  position: relative;
  z-index: 3;
  max-width: 900px;
}

.badge {
  display: inline-block;
  margin: 0 0 22px;
  padding: 6px 18px;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.3em;
  color: var(--magenta);
  background: rgba(255, 0, 255, 0.08);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 0, 255, 0.35), 0 0 22px rgba(255, 0, 255, 0.22);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.hero h1 {
  position: relative;
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: clamp(30px, 6.4vw, 64px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow: 0 0 26px rgba(128, 0, 255, 0.75), 0 0 60px rgba(255, 0, 255, 0.35);
  animation: glitch 5.5s steps(1) infinite;
}

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

.hero-sub {
  max-width: 640px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink-dim);
}

.hero-media {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56%;
  z-index: 1;
  will-change: transform;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--void) 2%, rgba(13, 13, 13, 0.5) 34%, rgba(13, 13, 13, 0.9) 100%);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.75) contrast(1.1) hue-rotate(-8deg);
  opacity: 0.8;
}

.corner {
  position: absolute;
  width: 34px;
  height: 34px;
  z-index: 4;
  border: 2px solid var(--magenta);
  opacity: 0.7;
  box-shadow: 0 0 14px rgba(255, 0, 255, 0.5);
}

.corner-tl { top: 20px; left: 20px; border-right: 0; border-bottom: 0; }
.corner-br { bottom: 20px; right: 20px; border-left: 0; border-top: 0; }

/* ---------------- 主体 ---------------- */
main {
  position: relative;
  z-index: 5;
  background: var(--void);
  border-top: 1px solid var(--line);
}

.wrap {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 44px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 62px 22px 90px;
}

.side {
  align-self: start;
  position: sticky;
  top: 156px;
  padding: 24px 22px 26px;
  background: var(--plate);
  border-radius: 28px;
}

.side-title {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--magenta);
}

.side-title > span { text-shadow: var(--glow-m); }

.side-title + .side-title,
.side-list + .side-title {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(128, 0, 255, 0.22);
}

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

.side-list li { transition: opacity 0.4s ease, transform 0.4s ease; }

.side-list a {
  display: block;
  padding: 8px 10px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-dim);
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
}

.side-list a:hover {
  color: #fff;
  background: rgba(128, 0, 255, 0.15);
  border-left-color: var(--violet);
}

.side-list.stagger li { opacity: 0; transform: translateX(-10px); }
.side-list.stagger li.in { opacity: 1; transform: none; }

.to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 18px;
  color: var(--ink);
  background: var(--plate-2);
  border-radius: 14px;
}

.to-top:hover { color: var(--magenta); box-shadow: var(--glow-m); }

/* ---------------- 正文 ---------------- */
.doc { max-width: 100%; }

.doc div + div {
  display: block;
  margin-top: 70px;
  padding-top: 56px;
  border-top: 1px dashed rgba(128, 0, 255, 0.32);
}

.doc h2,
.doc h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: #f6f0ff;
}

.doc h2 {
  position: relative;
  margin: 0 0 22px;
  padding-left: 20px;
  font-size: clamp(23px, 3.1vw, 31px);
}

.doc h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.22em;
  bottom: 0.22em;
  width: 5px;
  background: linear-gradient(180deg, var(--violet), var(--magenta));
  box-shadow: 0 0 12px rgba(255, 0, 255, 0.6);
}

.doc h2 > span { text-shadow: 0 0 18px rgba(255, 0, 255, 0.4); }

.doc h3 {
  margin: 34px 0 12px;
  font-size: 20px;
  color: #dcc9ff;
}

.doc h3 > span { text-shadow: var(--glow-v); }

.doc p { margin: 0 0 1.15em; }

.doc a {
  color: #ff8cff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 0, 255, 0.5);
  text-underline-offset: 4px;
}

.doc a:hover { color: #fff; }

.doc strong { color: #fff; font-weight: 700; }

.doc li { margin: 0.35em 0; }

.doc blockquote {
  margin: 26px 0;
  padding: 18px 24px;
  background: var(--plate);
  border-left: 3px solid var(--violet);
  border-radius: 0 28px 28px 0;
  color: var(--ink-dim);
}

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

.doc img {
  max-width: 100%;
  height: auto;
  margin: 26px 0;
  border-radius: 28px;
}

.doc hr {
  margin: 42px 0;
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--violet), transparent);
}

.doc table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 16px; }
.doc th, .doc td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(128, 0, 255, 0.24);
  vertical-align: top;
}
.doc th { color: var(--magenta); font-weight: 500; }

.doc pre {
  overflow-x: auto;
  padding: 16px 18px;
  background: #120b1b;
  border-radius: 16px;
  font-family: var(--mono);
  font-size: 16px;
}

.doc code { font-family: var(--mono); font-size: 0.95em; color: #ffb3ff; }

/* ---------------- 页脚 ---------------- */
.foot {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 26px;
  padding: 26px 24px;
  background: #0a0a0a;
  border-top: 1px solid var(--line);
  font-size: 16px;
}

.foot-brand a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  min-height: 42px;
  font-family: var(--serif);
  letter-spacing: 0.14em;
  color: #fff;
}

.foot nav { flex: 1 1 320px; }

.foot dl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  margin: 0;
}

.foot dt {
  font-family: var(--mono);
  font-size: 16px;
  color: #6f6489;
  padding-right: 6px;
}

.foot dd { margin: 0; }

.foot dd a {
  display: block;
  padding: 8px 10px;
  min-height: 42px;
  color: var(--ink-dim);
  font-size: 16px;
}

.foot dd a:hover { color: var(--magenta); text-shadow: var(--glow-m); }

.foot-copy { color: #6f6489; font-size: 16px; }
.foot-copy p { margin: 0; }

/* ---------------- 自适应 ---------------- */
@media (max-width: 980px) {
  .wrap { grid-template-columns: 1fr; gap: 34px; padding-top: 44px; }
  .side {
    position: static;
    order: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 26px;
    align-items: start;
  }
  .side-title + .side-title,
  .side-list + .side-title { margin-top: 0; padding-top: 0; border-top: 0; }
  .side-list { grid-column: 1 / -1; grid-row: 2 / span 2; margin-bottom: 20px; }
  .side-title:nth-of-type(2) { grid-column: 1 / -1; margin-top: 14px; padding-top: 20px; border-top: 1px solid rgba(128, 0, 255, 0.22); }
  .to-top { grid-column: 1 / -1; }
  .content { order: 1; }
}

@media (max-width: 820px) {
  [id] { scroll-margin-top: 76px; }
  .masthead { position: static; }
  .anchor-rail { position: sticky; top: 0; z-index: 30; }
  .hud-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px 12px 10px;
  }
  .brand { order: 1; flex: 1 1 100%; justify-content: center; }
  .nav-a, .nav-b { order: 2; flex: 1 1 100%; justify-content: center; }
  .navlink, .cta { padding: 10px 12px; font-size: 16px; }
  .cta { margin-left: 2px; }
  .has-drop .drop { display: none; }
  .hero { padding-top: 12vh; min-height: 88svh; }
  .hero-media { height: 46%; }
  .corner { width: 24px; height: 24px; }
  .foot { justify-content: center; text-align: center; }
  .foot dl { justify-content: center; }
}

@media (max-width: 520px) {
  body { font-size: 17px; line-height: 1.8; }
  .wrap { padding: 34px 16px 70px; }
  .hero { padding-left: 16px; padding-right: 16px; }
  .side { padding: 20px 16px 22px; border-radius: 22px; }
  .doc div + div { margin-top: 48px; padding-top: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .badge, .hud-scan, .hero h1 { animation: none; }
  .hero-media { transform: none !important; }
  .side-list li { transition: none; }
}

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