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

:root {
  --red: #ff0000;
  --violet: #8b00ff;
  --ink: #261717;
  --base: #140b0b;
  --text: #f8eeee;
  --muted: #c9b2b6;
  --card: rgba(40, 24, 24, 0.82);
  --glass: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.16);
  --rail: 120px;
  --r: 18px;
  --head: "Anton", "Epilogue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: "Epilogue", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font: 16px/1.75 var(--body);
  overflow-x: hidden;
}

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

a { color: #ff8a8a; }

.aura {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aura i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}
.aura i:nth-child(1) {
  width: 48vw; height: 48vw;
  left: -10vw; top: -12vw;
  background: radial-gradient(circle, var(--red) 0%, rgba(255, 0, 0, 0) 68%);
  animation: drift 22s ease-in-out infinite alternate;
}
.aura i:nth-child(2) {
  width: 42vw; height: 42vw;
  right: -8vw; top: 24vh;
  background: radial-gradient(circle, var(--violet) 0%, rgba(139, 0, 255, 0) 66%);
  animation: drift 28s ease-in-out infinite alternate-reverse;
}
.aura i:nth-child(3) {
  width: 36vw; height: 36vw;
  left: 28vw; bottom: -14vw;
  background: radial-gradient(circle, rgba(255, 0, 0, 0.75) 0%, rgba(139, 0, 255, 0) 70%);
  opacity: 0.4;
  animation: drift 34s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4vw, 5vh, 0) scale(1.16); }
}

.skip {
  position: fixed;
  left: 50%;
  top: 8px;
  z-index: 90;
  transform: translate(-50%, -180%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(38, 23, 23, 0.95);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
}
.skip:focus { transform: translate(-50%, 0); }

/* ---------- 左侧固定栏 ---------- */
.rail {
  position: fixed;
  left: 0; top: 0;
  z-index: 40;
  width: var(--rail);
  height: 100dvh;
  padding: 18px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: rgba(38, 23, 23, 0.5);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.mark {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(145deg, rgba(255, 0, 0, 0.55), rgba(139, 0, 255, 0.55));
  color: #fff;
  font-family: var(--head);
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(255, 0, 0, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.mark:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 30px rgba(139, 0, 255, 0.4); }
.mark-img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }

.drawer { position: relative; width: 100%; }
.drawer summary {
  list-style: none;
  cursor: pointer;
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 16px;
  letter-spacing: 0.14em;
  transition: background 0.2s ease;
}
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary:hover { background: rgba(255, 0, 0, 0.22); }
.drawer[open] summary { background: rgba(255, 0, 0, 0.3); border-color: rgba(255, 255, 255, 0.32); }

.drawer menu {
  list-style: none;
  margin: 0;
  padding: 8px;
  position: absolute;
  left: calc(100% + 12px);
  top: 0;
  width: 196px;
  max-width: calc(100vw - 30px);
  display: grid;
  gap: 2px;
  border-radius: var(--r);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(28, 16, 16, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
}
.drawer menu li { list-style: none; }
.drawer menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: 11px;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  transition: background 0.18s ease, transform 0.18s ease;
}
.drawer menu a:hover { background: rgba(255, 0, 0, 0.26); transform: translateX(3px); }
.drawer menu a.is-on { background: linear-gradient(100deg, rgba(255, 0, 0, 0.5), rgba(139, 0, 255, 0.45)); }
.drawer menu a.is-hit { background: rgba(139, 0, 255, 0.35); }

.finder { width: 100%; }
.finder input {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.finder input::placeholder { color: var(--muted); }
.finder input:focus { outline: 2px solid rgba(255, 0, 0, 0.55); outline-offset: 1px; }

/* ---------- 主区 ---------- */
main {
  position: relative;
  z-index: 1;
  margin-left: var(--rail);
  max-width: 1240px;
  padding: 22px clamp(14px, 3vw, 42px) 56px;
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 22px 30px;
  align-items: start;
}

.hero {
  grid-column: 1 / -1;
  position: relative;
  min-height: 45vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 26px 26px 70px 70px;
  background:
    radial-gradient(80% 120% at 20% 0%, rgba(255, 0, 0, 0.5), rgba(255, 0, 0, 0) 60%),
    radial-gradient(90% 120% at 90% 10%, rgba(139, 0, 255, 0.5), rgba(139, 0, 255, 0) 62%),
    linear-gradient(160deg, #3a1414, #1b0f1f 70%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.82;
}
.veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(62% 90% at 50% 26%, rgba(20, 11, 11, 0.12), rgba(20, 11, 11, 0.88));
}
.hero-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 34px 18px;
  max-width: 780px;
}
.chip {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 15px;
  letter-spacing: 0.18em;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.4);
}
h1 {
  margin: 16px 0 0;
  font-family: var(--head);
  font-size: clamp(30px, 6vw, 58px);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0.02em;
  text-shadow: 0 8px 34px rgba(0, 0, 0, 0.65);
}

/* ---------- 目录侧栏 ---------- */
.toc {
  grid-column: 1;
  position: sticky;
  top: 20px;
  padding: 15px 13px;
  border-radius: var(--r);
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}
.toc h2 {
  margin: 0 0 10px;
  font-family: var(--head);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.24em;
  color: var(--muted);
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 2px;
}
.toc li { counter-increment: toc; }
.toc a {
  display: block;
  padding: 9px 9px 9px 32px;
  min-height: 42px;
  position: relative;
  border-radius: 11px;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.5;
  transition: background 0.18s ease, color 0.18s ease;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 9px;
  top: 9px;
  font-family: var(--head);
  font-size: 14px;
  color: var(--violet);
  letter-spacing: 0.06em;
}
.toc a:hover { background: rgba(255, 0, 0, 0.2); }
.toc a.is-on { background: rgba(255, 0, 0, 0.32); }

/* ---------- 正文 ---------- */
.doc {
  grid-column: 2;
  min-width: 0;
  display: grid;
  gap: 20px;
}
.doc > article {
  background: var(--card);
  border-radius: var(--r);
  padding: clamp(18px, 3vw, 36px);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.3);
}
article[id] { scroll-margin-top: 96px; }

.doc h2 {
  font-family: var(--head);
  font-size: clamp(21px, 3.2vw, 31px);
  font-weight: 400;
  line-height: 1.24;
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}
.doc h2 > span {
  display: inline-block;
  position: relative;
  padding-left: 17px;
}
.doc h2 > span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.16em;
  bottom: 0.16em;
  width: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--red), var(--violet));
}
.doc h3 {
  font-family: var(--head);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  margin: 26px 0 10px;
  color: #ffe2e4;
}
.doc h3 > span { padding-left: 12px; position: relative; display: inline-block; }
.doc h3 > span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}
.doc p { margin: 0 0 14px; color: #f0dfe0; font-size: 16.5px; line-height: 1.86; }
.doc p:last-child { margin-bottom: 0; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 22px; }
.doc li { margin-bottom: 8px; color: #f0dfe0; font-size: 16.5px; line-height: 1.8; }
.doc li::marker { color: var(--red); }
.doc strong { color: #fff; font-weight: 600; }
.doc a { color: #ff9090; text-underline-offset: 3px; }
.doc a:hover { color: #fff; }
.doc blockquote {
  margin: 0 0 16px;
  padding: 14px 18px;
  border-left: 3px solid var(--violet);
  border-radius: 0 14px 14px 0;
  background: rgba(139, 0, 255, 0.14);
}
.doc blockquote p:last-child { margin-bottom: 0; }
.doc time {
  display: inline-block;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 16px; }
.doc th, .doc td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.doc th { color: #fff; background: rgba(255, 0, 0, 0.16); }
.doc code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 15px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- 页脚 ---------- */
footer {
  position: relative;
  z-index: 1;
  margin-left: var(--rail);
  padding: 34px clamp(14px, 3vw, 42px) 26px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 14px 20px;
  background: rgba(38, 23, 23, 0.45);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
footer p { margin: 0; }
.f-brand {
  font-family: var(--head);
  font-size: 21px;
  letter-spacing: 0.05em;
  background: linear-gradient(100deg, #ff5252, #b98bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub { display: flex; gap: 8px; }
.sub input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.sub input::placeholder { color: var(--muted); }
.sub button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(140deg, var(--red), var(--violet));
  color: #fff;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.sub button:hover { filter: brightness(1.15); transform: translateY(-1px); }
.f-top { text-align: right; }
.f-top a {
  display: inline-block;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  transition: background 0.2s ease;
}
.f-top a:hover { background: rgba(255, 0, 0, 0.26); }
footer small {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.08em;
}

/* ---------- 动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 断点 ---------- */
@media (max-width: 1000px) {
  .rail {
    position: sticky;
    height: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    padding: 9px 12px;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .mark { width: 44px; height: 44px; border-radius: 13px; font-size: 19px; }
  .drawer { width: auto; flex: 0 0 auto; }
  .drawer summary { padding: 0 15px; white-space: nowrap; }
  .drawer menu { left: 0; top: calc(100% + 8px); width: 210px; }
  .finder { flex: 1 1 auto; min-width: 0; }
  main {
    margin-left: 0;
    grid-template-columns: minmax(0, 1fr);
    padding-top: 16px;
  }
  .hero { grid-column: 1; min-height: 42vh; border-radius: 20px 20px 54px 54px; }
  .toc { grid-column: 1; position: static; }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc { grid-column: 1; }
  article[id] { scroll-margin-top: 92px; }
  footer { margin-left: 0; grid-template-columns: 1fr; text-align: center; }
  .f-top { text-align: center; }
  .sub { max-width: 380px; margin: 0 auto; }
  .f-brand { text-align: center; }
}

@media (max-width: 560px) {
  .toc ol { grid-template-columns: minmax(0, 1fr); }
  .hero { min-height: 46vh; }
  .hero-copy { padding: 26px 14px; }
  .doc > article { padding: 18px 16px; }
  footer { padding-bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aura i { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .mark, .sub button, .drawer menu a, .toc a { transition: none; }
}

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