/* ============================================================
   realTaki — unified design system
   Bilibili-inspired: sky-blue + pink, glassmorphism everywhere.
   No build step, no framework. Just clean CSS.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Design Tokens ── */
:root {
  --font:      'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;

  /* B站品牌色 */
  --b-blue:       #00aeec;
  --b-blue-deep:  #0086c9;
  --b-blue-soft:  #59d0ff;
  --b-pink:       #fb7299;
  --b-pink-soft:  #ffa0bc;

  /* 中性色 */
  --c-bg:        #eef4f9;
  --c-surface:   #ffffff;
  --c-line:      rgba(180, 205, 225, 0.55);
  --c-line-soft: rgba(180, 205, 225, 0.30);
  --c-ink:       #18191c;
  --c-ink2:      #61666d;
  --c-ink3:      #9499a0;

  /* 毛玻璃 */
  --glass-bg:     rgba(255, 255, 255, 0.58);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-bg-card: rgba(255, 255, 255, 0.64);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-blur:   18px;

  /* 深度 */
  --shadow-sm: 0 2px 8px  rgba(31, 84, 120, 0.06);
  --shadow-md: 0 8px 28px rgba(31, 84, 120, 0.10);
  --shadow-lg: 0 18px 48px rgba(31, 84, 120, 0.16);
  --shadow-blue: 0 8px 24px rgba(0, 174, 236, 0.28);

  --radius-sm:   8px;
  --radius:      12px;
  --radius-md:   16px;
  --radius-lg:   20px;
  --radius-full: 999px;

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

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font);
  color: var(--c-ink);
  background: var(--c-bg);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Selection ── */
::selection { background: rgba(0, 174, 236, 0.22); color: var(--c-ink); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--b-blue), var(--b-blue-deep));
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--b-blue-soft), var(--b-blue));
}

/* ── Container ── */
.container { max-width: var(--container-max, 1200px); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }

/* =================================================================
   Shared Glass Mixin — used via class on cards, panels, nav, etc.
   ================================================================= */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}
.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(calc(var(--glass-blur) + 4px)) saturate(180%);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) + 4px)) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

/* =================================================================
   Site Header — sticky glass nav, shared across all pages
   ================================================================= */
.site-head {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(calc(var(--glass-blur) + 4px)) saturate(190%);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) + 4px)) saturate(190%);
  border-bottom: 1px solid var(--c-line-soft);
  box-shadow: var(--shadow-sm);
}
.site-head-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: 16px;
}
.site-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 15px; color: var(--c-ink);
  letter-spacing: -0.01em; transition: opacity 0.15s;
}
.site-brand:hover { opacity: 0.6; }
.site-brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--b-blue), var(--b-blue-deep));
  box-shadow: 0 0 0 4px rgba(0, 174, 236, 0.12);
}

/* ── Nav links ── */
.site-nav { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.site-nav a {
  position: relative;
  padding: 7px 15px; border-radius: var(--radius-full);
  font-size: 13.5px; font-weight: 600; color: var(--c-ink2);
  border: 1px solid transparent;
  transition: all 0.22s var(--ease);
}
.site-nav a:hover {
  color: var(--b-blue);
  background: rgba(0, 174, 236, 0.10);
  border-color: rgba(0, 174, 236, 0.22);
  transform: translateY(-1px);
}
.site-nav a.active {
  color: var(--b-blue-deep);
  background: rgba(0, 174, 236, 0.14);
  border-color: rgba(0, 174, 236, 0.30);
  font-weight: 700;
}
.site-nav .nav-sep {
  display: inline-block; width: 1px; height: 18px;
  background: var(--c-line); margin: 0 6px; align-self: center;
}

/* ── Language toggle (shared, site-wide) ── */
.lang-toggle {
  display: inline-flex; align-items: center;
  margin-left: 6px; padding: 0;
  background: var(--c-line-soft); border: 1px solid var(--c-line);
  border-radius: var(--radius-full); overflow: hidden;
  font-family: inherit; cursor: pointer;
  flex-shrink: 0;
}
.lang-toggle .lang-side {
  padding: 5px 10px; font-size: 12px; font-weight: 500;
  color: var(--c-ink3); background: transparent; border: 0;
  cursor: pointer; transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.lang-toggle .lang-side:hover { color: var(--c-ink); }
.lang-toggle .lang-side.active {
  background: var(--c-surface); color: var(--b-blue-deep);
  font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.lang-toggle .lang-side.active:first-child {
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}
.lang-toggle .lang-side.active:last-child {
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}
.lang-toggle .lang-sep {
  width: 1px; height: 14px; background: var(--c-line);
}

@media (max-width: 520px) {
  .site-brand span.brand-text { display: none; }
  .site-nav a { padding: 5px 10px; font-size: 12px; }
  .lang-toggle .lang-side { padding: 4px 8px; font-size: 11px; }
}

/* =================================================================
   Footer — shared across all pages
   ================================================================= */
.site-foot {
  text-align: center; padding: 36px 0;
  color: var(--c-ink3); font-size: 12.5px; line-height: 1.8;
  border-top: 1px solid var(--c-line-soft);
}
.site-foot a { color: var(--b-blue); transition: color 0.15s; }
.site-foot a:hover { color: var(--b-blue-deep); }

/* =================================================================
   Back-to-top button
   ================================================================= */
.totop {
  position: fixed; right: 26px; bottom: 26px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-size: 19px; color: var(--b-blue);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: all 0.3s var(--ease);
}
.totop.show { opacity: 1; visibility: visible; transform: translateY(0); }
.totop:hover {
  color: #fff; background: linear-gradient(120deg, var(--b-blue), var(--b-blue-soft));
  transform: translateY(-4px); box-shadow: var(--shadow-blue);
}

/* =================================================================
   Tag pills (shared)
   ================================================================= */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11.5px; font-weight: 600;
  background: rgba(0, 174, 236, 0.12); color: var(--b-blue-deep);
  border: 1px solid rgba(0, 174, 236, 0.18);
}
.tag.pink {
  background: rgba(251, 114, 153, 0.14); color: var(--b-pink);
  border-color: rgba(251, 114, 153, 0.24);
}
.tag.amber {
  background: rgba(245, 158, 11, 0.14); color: #b45309;
  border-color: rgba(245, 158, 11, 0.40);
}
.tag.ghost { background: transparent; border-color: transparent; color: var(--c-ink3); padding-left: 0; }

/* =================================================================
   Card grid (shared base — pages extend)
   ================================================================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 16px;
}
.card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-md); padding: 18px 20px;
  display: block; color: inherit;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
/* Animated top border on hover */
.card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--b-blue), var(--b-blue-soft), var(--b-pink));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.38s var(--ease);
}
.card:hover::before { transform: scaleX(1); }
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 174, 236, 0.50);
  box-shadow: var(--shadow-lg);
  color: inherit;
}
.card .card-title { font-weight: 700; font-size: 15.5px; letter-spacing: 0.2px; }
.card:hover .card-title { color: var(--b-blue); }
.card .card-desc { color: var(--c-ink2); font-size: 13px; margin-top: 7px; line-height: 1.6; }

/* =================================================================
   Blog post typography
   ================================================================= */
.post-wrap { max-width: 760px; margin: 0 auto; padding: 56px 0 80px; }

.post-header { margin-bottom: 40px; }
.post-header h1 {
  font-size: clamp(24px, 4vw, 36px); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 14px;
  color: var(--c-ink);
}
.post-meta {
  font-size: 14px; color: var(--c-ink3);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}

.post-body {
  font-size: 17px; line-height: 1.88; color: var(--c-ink2);
}
.post-body > * + * { margin-top: 1.15em; }
.post-body > *:first-child { margin-top: 0; }

.post-body h2 {
  font-size: 22px; font-weight: 700; margin-top: 2.2em; margin-bottom: 0.6em;
  color: var(--c-ink); letter-spacing: -0.01em;
  padding-bottom: 0.4em; border-bottom: 1px solid var(--c-line);
}
.post-body h3 {
  font-size: 18px; font-weight: 600; margin-top: 1.8em; margin-bottom: 0.5em;
  color: var(--b-blue-deep);
}
.post-body p { line-height: 1.88; }
.post-body strong { color: var(--c-ink); font-weight: 600; }
.post-body a { color: var(--b-blue); text-decoration: underline; text-underline-offset: 3px; }
.post-body a:hover { color: var(--b-blue-deep); }

.post-body ul, .post-body ol { padding-left: 1.5em; }
.post-body li { margin: 0.4em 0; }
.post-body li::marker { color: var(--b-blue); }

.post-body blockquote {
  margin: 1.5em 0; padding: 1em 1.3em;
  border-left: 3px solid var(--b-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: linear-gradient(100deg, rgba(0, 174, 236, 0.08), rgba(0, 174, 236, 0.02));
  color: var(--c-ink2);
  font-style: italic;
}
.post-body blockquote p { margin: 0.4em 0; }
.post-body blockquote strong { color: var(--b-blue-deep); }

.post-body code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: rgba(0, 174, 236, 0.08); padding: 2px 6px;
  border-radius: 4px; color: #be185d;
  border: 1px solid var(--c-line-soft);
}
.post-body pre {
  font-family: var(--font-mono); font-size: 14px; line-height: 1.6;
  background: #1e293b; color: #e2e8f0;
  padding: 20px 24px; border-radius: var(--radius);
  overflow-x: auto; margin: 1.5em 0;
  box-shadow: var(--shadow-sm);
}
.post-body pre code {
  background: none; padding: 0; border-radius: 0;
  color: inherit; font-size: inherit; border: none;
}

.post-body table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 15px; margin: 1.5em 0;
  border: 1px solid var(--c-line); border-radius: var(--radius-sm); overflow: hidden;
}
.post-body th, .post-body td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--c-line-soft);
}
.post-body tr:last-child td { border-bottom: none; }
.post-body th {
  background: rgba(0, 174, 236, 0.08); font-weight: 600;
  color: var(--c-ink);
}
.post-body tbody tr { transition: background 0.15s; }
.post-body tbody tr:hover { background: rgba(0, 174, 236, 0.04); }

.post-body hr {
  border: none; height: 1px; margin: 2.5em 0;
  background: linear-gradient(90deg, transparent, var(--c-line), transparent);
}
.post-body img { border-radius: var(--radius); box-shadow: var(--shadow-md); }

/* Back link */
.post-back {
  display: inline-block; margin-top: 48px;
  padding: 11px 24px; border-radius: var(--radius-full);
  font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(120deg, var(--b-blue-deep), var(--b-blue) 55%, var(--b-blue-soft));
  border: 1px solid rgba(255, 255, 255, 0.30);
  box-shadow: var(--shadow-blue);
  transition: transform 0.26s var(--ease), box-shadow 0.26s var(--ease), filter 0.26s var(--ease);
}
.post-back:hover {
  color: #fff; transform: translateY(-3px);
  filter: brightness(1.1); box-shadow: 0 14px 34px rgba(0, 174, 236, 0.42);
}

/* =================================================================
   Blog post layout — sticky reading guide on the left.
   Articles wrap in `.post-layout` containing `.post-toc-sidebar`
   (the TOC) and `.post-wrap` (the article). On narrow screens the
   sidebar collapses above the content.
   ================================================================= */
.post-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: 52px;
  justify-content: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 0 80px;
  align-items: start;
}
.post-layout > * { min-width: 0; }

.post-toc-sidebar {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: var(--c-line) transparent;
}
.post-toc-sidebar::-webkit-scrollbar { width: 6px; }
.post-toc-sidebar::-webkit-scrollbar-thumb {
  background: var(--c-line); border-radius: 3px;
}

.post-toc-sidebar > strong {
  display: block;
  margin-bottom: 12px;
  color: var(--c-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-line-soft);
}

.post-toc-sidebar ol {
  margin: 0; padding: 0;
  list-style: none;
  counter-reset: tocItem;
}

.post-toc-sidebar li {
  counter-increment: tocItem;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
}

.post-toc-sidebar li::before {
  content: counter(tocItem, decimal-leading-zero);
  color: var(--c-ink3);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  margin-right: 7px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.post-toc-sidebar a {
  color: var(--c-ink2);
  text-decoration: none;
  display: block;
  padding: 4px 0 4px 9px;
  margin-left: -9px;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  border-radius: 0 4px 4px 0;
}

.post-toc-sidebar a:hover {
  color: var(--b-blue-deep);
  border-left-color: var(--b-blue);
  background: rgba(0, 174, 236, 0.05);
}

.post-toc-sidebar a.is-active {
  color: var(--b-blue-deep);
  border-left-color: var(--b-blue);
  font-weight: 600;
  background: rgba(0, 174, 236, 0.08);
}

/* When the post opt out of the sidebar (e.g. very short articles),
   leave the old in-body TOC working — fall back to the existing rules. */
.post-body .post-toc {
  margin: 30px 0 38px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}
.post-body .post-toc strong { display: block; margin-bottom: 8px; color: var(--c-ink); }
.post-body .post-toc ol { columns: 2; column-gap: 34px; padding-left: 1.4em; margin: 0; }
.post-body .post-toc li { break-inside: avoid; margin: 4px 0; font-size: 14px; }
.post-body .post-toc a { color: var(--c-ink2); text-decoration: none; }
.post-body .post-toc a:hover { color: var(--b-blue-deep); }

@media (max-width: 1024px) {
  .post-layout {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 0;
    padding: 40px 0 60px;
  }
  .post-wrap { max-width: 100%; }
  .post-toc-sidebar {
    position: static;
    max-height: none;
    margin-bottom: 32px;
    padding: 16px 18px;
  }
  .post-toc-sidebar li { font-size: 13px; }
  .post-toc-sidebar li::before { font-size: 11.5px; }
}
@media (max-width: 640px) {
  .post-toc-sidebar { padding: 14px 16px; }
}

/* ── Bilingual post body ──
   The article body contains both EN and CN versions inline. The site-wide
   lang toggle sets <html lang="zh-CN"> or <html lang="en">, and that same
   attribute drives which half of the post is visible. No per-page state. */
html[lang="zh-CN"] [data-lang="en"],
html[lang="en"]    [data-lang="zh"] { display: none; }

/* =================================================================
   Section heading (shared)
   ================================================================= */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
  padding-bottom: 14px; border-bottom: 1px solid var(--c-line);
  position: relative;
}
.sec-head::before {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 40px; height: 2px;
  background: linear-gradient(90deg, var(--b-blue), var(--b-pink));
  border-radius: 2px;
}
.sec-head h2 {
  font-size: 24px; font-weight: 700; margin: 0;
  letter-spacing: -0.01em; color: var(--c-ink);
  display: flex; align-items: center; gap: 10px;
}
.sec-head .sec-sub { font-size: 13px; color: var(--c-ink3); }

/* =================================================================
   Stats grid (shared)
   ================================================================= */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md); padding: 22px 22px 20px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--b-blue), var(--b-blue-soft));
  opacity: 0; transition: opacity 0.22s var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(0, 174, 236, 0.30); }
.stat:hover::before { opacity: 1; }
.stat .stat-label {
  font-size: 11px; color: var(--c-ink3); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 10px; font-weight: 700;
}
.stat .stat-value {
  font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
  color: var(--c-ink); font-variant-numeric: tabular-nums;
}
.stat .stat-delta {
  font-size: 12px; color: var(--b-blue-deep); margin-top: 10px; font-weight: 500;
}

/* =================================================================
   Badge / achievement
   ================================================================= */
.badge-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.badge {
  display: inline-block; padding: 9px 20px; border-radius: var(--radius-full);
  font-size: 13.5px; font-weight: 700; color: #fff; letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.badge:hover { transform: translateY(-4px) scale(1.04); }
.badge.blue  { background: linear-gradient(120deg, var(--b-blue-deep), var(--b-blue));       box-shadow: var(--shadow-blue); }
.badge.light { background: linear-gradient(120deg, var(--b-blue), var(--b-blue-soft));        box-shadow: 0 8px 22px rgba(89, 208, 255, 0.34); }
.badge.pink  { background: linear-gradient(120deg, var(--b-pink), var(--b-pink-soft));        box-shadow: 0 8px 22px rgba(251, 114, 153, 0.34); }
.badge.dark  { background: linear-gradient(120deg, #20262c, #39424c);                         box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28); }

/* =================================================================
   Contact buttons
   ================================================================= */
.contact-row { display: flex; flex-wrap: wrap; gap: 13px; justify-content: center; margin-top: 10px; }
.contact-btn {
  position: relative; overflow: hidden;
  padding: 11px 24px; border-radius: var(--radius-full);
  font-size: 14.5px; font-weight: 600; color: var(--c-ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.26s var(--ease), box-shadow 0.26s var(--ease), color 0.26s var(--ease);
}
.contact-btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, var(--b-blue), var(--b-blue-soft));
  opacity: 0; transition: opacity 0.28s var(--ease);
}
.contact-btn:hover {
  color: #fff; transform: translateY(-4px);
  box-shadow: var(--shadow-blue);
  border-color: transparent;
}
.contact-btn:hover::after { opacity: 1; }

/* =================================================================
   Responsive
   ================================================================= */
@media (max-width: 640px) {
  .post-body { font-size: 16px; line-height: 1.85; }
  .post-body pre { padding: 14px 16px; font-size: 13px; }
  .totop { right: 16px; bottom: 16px; width: 42px; height: 42px; }
}

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

/* =================================================================
   Long-form article (blog insight pages + investigation modal)
   Originally lived inline in investigation/index.html;
   extracted here so /blog/insight-*/ pages share the same look.
   ================================================================= */
.article-eyebrow {
  display: inline-flex; font-size: 11px; font-weight: 700;
  color: var(--b-blue); background: var(--primary-soft);
  padding: 5px 10px; border-radius: 999px;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin: 0 0 14px;
}
.article-deck {
  font-size: 17px; line-height: 1.55; color: var(--c-ink2);
  margin: 0 0 14px; font-weight: 500;
}
.article-byline {
  font-size: 12px; color: var(--c-ink3);
  padding-bottom: 18px; margin-bottom: 22px;
  border-bottom: 1px solid var(--c-line-soft);
}
.article-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin: 0 0 28px;
}
.article-stat {
  background: var(--c-bg); border: 1px solid var(--c-line);
  border-radius: 12px; padding: 16px 18px;
}
.article-stat-value {
  font-size: 26px; font-weight: 700; line-height: 1.1;
  color: var(--c-ink); letter-spacing: -0.02em;
}
.article-stat-suffix {
  font-size: 13px; font-weight: 500; color: var(--c-ink3);
  margin-left: 4px;
}
.article-stat-label {
  font-size: 11px; color: var(--c-ink3);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-top: 6px; font-weight: 600;
}
.article-section {
  margin: 0 0 26px;
}
.article-section h3 {
  font-size: 18px; font-weight: 700; margin: 0 0 12px;
  color: var(--c-ink); letter-spacing: -0.01em;
}
.article-section p {
  font-size: 14.5px; line-height: 1.7; color: var(--c-ink2);
  margin: 0 0 12px;
}
.article-callout {
  margin: 28px 0; padding: 22px 26px;
  border-radius: 14px; border: 1px solid var(--c-line);
  background: var(--c-bg);
}
.article-callout-quote { border-left: 4px solid var(--b-blue); }
.article-callout-stat { border-left: 4px solid var(--accent); }
.article-callout-text {
  font-size: 16px; line-height: 1.6; font-weight: 500;
  color: var(--c-ink); margin: 0 0 8px;
}
.article-callout-cite {
  font-size: 12px; color: var(--c-ink3); font-style: italic;
}
.article-related {
  margin: 32px 0 8px; padding-top: 22px;
  border-top: 1px solid var(--c-line-soft);
}
.article-related-title {
  font-size: 11px; color: var(--c-ink3);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 10px; font-weight: 700;
}
.article-related-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.article-related-tag {
  display: inline-flex; align-items: center;
  padding: 5px 12px; background: var(--c-surface);
  border: 1px solid var(--c-line); border-radius: 999px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all 0.15s ease;
}
.article-related-tag:hover {
  background: var(--b-blue); color: white;
  border-color: var(--b-blue); transform: translateY(-1px);
}
.article-related-tag.muted {
  color: var(--c-ink3); cursor: default; opacity: 0.5;
}
.article-related-tag.muted:hover {
  background: var(--c-surface); color: var(--c-ink3);
  border-color: var(--c-line); transform: none;
}
