/* chzhc 公开站样式
 * 视觉语言对齐 https://interestinglsy.github.io/ —— 那站是 Vuetify（Material Design 3）
 * 默认主题 + 自定义配色，作者没写任何自定义类名。所以这里不是"抄 CSS"，
 * 而是用纯 CSS 复刻它挑的组件观感：Roboto、白底平面、900px 内容列、
 * 虚线下划线的区块标题、左图 + 竖线 + 右文的条目行。
 * 没有深色模式（参考站的 defaultTheme 也是 light）。
 */

:root {
  /* Vuetify 主题变量，取值直接来自它 JS bundle 里的 createVuetify 配置 */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-light: #eeeeee;
  --primary: #1867c0;
  --primary-dark: #1f5592;
  --secondary: #48a9a6;
  --on-surface: #212121;
  --on-900: rgba(33, 33, 33, .87);   /* high emphasis */
  --on-600: rgba(33, 33, 33, .68);   /* medium emphasis */
  --on-380: rgba(33, 33, 33, .55);   /* disabled */
  --border: rgba(0, 0, 0, .12);
  --hover: rgba(0, 0, 0, .04);

  --shadow-bar: 0 2px 12px rgba(33, 33, 33, .04);
  --shadow-card: 0 3px 1px -2px rgba(0, 0, 0, .2),
                 0 2px 2px 0 rgba(0, 0, 0, .14),
                 0 1px 5px 0 rgba(0, 0, 0, .12);

  --col: 900px;          /* .v-container 在 ≥960px 时 max-width:900px */
  --gutter: 16px;
  --bar-h: 64px;
  /* 霞鹜文楷自带拉丁字形，所以不再单挂 Roboto；后面的兜底只在字体没下完时用 */
  --sans: "LXGW WenKai", "LXGW WenKai Mono", "PingFang SC", "Microsoft YaHei",
          "Noto Sans SC", sans-serif;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", monospace;
}

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

/* 顶栏是 sticky 的，锚点必须留出高度，否则目标正好顶到 y=0、被栏盖住，
   看起来就像"点了没反应"。
   注意：scroll-padding 要挂在**滚动容器**上，也就是根元素 html —— 挂在 body 上
   完全不生效（这就是之前那版"点了跳不过去"的直接原因）。 */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 16px);
}
section[id] { scroll-margin-top: calc(var(--bar-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--on-900);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 4px; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; }
::selection { background: rgba(24, 103, 192, .16); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap, .app-bar-inner, .home, .post-shell, .foot-inner {
  width: 100%;
  max-width: var(--col);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ───────────────────────── 顶栏 ───────────────────────── */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  box-shadow: var(--shadow-bar);
  border-bottom: 1px solid var(--border);
  height: var(--bar-h);
  display: flex;
  align-items: center;
}
.app-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;   /* 站名和四个栏目整体居中，不再左右两端对齐 */
  gap: 4px;
  min-width: 0;
}
.app-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.app-nav::-webkit-scrollbar { display: none; }
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 12px;
  min-height: 44px;
  border-radius: 4px;
  font: 500 14px/1 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--on-900);
  transition: background .2s cubic-bezier(.4, 0, .2, 1);
}
.nav-item:hover { background: var(--hover); color: var(--on-900); text-decoration: none; }
.nav-item.is-active { color: var(--primary); background: rgba(24, 103, 192, .07); }
.nav-item.is-active .nav-icon { fill: var(--primary); }
.nav-icon { flex: none; width: 20px; height: 20px; fill: currentColor; }

/* logo（兼回首页入口）与右边五个栏目之间的分隔 */
.brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 4px;
}
.brand:hover { background: var(--hover); text-decoration: none; }
/* 图形本身是 1.43:1 的横幅比例，所以只钉高度、宽度走 auto（SVG 已按实测包围盒裁紧，
   没有透明留白，30px 高就是实际看到的字高） */
.brand-logo { display: block; height: 30px; width: auto; }
.nav-divider {
  flex: none;
  width: 1px;
  height: 22px;
  margin-inline: 6px;
  background: var(--border);
}

/* ───────────────────────── 概览 ───────────────────────── */
.home { padding-bottom: 64px; }
/* 头像去掉了（站长说那个熊 logo 太丑），所以 hero 就是单列居中文字 */
.hero { margin-top: 32px; }
.hero-text { text-align: center; }
.hero-contact .hc-k { color: var(--on-600); margin-inline-end: 6px; }
.hero-lead { margin: 0 0 8px; font-size: 17px; line-height: 1.8; }
.hero-lead b { font-weight: 700; }
.hero-contact {
  margin-top: 12px;
  font-size: 14px;
  color: var(--on-600);
}
.hc-line { display: inline-block; margin: 4px 10px; }
.hero-contact a { color: var(--secondary); }
.hero-contact a:hover { color: var(--secondary); filter: brightness(.85); }

/* 分隔线：参考站在概览和第一个区块之间是一条通栏细线，上留 40px 下留 16px */
.rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 28px 0 8px;
}

/* ───────────────────────── 区块标题（虚线下划线） ───────────────────────── */
.section { margin-top: 16px; }
.section-title {
  display: inline-block;
  margin: 20px 0 12px;
  font: 400 28px/1.3 var(--sans);
  letter-spacing: 0;
  color: var(--on-900);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-color: var(--secondary);
  text-decoration-thickness: 2px;
  text-underline-offset: 9px;
}
.count {
  margin-inline-start: 10px;
  font-size: 13px;
  color: var(--on-380);
  vertical-align: 4px;
}

/* ───────────────────────── 条目行：左图 | 竖线 | 右文 ───────────────────────── */
.entries { margin-top: 8px; }
.entry {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 0;
  align-items: start;
  padding: 20px 0;
}
.entry + .entry { border-top: 1px solid rgba(0, 0, 0, .06); }
.entry-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 2px 16px 2px 0;
  color: var(--on-600);
  text-align: center;
}
.entry-side:hover { color: var(--on-600); text-decoration: none; }
.entry-date { font-size: 14px; letter-spacing: .02em; }
.entry-rt { font-size: 12px; color: var(--on-380); }
/* 竖线在右列的左边框上，这样它只占内容高度、不会被 grid 拉伸 */
.entry-main {
  border-left: 1px solid var(--border);
  padding-inline: 24px 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.entry-title {
  margin: 0 0 6px;
  font: 400 18px/1.4 var(--sans);
}
/* 奖项行：prize 加粗、event 跟同一行；左列还有 org 时是 ICPC/CCPC 这类主办方 */
.award-line {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}
.award-line strong { font-weight: 700; color: var(--on-900); }

/* 个人经历行：左列只有日期，右列是学校名 + 原文句子 */
.entry-period {
  font-size: 14px;
  letter-spacing: .02em;
  color: var(--on-600);
}
.entry-org {
  margin: 0 0 6px;
  font: 400 20px/1.4 var(--sans);
  color: var(--on-900);
}
/* 学校标识，在左列日期的上面。80px：左列宽约 209px（--col 900px 的 3fr 减内边距），
   80px 仍是章里环形小字最清楚的一档，再往上就会把行高顶得比右列正文高太多。
   ⚠️ 改这个数要同时改 lib/templates.mjs 里 img 的 width/height，否则首帧会跳版。 */
.org-logo { flex: none; width: 80px; height: 80px; }
.entry-title a { color: var(--primary); }
.entry-title a:hover { text-decoration: underline; }
.entry-desc {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--on-600);
}
.entry-meta { margin: 0 0 8px; font-size: 13px; color: var(--on-600); }
.entry-tags, .post-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
}
.entry-tags li, .post-tags .tag {
  background: var(--surface-light);
  color: var(--on-600);
  border-radius: 16px;
  padding: 2px 10px;
  font-size: 12px;
  letter-spacing: .04em;
}

/* ───────────────────────── 列表页 / 404 ───────────────────────── */
.wrap { padding-bottom: 64px; }
.wrap.center { display: grid; place-items: center; min-height: 50vh; text-align: center; }
.empty h1 { font: 300 64px/1 var(--sans); color: var(--on-380); margin: 0 0 16px; }
.empty p { color: var(--on-600); }

/* ───────────────────────── 文章页 ───────────────────────── */
/* 默认单列：没有目录的文章如果固定开 220px 轨道，
   .post 会被 grid 放进那条窄轨道里，正文和图表全被压扁 */
.post-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding-bottom: 64px;
}
.post-shell.has-toc { grid-template-columns: 220px minmax(0, 1fr); gap: 32px; }
.post { min-width: 0; }
.post-inner { padding-top: 36px; }
.crumb {
  display: inline-block;
  font-size: 13px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--on-600);
  margin-bottom: 16px;
}
.crumb:hover { color: var(--primary); }
.post-title {
  margin: 0 0 12px;
  font: 300 32px/1.35 var(--sans);
  color: var(--on-900);
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--on-600);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.post-meta .dot { color: var(--on-380); }
.post-tags { margin: 0 0 0 auto; }

.abstract {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--surface-light);
  border-radius: 4px;
}
.abstract-k {
  margin: 0 0 6px;
  font: 500 12px/1 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--on-600);
}
.abstract p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--on-900); }

/* 正文排版 */
.post-body { margin-top: 24px; font-size: 16px; line-height: 1.8; }
.post-inner { max-width: 740px; margin-inline: auto; }
.post-body > *:first-child { margin-top: 0; }
.post-body h2, .post-body h3, .post-body h4 {
  color: var(--on-900);
  scroll-margin-top: calc(var(--bar-h) + 16px);
}
.post-body h2 {
  display: inline-block;
  margin: 28px 0 8px;
  font: 400 24px/1.65 var(--sans);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-color: var(--secondary);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.post-body h3 { margin: 32px 0 12px; font: 500 19px/1.4 var(--sans); }
.post-body h4 { margin: 24px 0 8px; font: 500 16px/1.4 var(--sans); color: var(--on-600); }
.post-body p { margin: 0 0 18px; }
.post-body ul, .post-body ol { margin: 0 0 18px; padding-inline-start: 26px; }
.post-body li { margin: 6px 0; }
.post-body li > p { margin: 0; }
.post-body hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.post-body strong { font-weight: 700; color: var(--on-900); }
.post-body blockquote {
  margin: 0 0 18px;
  padding: 2px 0 2px 20px;
  border-left: 4px solid var(--surface-light);
  color: var(--on-600);
}
.post-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 14px;
}
.post-body caption {
  text-align: start;
  font-size: 13px;
  color: var(--on-600);
  padding-bottom: 8px;
}
.post-body th, .post-body td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  text-align: start;
}
.post-body thead th {
  font-weight: 500;
  color: var(--on-600);
  border-bottom: 1px solid var(--border);
}
.post-body tbody tr:hover { background: var(--hover); }
.post-body tbody tr:nth-child(even) { background: rgba(0, 0, 0, .015); }
.post-body figure { margin: 0 0 22px; }
.post-body figcaption { font-size: 13px; color: var(--on-600); margin-top: 8px; }
.post-body img { border-radius: 4px; }

/* 代码 */
.post-body :not(pre) > code {
  background: var(--surface-light);
  border-radius: 4px;
  padding: 2px 6px;
  font: 400 .875em/1.5 var(--mono);
  color: var(--on-900);
  word-break: break-word;
}
.post-body pre {
  position: relative;
  margin: 0 0 22px;
  padding: 16px 18px;
  background: #f5f5f5;
  border-radius: 4px;
  overflow-x: auto;
  font: 400 13.5px/1.7 var(--mono);
}
.post-body pre code { background: none; padding: 0; font: inherit; color: var(--on-900); }
.post-body pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0;
  right: 0;
  padding: 3px 10px;
  background: var(--surface-light);
  color: var(--on-600);
  font: 500 11px/1.4 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  border-bottom-left-radius: 4px;
}
/* highlight.js（github 主题色系，和这个平面白底更搭） */
.hljs-keyword, .hljs-selector-tag, .hljs-type { color: #a71d5d; }
.hljs-string, .hljs-attr, .hljs-symbol { color: #032f62; }
.hljs-number, .hljs-literal { color: #005cc5; }
.hljs-comment, .hljs-quote { color: #969896; font-style: italic; }
.hljs-title, .hljs-section, .hljs-name { color: #795da3; }
.hljs-variable, .hljs-template-variable, .hljs-params { color: #df5000; }
.hljs-built_in, .hljs-class .hljs-title { color: #e36209; }
.hljs-meta { color: #969896; }
.hljs-addition { color: #22863a; background: #f0fff4; }
.hljs-deletion { color: #b31d28; background: #ffeef0; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* 公式：KaTeX 保持它自己的衬线数学字体，正文不再用 Latin Modern */
.post-body .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

/* 目录 */
.toc {
  position: sticky;
  top: calc(var(--bar-h) + 24px);
  max-height: calc(100vh - var(--bar-h) - 48px);
  overflow-y: auto;
  padding: 24px 0 24px 20px;
  border-left: 1px solid var(--border);
  font-size: 13px;
  scrollbar-width: thin;
}
.toc-head {
  margin: 0 0 12px;
  font: 500 12px/1 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--on-600);
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc .toc-sub { padding-left: 12px; margin: 2px 0 6px; }
.toc a {
  display: block;
  padding: 6px 0;
  color: var(--on-600);
  line-height: 1.45;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -12px;
}
.toc a:hover { color: var(--primary); text-decoration: none; }
.toc a.is-current {
  color: var(--primary);
  border-left-color: var(--primary);
  margin-left: -12px;
  font-weight: 500;
}
.toc-l1 > a { color: var(--on-900); }

/* 引用块 / 上一篇下一篇 */
.cite { margin: 32px 0; border: 1px solid var(--border); border-radius: 4px; }
.cite summary {
  padding: 12px 16px;
  cursor: pointer;
  font: 500 13px/1.4 var(--sans);
  letter-spacing: .04em;
  color: var(--on-600);
  list-style: none;
}
.cite summary::-webkit-details-marker { display: none; }
.cite summary::before { content: "▸ "; color: var(--on-380); }
.cite[open] summary::before { content: "▾ "; }
.cite-hint { color: var(--on-380); font-weight: 400; margin-left: 8px; }
.cite pre { margin: 0; border-top: 1px solid var(--border); border-radius: 0; }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.pager-item {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: box-shadow .28s cubic-bezier(.4, 0, .2, 1);
}
.pager-item:hover { text-decoration: none; box-shadow: var(--shadow-card); }
.pager-item:empty { visibility: hidden; }
.pager-next { text-align: end; }
.pager-k {
  display: block;
  font: 400 12px/1 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--on-380);
  margin-bottom: 6px;
}
.pager-t { display: block; font-size: 15px; color: var(--on-900); line-height: 1.4; }
.pager-item:hover .pager-t { color: var(--primary); }

/* ───────────────────────── 页脚 ───────────────────────── */
.site-foot { border-top: 1px solid var(--border); padding: 24px 0 48px; }
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;   /* 只剩备案号，居中 */
  text-align: center;
  font-size: 13px;
  color: var(--on-600);
}
.site-foot a { color: var(--on-600); }
.site-foot a:hover { color: var(--primary); }
.foot-icp { font-size: 13px; color: var(--on-600); }
.foot-icp:hover { color: var(--primary); }

/* Devices：与首页共用展示网格，图片与文字各占一行，手机无需悬停。 */
.devices-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.device {
  --device-image-height: 92%;
  grid-column: span 2;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 24px;
  overflow: hidden;
  border-radius: 12px;
  background: #f8f9fa;
  border: 1px solid var(--border);
}
.device-wide { grid-column: span 3; }
.device-copy { min-height: 72px; }
.device-tablet { --device-image-height: 90%; }
.device-camera { --device-image-height: 98%; }
.device-action-camera { --device-image-height: 72%; }
.device-mouse { --device-image-height: 84%; }
.device-category {
  margin: 0 0 8px;
  color: var(--on-600);
  font-size: 13px;
  line-height: 1.4;
}
.device-name {
  margin: 0;
  color: var(--on-900);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.device-visual {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 176px;
}
.device-visual img {
  display: block;
  width: auto;
  height: auto;
  max-width: 90%;
  max-height: var(--device-image-height);
  object-fit: contain;
  object-position: center bottom;
  mix-blend-mode: multiply;
  transition: transform .25s ease;
}
#devices .section-title a { color: inherit; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .device:hover .device-visual img { transform: translateY(-4px); }
}
@media (max-width: 719px) {
  .devices-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .device, .device-wide { grid-column: span 1; padding: 20px; }
  .device-name { font-size: 19px; }
}
@media (max-width: 479px) {
  .devices-grid { grid-template-columns: minmax(0, 1fr); }
  .device { padding: 24px; }
}

/* ───────────────────────── 响应式 ───────────────────────── */
@media (max-width: 959px) {
  :root { --bar-h: 56px; }
  .app-nav { gap: 2px; }
  .nav-item { gap: 6px; padding-inline: 8px; font-size: 12px; }
  .hero-title { font-size: 26px; }
  .section-title { font-size: 24px; }
  .post-shell, .post-shell.has-toc { grid-template-columns: 1fr; gap: 0; }
  /* 窄屏把目录压成正文上方的横条，不做粘性侧栏 */
  .toc {
    position: static;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 16px 0;
    order: -1;
  }
  .toc a { margin-left: 0; padding-left: 10px; }
}
@media (max-width: 719px) {
  :root { --gutter: 20px; --bar-h: 68px; }
  .app-bar-inner { gap: 0; padding-inline: 10px; }
  .brand { padding: 8px 4px; min-height: 44px; }
  .brand-logo { height: 26px; }
  .nav-divider { margin-inline: 5px; }
  .app-nav { flex: 1; justify-content: space-around; gap: 0; }
  .nav-item { flex-direction: column; gap: 5px; padding: 7px 4px; min-height: 48px; letter-spacing: 0; text-transform: none; }
  .nav-item span { display: inline; font-size: 10px; }
  .nav-icon { width: 19px; height: 19px; }
  .hero { margin-top: 32px; }
  .hero-lead { font-size: 16px; }
  .entry { grid-template-columns: 80px minmax(0, 1fr); padding: 20px 0; }
  .entry-side { padding: 2px 12px 2px 0; gap: 6px; }
  .entry-main { padding-left: 16px; }
  .entry-date, .entry-period { font-size: 12px; }
  .entry-period { word-break: keep-all; overflow-wrap: normal; }
  .entry-title { font-size: 17px; }
  .entry-org { font-size: 19px; }
  .entry-desc, .award-line { font-size: 15px; line-height: 1.75; }
  .org-logo { width: 56px; height: 56px; }
  /* 手机经历：校徽配学校名和日期，说明另起一行，避免日期挤在校徽下。 */
  .entry-experience {
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-areas: "logo org" "logo period" "copy copy";
    column-gap: 16px;
    row-gap: 4px;
    align-items: center;
  }
  .entry-experience .entry-side, .entry-experience .entry-main { display: contents; }
  .entry-experience .org-logo { grid-area: logo; }
  .entry-experience .entry-org { grid-area: org; margin: 0; font-size: 18px; }
  .entry-experience .entry-period { grid-area: period; text-align: left; }
  .experience-copy { grid-area: copy; margin-top: 12px; }
  .experience-copy .entry-desc:last-child { margin-bottom: 0; }
  .post-title { font-size: 26px; overflow-wrap: anywhere; }
  .post-body { overflow-wrap: anywhere; }
  .pager { grid-template-columns: 1fr; }
}

/* 打印：笔记会被打印/存 PDF，去掉交互噪声 */
@media (max-width: 359px) {
  .nav-item { padding-inline: 2px; }
}

@media print {
  .app-bar, .site-foot, .toc, .pager, .crumb { display: none; }
  body { font-size: 11pt; }
  .post-body pre, .abstract { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}

/* Compact navigation keeps readable labels and full touch targets on phones. */
.mobile-menu { display: none; }
@media (max-width: 719px) {
  :root { --bar-h: 56px; }
  .app-bar-inner { justify-content: center; gap: 12px; padding-inline: 20px; }
  .app-bar .app-nav, .app-bar .nav-divider { display: none; }
  .mobile-menu { display: block; position: relative; }
  .mobile-menu summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; min-width: 124px; padding: 10px 12px; border-radius: 7px; font-size: 15px; cursor: pointer; list-style: none; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu[open] summary { background: var(--hover); }
  .mobile-menu nav { position: fixed; top: calc(var(--bar-h) + 8px); left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: min(300px,calc(100vw - 40px)); padding: 8px; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
  .mobile-menu .nav-item { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 12px 8px; min-height: 48px; }
  .mobile-menu .nav-item span { font-size: 13px; }
  .hero { margin-top: 24px; }
  .hero-contact { max-width: 320px; margin-inline: auto; }
  .hc-line { margin: 3px 6px; }
  .section { margin-top: 12px; }
  .section-title { margin-top: 16px; }
  .rule { margin-top: 24px; }
  .post-inner { padding-top: 28px; }
}
@media (max-width: 479px) {
  .device { grid-template-columns: minmax(0,1fr) minmax(0,.85fr); grid-template-rows: auto; align-items: center; gap: 16px; padding: 20px; }
  .device-copy { min-height: 0; }
  .device-name { font-size: 17px; }
  .device-category { font-size: 12px; }
  .device-visual { height: 132px; align-items: center; }
  .device-visual img { max-width: 100%; object-position: center; }
}
