:root {
  --paper: #fafaf8;
  --gray: #4a4a4a;
  --ink: #1a1a1a;
  --rough: 10px 5px 14px 6px / 6px 14px 5px 10px;
  --rough-2: 6px 12px 5px 13px / 12px 5px 13px 6px;
}

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

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

body {
  margin: 0;
  padding-bottom: 92px;
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(26, 26, 26, 0.035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, rgba(26, 26, 26, 0.022) 0 1px, transparent 1px 7px);
  color: var(--ink);
  font-family: 'Public Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.68;
  overflow-x: hidden;
  letter-spacing: 0.006em;
}

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

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid rgba(26, 26, 26, 0.32);
}

a:hover {
  background: rgba(26, 26, 26, 0.07);
}

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

p {
  max-width: 66ch;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 120;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border: 0;
}

.skip:focus {
  left: 8px;
  top: 8px;
}

/* ---------- 全屏遮罩菜单 ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.4rem 1.2rem 6.5rem;
  background: rgba(250, 250, 248, 0.96);
  -webkit-backdrop-filter: blur(5px) contrast(1.04);
  backdrop-filter: blur(5px) contrast(1.04);
  opacity: 0;
  visibility: hidden;
  transform: translateY(2.5%) rotate(-0.5deg);
  transition: opacity 0.16s steps(2, end), transform 0.16s steps(2, end);
}

.drawer.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.drawer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.1rem;
  max-width: 640px;
  margin-inline: auto;
  width: 100%;
}

.drawer-nav a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0.5rem 0.4rem;
  font-family: 'Lexend Mega', 'Public Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(1.25rem, 5.6vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  border-bottom: 2px dashed rgba(26, 26, 26, 0.3);
}

.drawer-nav li:nth-child(odd) a {
  transform: rotate(-0.5deg);
}

.drawer-nav li:nth-child(even) a {
  transform: rotate(0.4deg);
}

.drawer-nav a:active {
  background: rgba(26, 26, 26, 0.1);
}

.drawer-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  font-family: 'Lexend Mega', sans-serif;
  font-size: 0.92rem;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--rough);
  cursor: pointer;
}

/* ---------- 主区域 ---------- */
.wrap {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 0.95rem 2.4rem;
}

.paper {
  min-width: 0;
}

/* ---------- 首屏拼贴 ---------- */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem 0.15rem 1.6rem;
  background-image: radial-gradient(rgba(26, 26, 26, 0.3) 1px, transparent 1.2px);
  background-size: 15px 15px;
  border-bottom: 3px solid var(--ink);
}

.hero-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.colla {
  position: absolute;
  margin: 0;
  overflow: hidden;
  border: 3px solid var(--ink);
  box-shadow: 9px 9px 0 rgba(26, 26, 26, 0.14);
  background: repeating-linear-gradient(45deg, rgba(26, 26, 26, 0.1) 0 6px, transparent 6px 13px);
  filter: grayscale(0.12) contrast(1.05);
}

.colla-a {
  top: 4%;
  left: -2%;
  width: 47%;
  max-width: 300px;
  aspect-ratio: 4 / 3;
  transform: rotate(-4.2deg);
}

.colla-b {
  top: 25%;
  right: 1%;
  width: 36%;
  max-width: 215px;
  aspect-ratio: 3 / 4;
  transform: rotate(3.6deg);
}

.colla-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy {
  position: relative;
  z-index: 3;
  align-self: flex-end;
  text-align: right;
  max-width: 100%;
}

.hero-h1 {
  display: inline-block;
  margin: 0;
  padding: 0.3em 0.34em 0.36em;
  font-family: 'Lexend Mega', 'Public Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(1.95rem, 9.6vw, 4.6rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
  text-align: right;
  background: rgba(250, 250, 248, 0.88);
  border: 3px solid var(--ink);
  border-radius: var(--rough);
  box-shadow: 7px 7px 0 rgba(26, 26, 26, 0.13);
  transform: rotate(-0.8deg);
}

/* ---------- 正文区块（page.content 的 section） ---------- */
.paper > section {
  padding: 2.1rem 0.1rem;
  border-bottom: 2px dashed rgba(26, 26, 26, 0.38);
  scroll-margin-top: 14px;
  scroll-margin-bottom: 108px;
}

.paper > section:first-of-type {
  padding-top: 2.4rem;
}

.paper > section:last-child {
  border-bottom: 0;
}

.paper h2,
.paper h3 {
  font-family: 'Lexend Mega', 'Public Sans', sans-serif;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 0 0 0.85em;
  max-width: 24ch;
}

.paper h2 {
  font-size: clamp(1.32rem, 5.4vw, 1.95rem);
  padding-bottom: 0.24em;
  border-bottom: 3px solid var(--ink);
  display: inline-block;
}

.paper h2 > span {
  background: linear-gradient(transparent 64%, rgba(26, 26, 26, 0.19) 64%);
  padding: 0 0.06em;
}

.paper h3 {
  font-size: 1.12rem;
  display: inline-block;
  transform: rotate(-0.4deg);
}

.paper h3 > span {
  background: linear-gradient(transparent 66%, rgba(26, 26, 26, 0.14) 66%);
}

.paper p {
  margin: 0 0 1em;
}

.paper ul,
.paper ol {
  padding-left: 1.35rem;
}

.paper li {
  margin-bottom: 0.4em;
}

.paper blockquote {
  margin: 1.4rem 0;
  padding: 0.9rem 1rem;
  border-left: 5px solid var(--ink);
  background: rgba(26, 26, 26, 0.045);
  border-radius: 0 var(--rough-2) var(--rough-2) 0;
  transform: rotate(-0.25deg);
}

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

.paper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}

.paper th,
.paper td {
  border: 2px solid rgba(26, 26, 26, 0.5);
  padding: 0.5rem 0.6rem;
  text-align: left;
}

.paper code {
  font-size: 0.94em;
  background: rgba(26, 26, 26, 0.07);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

.paper img {
  border: 3px solid var(--ink);
  border-radius: var(--rough);
}

/* ---------- 右侧栏 ---------- */
.rail {
  position: relative;
  z-index: 2;
  padding: 1rem 0.9rem 1.15rem;
  background: rgba(255, 255, 255, 0.58);
  -webkit-backdrop-filter: blur(9px) saturate(1.15);
  backdrop-filter: blur(9px) saturate(1.15);
  border: 2px solid rgba(26, 26, 26, 0.55);
  border-radius: 10px;
  box-shadow: 6px 6px 0 rgba(26, 26, 26, 0.09);
  transform: rotate(0.45deg);
}

.rail-h {
  margin: 0 0 0.55rem;
  font-family: 'Lexend Mega', sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.rail-h > span {
  border-bottom: 3px solid var(--ink);
  padding-bottom: 0.15em;
}

.rail-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.05rem;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0.4rem 0.25rem;
  font-size: 0.98rem;
  border-bottom: 1px dashed rgba(26, 26, 26, 0.26);
}

.rail-nav li:last-child a {
  border-bottom: 0;
}

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 2;
  margin-top: 1.6rem;
  padding: 2rem 0.95rem 2.4rem;
  border-top: 3px solid var(--ink);
  background: rgba(26, 26, 26, 0.035);
}

.foot-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.7rem;
  max-width: 1180px;
  margin: 0 auto;
}

.foot dl {
  margin: 0;
  min-width: 0;
}

.foot dt {
  font-family: 'Lexend Mega', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--gray);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid rgba(26, 26, 26, 0.4);
  margin-bottom: 0.55rem;
}

.foot dd {
  margin: 0;
  font-size: 0.95rem;
  word-break: break-word;
}

.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.1rem 0;
}

.copy {
  max-width: 1180px;
  margin: 2.2rem auto 0;
  padding-top: 1.1rem;
  border-top: 2px dashed rgba(26, 26, 26, 0.3);
  text-align: center;
  font-size: 0.9rem;
  color: var(--gray);
  font-family: 'Lexend Mega', sans-serif;
}

/* ---------- 底部固定条 ---------- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  background: rgba(250, 250, 248, 0.74);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border-top: 2px solid var(--ink);
  box-shadow: 0 -5px 0 rgba(26, 26, 26, 0.07);
}

.dock-brand {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.2rem 0.15rem;
  font-family: 'Lexend Mega', sans-serif;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  border-bottom: 0;
  transform: rotate(-0.7deg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-contact,
.dock-burger {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0.85rem;
  font-family: 'Lexend Mega', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: var(--rough);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  border-bottom-width: 2px;
}

.dock-burger {
  background: var(--ink);
  color: var(--paper);
  transform: rotate(0.8deg);
}

.dock-burger[aria-expanded='true'] {
  background: var(--gray);
}

/* ---------- 微交互 ---------- */
.colla {
  transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end);
}

a:hover > .colla,
.colla:hover {
  transform: rotate(-3deg) translate(2px, -2px);
  box-shadow: 12px 12px 0 rgba(26, 26, 26, 0.18);
}

.drawer.is-open .drawer-nav li {
  animation: rise 0.24s steps(3, end) both;
}

.drawer.is-open .drawer-nav li:nth-child(1) { animation-delay: 0.01s; }
.drawer.is-open .drawer-nav li:nth-child(2) { animation-delay: 0.04s; }
.drawer.is-open .drawer-nav li:nth-child(3) { animation-delay: 0.07s; }
.drawer.is-open .drawer-nav li:nth-child(4) { animation-delay: 0.1s; }
.drawer.is-open .drawer-nav li:nth-child(5) { animation-delay: 0.13s; }
.drawer.is-open .drawer-nav li:nth-child(6) { animation-delay: 0.16s; }
.drawer.is-open .drawer-nav li:nth-child(7) { animation-delay: 0.19s; }

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

/* ---------- 断点 ---------- */
@media (min-width: 640px) {
  .wrap {
    padding-inline: 1.4rem;
  }

  .foot-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }

  .hero {
    min-height: 72vh;
  }
}

@media (min-width: 900px) {
  body {
    font-size: 18px;
  }

  .wrap {
    grid-template-columns: minmax(0, 1fr) 246px;
    gap: 2.6rem;
    align-items: start;
    padding-inline: 1.8rem;
    padding-top: 1.4rem;
  }

  .rail {
    position: sticky;
    top: 1.3rem;
  }

  .hero-h1 {
    font-size: clamp(2.6rem, 6.2vw, 4.8rem);
  }

  .colla-a {
    left: 1%;
    width: 42%;
  }

  .colla-b {
    right: 4%;
    top: 20%;
  }

  .dock {
    padding-inline: 1.8rem;
  }

  .dock-brand {
    font-size: 1.1rem;
  }
}

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

  .drawer,
  .colla,
  .colla:hover,
  .drawer.is-open .drawer-nav li {
    transition: none;
    animation: none;
  }
}

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