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

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

:root {
  --red: #ff0000;
  --pink: #ff1493;
  --ink: #261717;
  --panel: rgba(38, 23, 23, .5);
  --panel-2: rgba(28, 16, 17, .66);
  --line: rgba(255, 205, 220, .16);
  --line-2: rgba(255, 205, 220, .32);
  --text: #f8eef1;
  --muted: #cba9b4;
  --r: 18px;
  --rail: 252px;
  --anchor: 24px;
}

html {
  background: #140a0b;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Noto Sans SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(46% 38% at 12% 8%, rgba(255, 0, 0, .46), transparent 66%),
    radial-gradient(44% 40% at 86% 14%, rgba(255, 20, 147, .42), transparent 64%),
    radial-gradient(56% 50% at 74% 84%, rgba(122, 12, 78, .5), transparent 70%),
    radial-gradient(60% 52% at 24% 90%, rgba(255, 0, 0, .2), transparent 72%);
  background-size: 200% 200%;
  filter: saturate(1.25);
  animation: aurora 11s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(72% 64% at 50% 16%, #000 12%, transparent 88%);
  mask-image: radial-gradient(72% 64% at 50% 16%, #000 12%, transparent 88%);
}

@keyframes aurora {
  0%   { background-position: 0% 24%, 100% 8%, 62% 92%, 18% 84%; }
  100% { background-position: 74% 62%, 18% 74%, 8% 32%, 82% 18%; }
}

h1, h2, h3, h4 { line-height: 1.35; margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
a { color: #ffd0e1; }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 左侧竖排导航 */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px 18px;
  background: linear-gradient(180deg, rgba(38, 23, 23, .78), rgba(20, 10, 11, .9));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.rail-top { display: flex; flex-direction: column; gap: 10px; }

.mark {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 15px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: conic-gradient(from 20deg, var(--red), var(--pink), #7a0c4e, var(--red));
  box-shadow: 0 10px 26px -14px rgba(255, 20, 147, .95);
  transition: transform .28s ease, box-shadow .28s ease;
}
.mark:hover { transform: translateY(-2px) rotate(-4deg); box-shadow: 0 16px 30px -14px rgba(255, 0, 0, .9); }
.mark-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mark-txt { font-size: 22px; font-weight: 600; letter-spacing: .04em; }

.finder { display: flex; gap: 6px; }
.finder input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(20, 10, 11, .62);
  border: 1px solid var(--line-2);
  border-radius: 13px;
}
.finder input::placeholder { color: var(--muted); }
.finder button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(120deg, var(--red), var(--pink));
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  transition: filter .22s ease, transform .22s ease;
}
.finder button:hover { filter: brightness(1.12); transform: translateY(-1px); }

.finder-status { margin: 0; font-size: 16px; color: #ffc4dc; }
.finder-status:empty { display: none; }

.rail ol {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.rail ol a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .24s ease, border-color .24s ease, transform .24s ease;
}
.rail ol a svg { flex: 0 0 auto; opacity: .62; transition: opacity .24s ease, transform .24s ease; }
.rail ol a span { font-size: 16px; }
.rail ol a:hover {
  background: rgba(255, 20, 147, .13);
  border-color: var(--line-2);
  transform: translateX(2px);
}
.rail ol a:hover svg { opacity: 1; transform: scale(1.06); }
.rail ol a.is-on {
  background: linear-gradient(100deg, rgba(255, 0, 0, .3), rgba(255, 20, 147, .18));
  border-color: rgba(255, 20, 147, .5);
  color: #fff;
}
.rail ol a.is-on svg { opacity: 1; }

/* 主体 */
main {
  margin-left: var(--rail);
  padding: 26px 28px 0;
}

.wrap {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}

/* 左侧侧边栏 */
.side {
  position: sticky;
  top: 26px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 50px -38px #000;
}

.side-t {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--muted);
  margin: 0 0 8px;
}
.side-t + .side-list { margin-bottom: 16px; }

.side-list {
  list-style: none;
  margin: 0; padding: 0;
  counter-reset: side;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-list li { counter-increment: side; }
.side-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 11px;
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
  transition: color .2s ease, background .2s ease;
}
.side-list a::before {
  content: counter(side, decimal-leading-zero);
  font-size: 16px;
  color: rgba(255, 20, 147, .85);
  font-variant-numeric: tabular-nums;
}
.side-extra { counter-reset: side 0; }
.side-list a:hover { color: #fff; background: rgba(255, 20, 147, .12); }

/* 正文舞台 */
.stage { min-width: 0; }
.doc { min-width: 0; }

.hero {
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  padding: 8px 4px 20px;
}

.hero-copy { flex: 1 1 auto; text-align: right; }
.hero-copy h1 {
  font-size: clamp(27px, 4.6vw, 44px);
  font-weight: 600;
  letter-spacing: -.02em;
  background: linear-gradient(104deg, #ffffff 6%, #ffd9e7 42%, var(--pink) 72%, var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-emblem {
  position: relative;
  flex: 0 0 auto;
  width: 108px; height: 108px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 0, 0, .95), rgba(255, 20, 147, .9), rgba(255, 150, 195, .55), rgba(122, 12, 78, .9), rgba(255, 0, 0, .95));
  filter: saturate(1.25);
  animation: spin 12s linear infinite;
  box-shadow: 0 0 58px -14px rgba(255, 20, 147, .8);
}
.hero-emblem::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: rgba(20, 10, 11, .78);
  backdrop-filter: blur(3px);
}
.hero-emblem svg { position: relative; z-index: 1; }

@keyframes spin { to { transform: rotate(360deg); } }

.lead-h {
  font-size: clamp(22px, 3vw, 30px);
  padding-left: 14px;
  border-left: 4px solid transparent;
  border-image: linear-gradient(180deg, var(--red), var(--pink)) 1;
}
.subtitle {
  margin: 8px 0 26px;
  color: var(--muted);
  padding-left: 18px;
  border-left: 1px solid var(--line-2);
}

/* 正文 */
.prose { min-width: 0; }

.prose > article {
  position: relative;
  margin: 0 0 22px;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  backdrop-filter: blur(15px) saturate(1.15);
  -webkit-backdrop-filter: blur(15px) saturate(1.15);
  box-shadow: 0 28px 60px -46px #000;
  scroll-margin-top: var(--anchor);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.prose > article::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 76px; height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red), var(--pink));
}
.prose > article:hover { border-color: var(--line-2); }
.prose > article.is-hit {
  border-color: rgba(255, 20, 147, .8);
  box-shadow: 0 0 0 4px rgba(255, 20, 147, .16), 0 28px 60px -46px #000;
}

.prose h2 {
  font-size: clamp(21px, 2.6vw, 27px);
  margin: 2px 0 12px;
  color: #fff;
}
.prose h3 { font-size: 19px; margin: 22px 0 8px; color: #ffe3ee; }
.prose p { color: #edd9df; }
.prose strong { color: #fff; font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1em; color: #edd9df; }
.prose li { margin-bottom: .4em; }
.prose img { border-radius: 14px; margin: 12px 0; }
.prose a { color: #ffb6d6; text-underline-offset: 3px; }
.prose blockquote {
  margin: 16px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--pink);
  background: rgba(255, 20, 147, .08);
  border-radius: 0 12px 12px 0;
  color: #f3dfe6;
}
.prose table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.prose th, .prose td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { color: #ffd8e6; }
.prose code { font-size: 16px; }

/* 页脚 */
footer {
  margin-top: 34px;
  margin-left: var(--rail);
  padding: 34px 28px 18px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 26px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(38, 23, 23, .32), rgba(12, 6, 7, .86));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.f-col { min-width: 0; max-width: 1180px; }
.f-col h3 { font-size: 16px; letter-spacing: .14em; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.f-brand h3 { font-size: 20px; letter-spacing: 0; color: #fff; }
.f-kw { margin: 0; color: #ffc9de; }

.f-col ul { list-style: none; margin: 0; padding: 0; }
.f-col ul a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s ease, transform .2s ease;
}
.f-col ul a:hover { color: #fff; transform: translateX(3px); }

.subform { display: flex; flex-wrap: wrap; gap: 6px; }
.subform input {
  flex: 1 1 108px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(12, 6, 7, .6);
  border: 1px solid var(--line-2);
  border-radius: 13px;
}
.subform input::placeholder { color: var(--muted); }
.subform button {
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(120deg, var(--red), var(--pink));
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  transition: filter .2s ease;
}
.subform button:hover { filter: brightness(1.12); }
.sub-status { flex: 1 0 100%; margin: 4px 0 0; color: #ffc4dc; }
.sub-status:empty { display: none; }

.f-base {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.copy { margin: 0; color: var(--muted); }
.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid var(--line-2);
  color: var(--text);
  text-decoration: none;
  transition: background .22s ease, border-color .22s ease;
}
.to-top:hover { background: rgba(255, 20, 147, .16); border-color: rgba(255, 20, 147, .6); }

@media (max-width: 1040px) {
  .wrap { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
  footer { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --anchor: 132px; }

  .rail {
    inset: 0 0 auto 0;
    width: auto;
    padding: 8px 12px 6px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(20, 10, 11, .9);
  }
  .rail-top { flex-direction: row; align-items: center; gap: 8px; }
  .mark { width: 44px; height: 44px; flex: 0 0 auto; }
  .finder { flex: 1 1 auto; }
  .finder-status { flex: 1 0 100%; order: 3; }
  .rail ol {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding: 4px 0 4px;
    -webkit-overflow-scrolling: touch;
  }
  .rail ol a { white-space: nowrap; padding: 9px 12px; }
  .rail ol a:hover { transform: none; }

  main { margin-left: 0; padding: 116px 16px 0; }
  .wrap { grid-template-columns: minmax(0, 1fr); gap: 14px; }

  .side { position: static; order: 2; margin-top: 22px; }
  .side-list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .side-list a { border: 1px solid var(--line); background: rgba(38, 23, 23, .45); }
  .side-t + .side-list { margin-bottom: 12px; }

  .hero {
    min-height: 0;
    gap: 14px;
    padding: 6px 0 16px;
    align-items: center;
  }
  .hero-emblem { width: 82px; height: 82px; }
  .hero-emblem::after { inset: 9px; }

  .subtitle { margin-bottom: 18px; }

  .prose > article { padding: 18px 15px; margin-bottom: 16px; }

  footer {
    margin-left: 0;
    padding: 26px 16px 16px;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  .f-base { margin-top: 4px; }
}

@media (max-width: 420px) {
  footer { grid-template-columns: 1fr; }
  .hero-copy h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before, .hero-emblem { animation: none; }
  * { transition-duration: .01ms !important; }
}

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