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

:root {
  --ink: #261717;
  --ink-deep: #180d0d;
  --red: #ff0000;
  --pink: #ff1493;
  --paper: #f7edee;
  --dim: rgba(247, 237, 238, .66);
  --line: rgba(255, 255, 255, .12);
  --glass: rgba(255, 255, 255, .05);
  --pad: clamp(18px, 5vw, 52px);
}

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

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

body {
  margin: 0;
  overflow-x: clip;
  background-color: var(--ink-deep);
  color: var(--paper);
  font-family: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.72;
  font-weight: 400;
  letter-spacing: .01em;
}

body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 42% at 12% 18%, rgba(255, 0, 0, .62), transparent 70%),
    radial-gradient(42% 38% at 84% 12%, rgba(255, 20, 147, .5), transparent 72%),
    radial-gradient(52% 48% at 62% 92%, rgba(255, 0, 0, .34), transparent 74%),
    conic-gradient(from 210deg at 50% 50%, rgba(255, 20, 147, .26), rgba(255, 0, 0, .18), rgba(255, 20, 147, .26));
  background-size: 200% 200%;
  filter: blur(46px) saturate(1.25);
  opacity: .5;
  animation: drift 11s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1.04); }
  to { transform: translate3d(4%, 3%, 0) scale(1.16); }
}

img { max-width: 100%; }

a { color: var(--paper); }

hr {
  height: 1px;
  border: 0;
  margin: 14px 0 24px;
  background: linear-gradient(90deg, var(--pink), var(--red) 45%, transparent);
}

/* ---------- 顶部：品牌居中，菜单分列 ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 13, 13, .95), rgba(38, 23, 23, .72));
  backdrop-filter: blur(16px) saturate(1.2);
}

.nav {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  max-width: 1320px;
  margin: 0 auto;
  padding: 6px clamp(186px, 19vw, 236px);
}

.rail {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.3vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-a { justify-self: end; }
.rail-b { justify-self: start; }

.rail a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 12px 3px;
  font-size: 16px;
  line-height: 1.3;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .25s ease, border-color .25s ease;
}

.rail a::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  background: linear-gradient(135deg, var(--red), var(--pink));
  transform: rotate(45deg);
  opacity: .85;
}

.rail a:hover,
.rail a:focus-visible {
  color: #fff;
  border-bottom-color: var(--pink);
}

.brand {
  grid-column: 2;
  justify-self: center;
  padding: 10px 8px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .16em;
  text-decoration: none;
  background: linear-gradient(100deg, #ffe3ea, var(--pink) 55%, var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.find {
  position: absolute;
  right: clamp(12px, 2vw, 30px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(8px);
}

.find input {
  width: 132px;
  height: 40px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.find input::placeholder { color: rgba(247, 237, 238, .5); }

.find button {
  height: 40px;
  padding: 0 13px;
  border: 0;
  background: linear-gradient(120deg, var(--red), var(--pink));
  color: #fff;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.find:focus-within { border-color: var(--pink); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: clamp(86px, 15vh, 150px) var(--pad) clamp(28px, 6vh, 56px);
  max-width: 1320px;
  margin: 0 auto;
  overflow: hidden;
}

.ghost {
  position: absolute;
  left: var(--pad);
  top: clamp(58px, 11vh, 118px);
  z-index: 0;
  font-size: clamp(3.2rem, 17vw, 12rem);
  font-weight: 700;
  line-height: .86;
  letter-spacing: -.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .17);
  pointer-events: none;
  user-select: none;
}

.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 17ch;
  margin: 0 0 18px;
  font-size: clamp(2rem, 7.4vw, 4.3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  background: linear-gradient(118deg, #fff 18%, #ffd7e4 58%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  position: relative;
  z-index: 1;
  max-width: 48ch;
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--dim);
  font-weight: 300;
}

.hero-fig {
  position: relative;
  z-index: 1;
  margin: clamp(26px, 5vh, 48px) 0 0;
  aspect-ratio: 16 / 9;
  max-height: 50svh;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(10px);
}

.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.15) contrast(1.02);
}

.aurora {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(45% 60% at 18% 30%, rgba(255, 0, 0, .75), transparent 70%),
    radial-gradient(50% 60% at 78% 26%, rgba(255, 20, 147, .7), transparent 72%),
    radial-gradient(60% 70% at 50% 96%, rgba(255, 0, 0, .42), transparent 76%),
    var(--ink);
  background-size: 200% 200%;
  filter: saturate(1.3);
  animation: drift 9s ease-in-out infinite alternate;
}

/* ---------- 主体：左栏 + 正文 ---------- */

.body {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(20px, 4vw, 54px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(30px, 6vh, 64px) var(--pad);
}

.side {
  position: sticky;
  top: 94px;
  align-self: start;
  padding: 16px 14px 8px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(12px) saturate(1.1);
}

.side h2 {
  margin: 0 0 8px;
  padding-left: 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .32em;
}

.side hr { margin: 0 0 10px; }

.side-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 6px;
  font-size: 16px;
  color: var(--dim);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.side-list a:hover,
.side-list a:focus-visible,
.side-list a.active {
  color: #fff;
  border-left-color: var(--pink);
  background: rgba(255, 20, 147, .12);
}

.content {
  min-width: 0;
  max-width: 74ch;
  overflow-wrap: break-word;
}

.content > div {
  scroll-margin-top: 104px;
  padding: clamp(26px, 4vw, 46px) 0;
  border-top: 1px solid var(--line);
}

.content > div:first-child {
  padding-top: 0;
  border-top: 0;
}

.content h2 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.28;
  letter-spacing: -.01em;
  font-weight: 600;
}

.content h3 {
  margin: 1.5em 0 .5em;
  font-size: clamp(1.1rem, 2.1vw, 1.3rem);
  line-height: 1.35;
  font-weight: 600;
  color: #ffe6ee;
}

.content p {
  margin: 0 0 1.05em;
  color: #eee0e1;
}

.content ul,
.content ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.content li { margin: .38em 0; }

.content li::marker { color: var(--pink); }

.content a {
  color: #ffb0d2;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.content strong { color: #fff; font-weight: 600; }

.content blockquote {
  margin: 1.3em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--pink);
  background: rgba(255, 20, 147, .09);
  backdrop-filter: blur(8px);
  color: #ffe9f1;
}

.content figure { margin: 1.3em 0; }

.content figcaption {
  padding-top: 8px;
  font-size: 16px;
  color: var(--dim);
}

.content img { display: block; height: auto; }

.content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 16px;
}

.content th,
.content td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.content th { background: rgba(255, 255, 255, .06); }

.content pre {
  margin: 1.2em 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .34);
}

.content code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .94em;
  background: rgba(255, 255, 255, .1);
  padding: 1px 5px;
}

.content pre code { background: none; padding: 0; }

.content hr { margin: 22px 0 26px; }

/* ---------- 页脚 ---------- */

.foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(34px, 7vh, 76px) var(--pad) 46px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.foot .cta { margin: 0 0 12px; }

.foot .cta a {
  display: inline-block;
  padding: 4px 0;
  font-size: clamp(1.9rem, 7vw, 3.4rem);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.15;
  text-decoration: none;
  background: linear-gradient(100deg, var(--red), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.foot small {
  display: block;
  font-size: 16px;
  letter-spacing: .1em;
  color: var(--dim);
}

.to-top {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 11px 14px;
  font-size: 16px;
  text-decoration: none;
  color: #fff;
  border: 1px solid var(--line);
  background: rgba(24, 13, 13, .74);
  backdrop-filter: blur(12px);
}

.to-top:hover { border-color: var(--pink); }

/* ---------- 动效 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .62s ease, transform .62s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.flash { animation: flash 1.2s ease; }

@keyframes flash {
  0%, 100% { box-shadow: inset 0 0 0 1px transparent; }
  40% { box-shadow: inset 0 0 0 1px var(--pink); }
}

/* ---------- 窄屏 ---------- */

@media (max-width: 900px) {
  .nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 14px 12px;
  }

  .brand { order: -1; }

  .rail {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 14px;
  }

  .rail a { padding: 12px 5px; min-height: 44px; }

  .find {
    position: static;
    transform: none;
    width: 100%;
    max-width: 320px;
    margin-top: 8px;
  }

  .find input { flex: 1; width: auto; height: 42px; }
  .find button { height: 42px; }

  .hero {
    min-height: auto;
    padding-top: 40px;
    overflow: visible;
  }

  .ghost {
    top: 26px;
    font-size: clamp(2.6rem, 21vw, 5rem);
  }

  .hero-fig { aspect-ratio: 4 / 3; max-height: none; }

  .body {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .side {
    position: static;
    padding: 12px 12px 6px;
  }

  .side-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6px; }

  .side-list a { padding: 8px 6px; font-size: 16px; }

  .content > div { scroll-margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  body::before,
  .aurora { animation: none; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .flash { animation: none; }
}

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