/* The site theme: one stylesheet for the home, post, category and core pages (deliver/render.py).
   Colours, type and spacing are tokens; no reader-visible word lives here (theme/labels/ has them). */
:root {
  /* palette roles */
  --accent: #147D78;
  --accent-soft: #D7EBE7;
  --ink: #1F2D36;
  --muted: #4A5A62;
  --panel: #EEF4F1;
  --base-light: #F3E5CE;
  --bg: #FFFFFF;
  --line: color-mix(in srgb, var(--ink) 11%, var(--bg));
  --line-strong: color-mix(in srgb, var(--ink) 20%, var(--bg));
  --faint: color-mix(in srgb, var(--muted) 72%, var(--bg));

  /* type scale 14/16/18/20/24/30/36 (+48 display for the home hero only) */
  --font: 'Noto Sans TC', 'Noto Sans', system-ui, sans-serif;
  --fs-14: .875rem; --fs-16: 1rem; --fs-18: 1.125rem; --fs-20: 1.25rem;
  --fs-24: 1.5rem; --fs-30: 1.875rem; --fs-36: 2.25rem; --fs-display: 3rem;
  --lh-body: 1.8; --lh-head: 1.4;

  /* spacing 4/8/12/16/24/32/48/64 */
  --s-4: 4px; --s-8: 8px; --s-12: 12px; --s-16: 16px; --s-24: 24px; --s-32: 32px; --s-48: 48px; --s-64: 64px;
  --r-4: 4px; --r-8: 8px; --r-12: 12px;

  --content: 680px;       /* contentSize */
  --wide: 1200px;         /* wideSize */
  --page: 1360px;         /* three-column article shell */
  --gutter: 32px;
  --header-h: 72px;
  --shadow-hover: 0 6px 20px color-mix(in srgb, var(--ink) 10%, transparent);
}

/* palettes (SITE_STYLE_CONFIG.palettes): :root above is classic; each other one replaces the palette roles */
[data-palette="teal"] { --accent: #0F6E68; --accent-soft: #DDEFEC; --ink: #1F2D36; --muted: #4A5A62; --panel: #F2F7F6; --base-light: #E4EFEC; --bg: #FFFFFF; }
[data-palette="ink"] { --accent: #18181B; --accent-soft: #EDEDEF; --ink: #18181B; --muted: #52525B; --panel: #F6F6F7; --base-light: #EAEAEC; --bg: #FFFFFF; }
[data-palette="slate"] { --accent: #2F5D8A; --accent-soft: #E3EBF3; --ink: #1C2430; --muted: #505B68; --panel: #F4F6F9; --base-light: #E6EBF1; --bg: #FFFFFF; }
[data-palette="sage"] { --accent: #3E6B5A; --accent-soft: #E2ECE7; --ink: #1F2623; --muted: #535E59; --panel: #F4F6F5; --base-light: #E5EBE8; --bg: #FFFFFF; }
[data-palette="clay"] { --accent: #9A4B2B; --accent-soft: #F4E6DE; --ink: #262220; --muted: #5A524D; --panel: #F8F5F2; --base-light: #EFE6DE; --bg: #FFFFFF; }
[data-palette="indigo"] { --accent: #4338CA; --accent-soft: #E7E6FB; --ink: #1E1B2E; --muted: #545068; --panel: #F6F6FB; --base-light: #E9E8F5; --bg: #FFFFFF; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--s-24)); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--fs-16); line-height: 1.7;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: var(--lh-head); margin: 0; font-weight: 800; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-4); }

.wrap { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }
.tpl-post .header-inner, .tpl-post .footer-grid, .tpl-post .footer-bottom { width: min(100% - 2 * var(--gutter), var(--page)); }
.wrap-narrow { width: min(100% - 2 * var(--gutter), var(--content)); margin-inline: auto; }

/* ---------- shared bits ---------- */
.text-link { color: var(--accent); font-weight: 700; font-size: var(--fs-16); display: inline-flex; gap: var(--s-8); align-items: center; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link--arrow::after { content: ""; width: 7px; height: 7px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.text-link--arrow:hover::after { transform: translateX(3px) rotate(45deg); }
.badge { display: inline-block; background: var(--accent); color: #fff; font-size: var(--fs-14); font-weight: 700; line-height: 1; padding: 6px 10px; border-radius: var(--r-4); letter-spacing: .02em; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--s-24); border-radius: var(--r-8); font-weight: 700; font-size: var(--fs-16); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-8); }
.chip { display: inline-flex; align-items: center; gap: var(--s-8); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: var(--fs-14); color: var(--muted); background: var(--bg); line-height: 1.4; transition: border-color .15s, color .15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 700; }
.chip-count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.chip.is-active .chip-count { color: var(--accent); }
.avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--panel); color: var(--accent); font-weight: 800; font-size: var(--fs-18); border: 1px solid var(--line); }
.tree-thumb { display: block; }
.avatar--mark svg { width: 70%; height: 70%; }

.crumbs ol { display: flex; flex-wrap: wrap; gap: var(--s-4) 0; font-size: var(--fs-14); color: var(--muted); }
.crumbs li:not(:last-child)::after { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 10px 2px 8px; border-top: 1.5px solid var(--faint); border-right: 1.5px solid var(--faint); transform: rotate(45deg); }
.crumbs a:hover { color: var(--accent); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: var(--s-32); }
.brand { flex: none; display: block; }
.brand .logo { height: 40px; width: auto; }
.site-nav { margin-left: auto; min-width: 0; }
.site-nav ul { display: flex; gap: var(--s-4); }
.site-nav a { display: block; padding: var(--s-8) var(--s-12); border-radius: var(--r-8); font-size: var(--fs-16); font-weight: 500; color: var(--muted); white-space: nowrap; max-width: 15em; overflow: hidden; text-overflow: ellipsis; }
.site-nav a:hover { color: var(--ink); background: var(--panel); }
.site-nav a[aria-current] { color: var(--accent); font-weight: 700; }
.nav-toggle { display: none; margin-left: auto; align-items: center; gap: var(--s-8); background: none; border: 1px solid var(--line); border-radius: var(--r-8); padding: var(--s-8) var(--s-12); font-size: var(--fs-14); font-weight: 700; cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 16px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; transition: transform .2s, background .2s; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; } .nav-toggle-bars::after { top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }
.read-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--accent); }

/* ---------- footer ---------- */
.site-footer { margin-top: var(--s-64); border-top: 1px solid var(--line); background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-48); padding: var(--s-64) 0 var(--s-48); }
.footer-brand .logo { height: 36px; width: auto; }
.footer-brand p { margin-top: var(--s-16); color: var(--muted); font-size: var(--fs-14); line-height: 1.8; max-width: 30em; }
.footer-title { font-size: var(--fs-14); font-weight: 700; color: var(--ink); margin-bottom: var(--s-12); }
.footer-title-gap { margin-top: var(--s-24); }
.footer-col li + li { margin-top: var(--s-8); }
.footer-col a { font-size: var(--fs-14); color: var(--muted); }
.footer-col a:hover { color: var(--accent); }
.footer-mail { font-size: var(--fs-14); color: var(--accent) !important; word-break: break-all; }
.footer-bottom { display: flex; justify-content: space-between; gap: var(--s-16); padding: var(--s-24) 0; border-top: 1px solid var(--line); font-size: var(--fs-14); color: var(--faint); }
.footer-bottom a:hover { color: var(--accent); }

/* ---------- cards ---------- */
.card { display: flex; flex-direction: column; gap: var(--s-16); min-width: 0; }
.card-media { display: block; aspect-ratio: 16 / 9; border-radius: var(--r-12); overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: box-shadow .2s; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media { box-shadow: var(--shadow-hover); }
.card:hover .card-media img { transform: scale(1.03); }
.card-body { display: flex; flex-direction: column; gap: var(--s-8); min-width: 0; }
.card-cat { font-size: var(--fs-14); font-weight: 700; color: var(--accent); width: fit-content; }
.card-cat:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-title { font-size: var(--fs-20); font-weight: 700; line-height: var(--lh-head); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { font-size: var(--fs-16); color: var(--muted); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: var(--s-8); font-size: var(--fs-14); color: var(--faint); }

.card-grid--grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-48) var(--s-32); }
.card-grid--list { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: var(--s-32) var(--s-48); }
.card-grid--list .card { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s-24); align-items: center; }
.card-grid--list .card:only-child { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-48); }
.card-grid--list .card-title { font-size: var(--fs-20); }
.card-grid--list .card:only-child .card-title { font-size: var(--fs-24); }
.card-grid--list .card-excerpt { -webkit-line-clamp: 3; }

/* ---------- sections ---------- */
.section { padding: var(--s-64) 0 0; }
.section--tight { padding-top: var(--s-48); }
.section-head { margin-bottom: var(--s-32); }
.section-head--split { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-24); padding-bottom: var(--s-16); border-bottom: 1px solid var(--line); }
.section-kicker { font-size: var(--fs-14); font-weight: 700; color: var(--faint); margin-bottom: var(--s-4); }
.section-title { font-size: var(--fs-30); }
.section-title a:hover { color: var(--accent); }
.section-title--sm { font-size: var(--fs-20); }

/* ---------- home ---------- */
/* Home carousel: every slide is in the HTML as a real link (crawlable without JS); CSS scroll-snap moves it,
   the dots are anchors, theme.js only adds the buttons, the active dot and a pausable autoplay.
   Two looks, set by the wrapper: .cv = cover (image fills the slide, text over it), .cd = card (image above text). */
.carousel { position: relative; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; border-radius: 16px; }
.carousel-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; min-width: 0; }
.slide-link { position: relative; display: block; height: 100%; color: inherit; }
.slide-media { display: block; overflow: hidden; background: var(--panel); }
.slide-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.slide-link:hover .slide-media img { transform: scale(1.03); }
.slide-body { display: flex; flex-direction: column; gap: var(--s-12); }
.slide-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-12); }
.slide-cat { font-size: var(--fs-14); font-weight: 700; color: var(--accent); }
.slide-title { line-height: 1.35; }
.slide-excerpt { color: var(--muted); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slide-more { font-weight: 700; color: var(--accent); width: fit-content; border-bottom: 2px solid currentColor; padding-bottom: 2px; }
.carousel-nav { display: flex; align-items: center; gap: var(--s-12); margin-top: var(--s-16); }
.carousel-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font-size: var(--fs-20); line-height: 1; cursor: pointer; display: grid; place-items: center; transition: border-color .15s, color .15s; }
.carousel-btn:hover { border-color: var(--accent); color: var(--accent); }
.carousel-dots { display: flex; gap: 6px; }
.carousel-dots a { display: block; width: 6px; height: 6px; border-radius: 999px; background: var(--line-strong); transition: width .25s, background .25s; }
.carousel-dots a.is-active { width: 22px; background: var(--accent); }

/* cover */
.cv .slide-link { aspect-ratio: 12 / 5; overflow: hidden; border-radius: 16px; isolation: isolate; }
.cv .slide-media { position: absolute; inset: 0; z-index: -2; }
.cv .slide-link::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 78%, transparent) 0, color-mix(in srgb, var(--ink) 45%, transparent) 42%, transparent 72%); }
.cv .slide-body { position: absolute; inset: 0 auto 0 0; width: min(560px, 62%); justify-content: flex-end; padding: var(--s-48); color: #fff; }
.cv .slide-title { font-size: var(--fs-36); color: #fff; }
.cv .slide-excerpt { color: color-mix(in srgb, #fff 86%, transparent); font-size: var(--fs-16); }
.cv .slide-cat, .cv .slide-more { color: #fff; }
.cv .carousel-nav { justify-content: flex-end; }

/* card */
.cd .slide-link { display: flex; flex-direction: column; gap: var(--s-16); }
.cd .slide-media { aspect-ratio: 16 / 9; border-radius: var(--r-12); }
.cd .slide-title { font-size: var(--fs-24); }
.cd .slide-link:hover .slide-title { color: var(--accent); }

@media (max-width: 1023px) {
  .cv .slide-link { aspect-ratio: 4 / 3; }
  .cv .slide-link::before { background: linear-gradient(0deg, color-mix(in srgb, var(--ink) 82%, transparent) 0, transparent 70%); }
  .cv .slide-body { width: auto; inset: auto 0 0 0; padding: var(--s-24); }
  .cv .slide-title { font-size: var(--fs-24); }
}
@media (max-width: 639px) { .cv .slide-link { aspect-ratio: 4 / 5; } .cv .slide-excerpt { display: none; } .cd .slide-title { font-size: var(--fs-20); } }
@media (prefers-reduced-motion: reduce) { .carousel-track { scroll-behavior: auto; } }

/* layout: classic — the first sites' home: hero, the carousel as split cards, topic cards, latest per topic */
.hero { padding: var(--s-64) 0 var(--s-48); background:
  radial-gradient(60% 120% at 100% 0%, color-mix(in srgb, var(--base-light) 55%, transparent) 0, transparent 70%),
  linear-gradient(180deg, var(--panel) 0, var(--bg) 100%); }
.hero-inner { max-width: var(--wide); }
.hero-title { font-size: var(--fs-display); letter-spacing: -.01em; line-height: 1.2; }
.hero-desc { margin-top: var(--s-16); font-size: var(--fs-20); line-height: 1.75; color: var(--ink); max-width: 36em; }
.hero-audience { margin-top: var(--s-12); font-size: var(--fs-16); color: var(--muted); max-width: 40em; padding-left: var(--s-12); border-left: 3px solid var(--accent-soft); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-24) var(--s-32); margin-top: var(--s-32); }
.hero-stats { display: flex; gap: var(--s-24); color: var(--muted); font-size: var(--fs-14); }
.hero-stats b { font-size: var(--fs-24); color: var(--ink); font-weight: 800; margin-right: 2px; font-variant-numeric: tabular-nums; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-32); }
.topic-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-12); overflow: hidden; background: var(--bg); transition: box-shadow .2s, border-color .2s; }
.topic-card:hover { box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.topic-media { display: block; aspect-ratio: 16 / 9; background: var(--panel); overflow: hidden; }
.topic-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.topic-card:hover .topic-media img { transform: scale(1.03); }
.topic-body { display: flex; flex-direction: column; gap: var(--s-8); padding: var(--s-24); flex: 1; }
.topic-count { font-size: var(--fs-14); color: var(--faint); font-weight: 700; font-variant-numeric: tabular-nums; }
.topic-name { font-size: var(--fs-20); }
.topic-name a:hover { color: var(--accent); }
.topic-desc { color: var(--muted); font-size: var(--fs-16); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.topic-body .chips { margin-top: auto; padding-top: var(--s-12); }
.sp .slide-link { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-48); align-items: center; padding: var(--s-24); border: 1px solid var(--line); border-radius: var(--r-12); background: var(--bg); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 5%, transparent); }
.sp .carousel-track { border-radius: var(--r-12); }
.sp .slide-media { aspect-ratio: 16 / 9; border-radius: var(--r-8); }
.sp .slide-body { gap: var(--s-16); padding-right: var(--s-24); }
.sp .slide-title { font-size: var(--fs-30); }
.sp .slide-link:hover .slide-title { color: var(--accent); }
.sp .slide-excerpt { font-size: var(--fs-18); -webkit-line-clamp: 3; }
.sp .carousel-nav { justify-content: center; }
@media (max-width: 1023px) { .sp .slide-link { grid-template-columns: minmax(0, 1fr); gap: var(--s-24); } .sp .slide-body { padding: 0 var(--s-8) var(--s-8); } }
@media (max-width: 639px) { .hero { padding: var(--s-48) 0 var(--s-32); } .hero-title { font-size: var(--fs-36); } .hero-desc { font-size: var(--fs-18); } .topic-grid { grid-template-columns: 1fr; gap: var(--s-24); } .sp .slide-link { grid-template-columns: minmax(0, 1fr); gap: var(--s-16); padding: var(--s-12); } .sp .slide-body { padding-right: 0; } .sp .slide-title { font-size: var(--fs-24); } }

/* layout: magazine — intro line, cover carousel, topic tiles, latest per topic */
.mg-intro { padding: var(--s-48) 0 var(--s-32); }
.mg-intro-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-48); }
.mg-title { font-size: var(--fs-display); line-height: 1.15; letter-spacing: -.01em; }
.mg-desc { margin-top: var(--s-16); font-size: var(--fs-18); line-height: 1.75; color: var(--muted); max-width: 38em; }
.mg-intro-side { display: flex; align-items: center; gap: var(--s-32); flex-shrink: 0; }
.mg-stats { display: flex; gap: var(--s-24); }
.mg-stats li { display: flex; flex-direction: column; line-height: 1.2; }
.mg-stats b { font-size: var(--fs-30); font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.mg-stats span { font-size: 13px; color: var(--faint); }
.mg-topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-24); }
.mg-topic { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--panel); transition: transform .2s, box-shadow .2s; }
.mg-topic:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.mg-topic-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.mg-topic-media img { width: 100%; height: 100%; object-fit: cover; }
.mg-topic-body { display: flex; flex-direction: column; gap: var(--s-8); padding: var(--s-16) var(--s-24) var(--s-24); }
.mg-topic-count { font-size: 13px; font-weight: 700; color: var(--accent); }
.mg-topic-name { font-size: var(--fs-20); font-weight: 800; line-height: 1.4; }
.mg-topic-desc { font-size: var(--fs-14); color: var(--muted); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1023px) { .mg-intro-inner { flex-direction: column; align-items: flex-start; gap: var(--s-24); } }
@media (max-width: 639px) { .mg-title { font-size: var(--fs-36); } .mg-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-12); } .mg-topic-desc { display: none; } .mg-topic-body { padding: var(--s-12) var(--s-16) var(--s-16); } .mg-topic-name { font-size: var(--fs-16); } }

/* layout: index — a reference shelf: intro beside a card carousel, then every topic as a card with its list */
.ix-hero { padding: var(--s-48) 0 var(--s-64); background: linear-gradient(180deg, var(--panel) 0, var(--bg) 100%); }
.ix-hero-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s-64); align-items: center; }
.ix-title { font-size: var(--fs-display); line-height: 1.15; }
.ix-desc { margin-top: var(--s-16); font-size: var(--fs-18); line-height: 1.8; }
.ix-audience { margin-top: var(--s-12); font-size: var(--fs-14); color: var(--muted); line-height: 1.7; }
.ix-hero-foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-24); margin-top: var(--s-32); }
.ix-stats { display: flex; gap: var(--s-16); font-size: 13px; color: var(--faint); }
.ix-stats b { font-size: var(--fs-20); color: var(--ink); margin-right: 4px; font-variant-numeric: tabular-nums; }
.ix-hero-carousel { min-width: 0; }
.ix-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-24); }
.ix-card { display: flex; flex-direction: column; gap: var(--s-12); padding: var(--s-24); border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.ix-card-head { display: flex; align-items: center; gap: var(--s-16); }
.ix-card-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-12); flex-shrink: 0; }
.ix-card-name { display: block; font-size: var(--fs-20); font-weight: 800; line-height: 1.4; }
.ix-card-head:hover .ix-card-name { color: var(--accent); }
.ix-card-count { display: block; font-size: 13px; color: var(--faint); }
.ix-card-desc { font-size: var(--fs-14); color: var(--muted); line-height: 1.7; }
.ix-list { counter-reset: ix; border-top: 1px solid var(--line); }
.ix-list li { counter-increment: ix; border-bottom: 1px solid var(--line); }
.ix-list a { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--s-8); padding: var(--s-12) 0; align-items: baseline; }
.ix-list a::before { content: counter(ix); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; align-self: center; }
.ix-list-title { font-weight: 700; line-height: 1.5; }
.ix-list a:hover .ix-list-title { color: var(--accent); }
.ix-list-meta { font-size: 12px; color: var(--faint); white-space: nowrap; }
.ix-card-all { margin-top: auto; padding-top: var(--s-4); font-weight: 700; color: var(--accent); font-size: var(--fs-14); }
@media (max-width: 1023px) { .ix-hero-inner { grid-template-columns: minmax(0, 1fr); gap: var(--s-32); } }
@media (max-width: 639px) { .ix-title { font-size: var(--fs-30); } .ix-cards { grid-template-columns: minmax(0, 1fr); } .ix-card { padding: var(--s-16); } }

/* layout: wall — image-led tiles, for topics readers browse by picture */
.wl-head { padding: var(--s-48) 0 var(--s-24); text-align: center; }
.wl-head-inner { display: flex; flex-direction: column; align-items: center; gap: var(--s-12); }
.wl-title { font-size: var(--fs-36); letter-spacing: .02em; }
.wl-desc { font-size: var(--fs-18); color: var(--muted); max-width: 38em; line-height: 1.7; }
.wl-tile { position: relative; display: block; overflow: hidden; border-radius: var(--r-12); background: var(--panel); aspect-ratio: 4 / 3; isolation: isolate; }
.wl-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; z-index: -1; }
.wl-tile:hover img { transform: scale(1.04); }
.wl-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, color-mix(in srgb, var(--ink) 82%, transparent) 100%); z-index: -1; }
.wl-tile-text { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-16) var(--s-16) var(--s-16); color: #fff; }
.wl-tile-title { font-size: var(--fs-18); font-weight: 800; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wl-tile-kicker { font-size: 12px; font-weight: 700; opacity: .85; letter-spacing: .04em; }
.wl-topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-16); margin-top: var(--s-48); }
.wl-tile--topic { aspect-ratio: 1 / 1; }
.wl-tile--topic .wl-tile-title { font-size: var(--fs-20); }
.wl-featured { margin-top: var(--s-8); }
.wl-wall { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-16); }
.wl-wall .wl-tile:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.wl-wall .wl-tile:first-child .wl-tile-title { font-size: var(--fs-24); }
.wl-wall .wl-tile:only-child { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 21 / 9; }
@media (max-width: 1023px) { .wl-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .wl-wall { grid-template-columns: minmax(0, 1fr); }
  .wl-wall .wl-tile:first-child { grid-column: auto; grid-row: auto; aspect-ratio: 4 / 3; }
  .wl-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* layout: guide — a reading path, numbered steps, for readers new to the subject */
.gd-hero { padding: var(--s-64) 0; background: var(--panel); }
.gd-hero-inner { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--s-48); align-items: center; }
.gd-title { font-size: var(--fs-display); line-height: 1.2; }
.gd-desc { margin-top: var(--s-16); font-size: var(--fs-20); line-height: 1.75; }
.gd-audience { margin-top: var(--s-16); color: var(--muted); }
.gd-cta { margin-top: var(--s-32); width: fit-content; }
.gd-carousel { min-width: 0; padding: var(--s-16); background: var(--bg); border-radius: 16px; box-shadow: 0 10px 30px color-mix(in srgb, var(--ink) 8%, transparent); }
.gd-path { counter-reset: step; display: flex; flex-direction: column; }
.gd-step { counter-increment: step; position: relative; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--s-48); padding: var(--s-32) 0 var(--s-48) var(--s-64); border-left: 2px solid var(--line-strong); margin-left: var(--s-24); }
.gd-step:last-child { border-left-color: transparent; }
.gd-step::before { content: counter(step, decimal-leading-zero); position: absolute; left: -25px; top: var(--s-24); width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--bg); font-weight: 800; font-variant-numeric: tabular-nums; }
.gd-step-head { display: flex; flex-direction: column; gap: var(--s-12); }
.gd-step-name { font-size: var(--fs-24); }
.gd-step-name a:hover { color: var(--accent); }
.gd-step-desc { color: var(--muted); line-height: 1.75; }
.gd-step-posts { display: flex; flex-direction: column; gap: var(--s-12); }
.gd-step-posts a { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: var(--s-16); align-items: center; padding: var(--s-8); border-radius: var(--r-8); transition: background .15s; }
.gd-step-posts a:hover { background: var(--panel); }
.gd-step-posts img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; border-radius: var(--r-4); }
.gd-post-title { display: block; font-weight: 700; line-height: 1.5; }
.gd-post-meta { display: block; margin-top: var(--s-4); font-size: var(--fs-14); color: var(--faint); }
@media (max-width: 1023px) {
  .gd-hero-inner, .gd-step { grid-template-columns: minmax(0, 1fr); }
  .gd-step { gap: var(--s-24); }
}
@media (max-width: 639px) {
  .gd-title { font-size: var(--fs-30); }
  .gd-step { padding-left: var(--s-32); margin-left: var(--s-16); } .gd-step::before { left: -17px; width: 32px; height: 32px; font-size: 12px; }
  .gd-step-posts a { grid-template-columns: 88px minmax(0, 1fr); }
}

.author-band { margin-top: var(--s-64); padding: var(--s-48) 0; background: var(--panel); }
.author-band-inner { display: grid; gap: var(--s-32); }
.author-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-24); align-items: start; max-width: 52em; }
.author-card .avatar { width: 72px; height: 72px; background: var(--bg); font-size: var(--fs-24); }
.author-card-name { font-size: var(--fs-24); font-weight: 800; margin-top: var(--s-4); }
.author-card-name a:hover { color: var(--accent); }
.author-card-bio { margin: var(--s-12) 0 var(--s-16); color: var(--muted); line-height: 1.8; }

/* ---------- post ---------- */
.post-layout { width: min(100% - 2 * var(--gutter), var(--page)); display: grid; grid-template-columns: 220px minmax(0, var(--content)) 280px; justify-content: space-between; gap: var(--s-48); padding-top: var(--s-32); }
.post { min-width: 0; }
.rail { position: sticky; top: calc(var(--header-h) + var(--s-32)); max-height: calc(100vh - var(--header-h) - var(--s-64)); overflow: auto; overscroll-behavior: contain; padding-right: var(--s-4); scrollbar-width: thin; }
.rail-title { font-size: var(--fs-14); font-weight: 700; color: var(--ink); margin-bottom: var(--s-12); }

.toc-list { border-left: 1px solid var(--line); }
.toc-item a { display: block; margin-left: -1px; padding: 6px 0 6px var(--s-12); border-left: 2px solid transparent; font-size: var(--fs-14); line-height: 1.5; color: var(--muted); }
.toc-item--sub a { padding-left: var(--s-24); font-size: 13px; color: var(--faint); }
.toc-item a:hover { color: var(--ink); }
.toc-item a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 700; }

.post-head { margin-top: var(--s-24); }
.post-title { font-size: var(--fs-36); line-height: 1.35; letter-spacing: -.005em; }
.byline { display: flex; align-items: center; gap: var(--s-12); margin-top: var(--s-24); }
.byline-text { display: flex; flex-direction: column; min-width: 0; }
.byline-name { font-weight: 700; font-size: var(--fs-16); }
.byline-name:hover { color: var(--accent); }
.byline-meta { display: flex; flex-wrap: wrap; gap: 0 var(--s-8); font-size: var(--fs-14); color: var(--faint); }
.byline-meta a { color: var(--accent); }
.post-cover { margin: var(--s-32) 0 0; aspect-ratio: 16 / 9; border-radius: var(--r-12); overflow: hidden; background: var(--panel); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }

.toc-inline, .tree-end { display: none; margin-top: var(--s-24); border: 1px solid var(--line); border-radius: var(--r-8); }
.toc-inline > summary, .tree-end > summary { list-style: none; cursor: pointer; padding: var(--s-12) var(--s-16); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.toc-inline > summary::-webkit-details-marker, .tree-end > summary::-webkit-details-marker { display: none; }
.toc-inline > summary::after, .tree-end > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.toc-inline[open] > summary::after, .tree-end[open] > summary::after { transform: rotate(-135deg); }
.toc-inline .toc-list { margin: 0 var(--s-16) var(--s-16); }
.tree-end .tree { padding: 0 var(--s-16) var(--s-16); }
.tree-end .rail-title { display: none; }

/* article body: WordPress block markup (wp-block-image / wp-block-table) */
.entry-content { margin-top: var(--s-32); font-size: var(--fs-18); line-height: var(--lh-body); overflow-wrap: anywhere; }
.entry-content > * + * { margin-top: 1em; }
.entry-content h2 { font-size: var(--fs-30); margin-top: 2.2em; padding-top: 1.1em; border-top: 1px solid var(--line); }
.entry-content h3 { font-size: var(--fs-20); margin-top: 1.8em; }
.entry-content > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.entry-content h2 + p, .entry-content h3 + p { margin-top: .6em; }
.entry-content a {
  color: var(--accent); font-weight: 700; text-decoration: none;
  background: linear-gradient(var(--accent-soft), var(--accent-soft)) 0 100% / 100% .45em no-repeat;
  transition: background-size .15s;
}
.entry-content a:hover { background-size: 100% 100%; }
.entry-content strong { font-weight: 700; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content ul { list-style: disc; } .entry-content ol { list-style: decimal; }
.entry-content li + li { margin-top: .4em; }
.entry-content li::marker { color: var(--accent); }
.entry-content blockquote { margin-left: 0; padding: var(--s-16) var(--s-24); border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 var(--r-8) var(--r-8) 0; color: var(--muted); }
.entry-content figure { margin: 2em 0; }
.wp-block-image img { width: 100%; height: auto; border-radius: var(--r-12); border: 1px solid var(--line); }
.wp-block-image figcaption { margin-top: var(--s-8); font-size: var(--fs-14); color: var(--faint); text-align: center; }
.wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-strong); border-radius: var(--r-12); max-width: none; box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent); }
.wp-block-table table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: var(--fs-16); line-height: 1.6; }
.wp-block-table th, .wp-block-table td { padding: var(--s-12) var(--s-16); text-align: left; vertical-align: top; }
.wp-block-table th + th, .wp-block-table td + td { border-left: 1px solid var(--line); }
.wp-block-table thead th { background: var(--accent-soft); font-size: var(--fs-14); font-weight: 700; color: var(--ink); white-space: nowrap; border-bottom: 2px solid var(--accent); }
.wp-block-table tbody tr + tr td { border-top: 1px solid var(--line); }
.wp-block-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel) 55%, var(--bg)); }
.wp-block-table tbody td { color: var(--muted); }
.wp-block-table tbody td:first-child { font-weight: 700; color: var(--ink); white-space: nowrap; }
.entry-content--page h2 { font-size: var(--fs-24); border-top: 0; padding-top: 0; margin-top: 1.8em; }
/* Sources: the section's external source, a small card under it */
.source-note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--s-12); align-items: center; padding: var(--s-12) var(--s-16); border: 1px solid var(--line); border-radius: var(--r-12); background: color-mix(in srgb, var(--panel) 60%, var(--bg)); font-size: var(--fs-14); line-height: 1.55; }
.source-label { grid-row: span 2; align-self: start; margin-top: 1px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; }
.entry-content .source-note a { color: var(--ink); font-weight: 500; background: none; overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-decoration-thickness: 1px; text-underline-offset: 5px; transition: color .15s, text-decoration-color .15s; }
.entry-content .source-note a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.source-publisher { grid-column: 2; color: var(--faint); font-size: 13px; }

/* Head-Term Links: horizontal scroller */
.related { margin-top: var(--s-64); padding-top: var(--s-32); border-top: 1px solid var(--line-strong); }
.related-head { display: flex; align-items: center; gap: var(--s-12); margin-bottom: var(--s-24); }
.related-title { font-size: var(--fs-24); }
.related-hint { font-size: var(--fs-14); color: var(--faint); display: inline-flex; align-items: center; gap: var(--s-8); }
.related-hint::after { content: ""; width: 18px; height: 1px; background: currentColor; box-shadow: 4px 0 0 0 transparent; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(5px); } }
.related-nav { margin-left: auto; display: flex; gap: var(--s-8); }
.scroll-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--bg); cursor: pointer; display: grid; place-items: center; font-size: var(--fs-24); line-height: 1; color: var(--ink); transition: border-color .15s, color .15s, opacity .15s; }
.scroll-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.scroll-btn:disabled { opacity: .35; cursor: default; }
.scroller { position: relative; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; padding-bottom: var(--s-16); cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent); }
.scroller.is-end { -webkit-mask-image: none; mask-image: none; }
.scroller.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.scroller.is-dragging a { pointer-events: none; }
.scroller-track { display: grid; grid-auto-flow: column; grid-auto-columns: 260px; gap: var(--s-24); }
.scroller-item { scroll-snap-align: start; }
.scroller .card { gap: var(--s-12); }
.scroller .card-title { font-size: var(--fs-16); -webkit-line-clamp: 3; }
.scroller .card-excerpt, .scroller .card-meta { display: none; }
.scroller img { -webkit-user-drag: none; user-select: none; }

.author-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-16); margin-top: var(--s-48); padding: var(--s-24) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.author-box-label { font-size: var(--fs-14); color: var(--faint); font-weight: 700; }
.author-box-name { font-size: var(--fs-18); font-weight: 800; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-12); }
.author-box-name a:hover { color: var(--accent); }
.author-box-bio { margin: var(--s-8) 0 var(--s-12); color: var(--muted); font-size: var(--fs-16); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* category tree: quieter than the TOC */
.tree { font-size: var(--fs-14); }
.tree summary { list-style: none; cursor: pointer; display: grid; align-items: center; gap: var(--s-8); border-radius: var(--r-8); }
.tree summary::-webkit-details-marker { display: none; }
.tree summary:hover { background: var(--panel); }
.tree-parent + .tree-parent { margin-top: var(--s-4); }
.tree-parent > details > summary { grid-template-columns: 40px minmax(0, 1fr) auto; padding: var(--s-8); font-weight: 700; color: var(--ink); }
.tree-parent > details > summary img, .tree-parent > details > summary .tree-thumb { width: 40px; height: 40px; border-radius: var(--r-8); object-fit: cover; background: var(--panel); }
.tree-name { line-height: 1.45; min-width: 0; }
.tree-count { font-size: 12px; color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.tree-children { margin: var(--s-4) 0 var(--s-8) 28px; padding-left: var(--s-12); border-left: 1px solid var(--line); }
.tree-children summary { grid-template-columns: minmax(0, 1fr) auto; padding: 6px var(--s-8); color: var(--muted); font-weight: 500; }
.tree-children details[open] > summary { color: var(--ink); font-weight: 700; }
.tree-posts { margin: 2px 0 var(--s-8); }
.tree-posts a { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--s-8); align-items: center; padding: 6px var(--s-8); border-radius: var(--r-8); color: var(--muted); line-height: 1.45; }
.tree-posts a span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
.tree-posts img, .tree-posts .tree-thumb { width: 48px; aspect-ratio: 16 / 9; border-radius: var(--r-4); object-fit: cover; background: var(--panel); }
.tree-posts a:hover { background: var(--panel); color: var(--ink); }
.tree-posts a.is-current { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.tree-more a { display: block; grid-template-columns: none; padding: 4px var(--s-8); font-size: 13px; color: var(--accent); font-weight: 500; }
.rail--quiet .rail-title { color: var(--faint); }

/* ---------- category ---------- */
.cat-hero { padding: var(--s-32) 0 var(--s-48); background: linear-gradient(180deg, var(--panel) 0, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.cat-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-48); align-items: center; margin-top: var(--s-24); }
.cat-title { font-size: var(--fs-36); }
.cat-desc { margin-top: var(--s-16); font-size: var(--fs-18); color: var(--muted); line-height: 1.8; max-width: 36em; }
.cat-count { margin-top: var(--s-16); font-size: var(--fs-14); font-weight: 700; color: var(--faint); }
.cat-mosaic { position: relative; width: 400px; height: 240px; }
.cat-mosaic img { position: absolute; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-12); border: 4px solid var(--bg); box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 12%, transparent); background: var(--panel); }
.cat-mosaic img:nth-child(1) { width: 78%; right: 0; top: 0; z-index: 2; }
.cat-mosaic img:nth-child(2) { width: 52%; left: 0; bottom: 0; z-index: 3; }
.chips--lg { margin-top: var(--s-32); }
.chips--lg .chip { font-size: var(--fs-16); padding: var(--s-8) var(--s-16); }
.subcat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-16); }
.subcat { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s-16); align-items: center; padding: var(--s-12); border: 1px solid var(--line); border-radius: var(--r-12); transition: border-color .15s, box-shadow .15s; }
.subcat:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); }
.subcat img, .subcat .tree-thumb { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-8); background: var(--panel); }
.subcat-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.subcat-name { font-weight: 700; line-height: 1.45; }
.subcat-count { font-size: var(--fs-14); color: var(--faint); }

/* ---------- page ---------- */
.page { padding-top: var(--s-32); }
.page-head { margin: var(--s-32) 0 0; padding-bottom: var(--s-24); border-bottom: 1px solid var(--line); }
.page-title { font-size: var(--fs-36); }
.profile-head { display: flex; align-items: center; gap: var(--s-24); margin-top: var(--s-32); }
.profile-head .avatar { width: 88px; height: 88px; font-size: var(--fs-30); }
.profile-bio { margin-top: var(--s-24); padding: var(--s-24); background: var(--panel); border-radius: var(--r-12); color: var(--ink); line-height: 1.8; font-size: var(--fs-18); }

/* the menu folds behind the toggle when its items do not fit on one line, or below 1024 (theme.js sets .nav-compact) */
.nav-compact .header-inner { gap: var(--s-16); }
.nav-compact .nav-toggle { display: inline-flex; }
.nav-compact .site-nav { position: absolute; left: 0; right: 0; top: 100%; margin: 0; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px color-mix(in srgb, var(--ink) 8%, transparent); display: none; }
.nav-compact .site-nav.is-open { display: block; }
.nav-compact .site-nav ul { flex-direction: column; gap: 0; width: min(100% - 2 * var(--gutter), var(--wide)); margin: 0 auto; padding: var(--s-8) 0 var(--s-16); }
.nav-compact .site-nav a { white-space: normal; max-width: none; padding: var(--s-12) 0; border-radius: 0; border-bottom: 1px solid var(--line); }
.nav-compact .site-nav li:last-child a { border-bottom: 0; }
.nav-compact .site-nav a:hover { background: none; }
/* ---------- responsive ---------- */
/* 1024–1279: TOC stays as the left rail; the category tree moves to the end */
@media (max-width: 1279px) {
  .post-layout { grid-template-columns: 200px minmax(0, var(--content)); justify-content: center; }
  .post-tree { display: none; }
  .tree-end { display: block; }
}
/* < 1024: one column; TOC under the cover, collapsible, not sticky */
@media (max-width: 1023px) {
  .post-layout { grid-template-columns: minmax(0, var(--content)); }
  .post-toc { display: none; }
  .toc-inline { display: block; }
  .card-grid--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid--list { grid-template-columns: 1fr; }
  .cat-head { grid-template-columns: 1fr; }
  .cat-mosaic { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
  :root { --gutter: 20px; --header-h: 60px; }
  .brand .logo { height: 32px; }
  .nav-toggle-text { display: none; }
  .section { padding-top: var(--s-48); }
  .section-title { font-size: var(--fs-24); }
  .card-grid--grid, .card-grid--list { grid-template-columns: 1fr; gap: var(--s-32); }
  .card-grid--list .card, .card-grid--list .card:only-child { grid-template-columns: 1fr; gap: var(--s-16); }
  .card-grid--list .card-title { font-size: var(--fs-20); }
  .section-head--split .text-link { white-space: nowrap; }
  .section--topic .card-grid .card, .section--topic .card-grid .card:only-child { grid-template-columns: 120px minmax(0, 1fr); gap: var(--s-16); align-items: start; display: grid; }
  .section--topic .card-grid { gap: var(--s-24); }
  .section--topic .card-grid .card .card-title { font-size: var(--fs-16); }
  .section--topic .card-meta span { display: none; }
  .section--topic .card-excerpt { display: none; }
  .section--topic .card-body { gap: var(--s-4); }
  .post-title { font-size: var(--fs-30); }
  .entry-content { font-size: 17px; }
  .entry-content h2 { font-size: var(--fs-24); }
  .entry-content h3 { font-size: var(--fs-18); }
  .post-cover { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; }
  .related-nav { display: none; }
  .scroller { margin-right: calc(-1 * var(--gutter)); }
  .scroller-track { grid-auto-columns: 72%; padding-right: var(--gutter); gap: var(--s-16); }
  .cat-title, .page-title { font-size: var(--fs-30); }
  .author-card { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--s-32); padding-top: var(--s-48); }
  .footer-bottom { flex-direction: column; }
  .subcat-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
