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

:root {
  --ink: #0b060e;
  --ink2: #170d18;
  --ink3: #26171f;
  --pink: #ff0080;
  --mag: #ff00ff;
  --paper: #f5ecf4;
  --dim: #bfa9bf;
  --edge: rgba(255, 0, 128, 0.22);
  --sans: Roboto, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: Newsreader, "Songti SC", "Noto Serif SC", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.78;
}

img, svg { display: block; max-width: 100%; }

a { color: #ffa4d2; }

:focus-visible {
  outline: 2px solid var(--mag);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 极光层 ---------- */
.sky {
  position: fixed;
  inset: -20% 0 -10%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  filter: saturate(145%);
  will-change: transform;
}

.sky i {
  position: absolute;
  inset: -25% -12%;
  display: block;
}

.sky i:nth-child(1) {
  background:
    radial-gradient(40% 34% at 22% 18%, rgba(255, 0, 128, 0.55), transparent 68%),
    radial-gradient(34% 30% at 78% 28%, rgba(255, 0, 255, 0.42), transparent 70%);
  animation: drift 23s ease-in-out infinite alternate;
}

.sky i:nth-child(2) {
  background:
    radial-gradient(46% 32% at 62% 78%, rgba(90, 0, 255, 0.5), transparent 72%),
    radial-gradient(30% 26% at 12% 70%, rgba(0, 214, 255, 0.22), transparent 74%);
  animation: drift 31s ease-in-out infinite alternate-reverse;
}

.sky i:nth-child(3) {
  opacity: 0.7;
  filter: blur(46px);
  background: conic-gradient(from 205deg at 50% 42%,
    rgba(255, 0, 128, 0) 0deg,
    rgba(255, 0, 128, 0.4) 68deg,
    rgba(255, 0, 255, 0.34) 148deg,
    rgba(38, 23, 31, 0) 238deg,
    rgba(0, 225, 255, 0.2) 312deg,
    rgba(255, 0, 128, 0) 360deg);
  animation: shimmer 19s linear infinite;
}

@keyframes drift {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to { transform: translate3d(3%, 2.5%, 0) scale(1.14); }
}

@keyframes shimmer {
  from { filter: blur(46px) hue-rotate(0deg); }
  to { filter: blur(46px) hue-rotate(46deg); }
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 18px 10px;
}

.mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #140610;
  text-decoration: none;
  background: linear-gradient(140deg, var(--pink), var(--mag));
  box-shadow: 0 0 22px rgba(255, 0, 128, 0.48);
}

.mark img,
.mark .mark-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.burger { position: relative; }

.burger > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: rgba(255, 0, 128, 0.13);
  color: #ffd7ea;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

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

.burger > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.burger[open] > summary {
  background: rgba(255, 0, 128, 0.34);
  color: #fff;
}

.burger[open] > menu {
  display: grid;
}

.burger > menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 70;
  margin: 0;
  padding: 8px;
  min-width: 216px;
  list-style: none;
  gap: 2px;
  border-radius: 8px;
  border: 1px solid var(--edge);
  background: rgba(20, 11, 22, 0.97);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(10px);
}

.burger menu a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 5px;
  color: #eedcea;
  font-size: 16px;
  text-decoration: none;
}

.burger menu a:hover { background: rgba(255, 0, 128, 0.24); color: #fff; }

.contact {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  color: #1b0714;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  background: linear-gradient(120deg, rgba(255, 0, 128, 0.92), rgba(255, 0, 255, 0.82));
  box-shadow: 0 8px 26px rgba(255, 0, 128, 0.3);
}

/* ---------- 粘性锚点条 ---------- */
.rail {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 6, 14, 0.82);
  backdrop-filter: blur(14px);
}

.rail nav {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.rail a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: #e4d0e2;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}

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

/* ---------- 主体栅格 ---------- */
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 258px;
  gap: clamp(22px, 4vw, 48px);
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 18px 76px;
}

article { min-width: 0; }

/* ---------- 首屏 ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 70vh;
  padding: clamp(26px, 6vh, 60px) 0 26px;
  text-align: center;
}

.hero-in {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.orn {
  margin: 0;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 20px rgba(255, 0, 128, 0.55));
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 6.2vw, 56px);
  line-height: 1.22;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  background: linear-gradient(100deg, #ffffff 8%, #ffd6ea 40%, #ff8ecb 70%, #ffb0ff 94%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 0;
  max-width: 44ch;
  color: var(--dim);
  font-size: 17px;
}

/* ---------- 正文片段 ---------- */
article > div[id] {
  padding: 38px 0 8px;
  border-top: 1px solid rgba(255, 0, 128, 0.16);
  scroll-margin-top: 78px;
}

article h2 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(22px, 3.5vw, 31px);
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: #fff;
}

article h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-bottom: 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--pink), var(--mag));
}

article h3 {
  margin: 26px 0 8px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.5;
  color: #ffd9ee;
}

article p { margin: 0 0 16px; }

article ul,
article ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

article li { margin: 0 0 8px; }

article strong { color: #fff; }

article blockquote {
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: 4px;
  background: rgba(38, 23, 31, 0.72);
  color: #f1dded;
}

article blockquote p:last-child { margin: 0; }

article figure {
  margin: 22px 0;
  border-radius: 4px;
  overflow: hidden;
}

article figcaption {
  padding: 8px 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--dim);
}

article img { border-radius: 4px; height: auto; }

article table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin: 0 0 18px;
  border-collapse: collapse;
  font-size: 16px;
}

article th,
article td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

article code {
  font-size: 15px;
  color: #ffc4e4;
}

/* ---------- 侧栏 ---------- */
aside {
  position: sticky;
  top: 68px;
  padding: 16px 16px 10px;
  border-radius: 6px;
  background: rgba(38, 23, 31, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 0, 128, 0.14);
  backdrop-filter: blur(8px);
}

aside h2 {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: #ff9ed0;
}

aside h2 span { display: inline-block; }

.toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  font-size: 15px;
  color: #dcc8dd;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.11);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.toc a:last-child { border-bottom: 0; }

.toc a:hover { color: #fff; padding-left: 5px; }

/* ---------- 页脚 ---------- */
footer {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(20px, 4vw, 46px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 46px 18px 26px;
  border-top: 1px solid var(--edge);
}

footer h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  color: #fff;
}

footer h3 span { display: inline-block; }

footer p {
  margin: 0;
  max-width: 42ch;
  font-size: 15px;
  line-height: 1.72;
  color: var(--dim);
}

.flinks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.flinks a {
  display: flex;
  align-items: center;
  min-height: 40px;
  font-size: 15px;
  color: #dcc8dd;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

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

.bar {
  grid-column: 1 / -1;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  color: #9d879c;
}

/* ---------- 入场动效 ---------- */
.js article > div[id] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.62s ease, transform 0.62s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js article > div[id].in {
  opacity: 1;
  transform: none;
}

/* ---------- 断点 ---------- */
@media (max-width: 940px) {
  main { grid-template-columns: minmax(0, 1fr); }
  aside { position: static; order: 2; margin-top: 6px; }
  footer { grid-template-columns: 1fr; }
  .flinks { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .hero { min-height: 62vh; gap: 14px; }
  .hero-in { flex-direction: column; gap: 10px; }
  .orn svg { width: 44px; height: 44px; }
  h1 { font-size: clamp(26px, 8vw, 38px); }
  .rail nav { padding: 8px 12px; }
  .topbar { padding: 10px 12px 8px; }
  main { padding: 0 12px 60px; }
  footer { padding: 38px 12px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sky i { animation: none; }
  .js article > div[id] {
    opacity: 1;
    transform: none;
    transition-delay: 0ms !important;
  }
  .rail a, .toc a { transition: none; }
}

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