/* base.css · 重置与排版 */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-zh-body);
  font-size: 14px;
  line-height: 1.9;
  font-weight: 400;

  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .6em;
  font-family: var(--font-zh-title);
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}

h1 { font-size: 30px; letter-spacing: .04em; }
h2 { font-size: 23px; letter-spacing: .03em; }
h3 { font-size: 18px; letter-spacing: .02em; }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li { margin: .2em 0; }

a {
  color: var(--ink);
  text-decoration: none;
  transition: color var(--dur-hover) var(--ease-standard);
}
a:hover { color: var(--rose-deep); }

img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--rose-deep);
  outline-offset: 2px;
}

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

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
}
.paper-grain svg { width: 100%; height: 100%; display: block; }

.prose { font-size: 16px; line-height: 1.9; }
.prose p { margin-bottom: 1.2em; }
.prose code, code {
  font-family: var(--font-code);
  font-size: 12px;
  background: var(--paper-deep);
  padding: 1px 5px;
  border-radius: 2px;
}
.prose pre {
  background: var(--paper-deep);
  padding: 14px 16px;
  overflow-x: auto;
  border-left: 2px solid var(--rose-pale);
}
.prose pre code { background: transparent; padding: 0; }
.prose blockquote {
  margin: 1.2em 0;
  padding: 10px 16px;
  background: var(--rose-a08);
  border-left: 3px solid var(--rose);
  color: var(--ink-soft);
}
.prose h2, .prose h3 {
  color: var(--rose-deep);
  border-left: 3px solid var(--rose-pale);
  padding-left: 12px;
  margin-top: 1.8em;
  /* 无顶栏后只留一屏呼吸空间，与左右栏 sticky 的 --frame-top 对齐 */
  scroll-margin-top: 24px;
}
.prose h3 { font-size: 17px; }
.prose img {margin: 1.2em auto;border: 1px solid var(--line);max-height: 300px;}

.en-label {
  font-family: var(--font-en);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--ink-soft);
}

.muted { color: var(--ink-soft); }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
