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

:root {
  --white: #ffffff;
  --mist: #f5f5f5;
  --mist-deep: #ededed;
  --ink: #1f1f1f;
  --ink-soft: #5c5c5c;
  --line: #e4e4e4;
  --radius: 10px;
  --radius-lg: 18px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 20px 44px rgba(0, 0, 0, 0.045);
  --shadow-soft: 0 2px 4px rgba(0, 0, 0, 0.04);
  --font-body: 'DM Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --font-head: 'Space Grotesk', 'DM Sans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

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

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

/* ---------- 页头 ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.brandline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px var(--gutter) 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink);
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.cta:hover {
  transform: translateY(-1px) scale(1.02);
  opacity: 0.9;
}

.anchors {
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 0 var(--gutter);
}

.anchors p {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 6px 0;
}

.anchors a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.anchors a:hover,
.anchors a.is-on {
  background: var(--mist);
  color: var(--ink);
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: clamp(30px, 6vw, 56px) var(--gutter) clamp(34px, 6vw, 60px);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.hero-glyph {
  position: absolute;
  right: -0.06em;
  bottom: -0.26em;
  z-index: 0;
  font-family: var(--font-head);
  font-size: clamp(180px, 36vw, 360px);
  font-weight: 700;
  line-height: 0.8;
  color: var(--mist-deep);
  pointer-events: none;
  user-select: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
  text-align: center;
  margin: 0 auto;
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-family: var(--font-head);
  font-size: clamp(32px, 7vw, 62px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.015em;
}

.lede {
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.7;
}

.hero-art {
  position: relative;
  z-index: 1;
  margin: 0;
  min-width: 0;
  align-self: stretch;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

@media (min-width: 900px) {
  .hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: clamp(28px, 5vw, 64px);
    min-height: 70vh;
    padding-block: clamp(48px, 7vw, 96px);
  }

  .hero-copy {
    text-align: left;
    margin: 0;
    flex: 1 1 auto;
  }

  .hero-art {
    flex: 0 1 42%;
  }
}

/* ---------- 主体外壳 ---------- */

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 56px) var(--gutter) clamp(34px, 5vw, 64px);
}

@media (min-width: 1000px) {
  .shell {
    grid-template-columns: minmax(0, 1fr) 288px;
    align-items: start;
    gap: 24px;
  }
}

/* ---------- 正文卡片 ---------- */

.prose {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: dense;
  gap: 16px;
  min-width: 0;
}

@media (min-width: 760px) {
  .prose {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.prose > div {
  grid-column: span 1;
  min-width: 0;
  background: var(--white);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 34px);
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 150px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (min-width: 760px) {
  .prose > div {
    grid-column: span 2;
  }

  .prose > div:nth-child(4n + 1) {
    grid-column: span 4;
  }

  .prose > div:nth-child(4n + 3) {
    grid-column: span 2;
  }

  .prose > div:hover {
    transform: scale(1.012);
    box-shadow: var(--shadow);
  }
}

.prose > div > h2,
.prose > div > h3 {
  margin-top: 0;
  font-family: var(--font-head);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.prose > div > h2 {
  font-size: clamp(22px, 2.4vw, 28px);
}

.prose > div > h3 {
  font-size: 20px;
}

.prose p {
  margin: 0 0 14px;
}

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

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 1.35em;
}

.prose li {
  margin-bottom: 8px;
}

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

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

.prose blockquote {
  margin: 0 0 16px;
  padding: 14px 18px;
  background: var(--mist);
  border-left: 3px solid var(--ink);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-soft);
}

.prose img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 0 0 16px;
}

.prose figure {
  margin: 0 0 16px;
}

.prose figcaption {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 16px;
}

.prose hr {
  margin: 18px 0;
}

/* ---------- 右侧目录 ---------- */

.rail {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

@media (min-width: 1000px) {
  .rail {
    position: sticky;
    top: 140px;
  }
}

.rail-h {
  margin: 0;
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.rail hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 12px 0 10px;
}

.rail-list {
  display: grid;
  gap: 2px;
  margin: 0;
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 16px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.rail-list a:hover,
.rail-list a.is-on {
  background: var(--mist);
  color: var(--ink);
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 22px;
  padding: 20px var(--gutter);
  background: var(--white);
  border-top: 1px solid var(--line);
}

.foot-brand a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.foot-nav {
  min-width: 0;
}

.foot-nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 16px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.foot-nav a:hover {
  background: var(--mist);
  color: var(--ink);
}

.foot-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
}

@media (max-width: 700px) {
  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .foot-copy {
    padding-bottom: 8px;
  }
}

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

.js .prose > div {
  opacity: 0;
  transform: translateY(14px);
}

.js .prose > div.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

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

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

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