/* ==========================================================================
   c-r13iqkdbyzrn —— 杂志版：纸感底色、衬线大标题、左侧目录栏、出血信息图
   本篇专属样式，只被 /zh/blog/c-r13iqkdbyzrn.html 引用
   分区：变量 / 基础 / 页头 / 首屏 / 版心与目录 / 正文 / 分章 / 重点句 / 图与预览
        / 品牌动作 / 窄屏 / 暗色 / 打印
   ========================================================================== */

/* ---------- 变量 ---------- */
:root {
  --paper: #f7f5f0;
  --paper-2: #fffdf9;
  --ink: #181a1f;
  --ink-2: #4d525c;
  --rule: rgba(24, 26, 31, .14);
  --brand: #3D65FD;
  --brand-ink: #2b4ce0;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --col: 40rem;
  --rail: 15rem;
  --pad: clamp(1.15rem, 4vw, 3rem);
  --gap-para: 1rem;
  --radius: 8px;
  color-scheme: light dark;
}

:root { scrollbar-gutter: stable; }

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.9;
  overflow-wrap: break-word;
}

p, li, summary { text-wrap: pretty; }

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

strong { font-weight: 700; }

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

.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  transform: translateY(-130%);
  background: var(--paper-2);
  color: var(--ink);
  padding: .55rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: .95rem;
  text-decoration: none;
  transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(.75rem); }

/* ---------- 页头 ---------- */
.masthead { border-bottom: 1px solid var(--rule); }

.masthead__inner {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.05rem var(--pad);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
}

.masthead__site {
  font-size: .8rem;
  letter-spacing: .16em;
  color: var(--ink-2);
  text-decoration: none;
}
.masthead__site:hover { color: var(--ink); }

/* ---------- 首屏 ---------- */
.cover {
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(2.2rem, 5vw, 4.4rem) var(--pad) clamp(1.6rem, 3vw, 2.6rem);
}

.cover__mark {
  display: block;
  width: 2.6rem;
  height: 3px;
  background: var(--brand);
  margin-bottom: clamp(1.1rem, 2vw, 1.6rem);
}

.cover__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.95rem, 4.4vw, 3.4rem);
  line-height: 1.24;
  letter-spacing: -.004em;
  margin: 0;
  max-width: 46rem;
  text-wrap: balance;
}

.cover__line { display: block; }
.cover__line--brand { color: var(--brand-ink); }

.cover__sub {
  margin: clamp(1.3rem, 2.4vw, 1.9rem) 0 0;
  max-width: 42rem;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--ink-2);
}

/* ---------- 版心与目录 ---------- */
.layout {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 var(--pad) clamp(3rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: var(--rail) minmax(0, var(--col));
  gap: clamp(2rem, 4vw, 4.5rem);
  justify-content: center;
  align-items: start;
}

.rail {
  position: sticky;
  top: 1.75rem;
  align-self: start;
  padding-top: .2rem;
}

.rail__label {
  margin: 0 0 1.1rem;
  font-size: .78rem;
  letter-spacing: .2em;
  color: var(--ink-2);
}

.rail__list {
  counter-reset: toc;
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.rail__list li {
  counter-increment: toc;
  border-bottom: 1px solid var(--rule);
}

.rail__list li::before {
  content: counter(toc, decimal-leading-zero);
  display: block;
  padding-top: .85rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--brand-ink);
}

.rail__list a {
  display: block;
  padding: .1rem 0 .85rem;
  color: var(--ink-2);
  font-size: 1.125rem;
  line-height: 1.55;
  text-decoration: none;
}
.rail__list a:hover,
.rail__list a:focus-visible { color: var(--ink); }

/* 窄屏折叠目录（桌面版隐藏） */
.toc-inline {
  display: none;
  margin: 0 0 1.7rem;
  padding: .8rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.toc-inline summary {
  cursor: pointer;
  font-size: 1.0625rem;
  letter-spacing: .04em;
  color: var(--ink-2);
}

.toc-inline ol {
  counter-reset: toc2;
  list-style: none;
  margin: .85rem 0 0;
  padding: 0;
}

.toc-inline li {
  counter-increment: toc2;
  margin: .5rem 0;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.toc-inline li::before {
  content: counter(toc2, decimal-leading-zero);
  margin-right: .55rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--brand-ink);
}

.toc-inline a { color: var(--ink-2); text-decoration: none; }
.toc-inline a:hover { color: var(--ink); }

/* ---------- 正文 ---------- */
.prose {
  counter-reset: sec;
  min-width: 0;
}

.prose p {
  margin: 0 0 var(--gap-para);
}

.prose .lead {
  font-size: 1.22rem;
  line-height: 1.82;
  margin-bottom: 1.25rem;
}

/* ---------- 分章：细线 + 编号 + 衬线标题 ---------- */
.prose h2 {
  position: relative;
  counter-increment: sec;
  margin: clamp(3rem, 5vw, 4.4rem) 0 1.2rem;
  padding-top: 2.45rem;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.42rem, 1.05vw + 1.12rem, 1.9rem);
  line-height: 1.38;
  text-wrap: balance;
  scroll-margin-top: 1.5rem;
}

.prose h2::before {
  content: counter(sec, decimal-leading-zero);
  position: absolute;
  top: .72rem;
  left: 0;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--brand-ink);
}

/* ---------- 重点句块（草稿整段加粗的那一句） ---------- */
.prose .keyline {
  margin: clamp(2.4rem, 4vw, 3.3rem) 0;
  padding: .15rem 0 .15rem clamp(1rem, 2.4vw, 1.6rem);
  border-left: 3px solid var(--brand);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.4vw + .78rem, 1.52rem);
  line-height: 1.62;
  font-weight: 700;
  color: var(--ink);
  text-wrap: pretty;
}

.prose .keyline strong { font-weight: 700; }

/* ---------- 图与图内预览 ---------- */
.post-figure {
  margin: clamp(2rem, 3.6vw, 2.9rem) 0;
}

.zoom {
  display: block;
  max-width: 100%;
}

.post-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: #fff;
  transition: transform .25s ease, box-shadow .25s ease;
}

.zoom:hover img,
.zoom:focus-visible img {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -20px rgba(24, 26, 31, .6);
}

/* 只在两侧留白足够的宽视口，图向右多出 4rem，形成杂志出血节奏 */
@media (min-width: 1440px) {
  .post-figure--wide { width: calc(100% + 4rem); }
}

.zoom-exit {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lightbox { display: none; }

.lightbox:target {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: clamp(1rem, 4vw, 2.5rem);
  background: rgba(10, 12, 16, .86);
}

.lightbox img {
  max-width: min(88vw, 72rem);
  max-height: 76vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 0;
  background: transparent;
}

.lightbox__close {
  position: absolute;
  top: clamp(.6rem, 2vw, 1.2rem);
  right: clamp(.6rem, 2vw, 1.2rem);
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  text-decoration: none;
}

/* ---------- 文末品牌动作 ---------- */
.post-cta {
  margin: clamp(2.8rem, 5vw, 4rem) 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.post-cta__brand {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
}

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 1.0625rem;
  line-height: 1.5;
}
.btn:hover { background: var(--brand-ink); }

/* ---------- 窄屏 ---------- */
@media (max-width: 1023px) {
  body { font-size: 1.03rem; }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 42rem;
  }

  .rail { display: none; }

  .toc-inline { display: block; }

  .prose .lead { font-size: 1.14rem; }

  .cover__sub { font-size: 1.09rem; }

  .post-cta { justify-content: flex-start; }
}

@media (max-width: 420px) {
  .cover__title { font-size: 1.82rem; }
  .prose h2 { padding-top: 2.2rem; }
}

/* ---------- 暗色 ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121318;
    --paper-2: #191b22;
    --ink: #ecedf1;
    --ink-2: #a7acba;
    --rule: rgba(236, 237, 241, .18);
    --brand-ink: #93a8ff;
  }

  .post-figure img { background: #fff; }

  .btn { color: #fff; }
  .btn:hover { background: #2b4ce0; }
}

/* ---------- 打印 ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.7; }

  .masthead,
  .rail,
  .toc-inline,
  .lightbox,
  .zoom-exit,
  .post-cta { display: none !important; }

  .cover { padding: 0 0 1rem; }
  .cover__line--brand { color: #000; }
  .layout { display: block; padding: 0; }
  .prose .keyline { border-left-color: #000; }
  .post-figure img { border-color: #999; }
  a { color: #000; text-decoration: none; }
  .prose h2 { break-after: avoid; }
  .post-figure { break-inside: avoid; }
}

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

.nb { white-space: nowrap; }
