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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --radius: 28px;
  --bar-h: 4.5rem;
  --edge: clamp(1.2rem, 4vw, 3.2rem);
}

*,
*::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: 'Quicksand', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.8;
  font-weight: 400;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.55em;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

p {
  margin: 0 0 1.15em;
  max-width: 66ch;
}

ul,
ol {
  padding-left: 1.35em;
}

/* 跳转 */
.skip {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 95;
  padding: 0.7rem 1.2rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.skip:focus {
  top: 1rem;
}

/* 顶栏 */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--edge);
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  z-index: 80;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

body.menu-open .bar {
  background: var(--ink);
  color: var(--paper);
  border-bottom-color: var(--paper);
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
}

.mark-glyph {
  font-family: 'Caveat', 'Quicksand', cursive;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.mark-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

body.menu-open .mark-img {
  filter: invert(1);
}

.burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.burger:focus-visible,
.mark:focus-visible,
.veil-list a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}

/* 全屏菜单 */
.veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--bar-h) + 2rem) var(--edge) 2rem;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.veil.open {
  opacity: 1;
  visibility: visible;
}

.veil nav {
  width: 100%;
  max-width: 52rem;
}

.veil-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: m;
  text-align: center;
}

.veil-list li {
  counter-increment: m;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  transition-delay: calc(var(--i, 0) * 45ms);
}

.veil.open .veil-list li {
  opacity: 1;
  transform: none;
}

.veil-list a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.55rem 0.5rem;
  min-height: 48px;
  font-size: clamp(1.5rem, 5.5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.veil-list a::before {
  content: counter(m, decimal-leading-zero);
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.55;
  letter-spacing: 0.1em;
}

.veil-list a:hover {
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 3px;
}

/* 头图 */
main {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--bar-h) + 2.5rem) var(--edge) 3.5rem;
}

.hero-media-slot {
  min-width: 0;
}

.hero-media {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
  aspect-ratio: 4 / 5;
}

.hero-media.is-empty {
  background: var(--ink);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
}

.hero-text {
  text-align: center;
  min-width: 0;
}

.hero h1 {
  font-size: clamp(2.6rem, 9vw, 8.5rem);
  letter-spacing: -0.05em;
  line-height: 0.9;
  margin: 0 0 1.5rem;
  overflow-wrap: break-word;
}

.hero-desc {
  margin: 0 auto;
  max-width: 34ch;
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  line-height: 1.85;
  color: var(--ink);
}

/* 版面 */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1rem var(--edge) 6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18.5rem;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

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

.doc > div {
  padding: 4.5rem 0;
}

.doc > div:first-child {
  padding-top: 1rem;
}

.doc > div + div {
  border-top: 2px solid var(--ink);
}

.doc > div[id] {
  scroll-margin-top: calc(var(--bar-h) + 1.5rem);
}

.doc h2 {
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  margin-top: 0;
}

.doc h3 {
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  margin-top: 2em;
}

.doc h2 + p,
.doc h3 + p {
  font-size: 1.06rem;
}

.doc p {
  font-size: 1.04rem;
  line-height: 1.9;
}

.doc ul,
.doc ol {
  margin: 0 0 1.3em;
}

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

.doc li::marker {
  font-weight: 700;
}

.doc blockquote {
  margin: 2rem 0;
  padding: 1.4rem 1.6rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
}

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

.doc a {
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.doc strong {
  font-weight: 700;
}

small {
  display: inline-block;
  font-size: 1.4rem;
  line-height: 1.2;
  font-family: 'Caveat', 'Quicksand', cursive;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.6;
}

small + h2,
small + h3 {
  margin-top: 0.15em;
}

/* 侧栏 */
.side {
  position: sticky;
  top: calc(var(--bar-h) + 1.5rem);
  align-self: start;
  border-top: 2px solid var(--ink);
  padding-top: 1rem;
}

.side-h {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}

.side-list {
  list-style: none;
  margin: 0 0 1.6rem;
  padding: 0;
  counter-reset: s;
}

.side-list li {
  counter-increment: s;
}

.side-list a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 0;
  min-height: 44px;
  border-bottom: 1px solid var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.35;
}

.side-list a::before {
  content: counter(s, decimal-leading-zero);
  font-family: 'Caveat', cursive;
  font-size: 1.15rem;
  font-weight: 700;
  opacity: 0.5;
}

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

.side-list a:hover::before {
  opacity: 0.8;
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

.to-top:hover {
  background: var(--ink);
  color: var(--paper);
}

/* 页脚 */
.foot {
  background: var(--ink);
  color: var(--paper);
  padding: 5rem var(--edge) 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 3rem clamp(2rem, 6vw, 5rem);
}

.foot div {
  min-width: 0;
}

.foot-brand {
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.95;
  margin: 0 0 1rem;
  overflow-wrap: break-word;
}

.foot-desc {
  max-width: 42ch;
  font-size: 1rem;
  line-height: 1.85;
  opacity: 0.82;
}

.foot small {
  opacity: 0.6;
}

.foot-h {
  font-size: 1.3rem;
  margin-bottom: 0.9rem;
}

.foot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 1.5rem;
}

.foot-list li {
  break-inside: avoid;
}

.foot-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.15rem 0;
  font-size: 0.98rem;
  text-decoration: none;
}

.foot-list a:hover {
  text-decoration: underline;
  text-underline-offset: 0.24em;
}

.foot-c {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  padding-top: 1.6rem;
  text-align: center;
}

.copy {
  margin: 0 auto;
  font-size: 0.92rem;
  opacity: 0.72;
}

/* 动效 */
html.js .reveal {
  opacity: 0;
  transform: translateY(28px);
}

html.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 55ms);
}

/* 断点 */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: calc(var(--bar-h) + 2rem) var(--edge) 2.5rem;
    gap: 2.5rem;
  }

  .hero-text {
    order: -1;
  }

  .hero-media {
    aspect-ratio: 3 / 2;
  }

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

  .side {
    position: static;
    order: 2;
    margin-top: 1rem;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 3.5rem;
    gap: 2.5rem;
  }

  .foot-c {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .foot-list {
    columns: 1;
  }

  .doc > div {
    padding: 3.2rem 0;
  }

  .doc blockquote {
    border-radius: 22px;
    padding: 1.2rem 1.2rem;
  }
}

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

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .veil-list li,
  .veil {
    transition: none;
  }
}

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