@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --ink: #000000;
  --paper: #ffffff;
  --mute: #5c5c5c;
  --hair: #d8d8d8;
  --r: 4px;
  --pad: 1.25rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

p {
  margin: 0 0 1.1rem;
}

ul,
ol,
dl {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

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

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

.ic {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--ink);
  margin-right: 0.55rem;
  vertical-align: 0.15em;
  transition: transform 0.25s ease;
}

/* ---------- 页头 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem var(--pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: var(--r);
}

.brand:hover .brand-mark {
  background: var(--ink);
}

.top-nav {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.top-nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.72rem 0.6rem;
  font-size: 0.98rem;
  font-weight: 500;
  white-space: nowrap;
  min-height: 44px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  border-bottom-color: var(--ink);
}

.nav-link:hover .ic {
  transform: translateX(3px) rotate(45deg);
}

.search {
  display: flex;
}

.search input {
  width: 8.5rem;
  min-height: 44px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--r);
  padding: 0.5rem 0.7rem;
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder {
  color: var(--mute);
}

.search input:focus {
  outline: none;
  background: #f2f2f2;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 45vh;
  display: grid;
  place-items: center;
  padding: 4.5rem 1rem 3rem;
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
  text-align: center;
}

.hero h1 {
  position: relative;
  z-index: 2;
  font-size: clamp(3rem, 10vw, 12rem);
  letter-spacing: -0.05em;
  line-height: 0.88;
  max-width: 18ch;
  margin: 0 auto;
}

.hero-bg {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  font-size: clamp(7rem, 26vw, 20rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  color: #ededed;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

/* ---------- 主体骨架 ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem var(--pad) 5rem;
  display: grid;
  gap: 2.5rem;
}

.side {
  border: 2px solid var(--ink);
  border-radius: var(--r);
  padding: 1.1rem 1rem 1.2rem;
  align-self: start;
}

.side-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: var(--mute);
  margin: 0.35rem 0 1rem;
  letter-spacing: 0;
}

.side-list li + li {
  border-top: 1px solid var(--hair);
}

.side-list a {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.1rem;
  min-height: 44px;
  font-size: 0.98rem;
  line-height: 1.35;
  transition: background 0.18s ease, padding-left 0.18s ease;
}

.side-list a:hover {
  background: #f4f4f4;
  padding-left: 0.5rem;
}

.js .side-list li {
  opacity: 0;
  animation: slide-in 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

.js .side-list li:nth-child(1) { animation-delay: 0.05s; }
.js .side-list li:nth-child(2) { animation-delay: 0.1s; }
.js .side-list li:nth-child(3) { animation-delay: 0.15s; }
.js .side-list li:nth-child(4) { animation-delay: 0.2s; }
.js .side-list li:nth-child(5) { animation-delay: 0.25s; }
.js .side-list li:nth-child(6) { animation-delay: 0.3s; }
.js .side-list li:nth-child(7) { animation-delay: 0.35s; }

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

.doc {
  max-width: 68ch;
}

.doc div {
  scroll-margin-top: 130px;
}

.doc div + div {
  margin-top: 4rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--hair);
}

.doc h2 {
  font-size: clamp(1.9rem, 5.2vw, 3.4rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin-bottom: 1.1rem;
}

.doc h3 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 2rem 0 0.85rem;
}

.doc p {
  font-size: 1.0625rem;
  line-height: 1.78;
  margin-bottom: 1.15rem;
}

.doc a {
  border-bottom: 2px solid var(--ink);
  transition: background 0.18s ease, color 0.18s ease;
}

.doc a:hover {
  background: var(--ink);
  color: var(--paper);
}

.doc ul,
.doc ol {
  margin: 0 0 1.25rem;
  padding-left: 1.1rem;
}

.doc ul li {
  list-style: square;
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

.doc ol {
  padding-left: 1.4rem;
}

.doc ol li {
  list-style: decimal;
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

.doc blockquote {
  margin: 1.5rem 0;
  padding: 0.6rem 0 0.6rem 1.1rem;
  border-left: 4px solid var(--ink);
  font-size: 1.05rem;
  color: var(--mute);
}

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 0.05em 0.35em;
}

.doc strong {
  font-weight: 700;
}

.js .doc > div {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.js .doc > div.in {
  opacity: 1;
  transform: none;
}

/* ---------- 页脚 ---------- */
.site-foot {
  background: var(--ink);
  color: var(--paper);
  padding: 4.5rem var(--pad) 1.5rem;
}

.foot-cta {
  max-width: 1180px;
  margin: 0 auto 4rem;
  display: grid;
  gap: 1.6rem;
  justify-items: start;
}

.foot-cta h2 {
  font-size: clamp(2.4rem, 9vw, 6.5rem);
  letter-spacing: -0.055em;
  line-height: 0.86;
  word-break: break-word;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0.9rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--paper);
  border-radius: var(--r);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cta-btn:hover {
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-2px);
}

.foot-nav {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 1.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.foot-nav dt {
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.6rem;
}

.foot-nav dd {
  margin: 0;
}

.foot-nav dd a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0;
  font-size: 0.98rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.foot-nav dd a:hover {
  border-bottom-color: var(--paper);
}

.foot-bar {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
}

.foot-bar a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.2rem;
  color: var(--paper);
  border-bottom: 1px solid transparent;
}

.foot-bar a:hover {
  border-bottom-color: var(--paper);
}

/* ---------- 断点 ---------- */
@media (min-width: 900px) {
  :root {
    --pad: 2rem;
  }

  .site-head {
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    padding: 0.75rem var(--pad);
  }

  .top-nav {
    grid-column: auto;
    overflow: visible;
    justify-content: center;
  }

  .hero {
    min-height: 45vh;
    padding: 6rem 2rem 4rem;
  }

  .wrap {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 4rem;
    padding: 4.5rem var(--pad) 7rem;
  }

  .side {
    position: sticky;
    top: 108px;
  }

  .foot-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

@media (max-width: 420px) {
  .search input {
    width: 6.5rem;
  }

  .hero {
    padding-top: 3rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }

  .js .doc > div {
    opacity: 1;
    transform: none;
  }
}

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