:root {
  --bg: #1b0f10;
  --ink: #261717;
  --panel: #2f1c1d;
  --fg: #f8eeee;
  --muted: #c8b0b3;
  --red: #ff0000;
  --pink: #ff1493;
  --line: rgba(255, 255, 255, 0.11);
  --r: 28px;
  --maxw: 1160px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  font-family: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    radial-gradient(58% 42% at 88% -4%, rgba(255, 20, 147, 0.22), transparent 66%),
    radial-gradient(52% 40% at 2% 12%, rgba(255, 0, 0, 0.16), transparent 70%),
    radial-gradient(70% 50% at 50% 112%, rgba(255, 20, 147, 0.13), transparent 72%);
  background-attachment: fixed;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-weight: 600; }

/* ---------- 头部：品牌行 + 胶囊菜单行 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(24, 13, 14, 0.8);
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  border-bottom: 1px solid var(--line);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 40px) 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: #fff;
  flex: 0 0 auto;
}
.brand img { width: 28px; height: 28px; border-radius: 8px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
  max-width: 260px;
  min-width: 0;
  justify-content: flex-end;
}
.search input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline-offset: 2px;
}
.search input::placeholder { color: rgba(255, 255, 255, 0.55); }
.search button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 15px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(100deg, var(--red), var(--pink));
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.menu {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 12px;
}
.menu p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--fg);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.menu a:hover,
.menu a:focus-visible {
  color: #fff;
  background: rgba(255, 20, 147, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 20, 147, 0.55) inset;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(26px, 6vw, 60px) max(16px, calc(50vw - var(--maxw) / 2 + 16px)) 0;
  border-bottom: 1px solid var(--line);
}

.hero-glow {
  position: absolute;
  inset: -35% -12% -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(42% 52% at 22% 26%, rgba(255, 0, 0, 0.55), transparent 62%),
    radial-gradient(40% 48% at 76% 34%, rgba(255, 20, 147, 0.5), transparent 64%),
    conic-gradient(from 205deg at 54% 30%, rgba(255, 0, 0, 0.32), rgba(255, 20, 147, 0.2), rgba(255, 20, 147, 0) 58%);
  filter: blur(54px) saturate(1.25);
  animation: aurora 11s ease-in-out infinite alternate;
}

@keyframes aurora {
  0% { transform: translate3d(-3%, -2%, 0) scale(1); }
  50% { transform: translate3d(4%, 2%, 0) scale(1.12); }
  100% { transform: translate3d(-2%, 3%, 0) scale(1.05); }
}

.hero::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -2px;
  height: 10px;
  z-index: 2;
  background: linear-gradient(90deg, var(--red), var(--pink) 55%, var(--red));
  transform: skewY(-1.1deg);
  opacity: 0.9;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding-bottom: clamp(22px, 4vw, 40px);
}

.hero h1 {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(31px, 5.6vw, 56px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-shadow: 0 2px 26px rgba(27, 15, 16, 0.7);
}

.lead {
  margin: 16px 0 0;
  max-width: 56ch;
  font-size: 17px;
  color: #ecdcdd;
}

.hero-media {
  position: relative;
  z-index: 1;
  border-radius: var(--r) var(--r) 0 0;
  overflow: hidden;
  background: var(--panel);
}
.hero-media img {
  width: 100%;
  border-radius: var(--r) var(--r) 0 0;
}

/* ---------- 主体骨架 ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(26px, 5vw, 54px) max(16px, calc(50vw - var(--maxw) / 2 + 16px)) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 252px;
  gap: clamp(20px, 3.4vw, 44px);
  align-items: start;
}

.doc { min-width: 0; }

/* ---------- 正文 ---------- */
.content { overflow-wrap: anywhere; }

.content section {
  padding: clamp(24px, 3.6vw, 38px) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 180px;
  border-radius: 0;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.content section:first-child { border-top: 0; padding-top: 0; }

.content section.hit {
  background: rgba(255, 20, 147, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 20, 147, 0.38) inset;
  border-radius: 20px;
  padding-left: 18px;
  padding-right: 18px;
}

.content small {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--pink);
}

.content h2 {
  margin: 0 0 0.55em;
  font-size: clamp(23px, 3.2vw, 31px);
  line-height: 1.32;
  letter-spacing: -0.01em;
  color: #fff;
}

.content h3 {
  margin: 1.5em 0 0.5em;
  font-size: 20px;
  color: #fff;
}

.content p { margin: 0 0 1.15em; color: #edE1e2; }
.content ul,
.content ol { margin: 0 0 1.15em; padding-left: 1.25em; }
.content li { margin-bottom: 0.45em; }
.content li::marker { color: var(--pink); }
.content strong { color: #fff; font-weight: 600; }
.content em { color: #ffd0e3; font-style: normal; }

.content a {
  color: #ff9dc4;
  text-underline-offset: 4px;
  text-decoration-color: rgba(255, 157, 196, 0.45);
}
.content a:hover { color: #fff; }

.content blockquote {
  margin: 1.4em 0;
  padding: 14px 20px;
  color: #f1e4e6;
  background: rgba(255, 20, 147, 0.09);
  border-left: 3px solid var(--pink);
  border-radius: 0 var(--r) var(--r) 0;
}
.content blockquote p:last-child { margin-bottom: 0; }

.content table {
  width: 100%;
  display: block;
  overflow-x: auto;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 16px;
}
.content th,
.content td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.content th { color: #fff; font-weight: 600; background: rgba(255, 0, 0, 0.16); }
.content td { color: #ecdfe0; }

.content code {
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 6px;
}

.content img { margin: 1.3em 0; border-radius: 20px; }
.content hr { height: 1px; margin: 2em 0; border: 0; background: var(--line); }

/* ---------- 侧栏 ---------- */
.side {
  position: sticky;
  top: 150px;
  padding: 20px 20px 18px;
  background: var(--panel);
  border-radius: var(--r);
}
.side small {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--pink);
}
.side h2 { margin: 6px 0 12px; font-size: 19px; color: #fff; }

.toc {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 4px 0;
  font-size: 16px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.09);
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 13px;
  color: var(--pink);
  opacity: 0.85;
  letter-spacing: 0.05em;
}
.toc a:hover { color: #fff; }

.totop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--red), var(--pink));
}

/* ---------- 页脚 ---------- */
footer {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 26px;
  margin-top: clamp(34px, 6vw, 66px);
  padding: clamp(34px, 6vw, 58px) max(16px, calc(50vw - var(--maxw) / 2 + 16px)) 6px;
  font-size: 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 20, 147, 0.16), rgba(27, 15, 16, 0) 72%);
}

.mega {
  margin: 0;
  font-size: clamp(38px, 8vw, 86px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, #ffffff, #ff1493 60%, #ff0000);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.f-col small {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--pink);
}
.f-col a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
}
.f-col a:hover { color: #fff; }

.f-bar {
  grid-column: 1 / -1;
  margin-top: 18px;
  padding: 16px 0 14px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  border-top: 1px solid var(--line);
}
.f-bar p { margin: 0; }

/* ---------- 滚动显现 ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- 断点 ---------- */
@media (max-width: 980px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; order: 2; }
  .doc { order: 1; }
  footer { grid-template-columns: 1fr 1fr; }
  .f-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .brand { font-size: 18px; letter-spacing: 0.03em; }
  .search { max-width: none; flex: 1 1 auto; }
  .search button { padding: 0 12px; }
  .menu a { padding: 8px 13px; font-size: 16px; }
  .content section { scroll-margin-top: 210px; }
  .hero { min-height: 62vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-glow { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

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