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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --edge: 2px solid #000000;
}

*,
*::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: "Space Grotesk", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow-x: clip;
}

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

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

p {
  margin: 0 0 1rem;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

::selection {
  background: #000000;
  color: #ffffff;
}

:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 3px;
}

/* 顶栏 */
.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(10px);
  border-bottom: var(--edge);
}

.nav {
  flex: 1 1 0;
  min-width: 0;
}

.nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.nav-r p {
  justify-content: flex-end;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.1;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav a:hover,
.nav a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-1px);
}

.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.55rem 0.3rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

/* 首屏 */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  align-items: center;
  min-height: 45vh;
  padding: clamp(1.3rem, 4vw, 2.8rem) clamp(1rem, 4vw, 2.5rem) clamp(2.4rem, 6vw, 4rem);
  border-bottom: var(--edge);
  overflow: hidden;
}

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

.hero h1 {
  font-size: clamp(2rem, 7.6vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
  margin: 0;
}

.hero-sub {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  margin: 0.9rem 0 0.3rem;
}

.hero-copy .subtitle {
  margin: 0 0 0 auto;
  max-width: 36ch;
  font-size: 0.95rem;
  line-height: 1.65;
  opacity: 0.72;
}

.hero-art {
  position: relative;
  min-height: clamp(170px, 34vh, 300px);
  margin-bottom: 0.6rem;
}

.hero-art figure {
  margin: 0;
  position: absolute;
  overflow: hidden;
  border: var(--edge);
  border-radius: 18px;
  background: #f4f4f4;
  box-shadow: 8px 8px 0 var(--ink);
}

.hero-art figure:empty {
  display: none;
}

.a1 {
  width: 60%;
  aspect-ratio: 4 / 5;
  top: 0;
  left: 0;
  z-index: 1;
}

.a2 {
  width: 50%;
  aspect-ratio: 4 / 3;
  right: 2%;
  bottom: -10%;
  z-index: 2;
  box-shadow: -8px 8px 0 var(--ink);
}

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

/* 主体 */
main {
  display: block;
}

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: clamp(1.4rem, 3vw, 2.6rem);
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(1.6rem, 4vw, 3.2rem) clamp(1rem, 4vw, 2.5rem) clamp(2.4rem, 6vw, 5rem);
}

main [id] {
  scroll-margin-top: 6.5rem;
}

.content {
  min-width: 0;
}

.prose {
  max-width: 72ch;
}

.prose > section {
  padding-block: clamp(1.8rem, 5vw, 3.4rem);
  border-top: var(--edge);
}

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

.prose > section:last-child {
  padding-bottom: 0;
}

.prose h2 {
  font-size: clamp(1.55rem, 3.4vw, 2.4rem);
  letter-spacing: -0.045em;
  margin: 0 0 0.7rem;
}

.prose h3 {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  margin: 1.6rem 0 0.5rem;
}

.prose p,
.prose li {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.prose p {
  margin: 0 0 1.05rem;
}

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

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

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

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

.prose img {
  border: var(--edge);
  border-radius: 18px;
  margin: 1rem 0;
}

.prose blockquote {
  margin: 1.4rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 4px solid var(--ink);
  font-size: 1.1rem;
}

.prose blockquote p {
  margin-bottom: 0.4rem;
}

.prose hr {
  border: 0;
  border-top: var(--edge);
  margin: 2rem 0;
}

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

.prose th,
.prose td {
  border-bottom: 1.5px solid var(--ink);
  padding: 0.5rem;
  text-align: left;
}

/* 侧栏 */
.side {
  align-self: start;
  position: sticky;
  top: 5.4rem;
  padding: 1.05rem 0.95rem;
  border: var(--edge);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.9);
}

.side-head {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3em;
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.1rem;
}

.toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.2rem 0.45rem;
  font-size: 0.86rem;
  text-decoration: none;
  border-radius: 9px;
  transition: background 0.15s ease, color 0.15s ease;
}

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

/* 页脚 */
.foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.3rem 1rem;
  align-items: start;
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(1.8rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem) 1.8rem;
  border-top: 3px solid var(--ink);
}

.foot-cta {
  grid-column: 1 / -1;
  margin: 0 0 0.8rem;
}

.foot-cta a {
  display: inline-block;
  font-size: clamp(2rem, 7vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
  text-decoration: none;
  border-bottom: 6px solid var(--ink);
}

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

.foot-brand {
  grid-column: 1;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.foot-nav {
  grid-column: 2 / 4;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin: 0;
  font-size: 0.86rem;
}

.foot-nav a,
.foot-top a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
  border-bottom: 1.5px solid var(--ink);
}

.foot-copy {
  grid-column: 1;
  justify-self: start;
  align-self: center;
  font-size: 0.78rem;
  opacity: 0.68;
}

.foot-top {
  grid-column: 3;
  justify-self: end;
  font-size: 0.78rem;
}

/* 动效 */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* 窄屏 */
@media (max-width: 820px) {
  body {
    font-size: 16px;
  }

  .bar {
    position: static;
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand {
    order: -1;
    width: 100%;
    justify-content: center;
    font-size: 1.1rem;
  }

  .nav {
    flex: 1 1 100%;
  }

  .nav p {
    justify-content: center;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .hero-copy {
    order: -1;
  }

  .hero-art {
    min-height: 190px;
    margin-top: 1.1rem;
  }

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

  .side {
    position: static;
    order: 2;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot-brand,
  .foot-nav,
  .foot-copy,
  .foot-top {
    grid-column: 1;
  }

  .foot-top {
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .nav a {
    font-size: 0.78rem;
    padding: 0.4rem 0.7rem;
  }

  .prose > section {
    padding-block: 1.7rem;
  }
}

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