/* ==========================================================================
   潦草地 · v3
   版式与色彩对齐 joshwcomeau.com 的实测值（2026-11 抓取）：
   标签 16/500、字距 2px；副标题 17/500；标题 22/600；代码 16/600
   灰阶取自他的 --color-gray-*，语法配色取自 --syntax-*
   ========================================================================== */

:root {
  color-scheme: light;

  /* 纸与墨（= 他的 gray 阶） */
  --paper: #ffffff;
  --ink: #0a0c10;          /* gray-1000 同级 */
  --muted: #5a6072;        /* gray-700 */
  --body-ink: #3d455c;     /* gray-800 */

  /* 页首（草稿纸） */
  --tint-1: #ffe9a8;
  --tint-2: #fff3ce;
  --tint-3: #fffaf0;
  --hero-end: #ffffff;
  --hero-glow: #fffdf2;
  --grid-dot: rgba(22, 24, 29, 0.14);
  --edge-soft: #ffd98a;

  /* 页脚 */
  --foot-bg: #fff2cf;

  /* 强调：他那支品红 + 靛蓝 */
  --accent: #e60067;       /* color-secondary */
  --label: #e60067;
  --link: #4242fa;         /* color-action */
  --sun: #ffd24a;
  --chip: #ffe9a8;
  --chip-hover: #ffd98a;
  --chip-ink: #0a0c10;
  --on-link: #ffffff;

  /* 涂鸦 */
  --doodle-ink: #0a0c10;
  --doodle-paper: #ffffff;

  /* 便签 */
  --promo-bg: #ffffff;
  --promo-ink: #262d40;
  --tape: rgba(198, 226, 241, 0.9);
  --tape-edge: rgba(22, 24, 29, 0.22);
  --sticker-shadow: rgba(22, 24, 29, 0.08);

  /* 线与分隔（取自 gray-100/200） */
  --line: #e6e8f0;
  --line-2: #d6d8e1;

  /* 头部 */
  --header-bg: rgba(255, 255, 255, 0.96);
  --header-line: rgba(10, 12, 16, 0.32);
  --hover-bg: rgba(10, 12, 16, 0.06);

  /* 代码（= 他的 --syntax-*） */
  --soft: #f1f3f9;
  --code-inline: #e8f1fc;
  --code-bg: #e8f1fc;
  --code-bar: #d8e3f8;
  --code-ink: #292929;
  --code-border: #cbd7f1;
  --tok-kw: #db0079;
  --tok-str: #661fff;
  --tok-num: #576b75;
  --tok-com: #5b637b;
  --tok-fn: #3e5bfe;
  --tok-prop: #aa00ff;
  --tok-sel: #db0079;

  --mark: #ffec8f;
  --sel: #ffec8f;
  --warn-bg: #fbf4d0;
  --warn-line: #f3e0a5;

  --font: "Segoe UI Variable Display", "Segoe UI", -apple-system,
    BlinkMacSystemFont, "Noto Sans SC", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  --hand: "KaiTi", "Kaiti SC", "STKaiti", "Noto Serif SC", serif;
  --scrawl: "Ink Free", "Segoe Print", "Segoe Script", cursive;
  --mono: "Cascadia Code", "SF Mono", Consolas, ui-monospace, monospace;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;
  --r-full: 9999px;

  /* 他的 springy spring */
  --ease: linear(
    0, 0.1407 4.43%, 0.9383 16.72%, 1.0774 20.43%, 1.1493 24.31%,
    1.1629 26.95%, 1.1536 29.93%, 1.0168 43.09%, 0.9766 51%, 1.0033 76.88%, 1
  );
  --ease-out: cubic-bezier(0.27, 0.22, 0.44, 1.03);

  --shadow-1: 0 1px 2px rgba(22, 24, 29, 0.06), 0 4px 10px rgba(22, 24, 29, 0.05);
  --shadow-2: 0 2px 6px rgba(22, 24, 29, 0.06), 0 14px 28px rgba(22, 24, 29, 0.08);

  --shell: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --header-h: 88px;
}

/* ---- 暗色（= 他 data-color-mode=dark 的实测值）-------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --paper: #0d0f12;
  --ink: #e3e6e8;
  --muted: #9ca8b4;        /* gray-700 dark */
  --body-ink: #c3ccd6;

  --tint-1: #18222e;
  --tint-2: #121b25;
  --tint-3: #0e141b;
  --hero-end: #0d0f12;
  --hero-glow: #1d2b3a;
  --grid-dot: rgba(227, 230, 232, 0.1);
  --edge-soft: #6a5730;

  --foot-bg: #131519;

  --accent: #ff1981;       /* color-secondary dark */
  --label: #ff1981;
  --link: #809fff;         /* color-primary dark */
  --chip: #322a1c;
  --chip-hover: #3e3322;
  --chip-ink: #ffeec4;
  --on-link: #0d0f12;

  --doodle-ink: #e3e6e8;
  --doodle-paper: #0d0f12;

  --promo-bg: #171a1f;
  --promo-ink: #d5dbe2;
  --tape: rgba(38, 89, 115, 0.55);
  --tape-edge: rgba(227, 230, 232, 0.18);
  --sticker-shadow: rgba(0, 0, 0, 0.5);

  --line: #272e35;         /* gray-200 dark */
  --line-2: #454d54;

  --header-bg: rgba(13, 15, 18, 0.94);
  --header-line: rgba(227, 230, 232, 0.28);
  --hover-bg: rgba(255, 255, 255, 0.07);

  --soft: #1a1f23;
  --code-inline: #1a1f23;
  --code-bg: #1a1f23;
  --code-bar: #202e3c;
  --code-ink: #ffffff;
  --code-border: #272e35;
  --tok-kw: #ff38a9;
  --tok-str: #9a6bff;
  --tok-num: #9ba6b0;
  --tok-com: #6c8a99;
  --tok-fn: #00bfff;
  --tok-prop: #c552ff;
  --tok-sel: #ff38a9;

  --mark: rgba(255, 210, 74, 0.14);
  --sel: #ffd24a;
  --warn-bg: #2e271f;
  --warn-line: #403426;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.45), 0 14px 28px rgba(0, 0, 0, 0.4);
}


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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-ligatures: no-common-ligatures;
  font-feature-settings: "liga", "clig" off;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--link);
  text-decoration: none;
}
::selection {
  background: var(--sel);
  color: #16181d;
}
:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -80px;
  z-index: 200;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: var(--r-full);
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
}
.skip-link:focus {
  top: 10px;
}

/* ==========================================================================
   头部
   ========================================================================== */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.header.is-solid {
  background: linear-gradient(
    to top,
    transparent 0%,
    var(--header-bg) 82%
  );
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
}

.header .shell {
  display: flex;
  align-items: center;
  gap: 40px;
}

/* 叠字 logo：两行，像手写的 */
.brand {
  position: relative;
  display: inline-block;
  font-family: var(--hand);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--ink);
  transform: rotate(-2.2deg);
  transition: transform 0.35s var(--ease);
}
.brand:hover {
  color: var(--link);
  text-decoration: none;
}
.brand__scratch {
  display: block;
  width: 100%;
  height: 7px;
  margin-top: 1px;
  color: var(--accent);
  opacity: 0.75;
}

.nav {
  display: flex;
  align-items: center;
  gap: 34px;
  font-size: 17px;
}
.nav a {
  position: relative;
  color: var(--ink);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 2px;
  background: var(--link);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.32s var(--ease);
}
.nav a:hover::after {
  transform: scaleX(1);
}

.header__tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.25s var(--ease-out), transform 0.3s var(--ease);
}
.icon-btn:hover {
  color: var(--link);
  background: transparent;
}
.icon-btn svg {
  width: 21px;
  height: 21px;
}
/* 亮色显示月亮（点了变暗），暗色显示太阳 */
.icon-sun {
  display: none;
}
[data-theme="dark"] .icon-sun {
  display: block;
}
[data-theme="dark"] .icon-moon {
  display: none;
}
/* ==========================================================================
   Hero：天空带 + 跨在带子下沿的便签 + 涂鸦
   ========================================================================== */
.hero {
  position: relative;
  padding-top: 118px;
  padding-bottom: 56px;
  background: var(--paper);
  isolation: isolate;
}

/* 只有这一层是"天"，高度固定，下面是白的 */
.hero__sky {
  position: absolute;
  inset: 0 0 auto 0;
  height: 430px;
  z-index: 0;
  background:
    radial-gradient(120% 90% at 78% -10%, var(--hero-glow) 0%, transparent 55%),
    linear-gradient(180deg, var(--tint-1) 0%, var(--tint-2) 46%, var(--tint-3) 100%);
  overflow: hidden;
}
.hero__sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  opacity: 0.5;
}
.clouds {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 300px;
}
.clouds g {
  fill: #ffffff;
}
:root[data-theme="dark"] .clouds g:nth-of-type(1) {
  fill: #1b2733;
}
:root[data-theme="dark"] .clouds g:nth-of-type(2) {
  fill: #141d27;
}
.clouds g:nth-of-type(3) {
  fill: var(--paper);
}

.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 64px;
  align-items: start;
}

.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;
}

/* 手写大字：压在便签上沿 */
.hero__wordmark {
  position: relative;
  z-index: 3;
  width: fit-content;
  margin: 0 auto -14px;
  padding-left: 6px;
  font-family: var(--hand);
  font-size: clamp(64px, 7.6vw, 104px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--ink);
  transform: rotate(-2.5deg);
}
.hero__wordmark::after {
  content: "";
  position: absolute;
  left: -0.04em;
  right: 0.02em;
  bottom: 0.12em;
  height: 0.26em;
  background: var(--mark);
  transform: rotate(-1.2deg) skewX(-8deg);
  z-index: -1;
  border-radius: 3px;
}

/* 便签：跨在天空带下沿 */
.promo {
  position: relative;
  z-index: 2;
  padding: 72px 36px 32px;
  border-radius: 32px;
  background: #fff5cc;
  border: 4px dashed var(--doodle-ink);
  box-shadow: 0 1px 2px rgba(22, 24, 29, 0.08), 0 3px 6px rgba(22, 24, 29, 0.08), 0 9px 18px rgba(22, 24, 29, 0.08);
}
:root[data-theme="dark"] .promo {
  background: var(--promo-bg);
}
.promo p {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.62;
  color: var(--promo-ink);
}
.promo p:last-of-type {
  margin-bottom: 24px;
}
.promo a:not(.promo__btn) {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.promo a:not(.promo__btn):hover {
  color: var(--accent);
}
.promo__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 10px 16px 24px;
  border-radius: 6px;
  background: var(--doodle-ink);
  color: var(--doodle-paper);
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.3s var(--ease), filter 0.2s var(--ease-out);
}
.promo__btn:hover {
  filter: brightness(1.25);

  text-decoration: none;
}
.promo__btn span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.16);
  transition: transform 0.35s var(--ease);
}
:root[data-theme="dark"] .promo__btn span {
  background: rgba(0, 0, 0, 0.18);
}
.promo__btn:hover span {
  transform: translateX(5px);
}

/* 右侧涂鸦：比列宽，往左上方溢出去 */
.hero__art {
  position: relative;
  min-height: 400px;
}
.scene {
  position: absolute;
  top: -52px;
  right: -8px;
  width: 540px;
  max-width: none;
  height: auto;
  z-index: 1;
}
.blob {
  animation: bob 4.6s ease-in-out infinite;
  transform-origin: 330px 350px;
}
.plane {
  animation: drift 6s ease-in-out infinite;
  transform-origin: 400px 100px;
}
.sun-rays {
  animation: turn 42s linear infinite;
  transform-origin: 104px 100px;
}


/* ==========================================================================
   主体两栏
   ========================================================================== */
.main {
  position: relative;
  z-index: 3;
  padding-top: 76px;
  padding-bottom: 40px;
  background: var(--paper);
}
.main__grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 64px 96px;
  align-items: start;
}

/* 小号大写标签 */
.label {
  margin: 0 0 36px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--label);
}

/* 文章：纯文字块 */
.post-item {
  margin-bottom: 46px;
}
.post-item:nth-child(2) {
  animation-delay: 0.05s;
}
.post-item:nth-child(3) {
  animation-delay: 0.1s;
}
.post-item:nth-child(4) {
  animation-delay: 0.15s;
}

.post-item h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
}
.post-item h3 a {
  color: var(--ink);
  transition: color 0.2s var(--ease-out);
}
.post-item h3 a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.post-item__sub {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
}
.post-item__excerpt {
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--body-ink);
}
.readmore {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.readmore:hover {
  color: var(--ink);
  text-decoration: none;
}

/* Read more 的箭头拖尾：静止时完全不显示，悬停才从左侧淡入 */
.trail {
  position: relative;
  display: inline-block;
  flex: none;
  width: 54px;
  height: 18px;
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 0.22s var(--ease-out),
    transform 0.3s var(--ease);
}
.readmore:hover .trail {
  opacity: 1;
  transform: none;
}
.trail svg {
  position: absolute;
  top: 0;
  height: 18px;
  color: var(--link);
  transition:
    opacity 0.35s var(--ease-out),
    transform 0.35s var(--ease);
}
.trail__lead {
  left: 0;
  width: 24px;
  color: var(--ink);
}
.trail__ghost {
  width: 11px;
  opacity: 0;
}
.trail__ghost:nth-child(2) {
  left: 22px;
}
.trail__ghost:nth-child(3) {
  left: 32px;
}
.trail__ghost:nth-child(4) {
  left: 42px;
}
.readmore:hover .trail__lead {
  color: var(--link);
}
.readmore:hover .trail__ghost:nth-child(2) {
  opacity: 0.6;
  transform: translateX(2px);
}
.readmore:hover .trail__ghost:nth-child(3) {
  opacity: 0.38;
  transform: translateX(4px);
  transition-delay: 0.03s;
}
.readmore:hover .trail__ghost:nth-child(4) {
  opacity: 0.18;
  transform: translateX(6px);
  transition-delay: 0.06s;
}

/* 侧栏 */
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.sidebar section + section {
  margin-top: 54px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.chips a {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--r-md);
  background: var(--chip);
  color: var(--chip-ink);
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.25s var(--ease-out), transform 0.3s var(--ease);
}
.chips a:hover {
  background: var(--chip-hover);

  text-decoration: none;
}

.popular {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}
.popular a {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 16px;
  align-items: start;
  color: var(--ink);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.5;
}
.popular a:hover {
  color: var(--link);
  text-decoration: none;
}
/* 箭头：只拉横杆，斜线箭头保持原形 */
.arrow-grow {
  display: block;
  width: 22px;
  height: 18px;
  margin-top: 4px;
  overflow: visible;
}
.arrow-grow svg {
  display: block;
  width: 22px;
  height: 18px;
  overflow: visible;
  color: var(--ink);
  transition: color 0.2s var(--ease-out);
}
.arrow-grow .shaft {
  transform: scaleX(1);
  transform-origin: 1px 9px;
  transition: transform 0.34s var(--ease);
}
.arrow-grow .head {
  transform: translateX(0);
  transition: transform 0.34s var(--ease);
}
.popular a:hover .arrow-grow svg {
  color: var(--link);
}
.popular a:hover .arrow-grow .shaft {
  transform: scaleX(1.28);
}
.popular a:hover .arrow-grow .head {
  transform: translateX(2.9px);
}

/* ==========================================================================
   页脚：一块云边的浅色地基
   ========================================================================== */
.footer {
  position: relative;
  margin-top: 76px;
  padding-top: 78px;
  padding-bottom: 30px;
  background: var(--foot-bg);
  color: var(--muted);
}
.footer__cloud {
  position: absolute;
  left: 0;
  right: 0;
  top: -58px;
  width: 100%;
  height: 60px;
  color: var(--foot-bg);
}
.footer__copy {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Show more */
.showmore-wrap {
  display: flex;
  justify-content: center;
  padding: 18px 0 8px;
}
.showmore {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  border: 0;
  border-radius: 8px;
  background: #0d0f12;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s var(--ease), filter 0.2s var(--ease-out);
}
.showmore:hover {

  filter: brightness(1.3);
}
.showmore svg {
  width: 18px;
  height: 18px;
}
:root[data-theme="dark"] .showmore {
  background: #e3e6e8;
  color: #0d0f12;
}

/* 暗色下的便签：深底 + 黄色虚线 + 黄按钮（对齐参考站的暗色促销卡） */
:root[data-theme="dark"] .promo {
  border-color: var(--sun);
  background: #14171c;
}
:root[data-theme="dark"] .promo__btn {
  background: var(--sun);
  color: #16181d;
}
:root[data-theme="dark"] .promo__btn span {
  background: rgba(0, 0, 0, 0.12);
}
:root[data-theme="dark"] .promo__btn:hover {
  filter: brightness(1.08);
}
/* ==========================================================================
   标题下划线：从鼠标进入的位置向两侧展开
   ========================================================================== */
.post-item h3 a {
  position: relative;
}
.post-item h3 a::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: -3px;
  height: 3px;
  border-radius: 2px;
  background: var(--link);
  transform: scaleX(0);
  transform-origin: var(--ox, 50%) 50%;
  transition: transform 0.42s var(--ease-out);
  pointer-events: none;
}
.post-item h3 a:hover {
  color: var(--ink);
  text-decoration: none;
}
.post-item h3 a:hover::after {
  transform: scaleX(1);
}
/* 图标自身的小动效（容器不动，避免错位） */
.icon-btn svg,
.sub__btn svg,
.showmore svg,
.promo__btn span svg {
  transition: transform 0.34s var(--ease);
}
.icon-btn:hover svg {
  transform: scale(1.14);
}
.sub__btn:hover svg {
  transform: translateX(3px);
}
.showmore:hover svg {
  transform: translateY(3px);
}
.footer__social a svg {
  transition: transform 0.3s var(--ease);
}
.footer__social a:hover svg {
  transform: scale(1.15);
}

/* ==========================================================================
   文章页
   ========================================================================== */
.wrap {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.post-head {
  padding-top: calc(var(--header-h) + 46px);
}
.post-kicker {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--label);
}
.post-title {
  margin: 0;
  font-family: var(--hand);
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-wrap: balance;
}
.post-dek {
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
  text-wrap: pretty;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.post-meta a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.post-meta a:hover {
  color: var(--link);
  border-bottom-color: currentColor;
}
.sep {
  opacity: 0.5;
}
.rule {
  margin: 30px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* 目录 */
.toc {
  margin: 30px 0 0;
  padding: 18px 22px 20px;
  border-radius: 12px;
  background: var(--soft);
}
.toc h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--label);
}
.toc ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
}
.toc a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--paper);
  font-size: 14.5px;
  color: var(--body-ink);
  text-decoration: none;
  transition: border-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.toc a:hover {
  border-color: var(--link);
  color: var(--link);
}

.post-layout {
  max-width: 1000px;
  padding-top: 34px;
  padding-bottom: 24px;
}

/* 正文 */
.prose {
  font-size: 18px;
  line-height: 1.8;
  color: var(--body-ink);
  text-wrap: pretty;
}
/* 文字保持可读行宽，媒体（图/代码/表格/演示）可以更宽 */
.prose > * {
  max-width: 43rem;
  margin-inline: auto;
}
.prose > figure,
.prose > .code,
.prose > .demo,
.prose > .callout,
.prose > .table-wrap {
  max-width: 100%;
}

.prose > * + * {
  margin-top: 1.4em;
}
.prose > h2 + *,
.prose > h3 + * {
  margin-top: 0.9em;
}
.prose h2 {
  position: relative;
  margin-top: 3.2em;
  margin-bottom: 1em;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.prose h3 {
  margin-top: 2.6em;
  margin-bottom: 0.7em;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}
.prose strong {
  color: var(--ink);
  font-weight: 600;
}
.prose a {
  color: var(--link);
  text-decoration: none;
  box-shadow: inset 0 -1.5px 0 0 var(--link);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: box-shadow 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
}
.prose li + li {
  margin-top: 0.4em;
}
.prose blockquote {
  margin: 1.6em 0;
  padding: 18px 22px;
  border-left: 3px solid var(--link);
  border-radius: 0 8px 8px 0;
  background: var(--soft);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}
.prose blockquote p + p {
  margin-top: 0.6em;
}
.prose hr {
  margin: 2.4em 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.prose table {
  width: 100%;
  margin: 1.8em 0;
  border-collapse: collapse;
  font-size: 16px;
}
.prose caption {
  margin-bottom: 10px;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}
.prose th,
.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th {
  font-weight: 600;
  color: var(--ink);
  border-bottom-color: var(--line-2);
}

/* 标题锚点 */
.anchor {
  margin-left: 10px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.2s var(--ease-out);
  white-space: nowrap;
}
.prose h2:hover .anchor,
.anchor:focus {
  opacity: 1;
}
.anchor:hover {
  color: var(--link);
  text-decoration: none;
}

/* 演示区 */
.demo {
  margin: 1.9em 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  overflow: hidden;
}
.demo__bar {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.demo__bar b {
  color: var(--ink);
  font-weight: 600;
}
.demo__stage {
  padding: 22px 24px;
  background: var(--paper);
}
.demo__stage p {
  margin: 0;
  font-size: 17px;
  line-height: 1.75;
  color: var(--body-ink);
  transition: max-width 0.12s linear;
}
.demo__controls {
  padding: 16px 24px;
}
.demo input[type="range"] {
  width: 100%;
  height: 4px;
  appearance: none;
  border-radius: 999px;
  background: var(--line-2);
  outline: none;
}
.demo input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--link);
  border: 2px solid var(--paper);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* 代码块 */
.code {
  margin: 1.9em 0;
  border: 1px solid var(--code-border);
  border-radius: 12px;
  background: var(--code-bg);
  overflow: hidden;
}
.code__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--code-border);
  background: var(--code-bar);
}
.code__file {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--code-ink);
  opacity: 0.85;
}
.code__lang {
  flex: none;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--code-ink);
  opacity: 0.55;
}
.code__copy {
  flex: none;
  padding: 5px 10px;
  border: 1px solid var(--code-border);
  border-radius: 6px;
  background: transparent;
  color: var(--code-ink);
  font: inherit;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s var(--ease-out);
}
.code__copy:hover {
  background: rgba(66, 66, 250, 0.1);
}
.code pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  white-space: normal;
}
.code code {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.85;
  color: var(--code-ink);
  tab-size: 2;
}
.code .line {
  display: block;
  white-space: pre;
}
.tok-kw { color: var(--tok-kw); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-com { color: var(--tok-com); font-style: italic; }
.tok-fn { color: var(--tok-fn); }
.tok-prop { color: var(--tok-prop); }
.tok-sel { color: var(--tok-sel); }

/* 提示卡 */
.callout {
  display: flex;
  gap: 14px;
  margin: 1.9em 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.callout p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.7;
}
.callout__badge {
  flex: none;
  font-size: 20px;
  line-height: 1.4;
}
.callout--warn {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

/* 文末 */
.post-end {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--muted);
}
.post-end .avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--soft);
  font-size: 20px;
}
.post-end p {
  margin: 0;
  line-height: 1.6;
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1180px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 40px;
  }
  .scene {
    width: 420px;
    right: -30px;
  }
  .main__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
  }
  .sidebar {
    position: static;
    padding-top: 8px;
  }
  .popular {
    max-width: 520px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-h: 72px;
    --gutter: 1.25rem;
  }
  .hero {
    padding-top: 88px;
    padding-bottom: 40px;
  }
  .hero__sky {
    height: 380px;
  }
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .hero__art {
    display: none;
  }
  .promo {
    padding: 68px 26px 26px;
  }
  .post-head {
    padding-top: calc(var(--header-h) + 30px);
  }
  .post-meta {
    font-size: 13.5px;
  }
  .prose {
    font-size: 17px;
  }
  .prose h2 {
    font-size: 22px;
  }
  .footer__copy {
    text-align: center;
  }
}

@media (max-width: 640px) {
  .label {
    margin-bottom: 26px;
  }
  .post-item {
    margin-bottom: 34px;
  }
  .post-item__excerpt {
    line-height: 1.72;
  }
  .sidebar section + section {
    margin-top: 40px;
  }
  .nav {
    display: none;
  }
  .post-title {
    font-size: 32px;
  }
  .post-dek {
    font-size: 16.5px;
  }
  .toc {
    padding: 16px;
  }
  .toc a {
    font-size: 13.5px;
  }
  .code__bar {
    flex-wrap: wrap;
    gap: 6px 10px;
  }
  .code__file {
    flex: 1 1 100%;
  }
  .code pre {
    padding: 14px;
  }
  .code code {
    font-size: 13px;
  }
  .demo__stage,
  .demo__controls {
    padding: 16px;
  }
  .callout {
    padding: 14px 16px;
  }
  .post-item h3 {
    font-size: 20px;
  }
  .footer {
    margin-top: 64px;
    padding-top: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 暗色下头部阴影更沉 */
:root[data-theme="dark"] .header.is-solid {
  box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(0, 0, 0, 0.5);
}
/* 暗色：便签从纸面上浮起来一点，太阳带一圈暖光 */
:root[data-theme="dark"] .promo {
  background: #171a20;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
}
:root[data-theme="dark"] .scene .sun {
  filter: drop-shadow(0 0 26px rgba(255, 210, 74, 0.35));
}

/* 胶囊：暗色下是描边而非填充（对齐参考站 --color-cloud-500 只用于浅色） */
:root[data-theme="dark"] .chips a {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink);
}
:root[data-theme="dark"] .chips a:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* 头部下方 100px 的毛玻璃：蒙版让它渐隐，正文在这里被糊掉而不是直接透出来 */
.header::before {
  content: "";
  position: absolute;
  inset: 0 0 -100px 0;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0,
    #000 calc(100% - 100px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0,
    #000 calc(100% - 100px),
    transparent 100%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}
.header.is-solid::before {
  opacity: 1;
}

/* 暗色下这层玻璃是深色 */
:root[data-theme="dark"] .header::before {
  background: rgba(13, 15, 18, 0.72);
}

/* 页脚底栏：左边版权，右边一句说明 */
.footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
}
.footer__note {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  opacity: 0.9;
}
.footer__note a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.footer__note a:hover {
  color: var(--link);
  border-bottom-color: currentColor;
}
/* ==========================================================================
   涂鸦的呼吸：这三组 keyframes 之前随大段 CSS 一起被误删了，
   结果 .blob / .plane / .sun-rays 一直在引用不存在的动画
   ========================================================================== */
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(7px, -5px) rotate(-2deg); }
}
@keyframes turn {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .blob,
  .plane,
  .sun-rays {
    animation: none;
  }
}
/* 独占一行的图 */
.prose-figure {
  margin: 2.2em auto;
}
.prose-figure img {
  margin: 0;
}
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6em auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--soft);
}
.prose p > img:only-child {
  margin-block: 1.8em;
}
/* 行内代码：正文里区分出「这是标识符」 */
.prose :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.12em 0.36em;
  border-radius: 5px;
  background: var(--code-inline);
  color: var(--code-ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  white-space: nowrap;
}
/* 宽表格：横向可滚，避免列被压扁 */
.table-wrap {
  overflow-x: auto;
  margin-block: 2em;
  border-radius: 10px;
}
.table-wrap table {
  min-width: 760px;
  width: 100%;
  margin: 0;
  /* 等宽列：中文可在任意字间断行，auto 布局会把短列压到只剩一个字 */
  table-layout: fixed;
}
.table-wrap th,
.table-wrap td {
  overflow-wrap: break-word;
  word-break: normal;
}
.prose table td,
.prose table th {
  padding: 12px 16px;
}
.prose table td:first-child {
  white-space: nowrap;
}
/* 表格里的行内代码允许断行，否则窄列会被撑破 */
.prose .table-wrap code {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}