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

:root {
  --paper: #fafaf8;
  --mid: #4a4a4a;
  --ink: #1a1a1a;
  --soft: rgba(26, 26, 26, 0.07);
  --edge: rgba(26, 26, 26, 0.16);
  --r: 10px;
  --hand: Fredoka, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --body: Nunito, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

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

body {
  margin: 0;
  padding: 22px 18px 118px;
  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, 0.08) 1px, transparent 1px);
  background-size: 17px 17px;
  overflow-x: hidden;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
}

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

/* ---------- 底部固定条 ---------- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  background: rgba(250, 250, 248, 0.97);
  border-top: 2px dashed rgba(26, 26, 26, 0.35);
  box-shadow: 0 -3px 0 rgba(26, 26, 26, 0.05);
}

.dock-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 5px 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

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

.row-r {
  justify-content: flex-end;
}

.row a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 8px;
  font-size: 16px;
  line-height: 1.2;
  color: var(--mid);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
  transition: color 0.12s steps(2), background-color 0.12s steps(2);
}

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

.dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  display: inline-block;
  transform: rotate(9deg);
}

.row-l a:nth-child(2) .dot {
  border-radius: 50%;
  transform: rotate(0);
}

.row-l a:nth-child(3) .dot {
  border-radius: 2px 9px 2px 9px;
}

.row-r a:nth-child(1) .dot {
  background: currentColor;
  border-radius: 50%;
}

.row-r a:nth-child(2) .dot {
  border-style: dotted;
  border-width: 3px;
}

.row-r a:nth-child(3) .dot {
  transform: rotate(-14deg) scaleX(1.3);
}

.row-r a:nth-child(4) .dot {
  border-radius: 50% 2px 50% 2px;
}

.dock-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 4px 10px;
  font-family: var(--hand);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: 4px 12px 4px 12px;
  background: #fff;
  transform: rotate(-1deg);
}

.dock-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* ---------- 头图区 ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 22px;
  align-items: center;
  min-height: 45vh;
  padding: 8px 0 22px;
  border-bottom: 3px solid var(--ink);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(26, 26, 26, 0.16) 1.2px, transparent 1.2px);
  background-size: 10px 10px;
  -webkit-mask-image: linear-gradient(95deg, #000 0%, rgba(0, 0, 0, 0.35) 55%, transparent 88%);
  mask-image: linear-gradient(95deg, #000 0%, rgba(0, 0, 0, 0.35) 55%, transparent 88%);
}

.hero-l {
  position: relative;
  z-index: 1;
}

.hero-h {
  margin: 0 0 18px;
  font-family: var(--hand);
  font-size: clamp(30px, 5.2vw, 52px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0.5px;
  transform: rotate(-1.2deg);
  background: linear-gradient(transparent 74%, rgba(26, 26, 26, 0.14) 74%);
  padding-bottom: 2px;
}

.hero-f {
  position: relative;
  z-index: 1;
  margin: 0;
}

.hero-f img,
.hero-i {
  display: block;
  width: 100%;
  height: auto;
  max-height: 42vh;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  transform: rotate(1.5deg);
  box-shadow: 7px 7px 0 rgba(26, 26, 26, 0.09);
  filter: grayscale(0.18) contrast(1.05);
  background: #fff;
}

.find {
  display: flex;
  gap: 8px;
  max-width: 340px;
}

.q {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  font-family: var(--body);
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px 4px 12px 4px;
}

.q::placeholder {
  color: rgba(74, 74, 74, 0.65);
}

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

.qbtn {
  min-height: 44px;
  padding: 8px 16px;
  font-family: var(--body);
  font-size: 16px;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 4px 12px 4px 12px;
  cursor: pointer;
  transform: rotate(-1deg);
}

.qbtn:hover {
  background: var(--mid);
}

/* ---------- 主体骨架 ---------- */
.sheet {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  padding: 28px 0 0;
}

/* ---------- 左侧目录 ---------- */
.rail {
  position: sticky;
  top: 16px;
  z-index: 2;
  padding: 12px 12px 6px;
  background: #fff;
  border: 2px solid var(--ink);
  border-bottom: 6px solid var(--ink);
  border-radius: var(--r);
  transform: rotate(-0.9deg);
  box-shadow: 5px 5px 0 rgba(26, 26, 26, 0.07);
}

.rail-t {
  margin: 0 0 8px;
  font-family: var(--hand);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
}

.rail-t > span {
  display: inline-block;
  padding: 0 3px;
  background: linear-gradient(transparent 60%, rgba(26, 26, 26, 0.14) 60%);
}

.rail-t a {
  text-decoration: none;
}

.rail-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 6px;
  font-size: 16px;
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px dashed var(--edge);
}

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

.rail-nav a:hover {
  color: var(--ink);
  background: var(--soft);
}

.rail-t-up {
  margin: 6px 0 8px;
  padding-top: 8px;
  border-top: 2px dotted var(--edge);
}

/* ---------- 正文 ---------- */
.prose {
  min-width: 0;
  max-width: 70ch;
}

.prose div {
  padding: 4px 0 26px;
  margin: 0 0 26px;
  border-bottom: 2px dashed rgba(26, 26, 26, 0.22);
  scroll-margin-top: 20px;
}

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

.prose h2 {
  margin: 0 0 14px;
  font-family: var(--hand);
  font-size: clamp(23px, 3.2vw, 32px);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: 0.4px;
  transform: rotate(-0.4deg);
}

.prose h2 > span {
  background: linear-gradient(transparent 62%, rgba(26, 26, 26, 0.13) 62%);
  padding-bottom: 2px;
}

.prose h3 {
  margin: 22px 0 8px;
  font-family: var(--hand);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.prose h3 > span {
  border-bottom: 2px dotted rgba(26, 26, 26, 0.3);
}

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

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

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

.prose a {
  color: var(--ink);
  text-decoration: underline wavy rgba(26, 26, 26, 0.45);
  text-underline-offset: 4px;
}

.prose a:hover {
  background: rgba(26, 26, 26, 0.08);
}

.prose img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  filter: grayscale(0.12) contrast(1.03);
  background: #fff;
}

.prose figure {
  margin: 0 0 18px;
  padding: 8px;
  background: #fff;
  border: 2px solid var(--ink);
  border-bottom: 6px solid var(--ink);
  border-radius: var(--r);
  transform: rotate(0.35deg);
}

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

.prose blockquote {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid var(--ink);
  border-left: 8px solid var(--ink);
  border-radius: var(--r);
  transform: rotate(-0.3deg);
}

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

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  background: #fff;
}

.prose th,
.prose td {
  padding: 8px 10px;
  border: 1px dashed var(--edge);
  text-align: left;
  font-size: 16px;
}

.prose th {
  background: var(--soft);
}

.prose code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.94em;
  background: var(--soft);
  padding: 1px 4px;
  border-radius: 4px;
}

.prose hr {
  border: 0;
  border-top: 3px dashed rgba(26, 26, 26, 0.3);
  margin: 24px 0;
}

/* ---------- 滚动浮现 ---------- */
html.js .prose div,
html.js .rail,
html.js .foot {
  opacity: 0;
  transform: translateY(12px) rotate(-0.3deg);
  transition: opacity 0.34s steps(4, end), transform 0.34s ease-out;
}

html.js .prose div:first-child {
  opacity: 1;
  transform: none;
}

html.js .in {
  opacity: 1 !important;
  transform: none !important;
}

.prose div.hit {
  outline: 3px dashed var(--ink);
  outline-offset: 8px;
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  max-width: 1080px;
  margin: 44px auto 0;
  padding: 20px 0 8px;
  border-top: 3px solid var(--ink);
}

.foot-brand {
  font-family: var(--hand);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  text-decoration: none;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 2px;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 10px;
  font-size: 16px;
  color: var(--mid);
  text-decoration: none;
  border-radius: 8px;
}

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

.foot-z p {
  margin: 0;
  font-size: 16px;
  color: var(--mid);
}

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .sheet {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

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

  .prose {
    order: 1;
    max-width: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 16px;
    padding-top: 0;
  }

  .hero-f {
    order: 2;
  }

  .hero-f img,
  .hero-i {
    max-height: 34vh;
  }

  .hero-h {
    font-size: clamp(28px, 8vw, 40px);
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
    padding: 16px 14px 124px;
  }

  .dock-nav {
    padding: 4px 6px;
    gap: 4px;
  }

  .row a {
    padding: 6px 6px;
    font-size: 16px;
  }

  .dock-brand {
    font-size: 15px;
    padding: 4px 8px;
    letter-spacing: 0.3px;
  }

  .find {
    max-width: none;
  }

  .foot {
    margin-top: 32px;
  }
}

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

  html.js .prose div,
  html.js .rail,
  html.js .foot {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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