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

:root {
  --paper: #fafaf8;
  --ink: #1a1a1a;
  --grey: #4a4a4a;
  --wash: #f0eee8;
  --rule: rgba(26, 26, 26, 0.22);
}

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

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
}

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

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

a:hover {
  border-bottom-color: var(--ink);
}

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

img {
  display: block;
}

/* 顶栏 */
.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.brandrow {
  padding: 12px 20px 4px;
}

.brand {
  display: inline-block;
  padding: 4px 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
  border-bottom: 0;
}

.brand:hover {
  transform: rotate(-0.6deg);
}

.navrow {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 0 20px 10px;
}

.navwrap {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.navwrap::-webkit-scrollbar {
  display: none;
}

.pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  padding: 2px 1px;
  list-style: none;
}

.pill {
  display: block;
  padding: 10px 14px;
  font-size: 16px;
  line-height: 1.3;
  white-space: nowrap;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}

.pill:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.cta {
  flex: 0 0 auto;
  padding: 10px 18px;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 500;
  white-space: nowrap;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
}

.cta:hover {
  background: var(--grey);
}

/* 首屏 */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 560px;
  padding: 34px 20px 92px;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
}

.hero-dots {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.2;
  background-image: radial-gradient(var(--ink) 1.1px, transparent 1.1px);
  background-size: 16px 16px;
}

.hero-fig {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 74px), 0 100%);
}

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

.hero-fig::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(185deg, rgba(250, 250, 248, 0.95) 8%, rgba(250, 250, 248, 0.66) 58%, rgba(250, 250, 248, 0.9) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin-left: auto;
  text-align: right;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 7.4vw, 4.6rem);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.hero-desc {
  margin: 0;
  max-width: 34ch;
  margin-left: auto;
  font-size: 17px;
  color: var(--grey);
}

/* 主体 */
.wrap {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 46px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.side {
  position: sticky;
  top: 136px;
  align-self: start;
  transform: rotate(-0.4deg);
}

.side small {
  display: block;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--grey);
}

.side h2 {
  margin: 2px 0 14px;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.toc {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--ink);
}

.toc li {
  border-bottom: 1px solid var(--rule);
}

.toc a {
  display: block;
  padding: 10px 2px;
  font-size: 16px;
  border-bottom: 0;
}

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

.shell {
  min-width: 0;
}

.prose {
  max-width: 760px;
}

.prose section[id] {
  scroll-margin-top: 152px;
  margin-top: 46px;
  padding-top: 4px;
  border-top: 2px solid var(--ink);
}

.prose section[id]:first-child {
  margin-top: 0;
}

.prose small {
  display: block;
  margin-top: 16px;
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--grey);
}

.prose h2 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 3.4vw, 2.05rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.prose h3 {
  margin: 26px 0 10px;
  font-size: 1.22rem;
  line-height: 1.35;
}

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

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li {
  margin: 0 0 8px;
}

.prose a {
  border-bottom: 1.5px solid var(--grey);
}

.prose strong {
  font-weight: 700;
}

.prose time {
  display: inline-block;
  font-size: 15px;
  color: var(--grey);
}

.prose blockquote {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: var(--wash);
  transform: rotate(-0.3deg);
}

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

.prose img {
  max-width: 100%;
  height: auto;
  filter: grayscale(0.2) contrast(1.05);
}

.prose figcaption {
  margin-top: 6px;
  font-size: 15px;
  color: var(--grey);
}

.prose table {
  width: 100%;
  margin: 0 0 20px;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

/* 页脚 */
.foot {
  padding: 40px 20px 22px;
  background: var(--wash);
  border-top: 2px solid var(--ink);
}

.foot-cols {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 26px;
  max-width: 1180px;
  margin: 0 auto;
  padding-bottom: 26px;
  border-bottom: 1px dashed rgba(26, 26, 26, 0.4);
}

.foot-cols address {
  font-style: normal;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.foot-cols address a {
  border-bottom: 0;
}

.foot-nav {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 18px;
}

.foot-nav a {
  display: inline-block;
  padding: 7px 0;
  font-size: 16px;
  border-bottom: 0;
}

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

.foot-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 14px auto 0;
}

.copy {
  margin: 0;
  font-size: 15px;
  color: var(--grey);
}

.foot-mini {
  display: flex;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-mini a {
  display: inline-block;
  padding: 8px 0;
  font-size: 15px;
}

/* 动效 */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px) rotate(-0.4deg);
}

.js [data-reveal].in {
  opacity: 1;
  transform: none;
  transition: opacity 0.42s steps(5, end), transform 0.42s steps(5, end);
}

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

  .js [data-reveal],
  .js [data-reveal].in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 860px) {
  .wrap {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px 18px 48px;
  }

  .side {
    position: static;
    transform: none;
  }

  .toc {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
    border-top: 2px solid var(--ink);
  }

  .toc li {
    border-bottom: 1px solid var(--rule);
  }

  .prose section[id] {
    scroll-margin-top: 124px;
  }

  .foot-cols {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero {
    padding-bottom: 76px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 17px;
  }

  .hero-desc {
    font-size: 16px;
  }

  .foot-nav {
    columns: 1;
  }

  .hero-fig {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 48px), 0 100%);
  }
}

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