:root {
  --bg: #000000;
  --surface: #0a0c11;
  --surface-2: #121212;
  --line: #1c2230;
  --ink: #e9edf5;
  --body: #c6cfdc;
  --dim: #98a4b6;
  --neon: #5ea1ff;
  --glow: rgba(94, 161, 255, 0.42);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --r: 18px;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(94, 161, 255, 0.2) 1px, transparent 1.4px);
  background-size: 28px 28px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(130% 72% at 50% 6%, #000 0%, transparent 72%);
  mask-image: radial-gradient(130% 72% at 50% 6%, #000 0%, transparent 72%);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--neon); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3, h4 {
  font-family: var(--mono);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

/* ── 角落品牌 ───────────────────────────── */
.corner { position: fixed; top: 14px; left: 16px; z-index: 40; }

.corner-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 11, 15, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.corner-link:hover {
  border-color: var(--neon);
  box-shadow: 0 0 18px -4px var(--glow);
  text-decoration: none;
}

.corner-link img { width: 26px; height: 26px; border-radius: 6px; }

/* ── 主骨架 ─────────────────────────────── */
main {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
}

@media (min-width: 900px) {
  main {
    grid-template-columns: minmax(0, 1fr) 232px;
    gap: 44px;
    padding: 0 26px 24px;
  }
}

.prose { min-width: 0; }

/* ── 首屏 ──────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 45vh;
  padding: 78px 0 34px;
}

.hero h1 {
  margin: 0;
  max-width: 15ch;
  font-weight: 700;
  font-size: clamp(1.8rem, 7.6vw, 4.2rem);
  line-height: 1.16;
  letter-spacing: -0.035em;
  color: #ffffff;
  text-shadow: 0 0 28px var(--glow), 0 0 64px rgba(94, 161, 255, 0.16);
}

/* ── 正文分节卡片 ───────────────────────── */
.prose > section {
  position: relative;
  margin: 0 0 24px;
  padding: 26px 22px 30px;
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--neon);
  border-radius: var(--r);
  background: linear-gradient(180deg, #0a0c11 0%, #05060a 100%);
  scroll-margin-top: 20px;
  box-shadow: 0 22px 50px -44px var(--glow);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.prose > section:hover {
  border-color: #28324a;
  box-shadow: 0 30px 70px -44px var(--glow);
}

.prose h2 {
  font-size: clamp(1.3rem, 3.6vw, 1.62rem);
  margin: 0 0 0.55em;
  color: #ffffff;
}

.prose > section h2 + hr {
  height: 1px;
  border: 0;
  margin: 0 0 1.1em;
  background: linear-gradient(90deg, var(--neon), transparent);
  opacity: 0.45;
}

.prose h3 {
  font-size: 1.12rem;
  margin: 1.5em 0 0.5em;
  color: #ffffff;
}

.prose p { margin: 0 0 1em; color: var(--body); }
.prose p:last-child { margin-bottom: 0; }

.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.25em; color: var(--body); }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--neon); }

.prose strong { color: #ffffff; font-weight: 600; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.prose blockquote {
  margin: 0 0 1em;
  padding: 12px 16px;
  border-left: 2px solid var(--neon);
  border-radius: 0 12px 12px 0;
  background: #0b0f16;
  color: #b8c4d6;
}

.prose hr {
  height: 1px;
  border: 0;
  margin: 1.2em 0;
  background: linear-gradient(90deg, var(--neon), transparent);
  opacity: 0.4;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.95em;
  padding: 1px 6px;
  border-radius: 6px;
  background: #121722;
  color: #d6e4ff;
}

/* ── 右侧目录 ───────────────────────────── */
.rail { min-width: 0; font-size: 16px; }

@media (min-width: 900px) {
  .rail { position: sticky; top: 82px; }
}

.rail h2 {
  margin: 0 0 0.6em;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.rail hr {
  height: 1px;
  border: 0;
  margin: 0 0 14px;
  background: linear-gradient(90deg, var(--neon), transparent);
  opacity: 0.5;
}

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 10px;
  border-radius: 10px;
  color: #aab6c8;
  font-family: var(--mono);
  font-size: 16px;
  transition: color 0.2s ease, background 0.2s ease;
}

.rail-list a:hover {
  color: #ffffff;
  background: #0d1119;
  text-decoration: none;
}

/* ── 底部胶囊导航 ───────────────────────── */
.dock {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 54px -26px #000000;
}

.dock details { position: relative; }

.dock summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid #232b3a;
  border-radius: 999px;
  background: #12151d;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.06em;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.dock summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--neon);
  border-bottom: 2px solid var(--neon);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.dock details[open] summary::after { transform: translateY(2px) rotate(-135deg); }

.dock summary:hover,
.dock summary:focus-visible {
  border-color: var(--neon);
  box-shadow: 0 0 20px -5px var(--glow);
}

.dock menu {
  list-style: none;
  margin: 0;
  padding: 9px;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  display: grid;
  gap: 3px;
  min-width: min(250px, 76vw);
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(7, 9, 13, 0.97);
  box-shadow: 0 32px 74px -28px #000000;
  animation: dock-in 0.18s ease both;
}

@keyframes dock-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.dock menu a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: #c3ccdb;
  font-family: var(--mono);
  font-size: 16px;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.dock menu a:hover,
.dock menu a:focus-visible {
  background: #141a26;
  color: #ffffff;
  text-decoration: none;
}

/* ── 页脚 ──────────────────────────────── */
.foot {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 26px auto 0;
  padding: 54px 20px 152px;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  border-top: 1px solid #151a24;
}

.foot-brand {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2.2rem, 11vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.045em;
  color: #ffffff;
  text-shadow: 0 0 34px var(--glow);
}

.foot small {
  font-size: 16px;
  color: #8b97a8;
  letter-spacing: 0.08em;
}

/* ── 小屏 ──────────────────────────────── */
@media (max-width: 640px) {
  .hero { min-height: 42vh; padding-top: 86px; }
  .prose > section { padding: 20px 16px 24px; }
  .dock summary { padding: 0 16px; }
  .foot { padding-top: 44px; }
}

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

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