/* ═══════════════════════════════════════════════
   tech 主题 · 极简单栏 · 移动端优先 · GitHub 风格
   导航/页脚容器 .tech-shell（max-width 1000px）
   主内容统一单列 780px：页头 / 横线 / 正文 / 卡片，
   全站同一列宽基准，无第二档宽度
   ═══════════════════════════════════════════════ */

/* ── 设计令牌 ── */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  /* 导航毛玻璃半透明背景：72% 不透明保留底色识别，blur 14px + saturate 180% 让背后内容更鲜亮 */
  --nav-bg: rgba(255, 255, 255, .72);
  --bg-subtle: #f6f8fa;
  --bg-code: #f6f8fa;
  --border: #d0d7de;
  --border-strong: #afb8c1;
  --text: #1f2328;
  --text-secondary: #656d76;
  --accent: #0969da;
  --accent-weak: #ddf4ff;
  --quote-bg: #eef1f6;
  --success: #1a7f37;
  --warning: #9a6700;
  --danger: #cf222e;
  --shadow: 0 1px 3px rgba(31, 35, 40, .06);
  --overlay: rgba(31, 35, 40, .5);
  --code-bg: #f6f8fa;
  --hl-keyword: #cf222e;
  --hl-string: #0a3069;
  --hl-title: #8250df;
  --hl-comment: #6e7781;
  --hl-number: #0550ae;
  --hl-builtin: #953800;
  --hl-variable: #953800;
  --hl-tag: #116329;
  --hl-attr: #0550ae;
  --hl-symbol: #8250df;
  --hl-meta: #1f2328;
  /* 头像光环配色（亮色：半透明蓝→紫渐变，避免高饱和割裂感） */
  --ring-a: rgba(9, 105, 218, .32);
  --ring-b: rgba(130, 80, 223, .32);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  /* 暗色导航毛玻璃：与底色同源同透明度，背景透出更自然 */
  --nav-bg: rgba(13, 17, 23, .72);
  --bg-subtle: #161b22;
  --bg-code: #161b22;
  --border: #30363d;
  --border-strong: #484f58;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --accent-weak: rgba(56, 139, 253, .15);
  /* 头像光环配色（暗色：亮蓝→淡紫渐变，深底上呈发光感） */
  --ring-a: #58a6ff;
  --ring-b: #d2a8ff;
  --quote-bg: #1b222c;
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
  --shadow: 0 1px 3px rgba(1, 4, 9, .4);
  --overlay: rgba(1, 4, 9, .6);
  --code-bg: #161b22;
  --hl-keyword: #ff7b72;
  --hl-string: #a5d6ff;
  --hl-title: #d2a8ff;
  --hl-comment: #8b949e;
  --hl-number: #79c0ff;
  --hl-builtin: #ffa657;
  --hl-variable: #ffa657;
  --hl-tag: #7ee787;
  --hl-attr: #79c0ff;
  --hl-symbol: #d2a8ff;
  --hl-meta: #ffa657;
}

/* ── 基础 ── */
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable;
  /* 移动端全站禁用系统点按高亮块（Android Chrome 默认灰/蓝半透明方块）。
     该属性可继承，在 html 声明一次即可覆盖所有可点元素，无需逐个选择器声明 */
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}
a { color: var(--accent); }
img { max-width: 100%; }
::selection { background: var(--accent-weak); }

/* 跳过导航 */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  padding: 8px 16px; background: var(--accent); color: #fff;
  border-radius: 0 0 6px 0; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ── 全站唯一容器 ── */
.tech-shell {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}
/* ── 主内容与导航/页脚同宽 1000px：消除滚动时导航底边线与正文左右不齐的视觉割裂；
   940px→1000px 每行仅多 ~3 字符，仍在最佳阅读区间（55-65 中文字符） ── */
.tech-main .tech-shell {
  max-width: 1000px;
}

/* ── 导航 ── */
.tech-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  /* 毛玻璃：blur 14px + saturate 180% 让滚动内容在 nav 后方柔和透出 */
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  /* iOS Safari sticky 滚动时上方偶尔漏 1px：顶部画 1px 同色外阴影遮盖（不占盒模型空间） */
  box-shadow: 0 -1px 0 0 var(--nav-bg);
}
.tech-nav-inner {
  display: flex; align-items: center; justify-content: flex-start;
  height: 56px; gap: 12px;
}
.tech-logo {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 18px; font-weight: 700; color: var(--text);
  text-decoration: none; white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) { .tech-logo:hover { color: var(--accent); } }
.tech-logo-cursor {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 400;
  font-size: 0.95em;
  line-height: 1;
  color: var(--accent);
  margin-left: 1px;
  transform: translateY(-1px);
}
@media (hover: hover) and (pointer: fine) { .tech-logo:hover .tech-logo-cursor { color: var(--hl-title); } }
.tech-logo-blink {
  animation: tech-blink 1.2s steps(2, start) infinite;
}
@keyframes tech-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
/* 无障碍：系统开启「减弱动态效果」时，整体关闭光标闪烁 / 动画 / 过渡错位，
   保留状态切换但去掉位移与闪烁，避免前庭敏感用户不适 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .tech-quote-cursor { animation: none !important; }
}
.tech-nav-links { display: flex; gap: 2px; margin: 0 auto; }
.tech-nav-link {
  padding: 8px 12px; font-size: 15px; color: var(--text-secondary);
  text-decoration: none; border-radius: 6px; white-space: nowrap; position: relative;
}
/* 触屏无 hover：包裹后移动端点按不再残留背景高亮块（桌面鼠标不受影响） */
@media (hover: hover) and (pointer: fine) { .tech-nav-link:hover { color: var(--text); background: var(--bg-subtle); } }
.tech-nav-link.active { color: var(--accent); font-weight: 600; }
.tech-nav-link.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -9px;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.tech-nav-actions { display: flex; align-items: center; gap: 4px; }
/* 汉堡按钮桌面隐藏，仅移动端显示（移动端 media 中已 .tech-burger 显示） */
.tech-burger { display: none; }

.tech-icon-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; color: var(--text-secondary);
  border-radius: 6px; cursor: pointer; padding: 0;
}
@media (hover: hover) and (pointer: fine) { .tech-icon-btn:hover { color: var(--text); background: var(--bg-subtle); } }
.tech-icon-btn.active { color: var(--accent); }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
/* 三态主题切换：auto（跟随系统）态按钮右上角小圆点标识 */
.tech-icon-btn { position: relative; }
html[data-theme-mode="auto"] #theme-toggle::after {
  content: ''; position: absolute; top: 3px; right: 3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); pointer-events: none;
}

.tech-burger { display: none; }

/* ── 抽屉菜单 ── */
.tech-drawer-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--overlay);
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.tech-drawer-overlay.open { opacity: 1; visibility: visible; }
.tech-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 201;
  width: min(320px, 85vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .25s ease, visibility .25s;
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.tech-drawer.open { transform: none; visibility: visible; }
.tech-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.tech-drawer-title { font-size: 16px; font-weight: 700; }
.tech-drawer-close {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; color: var(--text-secondary);
  border-radius: 6px; cursor: pointer; font-size: 20px;
}
@media (hover: hover) and (pointer: fine) { .tech-drawer-close:hover { color: var(--text); background: var(--bg-subtle); } }
.tech-drawer-link {
  display: block; padding: 14px 20px; font-size: 16px;
  color: var(--text); text-decoration: none;
  border-bottom: 1px solid var(--border);
}
@media (hover: hover) and (pointer: fine) { .tech-drawer-link:hover { background: var(--bg-subtle); } }
.tech-drawer-link.active { color: var(--accent); font-weight: 600; }

/* ── 主内容 ── */
.tech-main { flex: 1; padding: 24px 0 40px; }
/* 居中极简 Hero 页面（首页/搜索/标签结果）：main 自身不垫顶部，留白交给 page-head 统一，保证上下对称 */
.tech-main:has(.tech-page-head--center) { padding-top: 0; }
/* 关于页：顶部是左对齐「关于」页头 + 下方人物卡 Hero，需与其他子页一致的顶部留白 */
.tech-main:has(.tech-about-hero) { padding-top: 32px; }
/* 关于页内容较短，收紧底部留白，避免页尾空荡 */
.tech-main:has(.tech-about-hero) { padding-bottom: 40px; }

/* ── 页脚 ── */
.tech-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 calc(24px + env(safe-area-inset-bottom));
  color: var(--text-secondary); font-size: 14px;
}
.tech-footer-inner {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  align-items: center; justify-content: space-between;
}
.tech-footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.tech-footer-links a { color: var(--text-secondary); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .tech-footer-links a:hover { color: var(--accent); } }
.tech-footer-copy { margin: 0; }
.tech-footer-beian { width: 100%; }
.tech-footer-beian a { color: var(--text-secondary); text-decoration: none; margin-right: 16px; }
@media (hover: hover) and (pointer: fine) { .tech-footer-beian a:hover { color: var(--accent); } }

/* ── 回到顶部 ── */
.tech-top {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom));
  width: 44px; height: 44px; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text-secondary);
  cursor: pointer; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.tech-top.show { opacity: 1; visibility: visible; }
@media (hover: hover) and (pointer: fine) { .tech-top:hover { color: var(--accent); border-color: var(--accent); } }
/* JS 动态隐藏：移动端评论表单进视口时调用（遮「提交评论」），带 !important 压过 .show */
.tech-top.hide { opacity: 0 !important; visibility: hidden !important; }
/* 滚动后缩小成 56px 圆形，避免遮挡右侧阅读 */
.tech-top.scrolled {
  width: 36px; height: 36px; right: 28px; bottom: calc(28px + env(safe-area-inset-bottom));
  border-radius: 50%;
}

/* ── 页面头部（子页：列表 / 标签 / 关于等，左对齐） ── */
.tech-page-head {
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.tech-page-head::after {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 64px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--hl-title));
}
.tech-page-title { font-size: 28px; font-weight: 700; line-height: 1.4; margin: 0 0 8px; }
.tech-page-desc { font-size: 15px; color: var(--text-secondary); margin: 0; }

/* 首页 / 搜索 / 标签结果：居中极简 Hero（统计并入描述行，无胶囊） */
.tech-page-head--center {
  text-align: center;
  padding: 48px 12px 32px;
  /* 与左对齐子页 .tech-page-head 的 28px 对齐：hero 彩条到列表的距离收窄，
     避免比卡片间距（24px）大一倍以上的空洞感 */
  margin-bottom: 28px;
}
/* 彩条全站统一 64px：居中 Hero 仍居中，仅长度与左对齐页一致 */
.tech-page-head--center::after {
  left: 50%; transform: translateX(-50%);
  width: 64px;
}
.tech-page-head--center .tech-page-title {
  font-size: 32px; letter-spacing: .01em; margin: 0 0 12px;
}
.tech-page-head--center .tech-page-desc { font-size: 16px; }

/* ── 仅 PC 宽屏：修「头轻脚重」──
   A. 垂直重心上收：上留白略大于下留白，格言间距收紧，底部 64px 权重降低
   B. 补宽屏横向空旷：标题/格言字号加大，Hero 在宽屏更有存在感
   移动端（<769px）完全维持原状。 */
@media (min-width: 769px) {
  .tech-page-head--center .tech-page-title {
    font-size: 40px;
  }
  .tech-quote {
    margin-top: 20px;
    font-size: 17px;
  }
  .tech-quote .tech-quote-refresh svg { width: 16px; height: 16px; }
}

/* ── 首页终端格言 ── */
.tech-quote {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 4px 10px; margin-top: 28px; min-height: 26px;
  font-size: 15px; line-height: 1.9; color: var(--text);padding-bottom: 10px;
}
.tech-quote-text { word-break: break-word; }
.tech-quote-src { font-size: 13px; color: var(--text-secondary); }
.tech-quote-src:empty { display: none; }
.tech-quote-cursor {
  flex: none; width: 2px; height: 17px; margin-left: 1px;
  background: var(--accent); border-radius: 1px;
  animation: tech-blink 1.2s steps(2, start) infinite;
}
.tech-quote-refresh {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  color: var(--text-secondary); background: none; border: none;
  border-radius: 6px; cursor: pointer;
  transition: color .15s, background .15s;
}
.tech-quote-refresh svg { width: 14px; height: 14px; transition: transform .28s ease; }
@media (hover: hover) and (pointer: fine) { .tech-quote-refresh:hover { color: var(--accent); background: var(--bg-subtle); } }
.tech-quote-refresh.spin svg { transform: rotate(360deg); }

/* ── 首页 Hero：极简无卡（一行统计 + 居中格言） ── */
/* 统计行等宽：保留终端质感，但不放假命令 */
.tech-page-desc--mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  letter-spacing: .01em;
}

/* ── 全局搜索：导航下拉面板（入口为导航栏放大镜） ── */
.tech-search-layer {
  /* 独立 fixed：body 是 flex 容器，sticky 在 flex 子元素中失效；top 56px 紧贴 nav 下方 */
  position: fixed; top: 56px; left: 0; right: 0; z-index: 99;
  display: none;
  padding: 12px 0 14px;
  border-top: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.tech-search-layer.open { display: block; animation: tech-search-drop .18s ease; }
@keyframes tech-search-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.tech-search-form { display: flex; align-items: center; gap: 8px; }
.tech-search-input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  font-size: 16px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; outline: none;
}
.tech-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.tech-search-btn {
  height: 44px; padding: 0 20px; flex-shrink: 0;
  font-size: 15px; font-weight: 600; color: #fff;
  background: var(--accent); border: none; border-radius: 8px; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .tech-search-btn:hover { filter: brightness(1.1); } }
.tech-search-close {
  flex: none; width: 44px; height: 44px; display: flex;
  align-items: center; justify-content: center;
  border: none; background: none; color: var(--text-secondary);
  font-size: 24px; line-height: 1; border-radius: 8px; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .tech-search-close:hover { color: var(--text); background: var(--bg-subtle); } }

/* ── 文章列表（列表式） ── */
.tech-post-list { list-style: none; margin: 0; padding: 0; }
/* 整卡可点：hover 背景向左右各外扩 8px 留出呼吸空间（负 margin 技巧，内容仍与正文严格对齐）；
   外扩 16px 在宽屏上视觉溢出过多，8px 为「不贴边也不溢出」的折中；
   分割线必须用 border-bottom（元素自身边框，会跟随 border-radius 圆角内收），
   不能用 ::after 直线——直线两端会戳出圆角背景块外侧，hover 时产生割裂感；
   触摸端禁用系统点按高亮，避免 Android 点按闪灰色块 */
.tech-post-item {
  position: relative;
  padding: 16px;
  margin: 0 -8px 24px;
  border-radius: 10px;
  border-bottom: 1px solid var(--border);
  -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease;
}
.tech-post-item:last-child { border-bottom: none; }
/* hover 仅在「宽屏 + 支持悬停 + 精确指针（鼠标）」的设备生效：
   - (pointer: fine) 过滤 iPad / 触屏 Android 误报，避免点按后 :hover 滞留高亮卡死
   - (min-width: 768px) 让移动端与 PC 窄窗口一律不显示 hover 背景，退化为纯分割线列表 */
@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
  .tech-post-item:hover { background: var(--bg-subtle); }
  .tech-post-item:hover .tech-post-title a { color: var(--accent); }
  .tech-post-item:hover .tech-post-arrow { opacity: 1; transform: translateX(0); }
}
.tech-post-arrow {
  position: absolute; top: 17px; right: 8px;
  font-size: 18px; line-height: 1; color: var(--accent); opacity: 0;
  transform: translateX(-6px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
/* 窄屏（真机移动端 / PC 窄窗口）：本就无 hover 背景，取消左右外扩，
   让分割线与正文同宽；箭头在 meta 行右侧易与换行标题叠字，直接隐藏 */
@media (max-width: 767px) {
  .tech-post-item { margin: 0 0 20px; padding: 14px 0; }
  .tech-post-arrow { display: none; }
}
.tech-post-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  font-size: 13px; color: var(--text-secondary); margin-bottom: 6px;
}
/* 精选徽标：用主题强调色 --accent（亮 #0969da / 暗 #58a6ff），
   与标题 hover、箭头、彩条同色系，亮色下清晰不糊灰；金色 chip 方案观感偏脏已弃 */
.tech-badge-featured {
  display: inline-block; flex: none;
  color: var(--accent);
  font-size: 12px; font-weight: 600;
}
.tech-post-title { font-size: 18px; font-weight: 600; line-height: 1.5; margin: 0 0 6px; }
.tech-post-title a { color: var(--text); text-decoration: none; transition: color .15s; }
.tech-post-excerpt {
  font-size: 15px; color: var(--text-secondary);
  line-height: 1.7; margin: 0 0 10px;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tech-post-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--accent);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 2px 10px; border-radius: 12px; text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, color .15s, background-color .15s, transform .1s;
}
@media (hover: hover) and (pointer: fine) {
  .tech-tag:hover {
    border-color: var(--accent); color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--bg-subtle));
  }
}
.tech-tag:active { transform: translateY(1px); }

/* ── 筛选栏（自定义下拉，替代原生 select：弹层为站内 DOM，亮暗全端可控） ── */
.tech-filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.tech-cs { position: relative; flex: 1; min-width: 150px; }
.tech-cs-trigger {
  width: 100%; height: 40px; padding: 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 14px; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; outline: none;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
@media (hover: hover) and (pointer: fine) { .tech-cs-trigger:hover { border-color: var(--border-strong); } }
.tech-cs.is-open .tech-cs-trigger,
.tech-cs-trigger:focus-visible {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak);
}
.tech-cs-arrow { flex: none; opacity: .6; transition: transform .15s; }
.tech-cs.is-open .tech-cs-arrow { transform: rotate(180deg); }
.tech-cs-trigger > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.tech-cs-items {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  max-height: 264px; overflow-y: auto;
  padding: 4px; margin: 0; list-style: none;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  display: none;
}
.tech-cs.is-open .tech-cs-items { display: block; }
.tech-cs-item {
  display: block; width: 100%; padding: 8px 10px; margin: 0;
  text-align: left; font-size: 14px; line-height: 1.4;
  color: var(--text); background: transparent;
  border: 0; border-radius: 5px; cursor: pointer;
  transition: background .12s, color .12s;
}
@media (hover: hover) and (pointer: fine) { .tech-cs-item:hover { background: var(--bg-subtle); } }
.tech-cs-item.is-selected { color: var(--accent); font-weight: 600; background: var(--accent-weak); }

/* ── 分页 ── */
.tech-more-wrap { display: flex; justify-content: center; margin-top: 32px; }
.tech-pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 32px; }
.tech-page-btn {
  min-width: 40px; height: 40px; padding: 0 12px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-secondary); text-decoration: none; font-size: 14px;
}
@media (hover: hover) and (pointer: fine) { .tech-page-btn:hover { border-color: var(--accent); color: var(--accent); } }
.tech-page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tech-page-ellipsis { display: flex; align-items: center; color: var(--text-secondary); padding: 0 4px; }

/* ── 空状态 ── */
.tech-empty { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.tech-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.tech-empty h3 { font-size: 18px; color: var(--text); margin: 0 0 6px; }
.tech-empty p { margin: 0; font-size: 14px; }

/* ── 阅读进度条：fixed 顶部细条，随滚动填充 ── */
.tech-reading-progress {
  position: fixed; top: 0; left: 0; z-index: 200;
  width: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--hl-title));
  transition: width .1s linear;
}

/* ── 文章详情 ── */
/* 容器与 nav 同宽 1000px，正文占满容器宽度 */
.tech-post-wrap { max-width: 1000px; margin: 0 auto; }
.tech-post-layout { display: block; }

/* TOC：窄屏内联折叠框，位于标题下方、正文之前；上下 24px（与相邻块 margin 折叠取较大值）；
   ≥1400px 改为 fixed 悬浮在容器右侧，margin 归零且脱离文档流 */
.tech-toc-sidebar { margin: 16px 0; }
@media (min-width: 1400px) {
  .tech-toc-sidebar {
    position: fixed;
    top: 80px;
    left: calc(50% + 520px);
    width: 180px;
    margin: 0;
  }
  /* 宽屏：summary 退化为标题，去掉折叠箭头和可点击感 */
  .tech-toc-summary { cursor: default; }
  .tech-toc-summary::after { display: none; }
}

.tech-post-header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.tech-post-title-lg { font-size: 26px; font-weight: 700; line-height: 1.35; margin: 0 0 10px; }
.tech-post-meta-lg {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-size: 13px; color: var(--text-secondary); margin-bottom: 8px;
}
.tech-post-tags-lg { display: flex; flex-wrap: wrap; gap: 6px; }

/* 锚点定位留出 sticky nav（56px）+ 呼吸空间，防止点 TOC 后标题被导航遮住 */
.tech-post-body :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: 72px; }

/* 目录 */
.tech-toc {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-subtle);
}
.tech-toc-summary {
  padding: 10px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; user-select: none; list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.tech-toc-summary::-webkit-details-marker { display: none; }
.tech-toc-summary::after {
  content: ""; width: 8px; height: 8px; flex-shrink: 0;
  border-right: 2px solid var(--text-secondary); border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg); transition: transform .2s; margin-top: -4px;
}
.tech-toc[open] .tech-toc-summary::after { transform: rotate(-135deg); margin-top: 4px; }
/* 目录面板最高只占视口 60%：面板自 top:80 起，用视口比例封顶能保证任何视口高度下
   底边都留出充足余量，滚动到页脚时不会贴住页脚（此前按 calc(100vh - Npx) 拉长，
   矮视口下减掉的那点余量根本不够，面板几乎顶到视口底部） */
.tech-toc-body {
  padding: 0 14px 12px; max-height: 60vh; overflow-y: auto;
}
/* 目录滚动条：系统默认粗条（Windows 约 15px）会把 180px 宽的目录面板撑得很难看
   注意 Chromium 121+ 只要设了标准属性 scrollbar-width，就会忽略 ::-webkit-scrollbar，故两者分开写 */
.tech-toc-body::-webkit-scrollbar { width: 6px; }
.tech-toc-body::-webkit-scrollbar-track { background: transparent; }
.tech-toc-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
@media (hover: hover) and (pointer: fine) { .tech-toc-body::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); } }
/* Firefox 不支持 ::-webkit-scrollbar，改用标准属性兜底（thin 细条 + 同色） */
@supports (-moz-appearance: none) {
  .tech-toc-body { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
}
.tech-toc-body .toc { margin: 0; }
.tech-toc-body ul { list-style: none; margin: 0; padding: 0; }
.tech-toc-body ul ul { padding-left: 16px; }
.tech-toc-body a {
  display: block; padding: 3px 0; font-size: 13px; line-height: 1.6;
  color: var(--text-secondary); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) { .tech-toc-body a:hover { color: var(--accent); } }
.tech-toc-body a.is-active {
  color: var(--accent); font-weight: 600;
  border-left: 2px solid var(--accent); padding-left: 8px; margin-left: -10px;
}

/* 正文：16px / 1.75 行高；中文不加字间距（等宽字符加间距反显松散，用户反馈） */
.tech-post-body,
.tech-post-body.markdown-body {
  font-size: 16px; line-height: 1.65; word-wrap: break-word;
}
.tech-post-body h1, .tech-post-body h2, .tech-post-body h3,
.tech-post-body h4, .tech-post-body h5, .tech-post-body h6,
.tech-post-body.markdown-body h1, .tech-post-body.markdown-body h2,
.tech-post-body.markdown-body h3, .tech-post-body.markdown-body h4,
.tech-post-body.markdown-body h5, .tech-post-body.markdown-body h6 {
  font-weight: 700; line-height: 1.35; margin: 20px 0 9px;
}
/* 桌面标题梯度：22/20/18/16.5/16/15.5，明显低于页面标题 26px
   —— 页面标题本身就是文章 h1，正文里若再出现一个 24px 的 # 大标题，
   两个大标题紧挨着会「打架」（用户反馈双标题丑），故整体下调一级；
   h1 显式清掉 markdown-body 默认的下边框，只留 h2 带分隔线，层级更清爽 */
.tech-post-body h1, .tech-post-body.markdown-body h1 {
  font-size: 22px; padding-bottom: 0; border-bottom: 0;
}
.tech-post-body h2, .tech-post-body.markdown-body h2 {
  font-size: 20px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.tech-post-body h3, .tech-post-body.markdown-body h3 { font-size: 18px; }
.tech-post-body h4, .tech-post-body.markdown-body h4 { font-size: 16.5px; }
.tech-post-body h5, .tech-post-body.markdown-body h5 { font-size: 16px; }
.tech-post-body h6, .tech-post-body.markdown-body h6 { font-size: 15.5px; }
.tech-post-body p, .tech-post-body.markdown-body p { margin: 0 0 13px; }
.tech-post-body strong, .tech-post-body.markdown-body strong { font-weight: 600; }
.tech-post-body em { font-style: italic; }
.tech-post-body s, .tech-post-body del { color: var(--text-secondary); }
.tech-post-body sub, .tech-post-body sup { font-size: 12px; }
.tech-post-body abbr { border-bottom: 1px dotted var(--border-strong); cursor: help; }
/* details 折叠块（GitHub README 常用）：文章页与项目详情页 README 同款
   summary 加三角箭头占位 + 嵌套内容内边距，修复项目页 tab 展开无样式/内容贴边 */
.tech-post-body details, .tech-proj-readme-body details { margin: 0 0 10px; }
.tech-post-body summary, .tech-proj-readme-body summary { cursor: pointer; font-weight: 600; }
.tech-post-body summary::marker, .tech-proj-readme-body summary::marker { color: var(--text-secondary); }
.tech-post-body details[open] > summary, .tech-proj-readme-body details[open] > summary { margin-bottom: 8px; }
.tech-post-body details > *, .tech-proj-readme-body details > * { margin-left: 0; }
.tech-post-body details > :last-child, .tech-proj-readme-body details > :last-child { margin-bottom: 0; }
.tech-post-body a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  transition: border-color .15s, background-color .15s;
}
@media (hover: hover) and (pointer: fine) {
  .tech-post-body a:hover {
    border-bottom-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
  }
}
.tech-post-body img { max-width: 100%; border-radius: 6px; display: block; margin: 8px auto; cursor: zoom-in; }
.tech-post-body blockquote {
  margin: 0 0 10px; padding: 8px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--quote-bg);
  color: var(--text);
}
.tech-post-body blockquote > :first-child { margin-top: 0; }
.tech-post-body blockquote > :last-child { margin-bottom: 0; }
.tech-post-body blockquote p { margin: 6px 0; }
.tech-post-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px; background: var(--bg-subtle);
  padding: 2px 6px; border-radius: 4px;
}
.tech-post-body pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; overflow-x: auto;
  margin: 0 0 10px; line-height: 1.5; text-align: left;
}
.tech-post-body pre code { background: none; padding: 0; font-size: 13.5px; }

/* 代码块复制按钮（JS 包 .code-wrap 容器） */
.code-wrap { position: relative; margin: 0 0 10px; }
.code-wrap pre { margin: 0; }
.code-copy {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  padding: 3px 10px; font-size: 12px; line-height: 1.5;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg); color: var(--text-secondary);
  cursor: pointer; opacity: 0; transition: opacity .2s;
}
@media (hover: hover) and (pointer: fine) { .code-wrap:hover .code-copy, .code-copy:focus { opacity: 1; } }
@media (hover: hover) and (pointer: fine) { .code-copy:hover { color: var(--accent); border-color: var(--accent); } }
@media (hover: none) { .code-copy { opacity: 1; } }
.tech-post-body table {
  width: 100%; border-collapse: collapse; margin: 0 0 10px; font-size: inherit;
  display: block; overflow-x: auto;
}
.tech-post-body th, .tech-post-body td {
  border: 1px solid var(--border); padding: 6px 10px; text-align: left;
}
.tech-post-body th { background: var(--bg-subtle); font-weight: 600; }
.tech-post-body ul, .tech-post-body ol { padding-left: 22px; margin: 0 0 10px; }
.tech-post-body li { margin-bottom: 2px; }
.tech-post-body li > ul, .tech-post-body li > ol { margin-bottom: 0; }
.tech-post-body hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.tech-post-body .task-list-item { list-style: none; margin-left: -20px; }
.tech-post-body input[type="checkbox"] { margin-right: 6px; }

/* 任务列表勾选符号（render_post_content 输出 .ck） */
.tech-post-body .ck { font-style: normal; font-size: 1.05em; margin-right: .3em; }
.tech-post-body .ck-todo { color: var(--text-secondary); }
.tech-post-body .ck-done { color: var(--success); }
.tech-post-body li:has(.ck) { list-style: none; margin-left: -1.2em; }

/* 提示块（admonition 扩展） */
.tech-post-body .admonition {
  padding: 10px 14px; border-radius: 8px; margin: 0 0 10px;
  border-left: 4px solid var(--border-strong);
  background: var(--bg-subtle);
}
.tech-post-body .admonition-title { font-weight: 700; margin: 0 0 6px; }
.tech-post-body .admonition p:last-child { margin-bottom: 0; }
.tech-post-body .admonition.note { border-left-color: var(--accent); background: var(--accent-weak); }
.tech-post-body .admonition.note .admonition-title { color: var(--accent); }
.tech-post-body .admonition.tip { border-left-color: var(--success); background: rgba(26, 127, 55, .08); }
.tech-post-body .admonition.tip .admonition-title { color: var(--success); }
.tech-post-body .admonition.warning { border-left-color: var(--warning); background: rgba(154, 103, 0, .08); }
.tech-post-body .admonition.warning .admonition-title { color: var(--warning); }
.tech-post-body .admonition.danger { border-left-color: var(--danger); background: rgba(207, 34, 46, .08); }
.tech-post-body .admonition.danger .admonition-title { color: var(--danger); }

/* 删除线 / 高亮 / 键盘键 */
.tech-post-body del { color: var(--text-secondary); }
.tech-post-body mark {
  background: rgba(154, 103, 0, .18); color: inherit;
  padding: 0 4px; border-radius: 3px;
}
.tech-post-body kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; background: var(--bg-subtle);
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 4px; padding: 2px 6px;
}

/* 定义列表（def_list 扩展） */
.tech-post-body dl { margin: 0 0 10px; }
.tech-post-body dt { font-weight: 600; margin-top: 6px; }
.tech-post-body dd { margin: 0 0 4px 24px; color: var(--text-secondary); }

/* 脚注（footnotes 扩展） */
.tech-post-body .footnote { font-size: 13px; color: var(--text-secondary); }
.tech-post-body .footnote-ref { font-size: 12px; }
.tech-post-body .footnote-backref { text-decoration: none; }

/* 视频 / iframe 16:9 容器 */
.media-wrap {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  margin: 0 0 16px; border-radius: 8px; overflow: hidden; background: #000;
}
.media-wrap video, .media-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* 附件链接图标改由 markdown-body.css 按扩展名前置（见 --doc-icon） */

/* ── 代码高亮（GitHub 风格，深浅色变量） ── */
.hljs { color: var(--text); background: transparent; }
.hljs-keyword, .hljs-selector-tag, .hljs-subst { color: var(--hl-keyword); }
.hljs-string, .hljs-attr, .hljs-template-tag, .hljs-regexp { color: var(--hl-string); }
.hljs-title, .hljs-section, .hljs-function .hljs-title { color: var(--hl-title); }
.hljs-comment, .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: var(--hl-number); }
.hljs-built_in, .hljs-type, .hljs-class .hljs-title { color: var(--hl-builtin); }
.hljs-variable, .hljs-template-variable, .hljs-params { color: var(--hl-variable); }
.hljs-tag, .hljs-name { color: var(--hl-tag); }
.hljs-attribute { color: var(--hl-attr); }
.hljs-meta, .hljs-meta .hljs-keyword { color: var(--hl-meta); }
.hljs-addition { color: var(--hl-tag); }
.hljs-deletion { color: var(--hl-keyword); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* ── 上一篇 / 下一篇 ── */
.tech-post-pager {
  margin: 26px 0 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.tech-pager-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; min-width: 0;
  border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; color: var(--text);
}
@media (hover: hover) and (pointer: fine) { .tech-pager-link:not(.tech-pager-empty):hover { border-color: var(--accent); } }
/* 方向标用内联 SVG：字符箭头（←/→）在部分字体栈会被回退渲染成彩色 emoji */
.tech-pager-dir {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-secondary);
}
.tech-pager-title {
  display: block; font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tech-pager-next { text-align: right; }
.tech-pager-empty {
  /* 单侧缺失占位：与可点卡片同宽同高同圆角，仅虚线描边+浅字，形似而不可点 */
  display: flex; align-items: center; justify-content: center;
  border-style: dashed; color: var(--text-secondary);
  font-size: 12px; opacity: .7;
}

/* ── 文章底部操作 ── */
.tech-post-footer {
  margin: 22px 0 0;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.tech-post-tags-bottom {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.tech-post-actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.tech-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 16px;
  font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text);
  cursor: pointer; text-decoration: none;
}
@media (hover: hover) and (pointer: fine) { .tech-btn:hover { border-color: var(--accent); color: var(--accent); } }
.tech-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
/* 深色主题：accent 是亮天蓝（#58a6ff），配白字对比仅约 2.4:1 会发糊，改深色字（约 8.9:1） */
[data-theme="dark"] .tech-btn-primary { color: #0d1117; }
/* primary hover：浅色加深 / 深色提亮——两端都朝「对比度变好」的方向反馈，不再无脑提亮 */
@media (hover: hover) and (pointer: fine) {
  .tech-btn-primary:hover { filter: brightness(.92); color: #fff; }
  [data-theme="dark"] .tech-btn-primary:hover { filter: brightness(1.12); color: #0d1117; }
}
/* 许可文字与按钮组同排，靠右对齐；窄屏折行时恢复左对齐 */
.tech-license { font-size: 13px; color: var(--text-secondary); margin: 0 0 0 auto; }

/* ── 轻提示 toast（分享/复制反馈，全站可用） ── */
.tech-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 300;
  transform: translateX(-50%) translateY(6px);
  max-width: min(86vw, 420px);
  padding: 9px 18px;
  font-size: 13px; font-weight: 500; line-height: 1.5;
  color: var(--text); background: var(--nav-bg);
  border: 1px solid var(--border-strong); border-radius: 8px;
  /* toast 毛玻璃：浮起反馈更明显，复用 nav-bg 保持视觉一致 */
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.tech-toast.show {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ── 相关文章 ── */
.tech-related { margin: 26px 0 0; }
.tech-related-title { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
/* 精选推荐区：底部对齐页头 --center 的分隔线（细 border + 居中渐变彩条） */
.tech-featured {
  position: relative;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.tech-featured::after {
  content: "";
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: -1px; width: 64px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--hl-title));
}
/* 卡片网格 */
.tech-related-grid {
    /* 4 篇横排铺满；minmax(0,1fr) 令长标题不可撑破轨道（防溢出容器） */
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  }
.tech-related-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; color: var(--text);
  transition: border-color .15s, background .15s;
}
@media (hover: hover) and (pointer: fine) { .tech-related-card:hover { border-color: var(--accent); background: var(--bg-subtle); } }
.tech-related-card-title {
  font-size: 14px; font-weight: 600; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
}
.tech-related-card-meta { font-size: 12px; color: var(--text-secondary); }

/* 视觉隐藏但保留给读屏：补全 heading 层级用（列表前 h2） */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.tech-share-row { display: flex; gap: 10px; }

.tech-about-empty { color: var(--text-secondary); }

/* ── 评论 ── */
/* hidden 属性必须强制隐藏：.tech-comment-form-row 的 display:flex 会覆盖 UA 的 [hidden] 样式 */
[hidden] { display: none !important; }
.tech-input, .tech-textarea {
  width: 100%; padding: 10px 12px; margin-bottom: 10px;
  font-size: 16px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; outline: none; font-family: inherit;
}
.tech-input:focus, .tech-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.tech-textarea { min-height: 100px; resize: vertical; }

/* ── 标签云 ── */
.tech-tags-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tech-tag-cloud-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); text-decoration: none;
}
@media (hover: hover) and (pointer: fine) { .tech-tag-cloud-item:hover { border-color: var(--accent); color: var(--accent); } }
.tech-tag-cloud-count {
  font-size: 12px; color: var(--text-secondary);
  background: var(--bg-subtle); padding: 1px 8px; border-radius: 10px;
}

/* ── 关于页：人物卡 Hero（与首页居中极简同语言）+ 单列叙事 ── */
/* 作者卡：圆角卡片容器，取代裸居中堆叠，成为有边界的设计对象 */
.tech-about-hero {
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 24px 24px;
  margin: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}
/* 卡片化后不再需要页头底部渐变彩条 */
.tech-about-hero::after { display: none; }
/* 名字从首页级特大标题降为 24px，与页标题区分层级 */
.tech-about-hero .tech-page-title { font-size: 24px; margin: 0 0 8px; }
.tech-avatar-wrap { margin-bottom: 12px; }
.tech-avatar,
.tech-avatar-placeholder {
  box-sizing: border-box;
  width: 118px; height: 118px; flex-shrink: 0; border-radius: 50%;
  object-fit: cover;
  /* 照片与光环之间留 2px 空隙（内衬 var(--bg)），光环成为独立徽章环，
     避免照片明暗不均的边缘糊住渐变环 */
  padding: 2px;
  /* 细渐变光环描边：外圈 ring-a→ring-b，padding 区垫回页面底色 */
  border: 2px solid transparent;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(135deg, var(--ring-a), var(--ring-b)) border-box;
  /* 柔和光晕：同形底色环（跟随 border-radius）+ 轻微浮起投影 */
  box-shadow: 0 0 0 3px var(--bg-subtle), 0 6px 24px rgba(0, 0, 0, .10);
  transition: transform .3s ease, box-shadow .3s ease;
}
.tech-avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 46px;
}
/* 头像加载失败：隐藏 img，显示相邻占位首字 */
.tech-avatar--broken { display: none; }
.tech-avatar--fallback { display: none; }
.tech-avatar--broken + .tech-avatar--fallback { display: flex; }
@media (hover: hover) and (pointer: fine) {
  .tech-avatar:hover,
  .tech-avatar-placeholder:hover {
    transform: scale(1.06) rotate(4deg);
    /* 保留底色光环，避免 hover 时光晕丢失 */
    box-shadow: 0 0 0 3px var(--bg-subtle), 0 12px 32px rgba(0, 0, 0, .18);
  }
}
.tech-about-bio {
  max-width: 800px; margin: 0 auto;
  font-size: 15px; line-height: 1.9; color: var(--text-secondary);
}
.tech-about-social {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; margin-top: 18px;
}
.tech-about-social-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-secondary); text-decoration: none;
  transition: color .2s, border-color .2s;
}
@media (hover: hover) and (pointer: fine) { .tech-about-social-btn:hover { color: var(--accent); border-color: var(--accent); } }
/* 统计行：卡内底部，细线分隔的轻量单行 */
.tech-about-stats {
  display: flex; justify-content: center;
  width: 100%; margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.tech-stat {
  display: flex; align-items: baseline; gap: 8px;
  padding: 0 24px; line-height: 1;
}
.tech-stat + .tech-stat { border-left: 1px solid var(--border); }
.tech-stat b {
  font-size: 22px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.tech-stat span { font-size: 12px; color: var(--text-secondary); }

/* 正文叙事区 */
.tech-about { max-width: 1000px; margin: 36px auto 0; }
/* 叙事区块：无装饰线，仅靠留白分层 */
.tech-about-section { margin-bottom: 24px; }
.tech-about-section > h2 {
  position: relative; font-size: 18px; font-weight: 600;
  margin: 0 0 16px; padding-left: 14px;
}
.tech-about-section > h2::before {
  content: ""; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--hl-title));
}

/* 技能 */
.tech-skill-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 28px; }
.tech-skill-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.tech-skill-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tech-skill-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tech-skill-level { font-size: 12px; color: var(--text-secondary); flex-shrink: 0; }
.tech-skill-bar { height: 6px; background: var(--bg-subtle); border-radius: 3px; overflow: hidden; }
.tech-skill-fill {
  height: 100%; border-radius: 3px; width: var(--sl, 0);
  background: linear-gradient(90deg, var(--accent), var(--hl-title));
  transition: width .9s cubic-bezier(.22, .61, .36, 1);
}

/* 历程（单列时间线） */
.tech-timeline { list-style: none; margin: 0; padding: 0; }
/* 单行紧凑：日期定宽左列 + 描述跟随，节点距 16px */
.tech-timeline-item {
  position: relative; display: flex; align-items: baseline; gap: 12px;
  padding: 0 0 16px 20px; border-left: 2px solid var(--border);
}
.tech-timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.tech-timeline-item::before {
  content: ""; position: absolute; left: -6px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}
.tech-timeline-date {
  font-size: 13px; color: var(--accent); font-weight: 600;
  flex: 0 0 108px;
}
.tech-timeline-content { font-size: 14px; margin: 0; }

/* ── 项目页：间距统一 8px 基准（分隔线两侧 12，卡内 16，卡间 12） ── */
.tech-lang-stats {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
  margin-bottom: 0; padding-bottom: 0;
}
.tech-lang-link {
  cursor: pointer; color: var(--text-secondary);
  padding: 4px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: transparent;
}
@media (hover: hover) and (pointer: fine) { .tech-lang-link:hover { color: var(--accent); border-color: var(--accent); } }
.tech-lang-link.is-active {
  color: var(--accent); font-weight: 600;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: var(--accent);
}
.tech-project-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding-top: 20px;
    padding-bottom: 20px;
  }
/* 宽屏 ≥1024px：项目网格三列，充分利用 1000px 容器空间，减少纵向滚动 */
@media (min-width: 1024px) {
  .tech-project-grid { grid-template-columns: repeat(3, 1fr); }
}
.tech-project-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 24px; min-width: 0;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
}
@media (hover: hover) and (pointer: fine) { .tech-project-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0, 0, 0, .08); } }
.tech-project-card-head { display: flex; align-items: center; gap: 8px; }
.tech-project-name {
  font-size: 18px; font-weight: 600; color: var(--text); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) { .tech-project-name:hover { color: var(--accent); } }
.tech-project-featured {
  font-size: 11px; color: var(--warning);
  border: 1px solid var(--warning); border-radius: 10px; padding: 1px 8px;
  flex-shrink: 0;
}
.tech-project-desc {
  font-size: 14px; color: var(--text-secondary); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tech-project-meta {
  display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--text-secondary);
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
}
.tech-project-card-head .tech-project-stars { margin-left: auto; flex-shrink: 0; }
.tech-project-stars { color: var(--warning); }
.tech-project-lang {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 10px;
  background: var(--bg-subtle); font-size: 12px;
}
.tech-project-lang-pct { opacity: .65; }
.tech-project-lang-more {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 10px;
  border: 1px dashed var(--border); color: var(--text-secondary); font-size: 12px;
  cursor: help; position: relative;
}
/* hover/点击 浮出隐藏语言列表：
   竖排每行一语言（.tech-tip-item），用 right:0 锚定按钮右缘从右向左生长，
   宽度只取最长一项，右侧永不超出卡片 → 不撑开任何 scrollWidth（彻底解决 PC/移动端宽度溢出）。
   真实子元素默认 display:none，展开才换 block，默认态不占布局。 */
.tech-project-lang-more {
  cursor: help; position: relative;
}
.tech-project-lang-more .tech-tip {
  display: none; position: absolute;
  right: 0; bottom: calc(100% + 8px); z-index: 5;
  padding: 6px 8px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  font-size: 12px; color: var(--text);
  pointer-events: none;
}
.tech-project-lang-more .tech-tip-item {
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; line-height: 1.7;
}
/* PC：hover/键盘聚焦展开；移动端（无 hover）由 JS 切 .is-open */
@media (hover: hover) and (pointer: fine) {
  .tech-project-lang-more:hover .tech-tip,
  .tech-project-lang-more:focus .tech-tip { display: block; }
}
.tech-project-lang-more.is-open .tech-tip { display: block; }
.tech-lang-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--lang-color, #8b949e); }

/* ── 项目详情页（从列表卡片点击进入） ── */
/* 禁用双击缩放 / 捏合缩放的 CSS 兜底（disable-zoom.js 为 iOS 主力拦截） */
html { touch-action: manipulation; }

.tech-proj { padding: 0 0 8px; }
/* 项目详情页顶部收紧：无 page-head，GitHub 仓库页 nav 到标题仅约 24px */
.tech-main:has(.tech-proj) { padding-top: 16px; }

/* GitHub 仓库页式标题行：owner / repo 面包屑 + 右侧操作按钮组 */
.tech-proj-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.tech-proj-crumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0; min-width: 0;
  font-size: 20px; font-weight: 400; line-height: 1.4;
}
.tech-proj-owner { color: var(--accent); text-decoration: none; min-width: 0; }
@media (hover: hover) and (pointer: fine) { .tech-proj-owner:hover { text-decoration: underline; } }
.tech-proj-sep { color: var(--text-secondary); }
.tech-proj-repo { color: var(--accent); font-weight: 600; text-decoration: none; min-width: 0; }
@media (hover: hover) and (pointer: fine) { .tech-proj-repo:hover { text-decoration: underline; } }
.tech-proj-badge {
  font-size: 11px; font-weight: 500; color: var(--warning);
  border: 1px solid var(--warning); border-radius: 10px; padding: 1px 8px;
  flex-shrink: 0;
}
/* GitHub 式描边小按钮组：Star 计数 + 访问仓库 */
.tech-proj-actions { display: flex; gap: 8px; flex-shrink: 0; }
.tech-proj-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 500; line-height: 1.4;
  color: var(--text); background: var(--bg-subtle);
  border: 1px solid var(--border); text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
@media (hover: hover) and (pointer: fine) { .tech-proj-btn:hover { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); } }
.tech-proj-btn-icon { display: inline-block; vertical-align: middle; }
.tech-proj-btn--gh { color: #fff; background: var(--accent); border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .tech-proj-btn--gh:hover { color: #fff; filter: brightness(1.1); background: var(--accent); } }

/* 项目信息行：简介 + topics + 语言（单栏，标题行下方紧凑排版） */
.tech-proj-info {
  margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.tech-proj-about-desc {
  margin: 0 0 10px; font-size: 14px;
  color: var(--text-secondary); line-height: 1.7;
}
/* Topics：GitHub 蓝色圆角标签（原灰底描边改为 accent-weak） */
.tech-proj-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-proj-topic {
  padding: 3px 12px; border-radius: 12px;
  background: var(--accent-weak);
  font-size: 12px; font-weight: 500; color: var(--accent);
}
.tech-proj-langs { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-proj-topics + .tech-proj-langs { margin-top: 10px; }
.tech-proj-info .tech-proj-langs:first-child { margin-top: 0; }

/* 项目文档（README）区：全宽单栏卡片 */
.tech-proj-readme {
  padding: 24px; min-width: 0;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg);
}
.tech-proj-readme-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.tech-proj-readme-title {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0; font-size: 18px; font-weight: 600;
}
.tech-proj-readme-age { font-size: 12px; color: var(--text-secondary); }
.tech-proj-feedback { font-size: 13px; font-weight: 500; color: var(--text-secondary); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 8px; padding: 5px 14px; cursor: pointer; transition: color .18s ease, border-color .18s ease, transform .18s ease; display: inline-flex; align-items: center; gap: 5px; }
@media (hover: hover) and (pointer: fine) { .tech-proj-feedback:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); } }
.tech-proj-feedback:active { transform: translateY(0); }
.tech-proj-feedback:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tech-proj-feedback-icon { display: inline-block; vertical-align: middle; }
.tech-proj-readme-body { min-width: 0; }
/* README 正文标题：对齐文章页同一套梯度。此前该项目未覆盖，README 里的 # 会回落到
   markdown-body 默认 font-size:2em(≈32px)+下边框，比上方页面标题还大且多一条横线，
   「项目名 + README 大标题」双标题非常突兀（用户反馈）。 */
.tech-proj-readme-body h1, .tech-proj-readme-body.markdown-body h1 {
  font-size: 22px; font-weight: 700; line-height: 1.35; margin: 20px 0 9px;
  padding-bottom: 0; border-bottom: 0;
}
.tech-proj-readme-body h2, .tech-proj-readme-body.markdown-body h2 {
  font-size: 20px; font-weight: 700; line-height: 1.35; margin: 20px 0 9px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.tech-proj-readme-body h3, .tech-proj-readme-body.markdown-body h3 { font-size: 18px; font-weight: 700; line-height: 1.35; margin: 18px 0 8px; }
.tech-proj-readme-body h4, .tech-proj-readme-body.markdown-body h4 { font-size: 16.5px; font-weight: 700; line-height: 1.35; margin: 16px 0 8px; }
.tech-proj-readme-body h5, .tech-proj-readme-body.markdown-body h5 { font-size: 16px; font-weight: 700; line-height: 1.35; margin: 14px 0 8px; }
.tech-proj-readme-body h6, .tech-proj-readme-body.markdown-body h6 { font-size: 15.5px; font-weight: 700; line-height: 1.35; margin: 14px 0 8px; }
/* README 段落与其他块同样按门户密度收紧 */
.tech-proj-readme-body.markdown-body p { margin: 0 0 13px; }
.tech-proj-readme-body.markdown-body ul,
.tech-proj-readme-body.markdown-body ol { margin: 0 0 10px; padding-left: 22px; }
.tech-proj-readme-body.markdown-body li { margin-top: 0; margin-bottom: 2px; }
/* README 首个标题通常就是「# 项目名」，与页面顶部 crumb 重复（「Contribuv/文件收集器」下面又出现
   一个「文件收集器 (File Collector)」大标题）。这里把它降级成一行灰色小字，消除双标题感；
   元素保留不隐藏，目录里指向它的锚点仍可命中（用 display:none 会让 TOC 跳到空处）。 */
.tech-proj-readme-body.markdown-body > h1:first-child,
.tech-proj-readme-body > h1:first-child {
  font-size: 15px; font-weight: 600; color: var(--text-secondary);
  margin: 0 0 16px; padding: 0; border: 0;
}
/* 点目录跳转时留出 sticky nav（56px）呼吸空间，与文章页正文一致 */
.tech-proj-readme-body :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: 72px; }
.tech-proj-readme-empty {
  padding: 48px 0; text-align: center;
  font-size: 14px; color: var(--text-secondary);
}
.tech-proj-readme-empty p { margin: 0 0 8px; }
.tech-proj-readme-empty a { color: var(--accent); }

/* README 代码块复制按钮：tech 不加载全局 style.css，在此补同款皮肤 */
.markdown-body .code-wrap .code-copy {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  padding: 3px 10px; font-size: 12px; line-height: 1.5;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text-secondary);
  cursor: pointer; opacity: 0; transition: opacity .15s;
}
@media (hover: hover) and (pointer: fine) {
  .markdown-body .code-wrap:hover .code-copy,
  .markdown-body .code-wrap .code-copy:focus { opacity: 1; }
}
@media (hover: hover) and (pointer: fine) { .markdown-body .code-wrap .code-copy:hover { color: var(--accent); border-color: var(--accent); } }
@media (hover: none) { .markdown-body .code-wrap .code-copy { opacity: 1; } }

/* 详情页移动端：信息行与 README 卡片间距收紧 + 字号收敛（与文章正文同档） */
@media (max-width: 720px) {
  .tech-proj-readme { padding: 16px; }
  .tech-proj-crumb { font-size: 17px; }
  .tech-proj-readme-head { padding-bottom: 12px; margin-bottom: 14px; }
  /* README 正文：与文章正文同档 14px，避免项目文档比文章正文显得更大 */
  .tech-proj-readme-body, .tech-proj-readme-body.markdown-body { font-size: 14px; line-height: 1.6; }
  /* README 标题与段落整体收紧，避免手机上一页过散；梯度与文章正文标题一致 */
  .tech-proj-readme-body h1, .tech-proj-readme-body.markdown-body h1 { font-size: 18px; margin: 16px 0 8px; }
  .tech-proj-readme-body h2, .tech-proj-readme-body.markdown-body h2 { font-size: 16px; margin: 16px 0 8px; }
  .tech-proj-readme-body h3, .tech-proj-readme-body.markdown-body h3 { font-size: 15px; }
  .tech-proj-readme-body h4, .tech-proj-readme-body.markdown-body h4 { font-size: 14px; }
  .tech-proj-readme-body h5, .tech-proj-readme-body.markdown-body h5 { font-size: 13.5px; }
  .tech-proj-readme-body h6, .tech-proj-readme-body.markdown-body h6 { font-size: 13px; }
  /* README 首个标题（通常即项目名，已降级为灰色说明行）随正文同档 */
  .tech-proj-readme-body.markdown-body > h1:first-child,
  .tech-proj-readme-body > h1:first-child { font-size: 14px; margin: 0 0 14px; }
  .tech-proj-readme-body.markdown-body p { margin: 0 0 12px; }
}

/* ── 友链页 ── */
.tech-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tech-link-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px; text-decoration: none; color: var(--text);
}
@media (hover: hover) and (pointer: fine) { .tech-link-card:hover { border-color: var(--accent); } }
.tech-link-avatar {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 8px;
  object-fit: cover; display: flex; align-items: center; justify-content: center;
  background: var(--bg-subtle); color: var(--text-secondary); font-size: 18px; font-weight: 700;
}
.tech-link-info { flex: 1; min-width: 0; }
.tech-link-name { display: block; font-size: 16px; font-weight: 600; margin: 0 0 2px; }
.tech-link-desc {
  display: block; font-size: 13px; color: var(--text-secondary); margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── 状态页（官方 svc-* 类名，status.js 依赖） ── */
.tech-status-section { margin-bottom: 32px; }
.tech-status-section h2 {
  font-size: 18px; font-weight: 600; margin: 0 0 6px;
  display: flex; align-items: center; gap: 8px;
}
.svc-list { border-top: 1px solid var(--border); }
.svc-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.svc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.svc-dot.st-ok { background: var(--success); }
.svc-dot.st-warn { background: var(--warning); }
.svc-dot.st-down { background: var(--danger); }
.svc-dot.st-none { background: var(--text-secondary); opacity: .4; }
.svc-main { flex: 1; min-width: 0; }
.svc-name { font-size: 15px; font-weight: 600; }
.expiry-label { font-size: 15px; }
.svc-metrics { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: flex-end; }
.svc-metric { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.svc-count { font-size: 13px; color: var(--text-secondary); font-weight: 400; }
.svc-empty { padding: 24px 0; text-align: center; color: var(--text-secondary); font-size: 14px; }
.svc-empty-sub { font-size: 13px; opacity: .8; }
.status-hint { font-size: 13px; color: var(--text-secondary); margin-top: 12px; }

/* ── 表单（友链申请） ── */
.tech-form-row { display: flex; gap: 10px; }
.tech-form-row .tech-input { flex: 1; }
.tech-flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.tech-flash-success { background: var(--accent-weak); color: var(--success); border: 1px solid var(--success); }
.tech-flash-error { background: rgba(207, 34, 46, .08); color: var(--danger); border: 1px solid var(--danger); }

/* ── 错误页 ── */
.tech-error { text-align: center; padding: 80px 20px; }
.tech-error-code { font-size: 72px; font-weight: 700; line-height: 1; margin-bottom: 12px; }
.tech-error-code span { color: var(--accent); }
.tech-error-title { font-size: 22px; font-weight: 600; margin: 0 0 8px; }
.tech-error-desc { color: var(--text-secondary); font-size: 15px; margin: 0 0 24px; }
.tech-error-code-block {
  max-width: 480px; margin: 0 auto 24px; text-align: left;
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; overflow-x: auto;
}
.tech-error-code-block pre { margin: 0; font-size: 13px; line-height: 1.6; }
.tech-error-code-block .hl-error { color: var(--danger); }

/* ── 移动端适配 ── */
@media (max-width: 768px) {
  .tech-nav-links { display: none; }
  .tech-burger { display: flex; }
  /* 移动端：links 隐藏后 actions 失去 auto 居中推力，这里补回靠右 */
  .tech-nav-actions { margin-left: auto; }
  /* 移动端：写作 icon 隐藏（drawer 菜单已有「写作」文字入口，避免重复） */
  .tech-nav-actions a.tech-icon-btn { display: none; }
  /* 移动端字号收敛：导航字号同步下调，避免小屏上「品牌名比正文还大」 */
  .tech-logo { font-size: 17px; }
  .tech-drawer-link { font-size: 15px; }
  .tech-main { padding: 18px 0 32px; }
  .tech-main:has(.tech-page-head--center) { padding-top: 0; }
  .tech-main:has(.tech-about-hero) { padding-top: 24px; }
  .tech-main:has(.tech-proj) { padding-top: 16px; }
  /* 移动端回到顶部按钮上移，避免遮挡页脚备案文字（scrolled 压缩态同样覆盖） */
  .tech-top, .tech-top.scrolled { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .tech-post-title-lg { font-size: 20px; }
  /* 移动端文章头部收紧：标题下留白与分隔线间距缩小，避免顶部一大片空白 */
  .tech-post-header { margin-bottom: 14px; padding-bottom: 10px; }
  .tech-page-title { font-size: 20px; }
  .tech-page-desc { font-size: 14px; }
  .tech-page-head--center { padding: 32px 4px 32px; margin-bottom: 24px; }
  /* 关于页：移动端作者卡收紧内边距 */
  .tech-about-hero { padding: 24px 16px 20px; margin-bottom: 20px; }
  .tech-page-head--center .tech-page-title { font-size: 26px; }
  .tech-page-head--center .tech-page-desc { font-size: 14px; }
  .tech-about-hero .tech-page-title { font-size: 20px; }
  /* 首页终端格言：与正文同档，避免小屏上装饰文案比正文还大 */
  .tech-quote { font-size: 14px; }
  /* 关于页统计行：小屏收紧字号与内距，保证单行不溢出 */
  .tech-stat { padding: 0 12px; gap: 6px; }
  .tech-stat b { font-size: 18px; }
  .tech-stat span { font-size: 11px; }
  .tech-about-stats { margin-top: 18px; }
  /* 时间线：窄屏回退上下结构，避免描述被定宽日期列挤压 */
  .tech-timeline-item { flex-direction: column; align-items: flex-start; gap: 2px; }
  .tech-timeline-date { flex: none; }
  .tech-post-pager { grid-template-columns: 1fr; }
  /* 相关推荐：窄屏 4 列过挤，降为 2 列两行 */
  .tech-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech-pager-next { text-align: left; }
  .tech-form-row { flex-direction: column; gap: 0; }
  .tech-skill-list { grid-template-columns: 1fr; }
  /* 许可文字折行后不再推右，避免单独悬于右侧 */
  .tech-license { margin-left: 0; }
}

/* ≤767px：文章页公众号式排版（手机与平板统一，桌面窄窗预览同样生效）：
   14px / 1.6 行高 / 13px 段距 / 两端对齐；含 <br> 的段落自动排除，避免短行被拉伸 */
@media (max-width: 767px) {
  .tech-post-title { font-size: 16px; }
  .tech-post-excerpt { font-size: 14px; }
  .tech-post-body, .tech-post-body.markdown-body {
    /* 中文正文不加字间距：0.03em 在 14px 下约 0.4px/字，移动端视觉明显发「散」（用户反馈） */
    font-size: 14px; line-height: 1.6; letter-spacing: normal;
  }
  /* 移动标题梯度：18/16/15/14/13.5/13，与页面标题 20px 拉开，避免双标题打架 */
  .tech-post-body h1, .tech-post-body.markdown-body h1 { font-size: 18px; padding-bottom: 0; border-bottom: 0; }
  .tech-post-body h2, .tech-post-body.markdown-body h2 {
    font-size: 16px; padding-bottom: 7px;
  }
  .tech-post-body h3, .tech-post-body.markdown-body h3 { font-size: 15px; }
  .tech-post-body h4, .tech-post-body.markdown-body h4 { font-size: 14px; }
  .tech-post-body h5, .tech-post-body.markdown-body h5 { font-size: 13.5px; }
  .tech-post-body h6, .tech-post-body.markdown-body h6 { font-size: 13px; }
  /* 段距再收紧到 13px：门户式密度，一屏能多看好几行 */
  .tech-post-body p, .tech-post-body.markdown-body p { margin: 0 0 13px; }
  /* 标题上下留白同步收紧 */
  .tech-post-body h1, .tech-post-body.markdown-body h1,
  .tech-post-body h2, .tech-post-body.markdown-body h2,
  .tech-post-body h3, .tech-post-body.markdown-body h3,
  .tech-post-body h4, .tech-post-body.markdown-body h4,
  .tech-post-body h5, .tech-post-body.markdown-body h5,
  .tech-post-body h6, .tech-post-body.markdown-body h6 { margin: 16px 0 8px; }
  /* 不使用两端对齐：justify 会拉伸含短行的段落字距，移动端观感发「散」（用户反馈，justify 移除） */
}

@media (max-width: 480px) {
  .tech-shell { padding: 0 16px; }
  .tech-post-body pre { padding: 12px; }
  /* ≤480px：标签/年份占半行并排，排序独占第二行并与第一排等宽对齐 */
  .tech-cs { flex: 1 1 calc(50% - 4px); max-width: calc(50% - 4px); }
  .tech-cs:last-child { flex: 1 1 100%; max-width: 100%; }
  .tech-links-grid { grid-template-columns: 1fr; }
  .tech-project-grid { grid-template-columns: 1fr; }

  /* 页脚：窄屏改为纵向堆叠，备案号整条折行，避免文字溢出 */
  .tech-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .tech-footer-links { justify-content: flex-start; }
  .tech-footer-beian {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
  }
  .tech-footer-beian a { margin-right: 0; }
}

/* 打印：正文全宽 */
@media print {
  .tech-nav, .tech-footer, .tech-top, .tech-drawer-overlay, .tech-drawer { display: none !important; }
  .tech-main { padding: 0; }
  .tech-post-body { max-width: none; }
}

/* ═══ 文章媒体灯箱：图片/视频点击浮窗，图片多图左右轮转 ═══ */
.tech-lightbox {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 9, 13, .92);
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s;
}
.tech-lightbox.open { opacity: 1; visibility: visible; }
.tech-lightbox-stage {
  display: flex; align-items: center; justify-content: center;
  max-width: 92vw; max-height: 86vh;
}
.tech-lightbox-media {
  max-width: 92vw; max-height: 86vh;
  border-radius: 8px; box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
  background: #000; object-fit: contain;
}
.tech-lightbox-stage video.tech-lightbox-media { width: auto; }
.tech-lightbox-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08);
  color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
@media (hover: hover) and (pointer: fine) { .tech-lightbox-close:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .45); } }
.tech-lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08);
  color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding-bottom: 2px;
}
@media (hover: hover) and (pointer: fine) { .tech-lightbox-nav:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .45); } }
.tech-lightbox-prev { left: 16px; }
.tech-lightbox-next { right: 16px; }
.tech-lightbox-count {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .78); font-size: 13px;
  font-variant-numeric: tabular-nums; letter-spacing: .05em; z-index: 2;
}
@media (max-width: 480px) {
  .tech-lightbox-close { top: 10px; right: 10px; }
  .tech-lightbox-prev { left: 8px; }
  .tech-lightbox-next { right: 8px; }
  .tech-lightbox-nav { width: 38px; height: 38px; font-size: 22px; }
}

/* ═══ 交互手感统一（2026-09：键盘焦点 / 按压反馈 / hover 微动）═══ */
/* 键盘可达元素统一焦点环（输入/下拉已有各自的 accent 焦点样式，不重复叠加） */
:where(a[href], button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
/* 导航链接 hover 平滑 */
.tech-nav-link { transition: color .15s ease; }
/* 图标按钮（搜索/主题/汉堡）：hover 平滑 + 按压回弹 */
.tech-icon-btn {
  transition: color .2s ease, background-color .2s ease, transform .12s ease;
}
.tech-icon-btn:active { transform: scale(.9); }
/* 普通/主按钮：hover 平滑 + 按压下沉 */
.tech-btn {
  transition: border-color .2s ease, color .2s ease, filter .2s ease,
              background-color .2s ease, transform .12s ease;
}
.tech-btn:active { transform: translateY(1px); }
.tech-btn-primary:active { filter: brightness(.95); color: #fff; }
[data-theme="dark"] .tech-btn-primary:active { color: #0d1117; }
/* 项目筛选芯片：可点击语义 + hover/焦点平滑 */
.tech-lang-link { cursor: pointer; transition: color .15s ease, transform .15s ease, border-color .15s ease; }
@media (hover: hover) and (pointer: fine) { .tech-lang-link:hover { transform: translateY(-1px); } }
/* 卡片 / 标签云芯片：hover 平滑微浮起 */
.tech-project-card,
.tech-link-card,
.tech-tag-cloud-item {
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
@media (hover: hover) and (pointer: fine) {
  .tech-project-card:hover,
  .tech-link-card:hover { transform: translateY(-3px); }
  .tech-tag-cloud-item:hover { transform: translateY(-2px); }
}

/* ── 图片画廊：连续纯图由 JS 合并为网格，点击进灯箱 ── */
.img-gallery {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px; margin: 0 0 16px;
}
.img-gallery img {
  width: 100%; margin: 0; display: block;
  aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 6px; cursor: zoom-in;
  transition: filter .18s ease, transform .18s ease;
}
@media (hover: hover) and (pointer: fine) { .img-gallery img:hover { filter: brightness(.94); } }
@media (min-width: 768px) {
  .img-gallery { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

/* ── 灯箱（点击正文任意图片打开，左右箭头 / 键盘 / 滑屏切换） ── */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: rgba(6, 8, 12, .92); padding: 24px;
  opacity: 0; transition: opacity 200ms ease;
}
.lightbox.open { display: flex; opacity: 1; }
.lightbox-media {
  max-width: 92vw; max-height: 88vh;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-media img,
.lightbox-media video {
  max-width: 92vw; max-height: 88vh; border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5); object-fit: contain;
  background: #000;
}
.lightbox-close, .lightbox-nav {
  position: absolute; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); color: #fff;
  transition: background .15s ease;
}
@media (hover: hover) and (pointer: fine) { .lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .25); } }
.lightbox-close {
  top: 16px; right: 16px; width: 40px; height: 40px;
  border-radius: 50%; font-size: 22px; line-height: 1;
}
.lightbox-nav {
  top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  font-size: 24px; line-height: 1;
}
.lightbox-nav[hidden] { display: none; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-count {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .7); font-size: 13px;
}
@media (max-width: 768px) {
  .lightbox-nav { width: 38px; height: 38px; font-size: 20px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* 通用隐藏类：置于末尾以按顺序压过后文同特异度的 display 声明（如 .tech-link-avatar） */
.hidden { display: none; }