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

:root {
  --paper: #fafaf8;
  --ink: #1a1a1a;
  --grey: #4a4a4a;
  --line: rgba(26, 26, 26, .78);
  --soft: rgba(26, 26, 26, .16);
  --wash: rgba(255, 255, 255, .58);
  --hand: 'Caveat', 'Quicksand', ui-rounded, system-ui, sans-serif;
  --body: 'Quicksand', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --r: 28px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0 0 104px;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(26, 26, 26, .055) 1px, transparent 1.1px),
    radial-gradient(rgba(26, 26, 26, .035) 1px, transparent 1.1px),
    repeating-linear-gradient(102deg, rgba(74, 74, 74, .05) 0 1px, transparent 1px 7px);
  background-size: 5px 5px, 13px 13px, auto;
  background-position: 0 0, 4px 9px, 0 0;
  overflow-wrap: anywhere;
}

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

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

.sheet {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 34px);
}

/* ——— 角落品牌 ——— */
.corner-brand {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--hand);
  font-size: 26px;
  line-height: 1;
  background: var(--paper);
  border: 2.4px solid var(--ink);
  border-radius: 52% 46% 55% 45% / 45% 55% 46% 54%;
  transform: rotate(-7deg);
  box-shadow: 3px 4px 0 rgba(26, 26, 26, .16);
}

.corner-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.15);
}

/* ——— 底部固定条 ——— */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px clamp(10px, 3vw, 22px);
  background: rgba(250, 250, 248, .95);
  backdrop-filter: blur(9px) saturate(1.1);
  border-top: 2.5px solid var(--ink);
  box-shadow: 0 -7px 0 rgba(26, 26, 26, .06);
}

.dock-list {
  flex: 1 1 auto;
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.dock-list::-webkit-scrollbar { display: none; }

.dock-list li {
  flex: 0 0 auto;
  animation: pop .2s ease-out both;
  animation-delay: calc(var(--i, 0) * .028s);
}

.dock-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 11px;
  font-size: 16px;
  color: var(--grey);
  text-decoration: none;
  border-radius: 13px 15px 12px 16px;
  border-bottom: 2px dashed transparent;
}

.dock-list a:hover {
  color: var(--ink);
  background: rgba(26, 26, 26, .07);
  border-bottom-color: var(--ink);
}

.dock-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px 990px 999px 990px;
  transform: rotate(-1.6deg);
  box-shadow: 3px 3px 0 rgba(26, 26, 26, .22);
}

/* ——— 开篇 ——— */
.intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .52fr);
  align-items: center;
  gap: clamp(18px, 4vw, 44px);
  min-height: 70vh;
  padding: clamp(88px, 13vh, 132px) 0 clamp(38px, 6vh, 60px);
  border-bottom: 3px solid var(--ink);
  overflow: hidden;
}

.intro::before {
  content: '';
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 0;
  height: 88px;
  background: rgba(74, 74, 74, .1);
  clip-path: polygon(0 26%, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

.intro-copy {
  position: relative;
  z-index: 2;
  max-width: 30ch;
}

.intro-h1 {
  margin: 0 0 .3em;
  font-size: clamp(1.95rem, 5.6vw, 3.15rem);
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: .01em;
}

.intro-h1::after {
  content: '';
  display: block;
  width: 116px;
  height: 9px;
  margin-top: 12px;
  background:
    repeating-linear-gradient(-24deg, rgba(26, 26, 26, .82) 0 3px, transparent 3px 7px);
  border-radius: 4px;
  transform: rotate(-1.2deg);
}

.intro-desc {
  margin: 0;
  font-size: 17px;
  color: var(--grey);
  max-width: 40ch;
}

.intro-fig {
  position: relative;
  z-index: 2;
  margin: 0;
  min-height: 150px;
  display: grid;
  place-items: center;
  transform: rotate(-2.6deg);
}

.fig-scratch {
  position: absolute;
  top: -30px;
  right: -6px;
  z-index: 3;
  color: var(--grey);
  opacity: .55;
  transform: rotate(9deg);
  pointer-events: none;
}

.hero-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  border: 2.4px solid var(--ink);
  border-radius: 26px 32px 24px 34px / 32px 24px 34px 26px;
  filter: grayscale(1) contrast(1.08);
  box-shadow: 8px 9px 0 rgba(26, 26, 26, .16);
  background: #efeeea;
}

/* ——— 两栏正文区 ——— */
.grid {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: clamp(20px, 3.4vw, 40px);
  align-items: start;
  padding: clamp(30px, 5vw, 52px) 0 44px;
}

.rail {
  position: sticky;
  top: 22px;
  padding: 16px 16px 20px;
  background: var(--wash);
  backdrop-filter: blur(7px) saturate(1.06);
  border: 1.6px solid var(--ink);
  border-radius: 22px 26px 20px 28px / 26px 20px 28px 22px;
  box-shadow: 5px 6px 0 rgba(26, 26, 26, .12);
  transform: rotate(-1.1deg);
}

.rail-h2 {
  margin: 0 0 .1em;
  font-size: 20px;
  letter-spacing: .06em;
}

.rail-list {
  margin: 14px 0 0;
  padding: 0 0 0 1.05em;
  font-size: 16px;
}

.rail-list li { margin: 0; }

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 2px;
  color: var(--grey);
  text-decoration: none;
  border-bottom: 1.5px dashed var(--soft);
}

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

/* ——— 正文 ——— */
.prose {
  counter-reset: sec;
  min-width: 0;
}

.prose > div {
  position: relative;
  counter-increment: sec;
  margin: 0 0 28px;
  padding: 30px 26px 30px 62px;
  background: var(--wash);
  backdrop-filter: blur(7px) saturate(1.05);
  border: 1.7px solid var(--ink);
  border-radius: var(--r);
  box-shadow: 7px 8px 0 rgba(26, 26, 26, .13);
  transform: rotate(-.24deg);
  scroll-margin-top: 26px;
  animation: rise .26s ease-out both;
}

.prose > div:nth-child(even) { transform: rotate(.32deg); }
.prose > div:nth-child(1) { animation-delay: .03s; }
.prose > div:nth-child(2) { animation-delay: .06s; }
.prose > div:nth-child(3) { animation-delay: .09s; }
.prose > div:nth-child(4) { animation-delay: .12s; }
.prose > div:nth-child(5) { animation-delay: .15s; }
.prose > div:nth-child(6) { animation-delay: .18s; }
.prose > div:nth-child(7) { animation-delay: .21s; }

.prose > div::before {
  content: counter(sec, decimal-leading-zero);
  position: absolute;
  left: 15px;
  top: 26px;
  padding-right: 9px;
  font-family: var(--hand);
  font-size: 27px;
  line-height: 1;
  color: var(--grey);
  border-right: 2px dashed var(--soft);
}

.prose h2 {
  margin: 0 0 .55em;
  font-size: 1.32rem;
  line-height: 1.4;
  letter-spacing: .02em;
}

.prose h2::after {
  content: '';
  display: block;
  width: 72px;
  height: 6px;
  margin-top: 8px;
  background: repeating-linear-gradient(-20deg, rgba(26, 26, 26, .7) 0 3px, transparent 3px 6px);
  border-radius: 3px;
}

.prose h2 + p {
  margin: -.1em 0 1.1em;
  padding-left: 11px;
  color: var(--grey);
  font-size: 16px;
  border-left: 3px solid var(--soft);
}

.prose h3 {
  margin: 1.5em 0 .4em;
  font-size: 1.08rem;
  letter-spacing: .02em;
}

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

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.25em;
}

.prose li { margin: 0 0 .45em; }

.prose strong { box-shadow: inset 0 -.42em 0 rgba(26, 26, 26, .13); }

.prose a {
  text-decoration: none;
  border-bottom: 2px dashed var(--grey);
}

.prose a:hover { border-bottom-style: solid; }

.prose blockquote {
  margin: 0 0 1.1em;
  padding: 4px 0 4px 15px;
  color: var(--grey);
  border-left: 4px double var(--line);
}

.prose figure { margin: 0 0 1.1em; }

.prose img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  border-radius: 14px;
  filter: grayscale(1) contrast(1.05);
}

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

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin: 0 0 1.1em;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 8px 12px;
  border: 1.4px dashed var(--soft);
  text-align: left;
}

.prose th { background: rgba(26, 26, 26, .06); }

.prose hr {
  height: 0;
  margin: 1.6em 0;
  border: 0;
  border-top: 2px dashed var(--soft);
}

.prose code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 15px;
  padding: 1px 5px;
  background: rgba(26, 26, 26, .07);
  border-radius: 5px;
}

/* ——— 页脚 ——— */
.foot {
  margin-top: 34px;
  border-top: 3px solid var(--ink);
  background: rgba(250, 250, 248, .9);
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 26px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 34px) 34px;
}

.foot-brand a {
  font-family: var(--hand);
  font-size: clamp(2.1rem, 8vw, 3.5rem);
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: .02em;
  border-bottom: 3px dashed transparent;
}

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

.foot-nav ol {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 2px;
  color: var(--grey);
  text-decoration: none;
  border-bottom: 1.5px dashed var(--soft);
}

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

.foot-legal {
  font-size: 16px;
  color: var(--grey);
  font-family: var(--hand);
  letter-spacing: .06em;
}

/* ——— 动效 ——— */
@keyframes pop {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) rotate(-.6deg); }
  to { opacity: 1; }
}

/* ——— 窄屏 ——— */
@media (max-width: 800px) {
  body { font-size: 17px; padding-bottom: 108px; }

  .intro {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 84px;
    gap: 22px;
  }

  .intro-copy { max-width: 100%; }

  .intro-fig { max-width: 230px; margin: 0 auto; transform: rotate(-2deg); }

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

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

  .rail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding-left: 0;
    list-style: none;
    font-size: 16px;
  }

  .rail-list li { flex: 0 0 auto; }

  .rail-list a {
    padding: 6px 13px;
    border: 1.5px dashed var(--soft);
    border-radius: 999px;
  }

  .prose > div {
    padding: 22px 18px 24px;
    transform: none;
  }

  .prose > div:nth-child(even) { transform: none; }

  .prose > div::before {
    position: static;
    display: block;
    margin-bottom: 8px;
    padding: 0;
    border-right: 0;
  }

  .prose > div { scroll-margin-top: 16px; }

  .foot-row { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-delay: 0s !important;
    transition-duration: .001s !important;
  }
}

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