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

/* ── 设计令牌 ── */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --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;
  --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; }
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;
}
/* ── 主内容统一单列 940px：页头、横线、列表、卡片共用同一列宽，
      与 1000px 导航/页脚同心居中；窄屏自动退化为全宽 ── */
.tech-main .tech-shell {
  max-width: 940px;
}

/* ── 导航 ── */
.tech-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.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;
}
.tech-logo-bracket {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px; font-weight: 400; color: var(--accent);
}
.tech-logo:hover { color: var(--accent); }
.tech-logo:hover .tech-logo-bracket { 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; }
}
.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;
}
.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;
}
.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;
}
.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);
}
.tech-drawer-link:hover { background: var(--bg-subtle); }
.tech-drawer-link.active { color: var(--accent); font-weight: 600; }

/* ── 主内容 ── */
.tech-main { flex: 1; padding: 32px 0 64px; }
/* 居中极简 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; }
.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; }
.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; }
.tech-top:hover { color: var(--accent); border-color: var(--accent); }
/* 滚动后缩小成 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: 40px 12px 40px;
  /* 与左对齐子页 .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; }

/* ── 首页终端格言 ── */
.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-prompt {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  color: var(--accent); user-select: none; white-space: nowrap;
}
.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; }
.tech-quote-refresh:hover { color: var(--accent); background: var(--bg-subtle); }
.tech-quote-refresh.spin svg { transform: rotate(360deg); }

/* ── 全局搜索：导航下拉面板（入口为导航栏放大镜） ── */
.tech-search-layer {
  display: none;
  padding: 12px 0 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}
.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;
}
.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;
}
.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;
}
.tech-post-title { font-size: 20px; 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;
}
.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;
}
.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;
}
.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;
}
.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; }

/* ── 文章详情 ── */
.tech-post-header { margin-bottom: 20px; }
.tech-post-title-lg { font-size: 28px; font-weight: 700; line-height: 1.4; margin: 0 0 12px; }
.tech-post-meta-lg {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 13px; color: var(--text-secondary); margin-bottom: 12px;
}
.tech-post-tags-lg { display: flex; flex-wrap: wrap; gap: 6px; }

/* 目录下拉 */
.tech-toc {
  margin: 0 0 24px;
  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; }
.tech-toc-body { padding: 0 14px 12px; max-height: 60vh; overflow-y: auto; }
.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: 14px; line-height: 1.6;
  color: var(--text-secondary); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.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;
}

/* 正文：容器全宽 */
.tech-post-body {
  font-size: 16px; line-height: 1.8; 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 {
  font-weight: 600; line-height: 1.4; margin: 28px 0 14px;
}
.tech-post-body h1 { font-size: 24px; }
.tech-post-body h2 {
  font-size: 21px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.tech-post-body h3 { font-size: 18px; }
.tech-post-body h4 { font-size: 16px; }
.tech-post-body p { margin: 0 0 18px; }
.tech-post-body strong { font-weight: 700; }
.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; }
.tech-post-body details { margin: 0 0 16px; }
.tech-post-body summary { cursor: pointer; font-weight: 600; }
.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;
}
.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: 0 auto 16px; }
.tech-post-body blockquote {
  margin: 0 0 16px; padding: 10px 16px;
  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: 8px 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 16px; line-height: 1.6;
}
.tech-post-body pre code { background: none; padding: 0; font-size: 13.5px; }

/* 代码块复制按钮（JS 包 .code-wrap 容器） */
.code-wrap { position: relative; margin: 0 0 16px; }
.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;
}
.code-wrap:hover .code-copy, .code-copy:focus { opacity: 1; }
.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 16px; font-size: 14px;
  display: block; overflow-x: auto;
}
.tech-post-body th, .tech-post-body td {
  border: 1px solid var(--border); padding: 8px 12px; text-align: left;
}
.tech-post-body th { background: var(--bg-subtle); font-weight: 600; }
.tech-post-body ul, .tech-post-body ol { padding-left: 24px; margin: 0 0 16px; }
.tech-post-body li { margin-bottom: 4px; }
.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: 32px 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: 12px 16px; border-radius: 8px; margin: 0 0 16px;
  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 16px; }
.tech-post-body dt { font-weight: 600; margin-top: 8px; }
.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;
}

/* 附件链接：常见附件扩展名加下载标记 */
.tech-post-body a[href$=".zip"]::after, .tech-post-body a[href$=".rar"]::after,
.tech-post-body a[href$=".pdf"]::after, .tech-post-body a[href$=".doc"]::after,
.tech-post-body a[href$=".docx"]::after, .tech-post-body a[href$=".xls"]::after,
.tech-post-body a[href$=".xlsx"]::after, .tech-post-body a[href$=".ppt"]::after,
.tech-post-body a[href$=".pptx"]::after, .tech-post-body a[href$=".txt"]::after,
.tech-post-body a[href$=".md"]::after, .tech-post-body a[href$=".py"]::after,
.tech-post-body a[href$=".js"]::after, .tech-post-body a[href$=".json"]::after {
  content: " ⬇";
  font-size: 12px;
}

/* ── 代码高亮（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: 40px 0 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.tech-pager-link {
  display: block; padding: 14px 16px; min-width: 0;
  border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; color: var(--text);
}
.tech-pager-link:hover { border-color: var(--accent); }
.tech-pager-dir { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.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 { visibility: hidden; }

/* ── 文章底部操作 ── */
.tech-post-footer {
  margin: 32px 0 0;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding-top: 20px; border-top: 1px solid var(--border);
}
.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;
}
.tech-btn:hover { border-color: var(--accent); color: var(--accent); }
.tech-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.tech-btn-primary:hover { filter: brightness(1.1); color: #fff; }
.tech-license { font-size: 13px; color: var(--text-secondary); }

/* ── 轻提示 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(--bg);
  border: 1px solid var(--border-strong); border-radius: 8px;
  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: 40px 0 0; }
.tech-related-title { font-size: 18px; font-weight: 600; margin: 0 0 16px; }
.tech-related-list { list-style: none; margin: 0; padding: 0; }
.tech-related-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.tech-related-item a { color: var(--text); text-decoration: none; font-size: 15px; }
.tech-related-item a:hover { color: var(--accent); }
.tech-related-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ── 评论 ── */
.tech-comments { margin: 40px 0 0; }
.tech-comments-title { font-size: 18px; font-weight: 600; margin: 0 0 16px; }
.tech-comment-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.tech-comment-avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-weak); color: var(--accent);
  font-size: 15px; font-weight: 700; border-radius: 50%;
  object-fit: cover; overflow: hidden;
}
.tech-comment-avatar-link { display: inline-flex; flex-shrink: 0; border-radius: 50%; }
.tech-comment-avatar-link:hover .tech-comment-avatar { box-shadow: 0 0 0 2px var(--accent); }
.tech-comment-body { flex: 1; min-width: 0; }
.tech-comment-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.tech-comment-author { font-size: 14px; font-weight: 600; }
.tech-comment-author-badge {
  display: inline-block; padding: 1px 8px; font-size: 11px;
  color: #fff; background: var(--accent); border-radius: 10px;
}
.tech-comment-replyto {
  display: inline-block; padding: 1px 8px; font-size: 11px;
  color: var(--accent); background: var(--accent-weak);
  border-radius: 10px; text-decoration: none; line-height: 1.6;
  transition: background .2s, color .2s;
}
.tech-comment-replyto:hover { background: var(--accent); color: #fff; }
.tech-comment-time { font-size: 12px; color: var(--text-secondary); }
.tech-comment-content { font-size: 14px; margin: 0; word-wrap: break-word; }
.tech-comments-empty { color: var(--text-secondary); font-size: 14px; padding: 16px 0; }
.tech-comment-form { margin-top: 20px; }
/* 盖楼：giscus/GitHub 风格——子回复整体缩进（头像随内容右移）+ 1px 细竖线，
   第 2 层起不再加深（平铺），杜绝无限嵌套溢出 */
.tech-comment-children { margin-left: 48px; padding-left: 16px; border-left: 1px solid var(--border); }
.tech-comment-children .tech-comment-children { margin-left: 0; padding-left: 0; }
.tech-comment-reply-btn {
  margin-top: 6px; padding: 2px 10px; font-size: 12px;
  color: var(--text-secondary); background: none;
  border: 1px solid var(--border); border-radius: 4px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.tech-comment-reply-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-weak); }
/* 评论表单：三字段一行 + 回复提示 */
/* hidden 属性必须强制隐藏：.tech-comment-form-row 的 display:flex 会覆盖 UA 的 [hidden] 样式 */
[hidden] { display: none !important; }
.tech-comment-form-row { display: flex; gap: 10px; }
.tech-comment-form-row .tech-input { flex: 1; }
.tech-comment-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tech-comment-replying { font-size: 13px; color: var(--accent); }
.tech-comment-cancel {
  margin-left: 8px; padding: 2px 8px; font-size: 12px;
  color: var(--text-secondary); background: none;
  border: 1px solid var(--border); border-radius: 4px; cursor: pointer;
}
.tech-comment-cancel:hover { color: var(--accent); border-color: var(--accent); }
/* 私密评论标记 */
.tech-comment-private-badge {
  display: inline-block; padding: 1px 8px; font-size: 11px;
  color: #fff; background: var(--accent); border-radius: 10px;
}
.tech-comment-pending-badge {
  display: inline-block; padding: 1px 8px; font-size: 11px;
  color: #7a5b00; background: #f5e6b8; border-radius: 10px;
}
/* 记住信息提示条 */
.tech-comment-remember {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; margin-bottom: 10px; font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-subtle); border: 1px dashed var(--border); border-radius: 6px;
}
.tech-comment-remember-edit {
  flex-shrink: 0; padding: 2px 10px; font-size: 12px;
  color: var(--accent); background: none;
  border: 1px solid var(--accent); border-radius: 4px; cursor: pointer;
}
.tech-comment-remember-edit:hover { background: var(--accent-weak); }
/* 私密评论开关 */
.tech-comment-private {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
  user-select: none;
}
.tech-comment-private input { accent-color: var(--accent); cursor: pointer; }
.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;
}
.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; }
.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;
}
.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: 940px; 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: 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;
}
.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;
  }
.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;
}
.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: 17px; font-weight: 600; color: var(--text); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.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 浮出隐藏语言列表：纯 CSS，data-more 由模板注入 */
.tech-project-lang-more::after {
  content: attr(data-more);
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 5;
  white-space: nowrap; padding: 6px 10px; 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);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  pointer-events: none;
}
.tech-project-lang-more:hover::after {
  opacity: 1; visibility: visible; transform: none;
}
.tech-lang-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ── 友链页 ── */
.tech-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 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);
}
.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: 15px; 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-main { padding: 24px 0 48px; }
  .tech-main:has(.tech-page-head--center) { padding-top: 0; }
  .tech-main:has(.tech-about-hero) { padding-top: 24px; }
  /* 移动端回到顶部按钮上移，避免遮挡页脚备案文字（scrolled 压缩态同样覆盖） */
  .tech-top, .tech-top.scrolled { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .tech-post-title-lg { font-size: 24px; }
  .tech-page-title { font-size: 24px; }
  .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: 32px; }
  .tech-page-head--center .tech-page-desc { font-size: 15px; }
  .tech-about-hero .tech-page-title { font-size: 22px; }
  /* 关于页统计行：小屏收紧字号与内距，保证单行不溢出 */
  .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; }
  .tech-pager-next { text-align: left; }
  .tech-form-row { flex-direction: column; gap: 0; }
  .tech-skill-list { grid-template-columns: 1fr; }
  /* 评论：表单三字段改纵向堆叠 */
  .tech-comment-form-row { flex-direction: column; gap: 0; }
  /* 盖楼：移动端缩进减半，避免窄屏挤压 */
  .tech-comment-children { margin-left: 24px; padding-left: 8px; }
}

@media (max-width: 480px) {
  .tech-shell { padding: 0 16px; }
  .tech-post-title { font-size: 18px; }
  .tech-post-body { font-size: 15.5px; }
  .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;
}
.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;
}
.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); }
/* 项目筛选芯片：可点击语义 + hover/焦点平滑 */
.tech-lang-link { cursor: pointer; transition: color .15s ease, transform .15s ease, border-color .15s ease; }
.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;
}
.tech-project-card:hover,
.tech-link-card:hover { transform: translateY(-3px); }
.tech-tag-cloud-item:hover { transform: translateY(-2px); }