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

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

:root {
  --paper: #fdfbf7;
  --card: #ffffff;
  --ash: #f5f5f5;
  --ink: #1a1a1a;
  --line: #e2e0da;
  --line-soft: #eeece6;
  --mute: #5f5d57;
  --r: 18px;
  --shadow: 0 1px 0 rgba(26, 26, 26, .03), 0 14px 30px -20px rgba(26, 26, 26, .5);
  --serif: "Syne", "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.72;
  font-weight: 400;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: .32;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.28'/></svg>");
  background-size: 168px 168px;
}

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

a { color: inherit; }

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

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 20px;
  background: rgba(253, 251, 247, .96);
  border-bottom: 1px solid var(--line);
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  line-height: 1;
  transition: background-color .12s linear, color .12s linear;
}
.mark:hover { background: var(--ink); color: var(--paper); }
.mark img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
}

.pillnav { position: relative; }

.pillnav summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  letter-spacing: .1em;
  cursor: pointer;
  user-select: none;
  transition: background-color .12s linear, color .12s linear;
}
.pillnav summary::-webkit-details-marker { display: none; }
.pillnav summary::after {
  content: "▾";
  font-size: 12px;
  line-height: 1;
  transform: translateY(-1px);
}
.pillnav[open] summary { background: var(--paper); color: var(--ink); }
.pillnav[open] summary::after { content: "▴"; }

.pillnav menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  margin: 0;
  padding: 10px;
  width: min(74vw, 300px);
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  z-index: 30;
}
.pillnav menu li { margin: 0; animation: pop .14s linear both; animation-delay: calc(var(--i, 0) * 24ms); }
.pillnav menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  transition: background-color .12s linear, border-color .12s linear;
}
.pillnav menu a:hover { background: var(--ash); border-color: var(--line); }

@keyframes pop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* 版面 */
.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 76px;
}

.hero {
  display: grid;
  place-items: center;
  min-height: 45vh;
  padding: 52px 0 34px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  margin: 0;
  max-width: 15ch;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.1rem, 8vw, 4.5rem);
  line-height: 1.06;
  letter-spacing: -.03em;
  overflow-wrap: break-word;
}

.reading {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
  padding-top: 46px;
}

/* 侧栏 */
.side {
  position: sticky;
  top: 88px;
  border-top: 3px solid var(--ink);
  padding-top: 13px;
}

.side small {
  display: block;
  font-size: .76rem;
  letter-spacing: .26em;
  color: var(--mute);
  line-height: 1.4;
}

.side h2 {
  margin: .12em 0 .55em;
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.25;
}

.side ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.side li + li { border-top: 1px dashed var(--line); }

.side a {
  display: block;
  padding: 10px 2px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--mute);
  text-decoration: none;
  transition: color .12s linear, padding-left .12s linear;
}
.side a:hover { color: var(--ink); padding-left: 5px; }

/* 正文 */
.body { min-width: 0; }

.body > div {
  margin: 0 0 20px;
  padding: 26px 24px 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  scroll-margin-top: 96px;
}

.body > div:target {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.body div div {
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
  background: none;
  border-radius: 0;
}

.body h2 {
  margin: 0 0 .62em;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.5rem, 4.4vw, 2rem);
  line-height: 1.16;
  letter-spacing: -.02em;
}

.body h3 {
  margin: 1.5em 0 .5em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.body h4 {
  margin: 1.3em 0 .4em;
  font-size: 1.03rem;
  font-weight: 600;
}

.body small {
  display: block;
  margin-bottom: 7px;
  font-size: .76rem;
  letter-spacing: .24em;
  line-height: 1.4;
  color: var(--mute);
}

.body p { margin: 0 0 1.05em; }
.body p:last-child { margin-bottom: 0; }

.body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.body a:hover { background: var(--ash); }

.body strong { font-weight: 700; }

.body ul, .body ol { margin: 0 0 1.05em; padding-left: 1.25em; }
.body li { margin: .32em 0; }

.body img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.body figure {
  margin: 1.3em 0;
  padding: 12px;
  background: var(--ash);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.body figure img { border-radius: 9px; border-color: var(--line-soft); }
.body figcaption {
  margin-top: 9px;
  font-size: .84rem;
  line-height: 1.6;
  color: var(--mute);
}

.body blockquote {
  margin: 1.25em 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--ink);
  color: var(--mute);
}

.body table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  display: block;
  overflow-x: auto;
}
.body th, .body td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.body th { font-weight: 700; }

.body pre {
  margin: 1.2em 0;
  padding: 14px;
  overflow-x: auto;
  background: var(--ash);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: .9rem;
  line-height: 1.6;
}
.body code { font-size: .92em; }

.body hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* 页脚 */
.foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 34px;
  align-items: start;
  padding: 46px 20px 34px;
  background: var(--ash);
  border-top: 1px solid var(--line);
}

.foot p { margin: 0; }

.foot-brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.28rem, 3.6vw, 1.6rem);
  line-height: 1.22;
  letter-spacing: -.01em;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  justify-content: flex-end;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  font-size: 15px;
  color: var(--mute);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .12s linear, border-color .12s linear;
}
.foot-links a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.foot-cta {
  grid-column: 1 / -1;
  margin-top: 6px !important;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.foot-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 42px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: .14em;
  text-decoration: none;
  transition: background-color .12s linear;
}
.foot-cta a:hover { background: #000; }

.foot small {
  grid-column: 1 / -1;
  display: block;
  padding-top: 6px;
  text-align: center;
  font-size: .79rem;
  letter-spacing: .04em;
  color: var(--mute);
}

/* 断点 */
@media (max-width: 860px) {
  .reading {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 32px;
  }
  .side {
    position: static;
    order: -1;
  }
  .side ul { grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .side li + li { border-top: 0; }
  .side a { border-bottom: 1px dashed var(--line); padding: 9px 0; }
  .body > div { padding: 22px 18px 24px; scroll-margin-top: 84px; }
}

@media (max-width: 620px) {
  body { font-size: 16.5px; }
  .topbar { padding: 10px 16px; }
  .shell { padding: 0 16px 64px; }
  .hero { min-height: 42vh; padding: 40px 0 28px; }
  .foot { grid-template-columns: 1fr; padding: 38px 16px 30px; }
  .foot-links { justify-content: flex-start; }
  .foot-cta { text-align: left; padding-top: 26px; }
  .foot-cta a { width: 100%; }
  .foot small { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

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