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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --pad: clamp(1.25rem, 5vw, 5rem);
  --nav-h: 74px;
  --display: 'Syne', 'Manrope', system-ui, -apple-system, 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

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

body {
  margin: 0;
  padding-bottom: calc(var(--nav-h) + 16px);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

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

/* 顶栏 */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--pad);
  border-bottom: 3px solid var(--ink);
  background: var(--paper);
}

.mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  letter-spacing: -0.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0;
  text-transform: uppercase;
}

.mark:hover {
  letter-spacing: 0.02em;
}

/* 底部固定导航 */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--ink);
  color: var(--paper);
  border-top: 3px solid var(--ink);
}

.nav p {
  margin: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

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

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 0.7rem;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--paper);
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.on {
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

/* 头图 */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: 100svh;
  padding: clamp(7rem, 26vh, 15rem) var(--pad) clamp(4.5rem, 16vh, 8rem);
  background: var(--ink);
  color: var(--paper);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.15);
  opacity: 0.42;
  z-index: 0;
}

.hero-text {
  position: relative;
  z-index: 1;
  max-width: 18ch;
}

.hero-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  word-break: break-word;
}

.hero-desc {
  margin: clamp(1.25rem, 4vh, 2.5rem) 0 0;
  max-width: 34ch;
  font-size: 1.0625rem;
  line-height: 1.6;
  opacity: 0.85;
}

/* 主体 */
.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21rem;
  align-items: start;
  gap: clamp(2rem, 5vw, 4rem);
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) var(--pad) clamp(3rem, 9vw, 6rem);
}

.prose {
  max-width: 64ch;
  counter-reset: sec;
}

.prose > section {
  counter-increment: sec;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  border-top: 2px solid var(--ink);
  scroll-margin-top: 1.5rem;
}

.prose > section:first-child {
  padding-top: 0;
  border-top: 0;
}

.prose h2 {
  margin: 0 0 1.1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.85rem, 4.6vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  display: block;
}

.prose h2::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  margin-bottom: 0.85rem;
  opacity: 0.55;
}

.prose h2 > span {
  display: block;
}

.prose h3 {
  margin: 2.25rem 0 0.75rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.prose h3 > span {
  display: block;
}

.prose p {
  margin: 0 0 1.15rem;
  max-width: 62ch;
}

.prose ul,
.prose ol {
  margin: 0 0 1.35rem;
  padding-left: 1.35rem;
}

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

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

.prose a {
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 6px solid var(--ink);
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.prose blockquote p {
  margin: 0 0 0.6rem;
}

.prose img {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.75rem 0;
  border: 2px solid var(--ink);
}

.prose hr {
  border: 0;
  border-top: 2px solid var(--ink);
  margin: 2.5rem 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 1rem;
}

.prose th,
.prose td {
  border: 2px solid var(--ink);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

/* 侧栏 */
.side {
  position: sticky;
  top: 1.5rem;
  padding-left: clamp(1rem, 2vw, 1.5rem);
  border-left: 2px solid var(--ink);
}

.side-title {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.18em;
}

.side-title > span {
  display: block;
}

.side-list {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.side-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  transition: padding-left 0.18s ease, font-weight 0.18s ease;
}

.side-list a:hover,
.side-list a.on {
  font-weight: 700;
  padding-left: 0.45rem;
}

/* 页脚 */
.foot {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(3rem, 8vw, 5.5rem) var(--pad) 1.75rem;
}

.foot-brand {
  margin: 0 0 clamp(2rem, 6vw, 3rem);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 13vw, 10rem);
  line-height: 0.84;
  letter-spacing: -0.06em;
  word-break: break-word;
  text-transform: uppercase;
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  border-top: 2px solid var(--paper);
  padding-top: 2rem;
}

.foot dl {
  margin: 0;
}

.foot dt {
  margin-bottom: 0.6rem;
  font-size: 1rem;
  letter-spacing: 0.14em;
  opacity: 0.6;
}

.foot dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

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

.foot-base {
  margin: clamp(2rem, 6vw, 3rem) 0 0;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(255, 255, 255, 0.28);
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

/* 滚动揭示 */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

/* 断点 */
@media (max-width: 960px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 3rem);
  }

  .prose {
    max-width: none;
  }

  .side {
    position: static;
    padding-left: 0;
    padding-top: 1.75rem;
    border-left: 0;
    border-top: 2px solid var(--ink);
  }

  .side-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 1.25rem;
  }

  .side-list a {
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  }

  .hero {
    clip-path: polygon(0 0, 100% 0, 100% 93%, 0 100%);
  }
}

@media (max-width: 700px) {
  .foot-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .hero-text {
    max-width: none;
  }
}

@media (max-width: 400px) {
  .nav a {
    padding: 0.8rem 0.6rem;
    font-size: 1rem;
  }

  .top {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
}

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

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

  .nav a,
  .side-list a,
  .prose a {
    transition: none;
  }
}

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