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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --mute: #767676;
  --hair: #e3e3e3;
  --edge: clamp(1.15rem, 5vw, 6rem);
  --lift: clamp(2.5rem, 8vw, 7rem);
  --round: 10px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--ink);
}

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

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

.hero :focus-visible,
.cta:focus-visible {
  outline-color: var(--paper);
}

/* ---------- 顶部双行 ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  padding: 0.85rem var(--edge) 0.8rem;
}

.brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-decoration: none;
  color: var(--ink);
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.6rem 1.35rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.cta:hover {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.navrow {
  display: flex;
  align-items: center;
}

.pillmenu {
  width: 100%;
}

.pillmenu > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  background: var(--paper);
}

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

.pillmenu > summary::after {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.22s ease;
}

.pillmenu[open] > summary::after {
  transform: rotate(-135deg) translateY(-2px);
}

.pillmenu > menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.pillmenu > menu a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.45rem 1.05rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.pillmenu > menu a:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 大图首屏 ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 70vh;
  padding: var(--lift) var(--edge) clamp(3.5rem, 9vw, 6.5rem);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%);
}

.hero-num {
  position: absolute;
  top: -0.06em;
  right: var(--edge);
  font-size: clamp(7rem, 32vw, 26rem);
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: -0.07em;
  color: var(--paper);
  opacity: 0.14;
  pointer-events: none;
  user-select: none;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  filter: grayscale(1) contrast(1.08);
  opacity: 0.5;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 22ch;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.75rem, 11vw, 8rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

/* ---------- 主体 ---------- */

.shell {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 5rem);
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--lift) var(--edge) clamp(4rem, 10vw, 8rem);
}

.index {
  position: sticky;
  top: 11rem;
  border-left: 2px solid var(--ink);
  padding-left: 1.05rem;
}

.index small {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  color: var(--mute);
}

.index h2 {
  margin: 0.15rem 0 0.9rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.index menu {
  display: flex;
  flex-direction: column;
}

.index a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--hair);
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
}

.index a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.prose {
  min-width: 0;
  max-width: 68ch;
}

.prose > div {
  scroll-margin-top: 12rem;
  padding: clamp(2.5rem, 7vw, 5rem) 0;
}

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

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

.prose small {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--mute);
}

.prose h2 {
  margin: 0.35rem 0 1.3rem;
  max-width: 20ch;
  font-size: clamp(1.85rem, 4.6vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.prose h3 {
  margin: 2.2rem 0 0.9rem;
  max-width: 24ch;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

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

.prose ul,
.prose ol {
  margin: 0 0 1.4rem;
  padding-left: 1.25rem;
  max-width: 62ch;
}

.prose li {
  margin: 0.4rem 0;
}

.prose a {
  text-underline-offset: 0.24em;
}

.prose img {
  display: block;
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: var(--round);
  margin: 1.6rem 0;
}

.prose figure {
  margin: 1.8rem 0;
  border: 1px solid var(--ink);
  border-radius: var(--round);
  padding: 0.5rem;
}

.prose figure img {
  border: 0;
  margin: 0;
}

.prose blockquote {
  margin: 2rem 0;
  padding: 0.2rem 0 0.2rem 1.4rem;
  border-left: 4px solid var(--ink);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

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

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

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

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

footer {
  border-top: 1px solid var(--ink);
  padding: clamp(2.5rem, 7vw, 5rem) var(--edge) 1.8rem;
}

.footmark {
  margin: 0 0 clamp(1.8rem, 5vw, 3.5rem);
  font-size: clamp(2.9rem, 16vw, 12rem);
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: -0.06em;
  word-break: break-word;
}

.footcols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  border-top: 1px solid var(--hair);
  padding-top: 1.6rem;
}

.footcols dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--mute);
  margin-bottom: 0.6rem;
}

.footcols dd {
  margin: 0;
}

.footcols a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.3rem 0;
  font-size: 0.93rem;
  color: var(--ink);
  text-decoration: none;
}

.footcols a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.copyright {
  margin: clamp(1.8rem, 5vw, 3rem) 0 0;
  font-size: 0.85rem;
  color: var(--mute);
}

/* ---------- 入场动效 ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.62s ease, transform 0.62s cubic-bezier(0.2, 0.72, 0.2, 1);
  will-change: opacity, transform;
}

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

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

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

  .pillmenu > summary::after,
  .cta,
  .pillmenu > menu a {
    transition: none;
  }
}

/* ---------- 窄屏 ---------- */

@media (max-width: 899px) {
  .masthead {
    padding-bottom: 0.7rem;
  }

  .pillmenu > menu {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 0.3rem;
    scrollbar-width: none;
  }

  .pillmenu > menu::-webkit-scrollbar {
    display: none;
  }

  .pillmenu > menu li {
    flex: 0 0 auto;
  }

  .hero {
    min-height: 62vh;
    padding-bottom: clamp(3rem, 14vw, 4.5rem);
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.2rem;
  }

  .index {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--ink);
    padding-left: 0;
    padding-top: 0.85rem;
  }

  .index h2 {
    margin-bottom: 0.7rem;
  }

  .index menu {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.45rem;
    padding-bottom: 0.35rem;
    scrollbar-width: none;
  }

  .index menu::-webkit-scrollbar {
    display: none;
  }

  .index menu li {
    flex: 0 0 auto;
  }

  .index a {
    border: 1px solid var(--ink);
    border-radius: 999px;
    padding: 0.35rem 0.95rem;
    white-space: nowrap;
  }

  .prose > div {
    scroll-margin-top: 9rem;
  }

  .footcols {
    gap: 0.9rem;
  }
}

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