/* 下拉漫研 —— 极光棱镜主题 */
:root {
  --ink: #26171f;
  --mag: #ff0080;
  --fuchsia: #ff00ff;
  --bg: #0a0509;
  --txt: #f6ecf4;
  --dim: #c9abc0;
  --line: rgba(255, 0, 128, 0.28);
  --glass: rgba(255, 255, 255, 0.045);
  --sans: "Exo", system-ui, -apple-system, "Segoe UI", "Noto Sans SC", sans-serif;
  --mono: "Roboto Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

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

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

body {
  margin: 0;
  background: transparent;
  color: var(--txt);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* 极光底 */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 38% at 18% 12%, rgba(255, 0, 128, 0.45), transparent 70%),
    radial-gradient(42% 42% at 86% 22%, rgba(255, 0, 255, 0.36), transparent 72%),
    radial-gradient(52% 52% at 62% 92%, rgba(118, 0, 190, 0.42), transparent 72%),
    conic-gradient(from 210deg at 72% 42%, rgba(255, 0, 128, 0.26), rgba(0, 210, 255, 0.14), rgba(255, 0, 255, 0.26), rgba(255, 0, 128, 0.26));
  filter: blur(46px) saturate(135%);
  animation: aurora 28s ease-in-out infinite alternate;
}

/* 点阵 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.28;
  mask-image: radial-gradient(80% 70% at 50% 10%, #000 20%, transparent 90%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 10%, #000 20%, transparent 90%);
}

@keyframes aurora {
  0% { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1.04); }
  100% { transform: translate3d(4%, 3%, 0) rotate(9deg) scale(1.16); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px clamp(14px, 4vw, 40px);
  background: rgba(12, 6, 12, 0.74);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px 6px 0;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-size: 1.05rem;
}

.brand__mark {
  width: 16px;
  height: 16px;
  background: conic-gradient(from 0deg, var(--mag), var(--fuchsia), #00d2ff, var(--mag));
  animation: spin 12s linear infinite;
}

.brand:hover .brand__name { color: var(--fuchsia); }

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

.menus ul,
.rail ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 2px;
}

.menus ul {
  overflow-x: auto;
  scrollbar-width: none;
}

.menus ul::-webkit-scrollbar { display: none; }

.menus a,
.rail a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--dim);
  text-decoration: none;
  font-size: 1rem;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.menus a:hover,
.menus a.on,
.rail a:hover,
.rail a.on {
  color: #fff;
  border-bottom-color: var(--mag);
  background: linear-gradient(180deg, transparent 55%, rgba(255, 0, 128, 0.16));
}

.find {
  display: flex;
  gap: 0;
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--glass);
}

.find input {
  width: 130px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: var(--mono);
  font-size: 1rem;
}

.find input:focus {
  outline: 2px solid var(--fuchsia);
  outline-offset: -2px;
}

.find button {
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-left: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(255, 0, 128, 0.6), rgba(255, 0, 255, 0.45));
  color: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.find button:hover { background: linear-gradient(140deg, var(--mag), var(--fuchsia)); }

/* 头图 */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: clamp(34px, 8vw, 96px) clamp(16px, 5vw, 56px);
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 0, 255, 0.22);
}

.hero__deco {
  position: absolute;
  left: 0;
  top: 50%;
  width: min(48%, 520px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero__deco span {
  position: absolute;
  display: block;
  filter: blur(26px);
  opacity: 0.72;
}

.hero__deco span:nth-child(1) {
  width: 58%;
  height: 58%;
  left: 6%;
  top: 8%;
  background: conic-gradient(from 40deg, var(--mag), var(--fuchsia), #00d2ff, var(--mag));
  animation: spin 22s linear infinite;
}

.hero__deco span:nth-child(2) {
  width: 40%;
  height: 40%;
  right: 4%;
  bottom: 10%;
  background: radial-gradient(circle, rgba(255, 0, 128, 0.9), transparent 68%);
  animation: spin 30s linear infinite reverse;
}

.hero__deco span:nth-child(3) {
  width: 26%;
  height: 26%;
  left: 30%;
  bottom: 22%;
  background: radial-gradient(circle, rgba(255, 0, 255, 0.85), transparent 70%);
}

.hero__text {
  position: relative;
  z-index: 2;
  max-width: 660px;
  text-align: right;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 6vw, 3.9rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.012em;
  background: linear-gradient(102deg, #fff 8%, #ffd3ea 34%, var(--mag) 68%, var(--fuchsia) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  margin: 0;
  margin-left: auto;
  max-width: 52ch;
  color: var(--dim);
  font-size: 1.02rem;
  line-height: 1.8;
  border-right: 2px solid var(--mag);
  padding-right: 14px;
}

/* 主体 */
.wrap {
  display: grid;
  grid-template-columns: minmax(168px, 208px) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 34px);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 54px) clamp(14px, 4vw, 40px) 64px;
}

.rail {
  position: sticky;
  top: 96px;
  padding: 14px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 2px solid var(--mag);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  counter-reset: railitem;
}

.rail h2 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--mag);
  text-transform: uppercase;
}

.rail hr {
  height: 1px;
  border: 0;
  margin: 0 0 12px;
  background: linear-gradient(90deg, var(--mag), rgba(255, 0, 255, 0.4), transparent);
}

.rail ul { flex-direction: column; gap: 0; }

.rail a {
  padding: 9px 8px;
  font-size: 0.98rem;
  border-left: 1px solid transparent;
  border-bottom: 0;
}

.rail a::before {
  counter-increment: railitem;
  content: counter(railitem, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(255, 0, 128, 0.75);
  margin-right: 8px;
}

.rail a:hover,
.rail a.on {
  border-left-color: var(--fuchsia);
  background: linear-gradient(90deg, rgba(255, 0, 128, 0.18), transparent);
}

.stream { min-width: 0; }

.prose {
  counter-reset: sec;
  padding: clamp(18px, 4vw, 42px);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid rgba(255, 0, 255, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.prose section {
  counter-increment: sec;
  scroll-margin-top: 112px;
  padding-bottom: 0.5em;
}

.prose section + section {
  margin-top: 2.4em;
  padding-top: 2em;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.prose h2,
.prose h3 {
  scroll-margin-top: 112px;
}

.prose h2 {
  margin: 0 0 4px;
  font-size: clamp(1.44rem, 3vw, 1.95rem);
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: #fff;
}

.prose h2::before {
  counter-increment: none;
  content: counter(sec, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.58em;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--mag);
  margin-right: 0.75em;
  vertical-align: 0.16em;
}

.prose hr {
  height: 1px;
  border: 0;
  margin: 0.85em 0 1.35em;
  background: linear-gradient(90deg, var(--mag), rgba(255, 0, 255, 0.45) 40%, transparent);
}

.prose section + section h2::before { color: var(--fuchsia); }

.prose h3 {
  margin: 1.9em 0 0.6em;
  font-size: 1.18rem;
  font-weight: 600;
  color: #ffd3ea;
  letter-spacing: 0.01em;
}

.prose p {
  margin: 0 0 1.05em;
  max-width: 70ch;
  color: #e8dce6;
}

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

.prose em { color: #ffd3ea; font-style: italic; }

.prose a {
  color: #ffd3ea;
  text-decoration: underline;
  text-decoration-color: var(--mag);
  text-underline-offset: 3px;
}

.prose a:hover { color: #fff; text-decoration-color: var(--fuchsia); }

.prose ul,
.prose ol {
  margin: 0 0 1.2em;
  padding-left: 1.35em;
  max-width: 68ch;
}

.prose li { margin-bottom: 0.5em; }

.prose ul li::marker { color: var(--mag); }
.prose ol li::marker { color: var(--mag); font-family: var(--mono); }

.prose blockquote {
  margin: 1.5em 0;
  padding: 0.2em 0 0.2em 18px;
  border-left: 2px solid var(--fuchsia);
  color: var(--dim);
  font-style: normal;
}

.prose blockquote p { color: var(--dim); }

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.4em 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.3);
}

.prose figure { margin: 1.4em 0; }

.prose figcaption {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--dim);
  margin-top: 8px;
}

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

.prose th,
.prose td {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: rgba(255, 0, 128, 0.18);
  color: #fff;
  font-weight: 600;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.94em;
  background: rgba(255, 0, 128, 0.14);
  padding: 1px 5px;
  color: #ffd3ea;
}

/* 页脚 */
footer {
  padding: clamp(30px, 6vw, 58px) clamp(14px, 4vw, 40px) 40px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 5, 9, 0.5), rgba(10, 5, 9, 0.92));
}

footer .cta { margin: 0; }

footer .cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 40px;
  border: 1px solid var(--mag);
  background: linear-gradient(100deg, rgba(255, 0, 128, 0.28), rgba(255, 0, 255, 0.22));
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.22em;
  font-size: 1rem;
  transition: background 0.25s, border-color 0.25s, letter-spacing 0.25s;
}

footer .cta a:hover {
  border-color: var(--fuchsia);
  background: linear-gradient(100deg, rgba(255, 0, 128, 0.6), rgba(255, 0, 255, 0.5));
  letter-spacing: 0.3em;
}

footer small {
  display: block;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
}

/* 滚动显现 */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

@media (max-width: 860px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 20px;
  }

  .rail {
    position: static;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid var(--mag);
  }

  .rail ul {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .rail a {
    border-left: 0;
    border-bottom: 1px solid transparent;
  }

  .rail a:hover,
  .rail a.on { border-bottom-color: var(--fuchsia); }

  .hero { min-height: 62vh; }

  .hero__deco {
    width: 72%;
    opacity: 0.6;
    top: 24%;
    transform: none;
  }

  .find { margin-left: auto; }

  .menus { order: 3; flex: 1 1 100%; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero h1 { font-size: clamp(1.8rem, 9vw, 2.4rem); }
  .hero__sub { font-size: 1rem; }
  .find input { width: 96px; }
  .prose h2::before { margin-right: 0.5em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before,
  .brand__mark,
  .hero__deco span { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

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