:root {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --mist: #f5f5f5;
  --line: rgba(31, 31, 31, 0.14);
  --line-s: rgba(31, 31, 31, 0.07);
  --e1: 0 1px 1px rgba(0, 0, 0, 0.04), 0 2px 5px rgba(0, 0, 0, 0.05);
  --e2: 0 2px 4px rgba(0, 0, 0, 0.05), 0 9px 20px rgba(0, 0, 0, 0.07);
  --e3: 0 4px 10px rgba(0, 0, 0, 0.06), 0 18px 38px rgba(0, 0, 0, 0.1);
  --e4: 0 10px 24px rgba(0, 0, 0, 0.08), 0 30px 68px rgba(0, 0, 0, 0.14);
  --hdr: 112px;
  --pad: clamp(14px, 3vw, 30px);
  --font: 'Atkinson Hyperlegible', system-ui, -apple-system, 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

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

[id] {
  scroll-margin-top: calc(var(--hdr) + 20px);
}

a:focus-visible,
summary:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 99;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  box-shadow: var(--e3);
  transition: top 0.2s ease;
}

.skip:focus {
  top: 12px;
}

/* 头部 */
.hdr {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.76);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--e1);
}

.hdr__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 4px var(--pad);
  max-width: 1220px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.06em;
}

.brand__img {
  display: block;
  width: 30px;
  height: 30px;
}

.brand__txt {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1px;
}

.srch {
  display: flex;
  align-items: stretch;
  flex: 1 1 110px;
  min-width: 0;
  max-width: 280px;
  margin-left: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--e1);
}

.srch__in {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  padding: 10px 12px;
}

.srch__in::placeholder {
  color: rgba(31, 31, 31, 0.5);
}

.srch__btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--mist);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
}

.srch__btn:hover {
  background: rgba(31, 31, 31, 0.08);
}

.menu {
  position: relative;
  flex: 0 0 auto;
}

.menu__sm {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 58px;
  padding: 0 12px;
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--e1);
  font-size: 16px;
  user-select: none;
}

.menu__sm::-webkit-details-marker {
  display: none;
}

.menu[open] > .menu__sm {
  box-shadow: var(--e2);
  border-color: var(--ink);
}

.menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(74vw, 268px);
  padding: 8px;
  z-index: 70;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--e4);
}

.menu__list li + li {
  margin-top: 2px;
}

.menu__list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 16px;
  text-decoration: none;
  border-left: 2px solid transparent;
}

.menu__list a:hover {
  background: var(--mist);
  border-left-color: var(--ink);
}

.rail {
  border-top: 1px solid var(--line-s);
  background: rgba(255, 255, 255, 0.4);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.rail__list {
  display: flex;
  gap: 2px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 3px var(--pad);
  width: max-content;
  min-width: 100%;
}

.rail__list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 16px;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  color: rgba(31, 31, 31, 0.78);
}

.rail__list a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
  background: rgba(31, 31, 31, 0.04);
}

/* 首屏 */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: calc(var(--hdr) + 44px) var(--pad) 76px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 52%, var(--mist) 100%);
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(31, 31, 31, 0.15) 1px, transparent 0);
  background-size: 21px 21px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 44%, #000 22%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 44%, #000 22%, transparent 72%);
}

.lyr {
  position: absolute;
  z-index: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, var(--ty, 0px), 0);
}

.lyr--1 {
  width: min(44vw, 400px);
  aspect-ratio: 1;
  top: 15%;
  left: 5%;
  box-shadow: var(--e3);
  transform: rotate(-6deg) translate3d(0, var(--ty, 0px), 0);
}

.lyr--2 {
  width: min(36vw, 330px);
  aspect-ratio: 3 / 4;
  bottom: 11%;
  right: 6%;
  box-shadow: var(--e4);
  transform: rotate(5deg) translate3d(0, var(--ty, 0px), 0);
}

.lyr--3 {
  width: min(22vw, 190px);
  aspect-ratio: 1;
  top: 58%;
  left: 20%;
  box-shadow: var(--e1);
  transform: rotate(11deg) translate3d(0, var(--ty, 0px), 0);
}

.hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 20ch;
}

.hero__h1 {
  margin: 0;
  font-size: clamp(2.5rem, 8.6vw, 5.6rem);
  line-height: 1.06;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 14px 34px rgba(0, 0, 0, 0.1);
}

.hero__cue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-top: 34px;
  border: 1px solid var(--ink);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--e3);
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  animation: bob 2.8s ease-in-out infinite;
}

@keyframes bob {
  50% {
    transform: translateY(9px);
  }
}

/* 正文区 */
.deck {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 3vw, 46px);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 68px) var(--pad) 88px;
}

.deck > * {
  min-width: 0;
}

.toc {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  box-shadow: var(--e2);
  padding: 18px 16px 16px;
  position: relative;
  z-index: 2;
}

.toc__h {
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.toc__h > span {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--ink);
}

.toc__h--up {
  margin: 18px 0 8px;
  color: rgba(31, 31, 31, 0.72);
}

.toc__h--up > span {
  border-bottom-color: var(--line);
}

.toc__list a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  font-size: 16px;
  text-decoration: none;
  border-left: 2px solid var(--line);
  color: rgba(31, 31, 31, 0.82);
  transition: border-color 0.2s ease, background 0.2s ease, padding-left 0.2s ease;
}

.toc__list a:hover {
  border-left-color: var(--ink);
  background: var(--mist);
  padding-left: 14px;
  color: var(--ink);
}

.toc__up {
  margin: 0;
}

.toc__up a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--e1);
  text-decoration: none;
  font-size: 18px;
}

.toc__up a:hover {
  border-color: var(--ink);
  box-shadow: var(--e2);
}

.prose {
  position: relative;
  z-index: 1;
}

.prose > section {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  margin: 0 0 clamp(18px, 3vw, 32px);
  padding: clamp(20px, 3.2vw, 42px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  box-shadow: var(--e2);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.prose > section:hover,
.prose > section:focus-within {
  box-shadow: var(--e3);
  transform: translateY(-3px);
  z-index: 3;
}

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

.prose h2 {
  margin: 0 0 16px;
  font-size: clamp(1.3rem, 2.6vw, 1.72rem);
  line-height: 1.34;
  letter-spacing: 0.01em;
}

.prose h2 > span {
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--ink);
}

.prose h3 {
  margin: 26px 0 10px;
  font-size: 1.14rem;
  line-height: 1.45;
}

.prose h3 > span {
  display: inline-block;
  border-left: 3px solid var(--ink);
  padding-left: 9px;
}

.prose p,
.prose li {
  font-size: 17px;
}

.prose p {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 1.25em;
}

.prose li {
  margin-bottom: 8px;
}

.prose li::marker {
  color: rgba(31, 31, 31, 0.45);
}

.prose a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover {
  background: var(--mist);
}

.prose figure {
  margin: 22px 0;
  padding: 0;
}

.prose figcaption {
  margin-top: 8px;
  font-size: 16px;
  color: rgba(31, 31, 31, 0.66);
}

.prose aside {
  margin: 22px 0;
  padding: 16px 18px;
  background: var(--mist);
  border: 1px solid var(--line);
  box-shadow: var(--e1);
}

.prose blockquote {
  margin: 22px 0;
  padding: 14px 20px;
  background: var(--mist);
  border-left: 4px solid rgba(31, 31, 31, 0.35);
  box-shadow: var(--e1);
}

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

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 16px;
}

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

.prose th {
  background: var(--mist);
}

.prose code {
  font-size: 15px;
  background: var(--mist);
  padding: 1px 5px;
  border: 1px solid var(--line-s);
}

.prose pre {
  overflow-x: auto;
  padding: 14px;
  background: var(--mist);
  border: 1px solid var(--line);
}

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

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 26px 0;
}

.rv {
  opacity: 0;
  transform: translateY(16px);
}

.rv.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

/* 页脚 */
.ftr {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 30px var(--pad) 40px;
  text-align: center;
  box-shadow: 0 -1px 0 var(--line-s);
}

.ftr p {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: 0.06em;
}

.ftr small {
  font-size: 16px;
}

.ftr small a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: rgba(31, 31, 31, 0.75);
}

.ftr small a:hover {
  color: var(--ink);
}

@media (min-width: 920px) {
  .deck {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .toc {
    position: sticky;
    top: calc(var(--hdr) + 18px);
  }
}

@media (max-width: 919px) {
  :root {
    --hdr: 108px;
  }

  .toc {
    position: relative;
    padding: 14px;
  }

  .toc__h--up,
  .toc__up {
    display: none;
  }

  .toc__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 4px;
  }

  .toc__list a {
    border-left: 0;
    border-bottom: 2px solid var(--line);
  }

  .toc__list a:hover {
    padding-left: 10px;
    border-bottom-color: var(--ink);
  }

  .lyr--3 {
    display: none;
  }

  .lyr--1 {
    width: 58vw;
    top: 16%;
    left: -10%;
  }

  .lyr--2 {
    width: 46vw;
    right: -8%;
    bottom: 13%;
  }
}

@media (max-width: 620px) {
  :root {
    --hdr: 106px;
  }

  .hdr__bar {
    gap: 6px;
    min-height: 60px;
  }

  .brand {
    font-size: 17px;
    padding: 0 4px;
  }

  .srch {
    max-width: none;
    flex: 1 1 60px;
  }

  .srch__in {
    padding: 10px 8px;
  }

  .srch__btn {
    padding: 0 9px;
  }

  .menu__sm {
    min-width: 52px;
    padding: 0 9px;
  }

  .hero {
    padding-top: calc(var(--hdr) + 34px);
  }

  .hero__h1 {
    font-size: clamp(2.1rem, 12vw, 3.2rem);
  }

  .deck {
    padding-bottom: 64px;
  }

  .prose > section {
    padding: 18px 15px;
    border-left-width: 3px;
  }
}

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

  .hero__cue {
    animation: none;
  }

  .lyr {
    transform: none !important;
  }

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

  .prose > section {
    transition: none;
  }

  .prose > section:hover {
    transform: none;
  }
}

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