/* ==========================================================================
   站点样式
   风格取向：编辑部署砖 —— 暖米色纸面、墨色正文、朱砂红点缀、发丝分隔线。
   不引外部字体，服务器在国内也能秒开。
   ========================================================================== */

:root {
  /* 纸与墨 */
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --sunken: #efeae0;
  --ink: #1c1a17;
  --ink-soft: #45403a;
  --muted: #7c7568;
  --faint: #a9a193;

  /* 线 */
  --rule: #e2dcd0;
  --rule-strong: #cec6b5;

  /* 朱砂 */
  --accent: #bf3a2b;
  --accent-ink: #9c3226;
  --accent-wash: #f7e9e5;
  --ok: #3d7a52;

  /* 字号阶梯 */
  --text-body: 17px;
  --text-small: 13.5px;
  --text-meta: 12.5px;

  /* 结构 */
  --topbar-h: 56px;
  --sidebar-w: 232px;
  --measure: 740px;

  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Microsoft YaHei",
    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

  --radius: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  margin: 0;
  background-color: var(--paper);
  /* 极淡的斜纹，给纯色底一点纸感 */
  background-image: repeating-linear-gradient(
    135deg,
    rgba(28, 26, 23, 0.014) 0 1px,
    transparent 1px 7px
  );
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent-ink);
  text-decoration-color: color-mix(in srgb, var(--accent-ink) 32%, transparent);
  text-underline-offset: 3px;
  transition: color 0.15s var(--ease), text-decoration-color 0.15s var(--ease);
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ==========================================================================
   顶栏
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 32px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.topbar__mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
}

.topbar__name {
  font-size: 15px;
}

.topbar__tagline {
  padding-left: 14px;
  border-left: 1px solid var(--rule-strong);
  color: var(--faint);
  font-size: var(--text-meta);
  letter-spacing: 0.04em;
}

.topbar__nav {
  margin-left: auto;
  font-size: var(--text-small);
}

.topbar__nav a {
  color: var(--muted);
  text-decoration: none;
}

.topbar__nav a:hover {
  color: var(--accent);
}

/* ==========================================================================
   骨架
   ========================================================================== */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 56px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

.main {
  min-width: 0;
  max-width: var(--measure);
  padding: 48px 0 96px;
}

/* ==========================================================================
   左侧栏
   ========================================================================== */

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  padding: 48px 0;
}

.sidebar__inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100%;
  padding-right: 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}

.sidebar__inner::-webkit-scrollbar {
  width: 6px;
}

.sidebar__inner::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border-radius: 3px;
}

.sidebar__label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.sidebar__count {
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0;
}

/* --- 本文目录 --- */

.toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc__list .toc__list {
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--rule);
}

.toc__link {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.6;
  text-decoration: none;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.toc__list .toc__list .toc__link {
  font-size: var(--text-meta);
}

.toc__link:hover {
  color: var(--ink);
}

.toc__link.is-active {
  border-left-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}

.toc__empty {
  margin: 0;
  color: var(--faint);
  font-size: var(--text-meta);
}

/* --- 全部文章 --- */

.all-posts > summary {
  cursor: pointer;
  list-style: none;
  margin-bottom: 0;
  transition: color 0.15s var(--ease);
}

.all-posts > summary::-webkit-details-marker {
  display: none;
}

.all-posts > summary::after {
  content: "＋";
  margin-left: auto;
  font-size: 11px;
}

.all-posts[open] > summary {
  margin-bottom: 12px;
}

.all-posts[open] > summary::after {
  content: "－";
}

.all-posts > summary:hover {
  color: var(--accent);
}

.all-posts__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.all-posts__link {
  display: flex;
  gap: 8px;
  padding: 5px 0 5px 12px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.55;
  text-decoration: none;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.all-posts__link:hover {
  color: var(--ink);
  border-left-color: var(--rule-strong);
}

.all-posts__num {
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-size: 11px;
  color: var(--faint);
}

.all-posts__item.is-current .all-posts__link {
  border-left-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}

.all-posts__item.is-current .all-posts__num {
  color: var(--accent);
}

/* ==========================================================================
   文章页
   ========================================================================== */

.article__head {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--rule);
}

.article__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: var(--text-meta);
  letter-spacing: 0.04em;
}

.article__meta > * {
  display: inline-flex;
  align-items: center;
}

.article__meta > * + *::before {
  content: "";
  width: 3px;
  height: 3px;
  margin-right: 12px;
  background: var(--faint);
  border-radius: 50%;
}

.article__index {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1;
  color: var(--accent);
}

.article__title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.article__subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.02em;
}

/* --- 正文 --- */

.article__body {
  padding-top: 8px;
  font-size: var(--text-body);
  line-height: 1.9;
  overflow-wrap: break-word;
}

.article__body > :first-child {
  margin-top: 26px;
}

/* 正文里常有上百字符的裸链接，窄屏不断行的话整页都会被撑出横向滚动条 */
.article__body a {
  overflow-wrap: anywhere;
}

.article__body p {
  margin: 22px 0;
}

.article__body strong {
  color: var(--ink);
  font-weight: 600;
}

.article__body h2,
.article__body h3,
.article__body h4 {
  position: relative;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}

.article__body h2 {
  margin: 64px 0 22px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 26px;
}

/* 压在分隔线上的朱砂短杠 */
.article__body h2::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 34px;
  height: 2px;
  background: var(--accent);
}

.article__body h3 {
  margin: 42px 0 16px;
  font-size: 19px;
}

.article__body h4 {
  margin: 32px 0 12px;
  font-size: 17px;
  color: var(--ink-soft);
}

.article__body h2:first-child,
.article__body h3:first-child {
  margin-top: 32px;
}

/* 标题左侧的 # 锚点，悬停才出现 */
.heading-anchor {
  position: absolute;
  left: -0.9em;
  color: var(--faint);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease);
}

.article__body h2:hover .heading-anchor,
.article__body h3:hover .heading-anchor,
.article__body h4:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.heading-anchor:hover {
  color: var(--accent);
}

.article__body ul,
.article__body ol {
  margin: 22px 0;
  padding-left: 1.5em;
}

.article__body li {
  margin: 9px 0;
}

.article__body li::marker {
  color: var(--faint);
}

.article__body blockquote {
  margin: 26px 0;
  padding: 16px 22px;
  background: var(--accent-wash);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-soft);
}

.article__body blockquote > :first-child {
  margin-top: 0;
}

.article__body blockquote > :last-child {
  margin-bottom: 0;
}

.article__body hr {
  margin: 48px 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

/* 行内代码 */
.article__body code {
  padding: 0.15em 0.42em;
  background: var(--sunken);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.86em;
  word-break: break-word;
}

/* --- 代码块 --- */

.article__body .code-block {
  position: relative;
  margin: 28px 0;
  background: #201f1c;
  border: 1px solid #332f28;
  border-radius: var(--radius);
  overflow: hidden;
}

.article__body .code-block::before {
  content: attr(data-lang);
  position: absolute;
  top: 11px;
  right: 16px;
  color: #7d766a;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
}

.article__body .code-block pre {
  margin: 0;
  padding: 34px 20px 20px;
  overflow-x: auto;
  background: transparent;
  font-size: 13.5px;
  line-height: 1.72;
  -webkit-overflow-scrolling: touch;
}

.article__body .code-block code {
  padding: 0;
  background: none;
  border: 0;
  color: #ddd7ca;
  font-size: inherit;
  white-space: pre;
}

/* 语法高亮：暖色暗调，和朱砂主色同一色系 */
.hljs-comment,
.hljs-quote {
  color: #6e695f;
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-doctag,
.hljs-name {
  color: #e08a72;
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-meta .hljs-string {
  color: #9dc08b;
}

.hljs-number,
.hljs-symbol,
.hljs-bullet,
.hljs-link {
  color: #d9b06a;
}

.hljs-title,
.hljs-title.function_,
.hljs-section {
  color: #8fb8d4;
}

.hljs-attr,
.hljs-attribute,
.hljs-variable,
.hljs-template-variable,
.hljs-property {
  color: #c3a6dd;
}

.hljs-type,
.hljs-built_in,
.hljs-class .hljs-title,
.hljs-title.class_ {
  color: #7fc7c0;
}

.hljs-meta,
.hljs-tag,
.hljs-punctuation {
  color: #a89e8c;
}

.hljs-deletion {
  color: #e0776a;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: 600;
}

/* --- 表格 --- */

.article__body table {
  display: block;
  width: 100%;
  margin: 28px 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.7;
}

.article__body th,
.article__body td {
  padding: 11px 16px;
  border: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.article__body th {
  background: var(--sunken);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.article__body tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--sunken) 45%, transparent);
}

/* --- 图片 --- */

.article__body img {
  display: block;
  width: auto;
  max-width: 100%;
  /* 手机截图又长又窄，限高避免一张图占满好几屏 */
  max-height: 720px;
  height: auto;
  margin: 30px auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: zoom-in;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.article__body img:hover {
  border-color: var(--rule-strong);
}

/* ==========================================================================
   上下篇 / 页脚
   ========================================================================== */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.pager__link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.pager__link:hover {
  border-color: var(--rule-strong);
  transform: translateY(-2px);
}

.pager__link--next {
  text-align: right;
}

.pager__link--empty {
  background: transparent;
  border-style: dashed;
  pointer-events: none;
}

.pager__label {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.pager__title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.footer {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: var(--text-meta);
}

.footer p {
  margin: 0;
}

.footer code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

/* ==========================================================================
   复制按钮
   ========================================================================== */

.copy-btn {
  position: fixed;
  top: calc(var(--topbar-h) + 22px);
  right: 32px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: var(--text-small);
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(28, 26, 23, 0.16), 0 12px 28px -14px rgba(28, 26, 23, 0.4);
  transition: background 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.copy-btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.copy-btn:active {
  transform: translateY(0);
}

.copy-btn.is-done {
  background: var(--ok);
}

.copy-btn.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.copy-btn__icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-btn__icon--done {
  display: none;
}

.copy-btn.is-done .copy-btn__icon--done {
  display: block;
}

.copy-btn.is-done .copy-btn__icon--copy {
  display: none;
}

/* 视口不够宽时右侧没有留白，浮标会压住正文，改成右下角悬浮 */
@media (max-width: 1280px) {
  .copy-btn {
    top: auto;
    bottom: 24px;
    right: 24px;
  }
}

/* ==========================================================================
   移动端目录抽屉
   ========================================================================== */

.toc-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 16px;
  z-index: 45;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-family: inherit;
  font-size: var(--text-small);
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(28, 26, 23, 0.12);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 48;
  background: rgba(28, 26, 23, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s var(--ease);
}

body.has-drawer .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   灯箱
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 17, 15, 0.92);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 6px;
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  color: #f4f1ea;
  border: 0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

body.is-zoomed {
  overflow: hidden;
}

/* ==========================================================================
   提示条
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 120;
  padding: 11px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  font-size: var(--text-small);
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast[data-tone="error"] {
  background: var(--accent);
}

/* ==========================================================================
   首页
   ========================================================================== */

.shell--index {
  grid-template-columns: minmax(0, 1fr);
}

.main--index {
  max-width: 900px;
  margin: 0 auto;
}

.masthead {
  padding: 88px 0 52px;
  border-bottom: 2px solid var(--ink);
}

.masthead__eyebrow {
  margin: 0 0 20px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.masthead__title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 5.6vw, 54px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.masthead__lede {
  max-width: 34em;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.masthead__stat {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 0;
  color: var(--faint);
  font-size: var(--text-meta);
  letter-spacing: 0.06em;
}

.masthead__stat i,
.post__meta i {
  font-style: normal;
  color: var(--rule-strong);
}

.masthead__stat i::before,
.post__meta i::before {
  content: "·";
}

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post {
  border-bottom: 1px solid var(--rule);
}

.post__link {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 26px;
  padding: 28px 12px 28px 4px;
  text-decoration: none;
  transition: background 0.18s var(--ease);
}

.post__link:hover {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.post__num {
  padding-top: 3px;
  color: var(--rule-strong);
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
  transition: color 0.18s var(--ease);
}

.post__link:hover .post__num {
  color: var(--accent);
}

.post__main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.post__title {
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  transition: transform 0.18s var(--ease);
}

.post__link:hover .post__title {
  transform: translateX(4px);
}

.post__excerpt {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  color: var(--faint);
  font-size: var(--text-meta);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 1024px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .main {
    max-width: none;
    padding: 32px 0 120px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    width: min(320px, 84vw);
    height: 100%;
    padding: 28px 24px;
    background: var(--surface);
    border-right: 1px solid var(--rule);
    transform: translateX(-102%);
    transition: transform 0.28s var(--ease);
  }

  .sidebar.is-open {
    transform: none;
  }

  .toc-toggle {
    display: block;
  }

  .heading-anchor {
    position: static;
    margin-right: 6px;
    opacity: 0.32;
  }

  .article__body img {
    max-height: none;
  }
}

@media (max-width: 720px) {
  :root {
    --text-body: 16px;
    --topbar-h: 52px;
  }

  .topbar {
    padding: 0 18px;
  }

  .topbar__tagline {
    display: none;
  }

  .shell {
    padding: 0 18px;
  }

  .copy-btn {
    top: auto;
    bottom: 20px;
    right: 16px;
    padding: 11px 16px;
  }

  .article__body h2 {
    margin-top: 48px;
    font-size: 22px;
  }

  .article__body h3 {
    font-size: 18px;
  }

  .article__body img {
    max-width: 100%;
  }

  .pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager__link--next {
    text-align: left;
  }

  .pager__link--empty {
    display: none;
  }

  .masthead {
    padding: 56px 0 40px;
  }

  .post__link {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 16px;
    padding: 22px 8px 22px 0;
  }

  .post__num {
    font-size: 24px;
  }

  .post__title {
    font-size: 18px;
  }

  .toast {
    left: 18px;
    right: 18px;
    bottom: 84px;
    transform: translateY(10px);
    text-align: center;
  }

  .toast.is-visible {
    transform: none;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .topbar,
  .sidebar,
  .copy-btn,
  .toc-toggle,
  .pager,
  .lightbox,
  .toast {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .article__body .code-block {
    background: #f5f5f5;
    border-color: #ddd;
  }

  .article__body .code-block code,
  .article__body .code-block::before {
    color: #222;
  }
}
