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

:root {
  --bg: #000000;
  --surface: #121212;
  --surface-2: #0a0d0c;
  --surface-3: #161a19;
  --midnight: #0d1520;
  --ink: #e9ecea;
  --ink-soft: #d3d8d5;
  --dim: #8c948f;
  --neon: #7ef2b0;
  --line: #1d2320;
  --radius: 4px;
  --tap: 44px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}

/* ---------- 顶栏 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem clamp(.7rem, 2.6vw, 1.6rem);
  background: rgba(0, 0, 0, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.top.is-stuck {
  background: #050706;
}

.mark,
.foot-mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  background: var(--surface);
  color: var(--neon);
  text-decoration: none;
  overflow: hidden;
}

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

.mark-glyph {
  font-weight: 700;
  font-size: 1rem;
  text-shadow: 0 0 12px rgba(126, 242, 176, .45);
}

.mark:hover,
.foot-mark:hover {
  background: var(--neon);
  color: #000;
}

.pills {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.pills::-webkit-scrollbar {
  display: none;
}

.pills a {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: .5rem .95rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--dim);
  font-size: .95rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease;
}

.pills a:first-child {
  color: var(--ink);
  background: var(--surface-3);
}

.pills a:hover,
.pills a:focus-visible {
  background: var(--neon);
  color: #000;
}

.find {
  flex: none;
  display: flex;
  gap: .3rem;
}

.find input {
  width: 9.5rem;
  min-height: var(--tap);
  padding: .45rem .9rem;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #0b0e0d;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.find input::placeholder {
  color: #626a66;
}

.find button {
  min-height: var(--tap);
  padding: .45rem 1rem;
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  color: #000;
  background: var(--neon);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.find button:hover {
  filter: brightness(1.12);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: calc(100svh - 70px);
  padding: clamp(1.5rem, 6vw, 4.5rem) clamp(1.1rem, 5vw, 4rem) clamp(2.5rem, 8vw, 5rem);
  overflow: hidden;
  background: radial-gradient(120% 95% at 82% 100%, #10201a 0%, #05080a 45%, #000 78%);
  border-bottom-left-radius: 50% 72px;
  border-bottom-right-radius: 50% 72px;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .5;
  filter: brightness(.7) saturate(.9);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(0, 0, 0, .15) 0%, rgba(0, 0, 0, .72) 62%, #000 100%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  max-width: 22ch;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 7.2vw, 4.1rem);
  line-height: 1.14;
  letter-spacing: -.015em;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 22px rgba(126, 242, 176, .16);
}

.hero-rule {
  display: block;
  width: 92px;
  height: 3px;
  margin-top: 1.35rem;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(126, 242, 176, 0), var(--neon));
  box-shadow: 0 0 14px rgba(126, 242, 176, .5);
}

/* ---------- 主体骨架 ---------- */
main {
  padding: clamp(1.9rem, 5vw, 4.2rem) clamp(.9rem, 3.6vw, 1.6rem);
}

.wrap {
  max-width: 1150px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  gap: clamp(1.1rem, 2.8vw, 2.6rem);
  align-items: start;
}

/* ---------- 目录 ---------- */
.toc {
  position: sticky;
  top: 84px;
  padding: 1.05rem .85rem;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.toc h2 {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .7rem;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .22em;
  color: var(--dim);
}

.toc h2 > span::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 1px;
  margin-right: .5rem;
  vertical-align: middle;
  background: var(--neon);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li + li {
  margin-top: .12rem;
}

.toc a {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 40px;
  padding: .28rem .4rem;
  border-radius: var(--radius);
  color: var(--dim);
  font-size: .93rem;
  line-height: 1.4;
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}

.toc .idx {
  flex: none;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  color: #5d6661;
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--ink);
  background: #151a18;
}

.toc a:hover .idx {
  color: var(--neon);
}

/* ---------- 正文 ---------- */
.doc {
  min-width: 0;
}

.prose {
  max-width: 74ch;
  padding: clamp(1.1rem, 3.2vw, 2.4rem);
  background: #050706;
  border-radius: var(--radius);
}

.prose section[id] {
  scroll-margin-top: 96px;
}

.prose h2,
.prose h3 {
  line-height: 1.34;
  letter-spacing: -.005em;
}

.prose h2 {
  margin: 2.6rem 0 1rem;
  font-size: clamp(1.35rem, 3.4vw, 1.85rem);
  color: #fff;
}

.prose h2:first-child,
.prose section:first-child h2 {
  margin-top: 0;
}

.prose h2 > span {
  background: linear-gradient(transparent 70%, rgba(126, 242, 176, .17) 0);
  padding-bottom: .1em;
}

.prose h3 {
  margin: 1.9rem 0 .75rem;
  font-size: clamp(1.08rem, 2.6vw, 1.28rem);
  color: var(--ink);
}

.prose h3 > span {
  border-left: 3px solid var(--neon);
  padding-left: .6rem;
}

.prose p {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
}

.prose ul,
.prose ol {
  margin: 0 0 1.2rem;
  padding-left: 1.35rem;
  color: var(--ink-soft);
}

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

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

.prose a {
  color: var(--neon);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose strong {
  color: #fff;
}

.prose blockquote {
  margin: 1.6rem 0;
  padding: .95rem 1.15rem;
  background: var(--surface);
  border-left: 3px solid var(--neon);
  border-radius: var(--radius);
  color: #c4cbc7;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code {
  padding: .1em .4em;
  font-size: .92em;
  background: #141817;
  border-radius: 3px;
  color: #cdf7e0;
}

.prose pre {
  margin: 1.5rem 0;
  padding: 1rem;
  overflow-x: auto;
  background: #0b0f0e;
  border-radius: var(--radius);
}

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

.prose img {
  display: block;
  margin: 1.6rem 0;
  border-radius: var(--radius);
}

.prose table {
  display: block;
  width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: .96rem;
}

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

.prose th {
  color: #fff;
  background: var(--surface);
}

.prose hr {
  margin: 2.2rem 0;
  border: 0;
  height: 1px;
  background: var(--line);
}

.prose section + section {
  margin-top: 2.6rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--line);
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding: clamp(2rem, 5vw, 3.6rem) clamp(.9rem, 3.6vw, 1.6rem) 1.4rem;
  background: linear-gradient(180deg, #000 0%, #0a0d0c 100%);
  border-top: 1px solid var(--line);
}

.foot-cta {
  max-width: 1150px;
  margin-inline: auto;
  margin-bottom: clamp(1.8rem, 4vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.3rem, 4vw, 2.3rem);
  background: var(--surface);
  border-radius: 8px;
}

.foot-cta h2 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 0 16px rgba(126, 242, 176, .14);
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: .7rem 1.6rem;
  border-radius: 999px;
  background: var(--neon);
  color: #000;
  font-weight: 700;
  text-decoration: none;
}

.cta:hover {
  filter: brightness(1.12);
}

.foot-body {
  max-width: 1150px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto 1fr 1fr auto;
  gap: 1.4rem 1.8rem;
  align-items: start;
}

.foot-body dl {
  margin: 0;
}

.foot-body dt {
  margin: 0;
}

.foot-body dt a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--dim);
  font-size: .95rem;
  text-decoration: none;
}

.foot-body dt a:hover,
.foot-body dt a:focus-visible {
  color: var(--neon);
}

.foot-body dd {
  margin: 0 0 .15rem;
  height: 1px;
  background: linear-gradient(90deg, #1b201e, rgba(27, 32, 30, 0));
}

.col-back {
  justify-self: end;
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .35rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-size: .92rem;
  text-decoration: none;
}

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

.foot-base {
  max-width: 1150px;
  margin: clamp(1.6rem, 4vw, 2.4rem) auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.foot-base p {
  margin: 0;
  color: #6d7570;
  font-size: .88rem;
  letter-spacing: .04em;
}

/* ---------- 动效 ---------- */
.rv {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}

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

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

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

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .wrap {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .foot-body {
    grid-template-columns: auto 1fr 1fr;
  }

  .col-back {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .top {
    flex-wrap: wrap;
    gap: .45rem;
  }

  .find {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .find input {
    width: 100%;
    min-width: 0;
  }

  .pills {
    order: 3;
    flex: 1 0 100%;
    padding: .1rem 0 .2rem;
    border-top: 1px solid var(--line);
    margin-top: .1rem;
  }

  .hero {
    min-height: 72svh;
    border-bottom-left-radius: 50% 46px;
    border-bottom-right-radius: 50% 46px;
    padding-bottom: 2.4rem;
  }

  .hero-copy {
    max-width: 18ch;
  }

  main {
    padding-inline: .85rem;
  }

  .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    position: static;
    order: 0;
  }

  .toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .1rem .6rem;
  }

  .toc a {
    font-size: .9rem;
  }

  .prose {
    padding: 1.05rem;
  }

  .foot-body {
    grid-template-columns: 1fr 1fr;
  }

  .col-back {
    grid-column: auto;
    justify-self: start;
  }

  .foot-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  body {
    font-size: 16px;
  }

  .toc ol {
    grid-template-columns: minmax(0, 1fr);
  }
}

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