@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --ink: #26171f;
  --bg: #140b12;
  --deep: #0d060c;
  --panel: rgba(38, 23, 31, .62);
  --pink: #ff0080;
  --magenta: #ff00ff;
  --text: #f7ecf4;
  --muted: #c9abc0;
  --line: rgba(255, 0, 128, .26);
  --line-soft: rgba(255, 255, 255, .1);
  --r: 28px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'PingFang SC', 'Microsoft YaHei', monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--deep);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: -25% -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 38% at 18% 22%, rgba(255, 0, 128, .62), transparent 68%),
    radial-gradient(38% 34% at 82% 16%, rgba(255, 0, 255, .5), transparent 70%),
    radial-gradient(50% 44% at 62% 82%, rgba(120, 16, 255, .42), transparent 72%),
    radial-gradient(30% 30% at 30% 70%, rgba(255, 120, 200, .3), transparent 70%);
  filter: blur(58px) saturate(150%);
  opacity: .85;
  animation: aurora 26s ease-in-out infinite alternate;
}

@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) scale(1); filter: blur(58px) saturate(150%) hue-rotate(0deg); }
  100% { transform: translate3d(-4%, 3%, 0) scale(1.18); filter: blur(74px) saturate(170%) hue-rotate(46deg); }
}

@keyframes shimmer {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

a { color: #ff63b4; text-decoration-thickness: 1px; text-underline-offset: 3px; }

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 3px;
  border-radius: 10px;
}

p { margin: 0 0 1rem; }

main,
.brandline,
.topnav,
.foot {
  padding-inline: max(1.35rem, calc((100% - 1160px) / 2));
}

/* ---------- 顶部两行 ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(15, 8, 14, .82);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

.brandline {
  display: flex;
  align-items: center;
  padding-top: .9rem;
  padding-bottom: .5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  max-width: 100%;
  text-decoration: none;
  color: #fff;
}

.brand .logo {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.brandname {
  font-size: 1.05rem;
  letter-spacing: .22em;
  overflow-wrap: anywhere;
  background: linear-gradient(94deg, #ffffff, #ffb8de 45%, var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.topnav {
  padding-bottom: .6rem;
  min-width: 0;
}

.navlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .1rem .45rem;
  max-width: 100%;
}

.navlist > li { min-width: 0; }

.navlist > li > a,
.navlist summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .4rem .55rem;
  font-size: 1rem;
  letter-spacing: .06em;
  color: var(--muted);
  text-decoration: none;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
}

.navlist > li > a::after,
.navlist summary::after {
  content: "";
  position: absolute;
  left: .55rem;
  right: .55rem;
  bottom: .35rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--pink), var(--magenta));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s ease;
}

.navlist > li > a:hover,
.navlist summary:hover { color: #fff; }

.navlist > li > a:hover::after,
.navlist summary:hover::after,
.navmore details[open] summary::after { transform: scaleX(1); }

.navmore { position: relative; }

.navmore summary {
  list-style: none;
  color: #fff;
  border: 1px solid var(--line);
}

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

.subnav {
  position: absolute;
  right: 0;
  left: auto;
  top: calc(100% + .35rem);
  min-width: 12rem;
  max-width: min(18rem, calc(100vw - 2.2rem));
  margin: 0;
  padding: .45rem;
  list-style: none;
  display: grid;
  gap: .1rem;
  background: rgba(19, 10, 17, .97);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  animation: riseIn .26s ease both;
}

.subnav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .35rem .75rem;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.subnav a:hover { color: #fff; background: rgba(255, 0, 128, .16); }

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

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  min-height: 70vh;
  padding-block: clamp(2rem, 6vw, 4.5rem);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 -1.35rem;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 0, 255, .3) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(70% 70% at 50% 45%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 45%, #000 25%, transparent 78%);
  opacity: .55;
  pointer-events: none;
}

.hero-copy { text-align: center; min-width: 0; }

.hero-copy h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5.6vw, 3.4rem);
  line-height: 1.16;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
  background: linear-gradient(96deg, #ffffff 8%, #ff9ed2 46%, var(--pink) 74%, var(--magenta));
  background-size: 210% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shift 12s ease-in-out infinite alternate;
}

@keyframes shift {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

.lede {
  margin: 0 auto;
  max-width: 40ch;
  color: var(--muted);
  font-size: 1rem;
}

.hero-visual {
  position: relative;
  min-width: 0;
  min-height: 320px;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 30% 25%, rgba(255, 0, 128, .45), transparent 70%),
    radial-gradient(55% 50% at 75% 70%, rgba(255, 0, 255, .4), transparent 72%),
    linear-gradient(160deg, #2c1a25, #120a11);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.prism {
  position: absolute;
  z-index: 2;
  inset: -35%;
  background: conic-gradient(from 0deg,
    rgba(255, 0, 128, .55),
    rgba(255, 0, 255, .38),
    rgba(120, 40, 255, .42),
    rgba(255, 200, 240, .35),
    rgba(255, 0, 128, .55));
  mix-blend-mode: screen;
  filter: blur(26px);
  opacity: .7;
  animation: shimmer 28s linear infinite;
  pointer-events: none;
}

/* ---------- 主体分栏 ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 232px) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
  padding-block: 1rem clamp(3rem, 7vw, 5rem);
}

.rail {
  position: sticky;
  top: 8.5rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.15rem 1.15rem 1.35rem;
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.rail h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: .3em;
  color: #ffd0e8;
}

.rail hr {
  margin: .7rem 0 1rem;
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
  display: grid;
  gap: .1rem;
}

.toc li { counter-increment: toc; min-width: 0; }

.toc a {
  display: flex;
  gap: .6rem;
  align-items: baseline;
  min-height: 42px;
  padding: .35rem .4rem;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  transition: color .2s ease, background .2s ease;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  flex: 0 0 auto;
  font-size: .72rem;
  color: rgba(255, 0, 128, .8);
  letter-spacing: .08em;
}

.toc a:hover,
.toc a.on {
  color: #fff;
  background: rgba(255, 0, 128, .16);
}

/* ---------- 正文 ---------- */

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

.prose div {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1.3rem, 3vw, 2.4rem);
  margin-bottom: clamp(1.2rem, 3vw, 1.9rem);
  background: linear-gradient(158deg, rgba(44, 26, 37, .74), rgba(18, 10, 17, .6));
  backdrop-filter: blur(6px);
}

.prose div > :last-child { margin-bottom: 0; }

.prose h2 {
  margin: 0 0 .8rem;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  line-height: 1.3;
  letter-spacing: .02em;
  color: #fff;
  overflow-wrap: anywhere;
}

.prose h3 {
  margin: 1.6rem 0 .6rem;
  font-size: 1.15rem;
  line-height: 1.4;
  color: #ffd0e8;
  overflow-wrap: anywhere;
}

.prose p { color: #ecdbe6; }

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
  color: #ecdbe6;
}

.prose li { margin-bottom: .4rem; }

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

.prose hr {
  height: 1px;
  border: 0;
  margin: .2rem 0 1.2rem;
  background: linear-gradient(90deg, var(--pink), var(--magenta) 45%, transparent);
  opacity: .7;
}

.prose strong { color: #fff; }

.prose a { color: #ff7cc0; }

.prose blockquote {
  margin: 1.2rem 0;
  padding: .8rem 1.1rem;
  border-left: 2px solid var(--magenta);
  background: rgba(255, 0, 128, .1);
  border-radius: 0 16px 16px 0;
  color: #f0dde8;
}

.prose code {
  font-family: var(--mono);
  font-size: .95em;
  padding: .1em .4em;
  border-radius: 8px;
  background: rgba(255, 0, 128, .16);
  color: #ffd7ea;
  overflow-wrap: anywhere;
}

.prose pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(10, 5, 9, .8);
}

.prose pre code { background: none; padding: 0; overflow-wrap: normal; }

.prose table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: .95rem;
}

.prose th,
.prose td {
  border-bottom: 1px solid var(--line-soft);
  padding: .6rem .5rem;
  text-align: left;
  overflow-wrap: anywhere;
}

.prose th { color: #ffd0e8; }

.prose figure { margin: 0 0 1rem; max-width: 100%; }

.prose figcaption {
  font-size: .9rem;
  color: var(--muted);
  margin-top: .4rem;
}

[ id ] { scroll-margin-top: 9.5rem; }

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

.foot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: 2rem;
  border-top: 1px solid var(--line);
  background: radial-gradient(90% 130% at 50% 0%, rgba(255, 0, 128, .18), transparent 72%);
}

.foot .cta {
  grid-column: 1 / -1;
  margin: 0 0 .8rem;
  text-align: center;
  min-width: 0;
}

.foot .cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 56px;
  padding: .3rem 1.2rem;
  font-size: clamp(1.4rem, 4.6vw, 2.2rem);
  letter-spacing: .16em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(96deg, #ffffff, #ffa9d6 40%, var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.foot .col {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
}

.foot .col a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .25rem 0;
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
  overflow-wrap: anywhere;
}

.foot .col a:hover { color: #fff; }

.foot .copy {
  grid-column: 1 / -1;
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
  color: #a98a9f;
  font-size: .9rem;
  letter-spacing: .08em;
  overflow-wrap: anywhere;
}

/* ---------- 滚动显现 ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.22, .7, .3, 1);
}

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

/* ---------- 断点 ---------- */

@media (max-width: 940px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; order: 2; }
  .prose { order: 1; max-width: none; }
  .toc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [ id ] { scroll-margin-top: 12rem; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    min-height: 0;
    padding-block: 1.6rem 2rem;
  }
  .hero::before { inset: 0 -1.35rem; }
  .hero-visual { min-height: 40vh; aspect-ratio: 16 / 11; }
  .brandname { font-size: .98rem; letter-spacing: .16em; }
  .navlist { gap: .1rem .2rem; }
  .navlist > li > a,
  .navlist summary { padding: .4rem .4rem; font-size: .95rem; }
  .prose div { border-radius: 22px; }
  .prose table { display: block; overflow-x: auto; }
  .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot .cta { text-align: left; }
  .foot .cta a { padding-left: 0; }
}

@media (max-width: 420px) {
  .toc { grid-template-columns: minmax(0, 1fr); }
  .subnav { min-width: 0; max-width: calc(100vw - 2.2rem); }
  .navlist > li > a,
  .navlist summary { font-size: .9rem; padding: .4rem .35rem; }
  .foot { grid-template-columns: minmax(0, 1fr); }
  .foot .cta a { font-size: clamp(1.2rem, 6.4vw, 1.7rem); }
}

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

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