:root {
  --ink: #000000;
  --paper: #ffffff;
  --gutter: clamp(1rem, 4vw, 2.75rem);
  --max: 1280px;
  --bar: 44px;
}

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

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

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.68;
  letter-spacing: 0.005em;
  font-weight: 400;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-weight: 700;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 90;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.skip:focus {
  left: 8px;
  top: 8px;
}

/* ---------- 顶栏 ---------- */

.bar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem var(--gutter);
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
}

.menu-wrap {
  position: relative;
}

.menu-wrap > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: var(--bar);
  padding: 0 0.8rem;
  border: 1px solid var(--ink);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  cursor: pointer;
  list-style: none;
}

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

.menu-wrap > summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg) translate(-1px, -1px);
}

.menu-wrap[open] > summary::after {
  transform: rotate(-135deg) translate(-1px, -1px);
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  min-width: 15rem;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--paper);
  border: 2px solid var(--ink);
}

.menu a {
  display: flex;
  align-items: center;
  min-height: var(--bar);
  padding: 0.4rem 1rem;
  border-bottom: 1px solid var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}

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

.menu a:hover,
.menu a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 粘性锚点条 ---------- */

.rail {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.rail-list {
  display: flex;
  margin: 0;
  padding: 0 var(--gutter);
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: var(--bar);
  padding: 0 0.85rem;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.rail-list li:first-child a {
  border-left: 0;
  padding-left: 0;
}

.rail-list a:hover,
.rail-list a[aria-current="true"] {
  background: var(--paper);
  color: var(--ink);
}

/* ---------- 版面骨架 ---------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  min-height: 100svh;
  padding: clamp(2rem, 9vh, 5.5rem) 0 0;
  border-bottom: 2px solid var(--ink);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.17;
  pointer-events: none;
}

.hero-txt {
  position: relative;
  z-index: 1;
}

.hero-h1 {
  margin: 0;
  font-size: clamp(2.3rem, 9vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.hero-sub {
  display: grid;
  gap: 0.5rem;
  max-width: 48ch;
  margin-top: 1.4rem;
  padding-left: 1rem;
  border-left: 4px solid var(--ink);
}

.hero-brand {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.subtitle {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.hero-media {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-top: 2px solid var(--ink);
}

.hero-media img {
  width: 100%;
  max-height: 50svh;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
  will-change: transform;
}

/* ---------- 正文两栏 ---------- */

.doc {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 2rem 0 3rem;
  background-image: radial-gradient(rgba(0, 0, 0, 0.14) 1px, transparent 1px);
  background-size: 12px 12px;
}

.doc-body {
  min-width: 0;
}

.doc-body div {
  margin: 0 0 1.5rem;
  padding: clamp(1.1rem, 3.5vw, 2.25rem);
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(7px) saturate(120%);
  backdrop-filter: blur(7px) saturate(120%);
  border: 1px solid var(--ink);
  scroll-margin-top: calc(var(--bar) + 1.25rem);
}

.doc-body div:first-child {
  margin-top: 0;
}

.doc-body h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.doc-body h3 {
  margin: 1.7rem 0 0.5rem;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
}

.doc-body p {
  max-width: 66ch;
  margin: 0 0 1rem;
}

.doc-body div > p:last-child,
.doc-body div > ul:last-child,
.doc-body div > ol:last-child {
  margin-bottom: 0;
}

.doc-body ul,
.doc-body ol {
  max-width: 66ch;
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.doc-body li {
  margin: 0 0 0.5rem;
}

.doc-body a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.doc-body strong {
  font-weight: 700;
}

.doc-body blockquote {
  margin: 1.2rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 4px solid var(--ink);
  font-size: 1.05rem;
}

.doc-body img {
  margin: 1rem 0;
  border: 1px solid var(--ink);
}

.doc-body table {
  width: 100%;
  max-width: 100%;
  margin: 0 0 1rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.doc-body th,
.doc-body td {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--ink);
  text-align: left;
  vertical-align: top;
}

/* ---------- 右侧栏 ---------- */

.side {
  padding: 1rem;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
}

.side-h2 {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.side-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: idx;
}

.side-list li {
  counter-increment: idx;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.side-list a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 40px;
  padding: 0.55rem 0;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.92rem;
}

.side-list a::before {
  content: counter(idx, decimal-leading-zero);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  opacity: 0.7;
}

.side-list a:hover,
.side-list a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 页脚 ---------- */

.foot {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  padding: clamp(2rem, 6vw, 3.5rem) var(--gutter) 1.25rem;
  background: var(--ink);
  color: var(--paper);
  border-top: 2px solid var(--ink);
}

.foot-col {
  min-width: 0;
}

.foot-brand {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.foot-kw {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.78;
}

.foot-lab {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.72;
}

.foot-host {
  margin: 0;
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.foot-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-menu a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.foot-menu a:hover,
.foot-menu a:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

.sub-form {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.sub-form input {
  flex: 1 1 8rem;
  min-height: var(--bar);
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--paper);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.95rem;
}

.sub-form input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.sub-form button {
  min-height: var(--bar);
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--paper);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.sub-form button:hover,
.sub-form button:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.foot-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 2px solid var(--paper);
}

/* ---------- 动效 ---------- */

.rv {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

/* ---------- 断点 ---------- */

@media (min-width: 760px) {
  .foot {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 900px) {
  body {
    font-size: 18px;
  }

  .menu-wrap {
    flex: 1;
  }

  .menu-wrap > summary {
    display: none;
  }

  .menu {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.2rem;
    min-width: 0;
    background: transparent;
    border: 0;
  }

  .menu a {
    min-height: 40px;
    padding: 0.35rem 0.72rem;
    border-bottom: 0;
    font-size: 0.92rem;
    letter-spacing: 0.03em;
  }

  .doc {
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    padding: 3rem 0 4rem;
  }

  .doc-body {
    grid-column: 1 / span 8;
  }

  .side {
    grid-column: 10 / span 3;
    position: sticky;
    top: calc(var(--bar) + 1.25rem);
    align-self: start;
  }

  .hero-sub {
    max-width: 44ch;
  }
}

@media (min-width: 1200px) {
  .doc-body {
    grid-column: 1 / span 8;
  }

  .side {
    grid-column: 10 / span 3;
  }
}

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

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

  .hero-media img {
    transform: none !important;
  }
}

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