@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

:root {
  --red: #ff0000;
  --pink: #ff1493;
  --ink: #261717;
  --ink-deep: #170c0c;
  --text: #fdf2ef;
  --muted: #d6b8b4;
  --cream: #fff4f1;
  --cream-alt: #ffe7ee;
  --line: rgba(255, 255, 255, 0.13);
  --radius: 28px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  max-width: 100%;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.68;
  color: var(--text);
  background: var(--ink);
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: -30%;
  z-index: -2;
  background:
    radial-gradient(38% 42% at 16% 20%, rgba(255, 0, 0, 0.55), transparent 70%),
    radial-gradient(40% 40% at 84% 16%, rgba(255, 20, 147, 0.5), transparent 72%),
    radial-gradient(52% 52% at 62% 84%, rgba(255, 0, 0, 0.26), transparent 70%),
    radial-gradient(46% 46% at 28% 80%, rgba(255, 20, 147, 0.34), transparent 72%);
  background-size: 200% 200%;
  filter: saturate(1.25) blur(28px);
  opacity: 0.55;
  animation: aurora 11s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.16;
  pointer-events: none;
}

@keyframes aurora {
  0% { background-position: 0% 0%, 100% 0%, 50% 100%, 0% 100%; }
  100% { background-position: 22% 30%, 78% 22%, 40% 70%, 12% 82%; }
}

img,
svg,
video,
canvas,
iframe,
embed,
object,
table,
pre,
figure,
blockquote { max-width: 100%; }

img { height: auto; display: block; }

iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; }

a { color: inherit; text-decoration: none; }

ul { margin: 0; padding: 0; list-style: none; }

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

/* ---------- 顶栏 ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  min-width: 0;
  padding: 0.5rem clamp(0.7rem, 3vw, 1.6rem);
  background: rgba(28, 15, 15, 0.78);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

.masthead__nav { flex: 1 1 auto; min-width: 0; }

.masthead__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 2px;
}

.navlink {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.4rem 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 999px;
  text-align: center;
  transition: color 0.25s ease, background 0.25s ease;
}

.navlink:hover,
.navlink:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.brand { display: flex; justify-content: center; min-width: 0; }

.brand__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  min-height: 44px;
}

.brand__mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--red), var(--pink));
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}

.brand__img { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 12px; }

.brand__name {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.masthead__tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.85rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.25s ease;
}

.chip:hover { background: rgba(255, 20, 147, 0.5); }

.burger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--pink));
}

.burger__bars { display: grid; gap: 4px; width: 16px; }

.burger__bars i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

body.menu-open .burger__bars i:first-child { transform: translateY(3px) rotate(45deg); }
body.menu-open .burger__bars i:last-child { transform: translateY(-3px) rotate(-45deg); }

/* ---------- 遮罩菜单 ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem clamp(1rem, 5vw, 3rem) 2rem;
  background:
    radial-gradient(60% 60% at 80% 10%, rgba(255, 20, 147, 0.55), transparent 70%),
    radial-gradient(60% 60% at 10% 90%, rgba(255, 0, 0, 0.5), transparent 70%),
    #1a0e0e;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
  overflow-y: auto;
  overflow-x: hidden;
}

body.menu-open .drawer {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

body.menu-open { overflow: hidden; }

.drawer__nav { width: min(540px, 100%); min-width: 0; }

.drawer__link {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0.75rem 1rem;
  font-size: 1.18rem;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.25s ease, color 0.25s ease;
}

.drawer__link:hover {
  padding-left: 1.6rem;
  color: var(--pink);
}

/* ---------- 首屏 ---------- */
.stage { max-width: 1440px; margin: 0 auto; min-width: 0; max-width: 100%; }

.doc {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 0 1.4rem;
  min-width: 0;
  max-width: 100%;
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.hero {
  grid-column: 1 / -1;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
  min-height: 45vh;
  padding: clamp(1.4rem, 4vw, 2.6rem) clamp(1rem, 4vw, 2.8rem) clamp(1.6rem, 4vw, 2.6rem);
  overflow: hidden;
  border-radius: 0 0 var(--radius) var(--radius);
  background:
    linear-gradient(115deg, rgba(255, 0, 0, 0.42), rgba(255, 20, 147, 0.3) 58%, rgba(38, 23, 23, 0.15)),
    var(--ink-deep);
}

.hero__img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  transform-origin: center 30%;
  -webkit-mask-image: radial-gradient(125% 110% at 22% 26%, #000 38%, transparent 92%);
  mask-image: radial-gradient(125% 110% at 22% 26%, #000 38%, transparent 92%);
  will-change: transform;
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(to top, rgba(26, 14, 14, 0.9), rgba(26, 14, 14, 0.1) 62%);
  background-size: 22px 22px, 100% 100%;
  opacity: 0.7;
}

.hero__title {
  margin: 0;
  max-width: min(24ch, 100%);
  font-size: clamp(1.9rem, 4.6vw, 3.3rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 26px rgba(26, 14, 14, 0.55);
}

.hero__lead {
  margin: 0.7rem 0 0;
  max-width: min(60ch, 100%);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  line-height: 1.6;
  color: rgba(255, 246, 244, 0.84);
}

/* ---------- 侧栏 ---------- */
.rail {
  position: sticky;
  top: 84px;
  align-self: start;
  min-width: 0;
  max-width: 100%;
  margin: 1.6rem 0 0 clamp(1rem, 3vw, 2rem);
  padding: 1.1rem 0.9rem 1.2rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  overflow-x: auto;
  scrollbar-width: none;
}

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

.rail__title {
  margin: 0 0 0.7rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.rail__nav { min-width: 0; }

.rail__nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.5rem 0.6rem;
  border-radius: 14px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.25s ease, color 0.25s ease;
}

.rail__no {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
}

.rail__nav a:hover,
.rail__nav a.is-active {
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.85), rgba(255, 20, 147, 0.85));
  color: #fff;
}

.rail__nav a.is-active .rail__no { color: rgba(255, 255, 255, 0.75); }

.rail__back {
  display: inline-flex;
  align-items: center;
  margin: 0.9rem 0 0 0.6rem;
  min-height: 40px;
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
}

.rail__back:hover { color: var(--pink); }

/* ---------- 正文 ---------- */
.prose {
  max-width: 860px;
  min-width: 0;
  margin-inline: auto;
  padding: 1.6rem clamp(1rem, 3vw, 2.2rem) 0 0;
  overflow-wrap: anywhere;
}

.prose__label {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.prose section {
  position: relative;
  min-width: 0;
  max-width: 100%;
  margin: 0 0 1.4rem;
  padding: clamp(1.3rem, 3vw, 2.2rem);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  scroll-margin-top: 100px;
  overflow: hidden;
}

.prose section:nth-of-type(even) { background: var(--cream-alt); }

.prose section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--red), var(--pink));
  opacity: 0.9;
}

.prose h2,
.prose h3 {
  margin: 0 0 0.7rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #1d0f0f;
  overflow-wrap: anywhere;
}

.prose h2 { font-size: clamp(1.24rem, 2.6vw, 1.6rem); font-weight: 800; }
.prose h3 { font-size: 1.08rem; font-weight: 700; }

.prose p { margin: 0 0 0.9rem; }
.prose p:last-child { margin-bottom: 0; }

.prose a {
  color: #c4006b;
  font-weight: 600;
  border-bottom: 1px solid rgba(196, 0, 107, 0.35);
  overflow-wrap: anywhere;
}

.prose a:hover { border-bottom-color: #c4006b; }

.prose ul,
.prose ol {
  margin: 0 0 0.9rem;
  padding-left: 1.2rem;
  list-style: disc;
}

.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.4rem; }

.prose strong { font-weight: 800; }

.prose blockquote {
  margin: 0 0 0.9rem;
  padding: 0.7rem 1rem;
  border-left: 4px solid var(--pink);
  border-radius: 0 14px 14px 0;
  background: rgba(255, 20, 147, 0.09);
}

.prose img { border-radius: 18px; margin: 0 0 0.9rem; }

.prose pre {
  overflow-x: auto;
  margin: 0 0 0.9rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(38, 23, 23, 0.08);
}

.prose pre code {
  font-size: 0.9rem;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.prose table {
  display: block;
  width: 100%;
  margin: 0 0 0.9rem;
  border-collapse: collapse;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(38, 23, 23, 0.15);
  text-align: left;
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.4rem;
  min-width: 0;
  max-width: 100%;
  padding: 1.5rem clamp(1rem, 3vw, 2.4rem);
  background: rgba(14, 7, 7, 0.6);
  border-top: 1px solid var(--line);
}

.foot__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
}

.foot__name { font-weight: 800; font-size: 0.98rem; }

.foot__nav { flex: 1 1 320px; min-width: 0; }

.foot__title {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.foot__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.9rem;
}

.foot__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.25s ease;
}

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

.foot__copy {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.foot__sep { margin: 0 0.4rem; }

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .masthead__list {
    display: flex;
    justify-content: center;
  }

  .masthead__list li:not(.brand) { display: none; }

  .masthead { padding: 0.4rem 0.7rem; }

  .doc {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .hero {
    order: 1;
    min-height: 42vh;
    padding-top: 1.2rem;
    border-radius: 0 0 20px 20px;
  }

  .hero__title {
    font-size: clamp(1.7rem, 7.6vw, 2.4rem);
    max-width: 100%;
  }

  .rail {
    order: 2;
    position: sticky;
    top: 62px;
    z-index: 40;
    width: 100%;
    margin: 0;
    padding: 0.55rem clamp(0.6rem, 3vw, 1rem);
    border-radius: 0;
    background: rgba(26, 14, 14, 0.92);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid var(--line);
  }

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

  .rail__title { display: none; }

  .rail__nav {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .rail__nav::-webkit-scrollbar { display: none; }

  .rail__nav ul {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    gap: 0.4rem;
  }

  .rail__nav a {
    min-height: 40px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    font-size: 0.84rem;
  }

  .rail__no { font-size: 0.66rem; }

  .rail__back { display: none; }

  .prose {
    order: 3;
    width: 100%;
    padding: 1rem clamp(0.8rem, 4vw, 1.3rem) 0;
    max-width: none;
  }

  .prose section { scroll-margin-top: 118px; border-radius: 22px; }

  .hero__lead { font-size: 0.95rem; }
}

@media (max-width: 560px) {
  .foot { justify-content: center; text-align: center; }
  .foot__nav ul { justify-content: center; }
  .foot__brand { width: 100%; justify-content: center; }
  .prose section { padding: 1.1rem 1rem; }
  .hero__lead { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before { animation: none; }
  .hero__img { transform: none !important; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

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