/* =====================================================================
   coolcheng 静态博客 · 样式表（明日方舟风格重制版）
   风格：ark 工业信息系统 —— 近黑墨色 + 纸白 + 信号青 #18d1ff
   特征：方角（圆角 2px）、1px 细线、蓝图网格、模块编号、等宽微标注
   双主题：浅色 = 罗德岛纸面风；深色 = 终端作战风
   ===================================================================== */

/* ==================== 自托管字体（零外部依赖） ====================
   不再请求 Google Fonts（被墙/慢网络会卡加载），字体文件随站点本地提供：
   Oswald（可变字重 200–700，展示字）+ IBM Plex Mono（400/500/600，等宽字）
   已用 pyftsubset 瘦身为拉丁字符集（约 190KB 总量），
   来源 google/fonts 开源仓库（OFL 许可），可自由使用与分发 */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url('../assets/fonts/oswald-vf.ttf') format('truetype');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/ibmplexmono-400.ttf') format('truetype');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/ibmplexmono-500.ttf') format('truetype');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/ibmplexmono-600.ttf') format('truetype');
}

/* ------------------------------ 设计变量 ------------------------------ */
:root {
  /* 主题色（随明暗翻转） */
  --ink: #080a0b;            /* 墨黑（正文） */
  --ink-2: #15181a;          /* 次级墨色 */
  --paper: #f4f6f6;          /* 纸白（底色） */
  --paper-2: #e9eceb;        /* 次级纸色（分隔/悬停） */
  --card: #fbfcfc;           /* 卡片（近白） */
  --signal: #18d1ff;         /* 信号青（唯一主强调色） */
  --signal-deep: #0e9ecb;    /* 信号青（深，用于链接/浅底文字） */
  --signal-soft: rgba(24, 209, 255, .12);  /* 信号青浅底 */
  --state: #c8eb21;          /* 状态绿（极少量状态点缀） */
  --muted: #7d8587;          /* 次级文字 */
  --faint: #a2aaac;          /* 弱化文字 */
  --line: rgba(8, 10, 11, .14);   /* 细线 */
  --rule: rgba(8, 10, 11, .22);   /* 强线 */
  --code-bg: #edf0f0;
  --quote-bg: #e9eceb;
  --shadow: 0 1px 0 rgba(8, 10, 11, .06), 0 14px 34px -20px rgba(8, 10, 11, .28);
  --shadow-lift: 0 1px 0 rgba(8, 10, 11, .08), 0 24px 46px -22px rgba(8, 10, 11, .42);

  /* 舞台色（Hero / 页脚 / 代码块 / 表格头：随主题翻转） */
  --stage-bg: #f4f6f6;
  --stage-bg-2: #e9eceb;
  --stage-ink: #080a0b;
  --stage-muted: rgba(8, 10, 11, .60);
  --stage-line: rgba(8, 10, 11, .16);
  --stage-panel: rgba(255, 255, 255, .68);          /* 读数条面板（浅色=半透明白） */
  --stage-grid:                                    /* 蓝图网格（浅色=青色深线） */
    linear-gradient(rgba(24, 209, 255, .28) 1px, transparent 1px),
    linear-gradient(rgba(8, 10, 11, .09) 1px, transparent 1px);
  --stage-fold: rgba(24, 209, 255, .32);            /* 斜切折痕线 */
  /* 选中态颜色（随主题翻转）：浅色=实心信号青底+深字；深色=半透明青高亮+近白字 */
  --sel-bg: #18d1ff;
  --sel-ink: #080a0b;
  --on-signal: #080a0b;                             /* 信号青底上的文字（恒定深色） */

  /* 字体 */
  --display: 'Oswald', 'Arial Narrow', 'Noto Sans SC', 'PingFang SC', sans-serif;  /* 拉丁展示字 */
  --sans: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;

  --header-h: 64px;
  --radius: 2px;             /* 方舟方角 */
}

html.dark {
  --ink: #f4f6f6;
  --ink-2: #e9eceb;
  --paper: #080a0b;
  --paper-2: #0d0f10;
  --card: #101314;
  --signal: #18d1ff;
  --signal-deep: #4cd9ff;
  --signal-soft: rgba(24, 209, 255, .13);
  --state: #c8eb21;
  --muted: #9aa3a6;
  --faint: #5d6669;
  --line: rgba(244, 246, 246, .13);
  --rule: rgba(244, 246, 246, .20);
  --code-bg: #131718;
  --quote-bg: #101314;
  --shadow: 0 1px 0 rgba(0, 0, 0, .5), 0 16px 38px -20px rgba(0, 0, 0, .75);
  --shadow-lift: 0 1px 0 rgba(0, 0, 0, .55), 0 26px 50px -22px rgba(0, 0, 0, .9);

  /* 深色主题的舞台色（终端作战风） */
  --stage-bg: #080a0b;
  --stage-bg-2: #0d1011;
  --stage-ink: #f4f6f6;
  --stage-muted: rgba(244, 246, 246, .60);
  --stage-line: rgba(244, 246, 246, .16);
  --stage-panel: rgba(8, 10, 11, .55);
  --stage-grid:
    linear-gradient(rgba(24, 209, 255, .10) 1px, transparent 1px),
    linear-gradient(rgba(244, 246, 246, .07) 1px, transparent 1px);
  --stage-fold: rgba(24, 209, 255, .26);
  /* 深色主题选中态：半透明青高亮 + 近白字（终端式，避免实心亮块刺眼） */
  --sel-bg: rgba(24, 209, 255, .38);
  --sel-ink: #f0fdff;
}

/* -------------------------------- 基础 -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  /* 隐藏原生滚动条：浏览器不再占宽（页面间布局完全一致），由博客自定义滚动条替代（见 main.js） */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar { width: 0; height: 0; display: none; }
body {
  margin: 0;
  /* 弹性纵向布局：内容不足一屏时页脚贴底，消除页脚下方留白 */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}
::selection { background: var(--sel-bg); color: var(--sel-ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 2px; }
a { color: var(--signal-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--signal); }
img { max-width: 100%; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
main { flex: 1 0 auto; min-height: 60vh; }
h1, h2, h3, h4 { text-wrap: balance; }

/* 禁用 JS 时：所有入场效果直接展示（no-js 由 main.js 切走，js 类接管） */
.no-js .reveal { opacity: 1; transform: none; }
.no-js .section-title, .no-js .page-head h1 { clip-path: none; }

/* -------------------------------- 顶栏 -------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--line);
  transition: background .3s ease;
}
/* 阅读进度条：顶栏下缘信号青细线，随滚动填充（JS 驱动 scaleX，滚动联动不缓动） */
.scroll-progress {
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
  z-index: 5;
}
.header-inner {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); gap: 16px;
  /* 顶栏通栏：头像+名字钉在最左，RSS/明暗切换钉在最右，导航严格居中（绝对定位锚定几何中心） */
  max-width: none;
  padding: 0 28px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); position: relative; }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 2px;
  border: 1px solid var(--rule);
  object-fit: cover;
}
/* 品牌名前缀：信号青方块（方舟 wordmark 式标识） */
.brand::before {
  content: ""; width: 6px; height: 22px; flex: none;
  background: var(--signal);
  clip-path: polygon(0 0, 55% 0, 55% 100%, 0 100%);
}
.brand-name {
  font-family: var(--display); font-weight: 700;
  font-size: 1.14rem; letter-spacing: .14em;
  text-transform: uppercase;
}
/* 导航：绝对定位在顶栏几何中心（不受左右块宽度影响） */
.site-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 2px;
}
.nav-link {
  position: relative;
  padding: 7px 15px; border-radius: 2px;
  color: var(--muted); text-decoration: none; font-size: .95rem;
  transition: color .2s, background .2s;
}
.nav-link::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--signal);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .22s cubic-bezier(.22, .8, .2, 1);
}
.nav-link:hover { color: var(--ink); background: var(--signal-soft); }
.nav-link.active { color: var(--ink); background: var(--signal-soft); font-weight: 600; }
.nav-link.active::before { transform: scaleY(1); }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 2px;
  border: 1px solid transparent; background: none; cursor: pointer;
  color: var(--muted); text-decoration: none; padding: 0;
  transition: color .2s, background .2s, border-color .2s;
}
.icon-link:hover { color: var(--signal); background: var(--signal-soft); border-color: var(--line); }
#theme-toggle .ic-moon { display: none; }
html.dark #theme-toggle .ic-sun { display: none; }
html.dark #theme-toggle .ic-moon { display: block; }
.nav-toggle { display: none; }

/* -------------------------------- 首页 Hero --------------------------------
   「舞台 + 仪表」：恒定深色舞台，青色蓝图网格 + 几何装饰 + 底部读数条 */
.hero {
  position: relative; overflow: hidden;
  /* 铺满首屏（减去顶栏高度） */
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  padding: 72px 0 56px;
  background: var(--stage-bg);
  color: var(--stage-ink);
  border-bottom: 1px solid var(--stage-line);
}
/* 蓝图网格 + 斜切光线 + 角括号（纯 CSS） */
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; user-select: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: var(--stage-grid);
  background-size: 54px 54px;
  mask-image: linear-gradient(90deg, #000, #000 58%, transparent 94%);
  -webkit-mask-image: linear-gradient(90deg, #000, #000 58%, transparent 94%);
  /* 极慢漂移：一个网格周期无缝循环，像游戏主界面背景缓缓移动 */
  animation: grid-drift 60s linear infinite;
}
@keyframes grid-drift {
  from { background-position: 0 0; }
  to { background-position: 54px 54px; }
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    /* 斜切信号线（蓝图折痕） */
    linear-gradient(115deg, transparent 0 62%, var(--stage-fold) 62.1% 62.25%, transparent 62.4%),
    /* 斜切光线洗色 */
    linear-gradient(112deg, rgba(24, 209, 255, .06) 0 40%, transparent 62%),
    linear-gradient(160deg, var(--stage-bg-2), var(--stage-bg) 62%);
}
/* 角括号装饰：左上 / 右下 */
.hero::before {
  content: ""; position: absolute; left: 26px; top: 26px; z-index: 2;
  width: 42px; height: 42px;
  border-left: 2px solid var(--signal); border-top: 2px solid var(--signal);
  opacity: .55; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; right: 26px; bottom: 26px; z-index: 2;
  width: 42px; height: 42px;
  border-right: 2px solid var(--signal); border-bottom: 2px solid var(--signal);
  opacity: .55; pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; width: 100%; }
.hero-kicker {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 20px; font-family: var(--mono); font-size: .78rem;
  letter-spacing: .30em; color: var(--signal-deep); text-transform: uppercase;
}
.hero-kicker::before {
  content: ""; width: 26px; height: 5px; flex: none;
  background: var(--signal);
  clip-path: polygon(0 0, 62% 0, 62% 100%, 0 100%);
}
.hero-title {
  margin: 0; font-family: var(--sans); font-weight: 900;
  font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1.2;
  letter-spacing: .02em; color: var(--stage-ink);
  text-wrap: balance;
}
.hero-title::after {
  content: ""; display: block;
  width: 64px; height: 4px; margin-top: 26px;
  background: var(--signal);
}
/* 标题第二行（原镂空方案因 CJK 笔画交叉无法干净镂空，已改回实心） */
.hero-title-outline {
  color: inherit;
}
/* 右侧竖排系统标注 */
.hero-axis {
  position: absolute; right: 30px; top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  writing-mode: vertical-rl;
  font-family: var(--mono); font-size: .62rem;
  letter-spacing: .42em; text-transform: uppercase;
  color: var(--stage-muted);
  pointer-events: none; user-select: none;
}
.hero-sub { margin: 22px 0 0; font-size: 1.1rem; color: var(--stage-muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* 底部读数条：等宽数据 + 状态指示灯（仪表化） */
.hero-readout {
  display: flex; flex-wrap: wrap;
  width: fit-content; /* 收缩贴合内容，右侧留白让给 Hero 舞台（网格/渐变透出） */
  margin-top: 56px;
  border: 1px solid var(--stage-line);
  background: var(--stage-panel);
}
.hr-cell {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 132px; padding: 14px 22px;
  border-right: 1px solid var(--stage-line);
  font-family: var(--mono);
  transition: background .2s ease;
}
.hr-cell:hover { background: rgba(24, 209, 255, .09); } /* 仪表单元响应 */
.hr-cell:last-child { border-right: none; }
.hr-label { font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; color: var(--stage-muted); }
.hr-value { font-size: 1.28rem; font-weight: 600; color: var(--stage-ink); font-variant-numeric: tabular-nums; }
/* 状态单元：与数据单元同构（label 上 / value 下），脉冲点内嵌在 value 行 */
.hr-live { min-width: 132px; }
.hr-live .hr-value { display: inline-flex; align-items: center; gap: 10px; font-size: 1.28rem; }
.hr-dot {
  width: 8px; height: 8px; flex: none;
  background: var(--state);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--state), transparent 60%);
  animation: ark-pulse 2s ease-out infinite;
}
@keyframes ark-pulse {
  70%, 100% { box-shadow: 0 0 0 9px transparent; }
}

.hero-kicker, .hero-title, .hero-sub, .hero-actions, .hero-readout { opacity: 0; animation: rise .7s cubic-bezier(.22, .61, .36, 1) forwards; }
.hero-kicker { animation-delay: .05s; }
.hero-title { animation-delay: .15s; }
.hero-sub { animation-delay: .28s; }
.hero-actions { animation-delay: .40s; }
.hero-readout { animation-delay: .52s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* -------------------------------- 按钮 -------------------------------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px 11px 30px; border-radius: 2px;
  font-size: .98rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .18s cubic-bezier(.23, 1, .32, 1), box-shadow .2s, background .2s, color .2s, border-color .2s;
}
/* 左楔形箭头：hover 时滑出（方舟按钮签名细节）；currentColor 跟随文字色，hover 反色时仍可见 */
.btn::before {
  content: ""; position: absolute; left: 9px; top: 50%;
  width: 12px; height: 3px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  opacity: 0;
  transform: translate(-7px, -50%);
  transition: opacity .18s ease, transform .18s cubic-bezier(.23, 1, .32, 1);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover::before, .btn:focus-visible::before { opacity: 1; transform: translate(0, -50%); }
}
.btn:hover { transform: translateY(-2px); }
/* 按下反馈：轻微收缩（触屏同样生效） */
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--signal); color: var(--on-signal); font-weight: 700; box-shadow: 0 8px 22px -10px var(--signal); }
.btn-primary:hover { background: var(--stage-ink); color: var(--stage-bg); }
.btn-ghost { border-color: var(--stage-line); color: var(--stage-ink); background: transparent; }
.btn-ghost:hover { border-color: var(--signal); color: var(--signal); }
/* 浅色场景（404 页）下的幽灵按钮 */
.notfound .btn-ghost, .about-teaser .btn-ghost { border-color: var(--rule); color: var(--ink); }
.notfound .btn-ghost:hover, .about-teaser .btn-ghost:hover { border-color: var(--signal-deep); color: var(--signal-deep); }

/* ------------------------------ 区块标题 ------------------------------
   方舟式：「模块编号 + 标题 + 延伸细线」 */
.section-title {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--sans); font-weight: 700; font-size: 1.5rem;
  letter-spacing: .04em; margin: 0 0 28px;
  /* 划入入场：clip-path 左侧擦拭揭示（JS 加 .in；no-js 下不裁剪） */
  clip-path: inset(0 100% 0 0);
  transition: clip-path .55s cubic-bezier(.22, .8, .2, 1);
}
.section-title.in { clip-path: inset(0); }
.sec-idx {
  flex: none;
  font-family: var(--mono); font-size: .92rem; font-weight: 500;
  color: var(--signal-deep);
  letter-spacing: .08em;
}
.sec-idx::after { content: " /"; color: var(--faint); }
.sec-line { flex: 1; height: 1px; background: var(--line); margin-left: 6px; }

/* -------------------------------- 首页分区 -------------------------------- */
.latest { padding: 16px 0 64px; }
.cats { padding: 64px 0; background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cats .container, .latest .container { padding-top: 8px; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 24px 20px; box-shadow: var(--shadow);
  transition: transform .22s cubic-bezier(.22, .8, .2, 1), box-shadow .22s, border-color .22s;
}
/* 悬停时顶部亮起信号条 */
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--signal);
  transform: scaleX(0); transform-origin: left;
  transition: transform .24s cubic-bezier(.22, .8, .2, 1);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--rule); }
.card:hover::before { transform: scaleX(1); }
/* 非精选卡悬停：右下角浮现小角括号（与顶部信号条呼应；占位卡除外——它有独立的虚线点亮语言） */
.post-grid .card:not(.card-featured):not(.card-more)::after {
  content: ""; position: absolute; right: 7px; bottom: 7px;
  width: 14px; height: 14px;
  border-right: 2px solid var(--signal);
  border-bottom: 2px solid var(--signal);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .2s ease, transform .2s cubic-bezier(.22, .8, .2, 1);
}
.post-grid .card:not(.card-featured):not(.card-more):hover::after { opacity: 1; transform: scale(1); }

/* Featured 通栏大卡：首页第一篇，非对称焦点 */
.card-featured {
  grid-column: 1 / -1;
  padding: 28px 44px 24px 32px;
  gap: 12px;
}
/* 左侧信号竖条（区别于普通卡片的顶部悬停条） */
.card-featured::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--signal);
}
.card-featured .card-kicker {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--signal-deep);
}
.card-featured .card-kicker::before {
  content: ""; display: inline-block; width: 16px; height: 4px;
  margin-right: 10px; background: var(--signal);
  clip-path: polygon(0 0, 60% 0, 60% 100%, 0 100%);
  vertical-align: 2px;
}
.card-featured .card-title { font-size: 1.85rem; line-height: 1.35; max-width: 24em; }
.card-featured .card-excerpt { -webkit-line-clamp: 3; font-size: 1rem; max-width: 58em; }
/* 右侧大号描边编号（装饰）：悬停时点亮为信号青 */
.card-featured .card-no {
  position: absolute; right: 38px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--display); font-weight: 700;
  font-size: 5rem; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--rule);
  opacity: .6;
  pointer-events: none; user-select: none;
  transition: opacity .25s ease, -webkit-text-stroke-color .25s ease;
}
.card-featured:hover .card-no {
  -webkit-text-stroke-color: var(--signal);
  opacity: 1;
}

/* 占位卡：填充文章网格行内剩余列（grid-column: auto / -1），链接到归档页 */
.card-more {
  grid-column: auto / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 200px;
  border-style: dashed;
  border-color: var(--rule);
  background: transparent;
  color: var(--faint);
  text-decoration: none;
  box-shadow: none;
}
.card-more::before { display: none; } /* 占位卡无顶部信号条 */
.card-more:hover {
  transform: translateY(-2px);
  border-color: var(--signal);
  color: var(--signal-deep);
  background: var(--signal-soft);
}
.card-more-code {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .74rem;
  letter-spacing: .3em; text-transform: uppercase;
}
.card-more-code::before {
  content: ""; width: 16px; height: 4px; flex: none;
  background: var(--signal);
  clip-path: polygon(0 0, 60% 0, 60% 100%, 0 100%);
}
.card-more-text { font-size: 1.05rem; font-weight: 600; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: .8rem; color: var(--faint); }
.card-meta time { letter-spacing: .02em; }
.dot-sep { opacity: .6; }
.card-title { margin: 4px 0 0; font-family: var(--sans); font-size: 1.26rem; font-weight: 700; line-height: 1.45; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--signal-deep); }
.card-excerpt { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.75; }
.card-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { margin-top: auto; padding-top: 6px; font-family: var(--mono); font-size: .76rem; color: var(--faint); display: flex; gap: 10px; flex-wrap: wrap; }

/* -------------------------------- 分类卡片 -------------------------------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.cat-card {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .22s, box-shadow .22s, border-color .22s;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--signal); color: var(--ink); }
.cat-dot { width: 12px; height: 12px; margin-bottom: 10px; border-radius: 1px; transition: box-shadow .22s ease; }
/* 悬停时分类色方块"声呐脉冲"：信号青光环扩散（仅悬停期间，信息色块不做常驻动画） */
.cat-card:hover .cat-dot {
  box-shadow: 0 0 0 0 rgba(24, 209, 255, .45);
  animation: dot-ping 1.8s cubic-bezier(.22, .8, .2, 1) infinite;
}
@keyframes dot-ping {
  70%, 100% { box-shadow: 0 0 0 9px transparent; }
}
.cat-name { font-family: var(--sans); font-size: 1.18rem; font-weight: 700; }
.cat-count {
  position: absolute; top: 20px; right: 20px;
  font-family: var(--mono); font-size: .76rem; color: var(--faint);
  letter-spacing: .06em;
}
.cat-desc { font-size: .88rem; color: var(--muted); }

/* -------------------------------- 关于简介 -------------------------------- */
.about-teaser { padding: 64px 0 8px; }
.about-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 36px; box-shadow: var(--shadow); }
.about-box p { color: var(--muted); max-width: 46em; margin: 0 0 22px; }

/* 干员档案卡：左档案栏 + 右介绍 */
.about-box.operator-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.op-side {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; padding: 36px 26px;
  border-right: 1px solid var(--line);
  background: var(--paper-2);
  text-align: center;
}
.op-avatar-wrap { position: relative; margin-bottom: 12px; }
.op-avatar-wrap::before, .op-avatar-wrap::after {
  content: ""; position: absolute; width: 15px; height: 15px;
}
.op-avatar-wrap::before { left: -5px; top: -5px; border-left: 2px solid var(--signal); border-top: 2px solid var(--signal); }
.op-avatar-wrap::after { right: -5px; bottom: -5px; border-right: 2px solid var(--signal); border-bottom: 2px solid var(--signal); }
.op-avatar {
  display: block; width: 96px; height: 96px; object-fit: cover;
  border: 1px solid var(--rule); border-radius: 2px;
}
.op-name { font-family: var(--sans); font-weight: 900; font-size: 1.3rem; letter-spacing: .08em; }
.op-id {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .18em;
  color: var(--signal-deep); text-transform: uppercase;
}
.op-role {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em;
  color: var(--faint); text-transform: uppercase;
}
.op-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.op-main {
  padding: 36px 38px;
  display: flex; flex-direction: column; justify-content: center;
}

/* 关于页：完整干员档案卡（档案头 + 档案栏 + 数据格 + 风味引用） */
.op-file {
  margin: 8px 0 40px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* 档案头：深色状态条（随主题） */
.op-file-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--stage-bg);
  border-bottom: 1px solid var(--stage-line);
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.op-file-code {
  display: flex; align-items: center; gap: 10px;
  color: var(--signal-deep);
}
.op-file-code::before {
  content: ""; width: 18px; height: 4px; flex: none;
  background: var(--signal);
  clip-path: polygon(0 0, 60% 0, 60% 100%, 0 100%);
}
.op-file-no { color: var(--stage-muted); letter-spacing: .14em; }
.op-file-body {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}
/* 档案栏：头像 + 代号 + 职业 + 标签 */
.op-file-side {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; padding: 30px 24px;
  border-right: 1px solid var(--line);
  background: var(--paper-2);
  text-align: center;
}
.op-file-side .op-avatar { width: 100px; height: 100px; }
.op-file-main {
  display: flex; flex-direction: column; justify-content: center;
  gap: 20px;
  padding: 28px 34px;
}
/* 数据格：1px 网格线由背景色充当 */
.op-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
}
.op-stats > div {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 16px;
  background: var(--card);
}
.op-stats dt {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--faint);
}
.op-stats dd {
  margin: 0;
  font-family: var(--mono); font-size: 1.32rem; font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
/* 档案风味引用 */
.op-flavor {
  margin: 0;
  padding: 14px 18px;
  border-left: 3px solid var(--signal);
  background: var(--quote-bg);
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.8;
}

/* -------------------------------- 标签 chip（方形技术徽章） -------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 2px 10px; border-radius: 2px;
  border: 1px solid var(--rule);
  font-family: var(--mono); font-size: .76rem; line-height: 1.6; white-space: nowrap;
  background: var(--signal-soft); color: var(--signal-deep);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--dot, var(--signal)); }
/* 文章卡悬停时，分类圆点轻柔明暗呼吸（随卡点亮，不悬停即安静） */
.card:hover .card-meta .chip::before { animation: dot-breathe 2.2s ease-in-out infinite; }
@keyframes dot-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.chip-sm { padding: 1px 8px; font-size: .7rem; }

/* -------------------------------- 文章页 -------------------------------- */
/* 正文列固定 740px 并水平居中；右侧目录栏为固定定位，贴在正文右缘外侧 */
.post-layout { display: grid; grid-template-columns: minmax(0, 740px); justify-content: center; padding-top: 44px; padding-bottom: 24px; }
.post { min-width: 0; }
.post-header { margin-bottom: 34px; }
.back-link {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 26px; font-family: var(--mono); font-size: .82rem;
  letter-spacing: .1em; color: var(--faint); text-decoration: none;
  text-transform: uppercase;
}
.back-link::before {
  content: ""; width: 20px; height: 4px; flex: none;
  background: var(--signal);
  clip-path: polygon(0 0, 60% 0, 60% 100%, 0 100%);
}
.back-link:hover { color: var(--signal-deep); }
.post-meta-top { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: .84rem; color: var(--faint); }
.post-header h1 {
  margin: 16px 0 0; font-family: var(--sans); font-weight: 900;
  font-size: clamp(1.9rem, 4.4vw, 2.7rem); line-height: 1.32; letter-spacing: .01em;
}
.post-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px; font-family: var(--mono); font-size: .82rem; color: var(--faint); }
.post-sub .tags { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.tag { color: var(--faint); text-decoration: none; }
.tag:hover { color: var(--signal-deep); }

/* 文章正文排版 */
.prose { font-size: 1.04rem; line-height: 1.95; }
.prose > p:first-of-type { font-size: 1.09em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--sans); color: var(--ink); scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h2 {
  position: relative;
  font-size: 1.56rem; font-weight: 700; margin: 2.3em 0 .8em;
  padding: 0 0 .45em 16px;
  border-bottom: 1px solid var(--line);
}
/* h2 左侧信号竖条 */
.prose h2::before {
  content: ""; position: absolute; left: 0; top: .22em; bottom: .22em;
  width: 5px; background: var(--signal);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.prose h3 { font-size: 1.28rem; font-weight: 700; margin: 1.9em 0 .65em; }
.prose h4 { font-size: 1.1rem; font-weight: 600; margin: 1.6em 0 .55em; }
.prose p { margin: .95em 0; }
.prose a { color: var(--signal-deep); }
.prose a:hover { color: var(--signal); }
.prose strong { font-weight: 700; color: var(--ink); }
.prose ul, .prose ol { margin: 1em 0; padding-left: 1.6em; }
.prose li { margin: .34em 0; }
.prose li::marker { color: var(--signal-deep); }
.prose blockquote {
  margin: 1.5em 0; padding: 14px 20px;
  border-left: 3px solid var(--signal); border-radius: 0;
  background: var(--quote-bg); color: var(--muted);
  position: relative;
}
.prose blockquote p { margin: .35em 0; }
.prose code {
  font-family: var(--mono); font-size: .86em;
  background: var(--code-bg); color: var(--signal-deep);
  padding: 2px 7px; border-radius: 2px;
  border: 1px solid var(--line);
}
.prose pre {
  background: var(--stage-bg); color: var(--stage-ink);
  border: 1px solid var(--stage-line); border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto;
  margin: 1.5em 0; line-height: 1.75;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.prose pre code { background: none; color: inherit; padding: 0; border: 0; font-size: .88em; }
.prose .table-wrap { overflow-x: auto; margin: 1.5em 0; border-radius: var(--radius); border: 1px solid var(--rule); }
.prose table { width: 100%; border-collapse: collapse; font-size: .94rem; }
/* 表头：深色终端式 */
.prose th {
  background: var(--stage-bg); color: var(--stage-ink);
  text-align: left; font-weight: 600; padding: 11px 15px; white-space: nowrap;
  font-family: var(--mono); font-size: .84rem; letter-spacing: .04em;
  border-left: 3px solid var(--signal);
}
.prose td { padding: 10px 15px; border-top: 1px solid var(--line); vertical-align: top; }
.prose tr:hover td { background: var(--paper-2); }
.prose img { border-radius: var(--radius); border: 1px solid var(--rule); box-shadow: var(--shadow); margin: 1.4em 0; cursor: zoom-in; }
.prose hr { border: none; height: 1px; background: var(--line); margin: 2.6em auto; width: 40%; }
.prose .anchor { opacity: 0; color: var(--signal); font-size: .75em; margin-left: 8px; text-decoration: none; transition: opacity .2s; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }

/* 目录（桌面右侧浮栏：固定定位，与正文右缘始终留 20px，宽屏显示） */
.toc {
  display: none;
  position: fixed;
  top: calc(var(--header-h) + 28px);
  right: max(20px, calc((100vw - 740px) / 2 - 250px));
  width: 230px;
  max-height: calc(100vh - var(--header-h) - 60px);
  overflow-y: auto;
  scrollbar-gutter: stable; /* 目录自身滚动条出现/消失时内容也不偏移 */
  padding-left: 18px;
  border-left: 1px solid var(--line);
  font-size: .9rem;
  z-index: 10;
}
.toc h4 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px; font-family: var(--mono); font-size: .76rem; font-weight: 500;
  letter-spacing: .22em; color: var(--faint); text-transform: uppercase;
}
.toc h4::before { content: ""; width: 14px; height: 4px; background: var(--signal); clip-path: polygon(0 0, 60% 0, 60% 100%, 0 100%); }

/* 目录导航（侧栏与折叠面板通用） */
.toc-nav ul { list-style: none; margin: 0; padding: 0; }
.toc-nav li { margin: 7px 0; line-height: 1.55; }
.toc-nav a { color: var(--muted); text-decoration: none; }
.toc-nav a:hover { color: var(--signal-deep); }
.toc-nav .toc-3 { padding-left: 15px; font-size: .86em; }

/* 目录（窄屏：悬浮按钮 + 右侧滑出抽屉，替代原地折叠）
   原生 <details> 驱动：无 JS 也能开合；JS 增强遮罩点击/Esc/跳转后关闭 */
.toc-mobile {
  position: fixed;
  z-index: 150;
  margin: 0; border: 0; background: transparent;
}
/* 悬浮按钮（初始与回到顶部同位置；滚过阈值后上移让位） */
.toc-mobile summary {
  position: fixed; right: 22px; bottom: 22px;
  z-index: 165;
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  border: 1px solid var(--rule); border-radius: 2px;
  background: var(--card); color: var(--ink);
  font-size: 0; /* 隐藏真实文本，用伪元素展示（a11y 名称保留） */
  cursor: pointer; list-style: none;
  box-shadow: var(--shadow);
  transition: transform .25s cubic-bezier(.22, .8, .2, 1), color .2s, background .2s, border-color .2s;
}
/* 滚过阈值后上移 58px，给回到顶部按钮让位（JS 切 shift 类） */
.toc-mobile.shift summary { transform: translateY(-58px); }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after {
  content: "目录";
  font-family: var(--sans); font-size: .74rem; letter-spacing: .06em;
}
.toc-mobile summary:hover { border-color: var(--signal); color: var(--signal-deep); }
/* 打开后：按钮移到抽屉右上角变成关闭钮 */
.toc-mobile[open] summary {
  top: 18px; right: 18px; bottom: auto;
  transform: none; /* 覆盖 shift 位移，关闭钮固定在抽屉右上角 */
  background: var(--signal); border-color: var(--signal); color: var(--on-signal);
}
.toc-mobile[open] summary::after { content: "×"; font-size: 1.05rem; }
/* 遮罩 */
.toc-mobile[open]::before {
  content: ""; position: fixed; inset: 0;
  background: rgba(8, 10, 11, .5);
  z-index: 155;
}
/* 抽屉面板 */
.toc-mobile[open] .toc-nav {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(300px, 82vw);
  z-index: 160;
  background: var(--card);
  border-left: 1px solid var(--rule);
  box-shadow: var(--shadow-lift);
  padding: 24px 22px;
  overflow-y: auto;
  animation: toc-slide-in .28s cubic-bezier(.22, .8, .2, 1);
}
.toc-mobile .toc-nav::before {
  content: "本页目录";
  display: block;
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .22em;
  color: var(--faint); text-transform: uppercase;
}
@keyframes toc-slide-in {
  from { transform: translateX(100%); }
  to { transform: none; }
}

/* 上一篇 / 下一篇 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 34px; padding-bottom: 40px; max-width: 740px; }
.post-nav-link {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; text-decoration: none; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.post-nav-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--signal); }
.post-nav-link::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--signal);
  transform: scaleX(0); transform-origin: left;
  transition: transform .24s cubic-bezier(.22, .8, .2, 1);
}
.post-nav-link:hover::before { transform: scaleX(1); }
.post-nav-link span { font-family: var(--mono); font-size: .76rem; letter-spacing: .1em; color: var(--faint); text-transform: uppercase; }
.post-nav-link b { font-weight: 600; color: var(--ink); font-size: 1rem; }
.post-nav-link.next { text-align: right; }
.post-nav-link.empty { visibility: hidden; }

/* -------------------------------- 归档页 -------------------------------- */
.page-head { padding: 56px 0 6px; }
.page-head h1 {
  position: relative;
  margin: 0 0 10px; font-family: var(--sans); font-weight: 900;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  padding-left: 18px;
  /* 划入入场（与区块标题一致） */
  clip-path: inset(0 100% 0 0);
  transition: clip-path .55s cubic-bezier(.22, .8, .2, 1);
}
.page-head h1.in { clip-path: inset(0); }
.page-head h1::before {
  content: ""; position: absolute; left: 0; top: .12em; bottom: .12em;
  width: 7px; background: var(--signal);
}
.page-head p { margin: 0; color: var(--muted); font-family: var(--mono); font-size: .86rem; letter-spacing: .04em; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 30px 0 10px; }
.filter-bar input {
  flex: 1 1 240px; min-width: 200px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 2px;
  padding: 10px 16px; font-size: .95rem; color: var(--ink); font-family: var(--sans);
  transition: border-color .2s, box-shadow .2s;
}
.filter-bar input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.filter-bar input::placeholder { color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  border: 1px solid var(--rule); background: transparent; color: var(--muted);
  border-radius: 2px; padding: 6px 15px; font-size: .88rem; cursor: pointer;
  font-family: var(--mono); letter-spacing: .04em;
  transition: all .2s;
}
.chip-btn:hover { color: var(--signal-deep); border-color: var(--signal); }
.chip-btn.active { background: var(--signal); border-color: var(--signal); color: var(--on-signal); font-weight: 600; }
.year-block { margin-top: 34px; }
.year-title {
  font-family: var(--sans); font-size: 1.42rem; font-weight: 700;
  display: flex; align-items: center; gap: 16px; margin: 0 0 6px;
}
.year-title::before {
  content: ""; width: 10px; height: 10px; flex: none;
  background: var(--signal); border-radius: 1px;
}
.year-title::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.row {
  position: relative;
  display: flex; align-items: baseline; gap: 14px;
  padding: 13px 4px; border-bottom: 1px dashed var(--line);
}
/* 悬停时行左侧浮现信号竖条 */
.row::before {
  content: ""; position: absolute; left: -6px; top: 0; bottom: 0;
  width: 3px; background: var(--signal);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .22s cubic-bezier(.22, .8, .2, 1);
}
.row:hover::before { transform: scaleY(1); }
.row.hidden { display: none; }
.row-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.04rem; font-weight: 500; color: var(--ink); text-decoration: none; max-width: 70%; }
.row-title:hover { color: var(--signal-deep); }
.dots { flex: 1 1 auto; border-bottom: 2px dotted var(--line); transform: translateY(-5px); transition: border-color .22s ease; }
/* 悬停时省略点线点亮为信号青 */
.row:hover .dots { border-color: var(--signal); }
.row-meta { flex: none; display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .82rem; color: var(--faint); white-space: nowrap; }

/* -------------------------------- 搜索页 -------------------------------- */
.search-hint { margin: 0 0 22px; font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; color: var(--faint); }
.search-empty { padding: 44px 0; font-family: var(--mono); font-size: .9rem; letter-spacing: .05em; color: var(--muted); }
/* 搜索命中高亮 */
mark {
  background: var(--signal-soft);
  color: var(--signal-deep);
  padding: 0 2px;
  border-radius: 2px;
}

/* -------------------------------- 关于页 / 404 -------------------------------- */
/* 关于页与归档/友链同容器宽度（1080px），仅正文限宽 760px 保持左对齐可读 */
.page-about { padding-bottom: 40px; }
.page-about .prose { max-width: 760px; }
.page-about .page-head { padding-top: 56px; }
.notfound { text-align: center; padding: 110px 24px; }
.nf-code { font-family: var(--display); font-weight: 700; font-size: clamp(4rem, 12vw, 7rem); margin: 0; color: var(--signal); line-height: 1; letter-spacing: .04em; }
.notfound h1 { font-family: var(--sans); margin: 18px 0 10px; }
.notfound p { color: var(--muted); }
.nf-actions { display: flex; justify-content: center; gap: 12px; margin-top: 26px; }

/* -------------------------------- 友情链接页 -------------------------------- */
.page-friends { padding-bottom: 40px; }
.friends-intro { max-width: 760px; margin-top: 8px; }
.friends-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 30px; }
.friend-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .22s cubic-bezier(.22, .8, .2, 1), box-shadow .22s, border-color .22s;
}
.friend-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--signal); color: var(--ink); }
.friend-avatar {
  position: relative;
  flex: none; width: 54px; height: 54px; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 700; font-size: 1.45rem;
  background: var(--signal-soft); color: var(--signal-deep);
  border: 1px solid var(--rule);
  overflow: hidden;
}
/* 悬停时头像四角浮现信号青角括号（与关于页档案卡同套语言） */
.friend-avatar::before, .friend-avatar::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  opacity: 0;
  transition: opacity .22s ease;
  pointer-events: none;
}
.friend-avatar::before { left: -4px; top: -4px; border-left: 2px solid var(--signal); border-top: 2px solid var(--signal); }
.friend-avatar::after { right: -4px; bottom: -4px; border-right: 2px solid var(--signal); border-bottom: 2px solid var(--signal); }
.friend-card:hover .friend-avatar::before, .friend-card:hover .friend-avatar::after { opacity: 1; }
.friend-avatar img { width: 100%; height: 100%; object-fit: cover; }
.friend-body { min-width: 0; display: flex; flex-direction: column; }
.friend-name { font-family: var(--sans); font-size: 1.12rem; font-weight: 700; line-height: 1.4; }
.friend-desc { margin-top: 3px; font-size: .88rem; color: var(--muted); line-height: 1.6; }
.friend-arrow {
  margin-left: auto; flex: none; color: var(--faint);
  font-size: 1.05rem; opacity: .7;
  transition: opacity .2s, color .2s, transform .2s;
}
.friend-card:hover .friend-arrow { opacity: 1; color: var(--signal); transform: translate(2px, -2px); }

/* -------------------------------- 页脚（恒定深色终端） -------------------------------- */
.site-footer { margin-top: 72px; border-top: 1px solid var(--stage-line); background: var(--stage-bg); color: var(--stage-ink); }
.footer-inner { padding: 40px 24px 46px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.footer-inner .brand { color: var(--stage-ink); }
.footer-sub { margin: 0; color: var(--stage-muted); font-size: .95rem; }
.footer-nav { display: flex; gap: 14px; font-size: .92rem; }
.footer-nav a { color: var(--stage-muted); text-decoration: none; }
.footer-nav a:hover { color: var(--signal); }
.footer-nav span { color: var(--stage-line); }
.footer-line { margin: 10px 0 0; font-family: var(--mono); font-size: .8rem; color: var(--stage-muted); }
/* 终端状态行 */
.footer-status {
  margin: 4px 0 0; font-family: var(--mono); font-size: .66rem;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--signal-deep);
  opacity: .9;
}
.footer-status::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px;
  background: var(--state); vertical-align: 0;
  animation: ark-pulse 2s ease-out infinite;
}

/* 回到顶部 */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 44px; height: 44px; border-radius: 2px;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
  font-size: 18px; cursor: pointer; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  /* visibility 必须参与过渡：出现时开头翻转、消失时结尾翻转，两个方向都有动画 */
  transition: opacity .25s, transform .25s, visibility .25s, color .2s, background .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--on-signal); background: var(--signal); border-color: var(--signal); }

/* -------------------------------- 滚动显现 -------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s cubic-bezier(.22, .61, .36, 1); }
.reveal.in { opacity: 1; transform: none; }
.post-grid .card:nth-child(2) { transition-delay: .06s; }
.post-grid .card:nth-child(3) { transition-delay: .12s; }
.post-grid .card:nth-child(4) { transition-delay: .18s; }
.post-grid .card:nth-child(5) { transition-delay: .24s; }
.post-grid .card:nth-child(6) { transition-delay: .30s; }
.cat-grid .cat-card:nth-child(2) { transition-delay: .06s; }
.cat-grid .cat-card:nth-child(3) { transition-delay: .12s; }
.cat-grid .cat-card:nth-child(4) { transition-delay: .18s; }
.friends-grid .friend-card:nth-child(2) { transition-delay: .06s; }
.friends-grid .friend-card:nth-child(3) { transition-delay: .12s; }
.friends-grid .friend-card:nth-child(4) { transition-delay: .18s; }
.friends-grid .friend-card:nth-child(5) { transition-delay: .24s; }
.friends-grid .friend-card:nth-child(6) { transition-delay: .30s; }

/* -------------------------------- 评论区 -------------------------------- */
.comments { margin-top: 3.6em; padding-top: 2em; border-top: 1px dashed var(--line); }
.comments-title {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--sans); font-size: 1.4rem; font-weight: 700;
  margin: 0 0 20px;
}
.comments-title::before { content: ""; width: 20px; height: 5px; background: var(--signal); flex: none; clip-path: polygon(0 0, 62% 0, 62% 100%, 0 100%); }
.comments .giscus, .comments #waline, .comments #tcomment { min-height: 120px; }

/* -------------------------------- 图片灯箱 -------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 11, .93);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  touch-action: none; /* 触摸手势由 JS 接管（拖动/捏合/滑动），禁用浏览器默认滚动缩放 */
}
.lightbox.open { opacity: 1; visibility: visible; }
/* 图片入场：轻微放大 + 淡入（动画只覆盖入场瞬间，缩放/拖拽的内联 transform 不受影响） */
@keyframes lb-in {
  from { opacity: 0; transform: scale(.96); }
}
.lightbox.open img { animation: lb-in .22s ease-out; }
.lightbox img {
  max-width: 92vw; max-height: 82vh;
  border-radius: 2px;
  border: 1px solid rgba(244, 246, 246, .16);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
  transform-origin: 50% 50%;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.lightbox .lb-caption {
  position: absolute; left: 0; right: 0; bottom: 22px;
  text-align: center; color: rgba(255, 255, 255, .85);
  font-family: var(--mono); font-size: .84rem; letter-spacing: .06em;
  padding: 0 24px;
}
.lightbox button {
  position: absolute; width: 46px; height: 46px; border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .06); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.lightbox button:hover { background: rgba(255, 255, 255, .18); border-color: var(--signal); }
.lightbox .lb-close { top: 18px; right: 22px; }
.lightbox .lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

/* -------------------------- 自定义滚动条（替代原生） -------------------------- */
/* 由 main.js 动态创建：信号青细条，随内容高度自适应，可拖拽 */
.cc-scrollbar {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.cc-scrollbar.visible { opacity: 1; }
.cc-scrollbar-thumb {
  position: absolute; top: 0; right: 3px;
  width: 6px; border-radius: 1px;
  background: var(--signal); opacity: .38;
  cursor: pointer; pointer-events: auto;
  transition: opacity .2s, background .2s;
}
.cc-scrollbar-thumb:hover { opacity: .8; }
.cc-scrollbar-thumb:active { opacity: 1; }
@media (hover: none) { .cc-scrollbar { display: none; } } /* 触摸设备用系统默认，不显示 */

/* 目录小滚动条统一为细条 */
.toc { scrollbar-width: thin; }
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-thumb { background: var(--line); border-radius: 1px; }

/* -------------------------------- 响应式 -------------------------------- */
/* 屏幕够宽（≥1280px）时显示右侧目录栏，否则退回文章开头的折叠面板 */
@media (min-width: 1280px) {
  .toc { display: block; }
  .toc-mobile { display: none; }
}
@media (max-width: 720px) {
  /* 移动端压缩顶栏：缩小图标与字距，避免右侧图标挤到站点标题 */
  .header-inner { padding: 0 14px; gap: 10px; }
  .brand { gap: 9px; }
  .brand-name { font-size: 1.02rem; letter-spacing: .1em; }
  .icon-link { width: 34px; height: 34px; }
  .header-actions { gap: 4px; }
  /* 移动端隐藏 RSS 图标（页脚导航有 RSS 入口），给搜索/主题/菜单腾空间 */
  .header-actions a[href$="rss.xml"] { display: none; }
  .site-nav {
    display: none;
    position: fixed; top: var(--header-h); left: 0; right: 0;
    transform: none; /* 复位桌面端绝对定位的居中位移 */
    flex-direction: column; gap: 2px;
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px; box-shadow: var(--shadow-lift);
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .nav-link { padding: 12px 14px; border-radius: 2px; }
  .hero { padding: 72px 0 64px; }
  .hero::before { left: 14px; top: 14px; width: 28px; height: 28px; }
  .hero::after { right: 14px; bottom: 14px; width: 28px; height: 28px; }
  .hero-axis { display: none; }
  .hero-readout { width: 100%; } /* 移动端恢复全宽，单元格按 50% 换行成 2×2 */
  .hr-cell { min-width: 50%; border-bottom: 1px solid var(--stage-line); }
  .card-featured { padding: 22px 22px 20px; }
  .card-featured .card-title { font-size: 1.42rem; }
  .card-featured .card-no { font-size: 2.8rem; right: 18px; top: 16px; transform: none; }
  .card-featured .card-excerpt { -webkit-line-clamp: 2; }
  .about-box.operator-card { grid-template-columns: 1fr; }
  .op-side {
    border-right: none; border-bottom: 1px solid var(--line);
    flex-direction: row; flex-wrap: wrap; gap: 6px 10px;
    padding: 22px 16px;
  }
  .op-avatar-wrap { margin-bottom: 0; }
  .op-avatar { width: 60px; height: 60px; }
  .op-main { padding: 24px 22px; }
  .op-file-body { grid-template-columns: 1fr; }
  .op-file-side {
    border-right: none; border-bottom: 1px solid var(--line);
    flex-direction: row; flex-wrap: wrap; gap: 6px 10px;
    padding: 22px 16px;
  }
  .op-file-side .op-avatar { width: 64px; height: 64px; }
  .op-file-main { padding: 22px; }
  .op-stats { grid-template-columns: 1fr 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-link.next { text-align: left; }
  .row { gap: 10px; }
  .row-title { max-width: 58%; font-size: .98rem; }
  .row-meta .chip { display: none; }
}

/* -------------------------------- 无障碍 / 打印 -------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-kicker, .hero-title, .hero-sub, .hero-actions, .hero-readout { opacity: 1; }
  .reveal { opacity: 1; transform: none; }
  /* 关闭自主运动：网格漂移停止；标题划入直接展示；悬停呼吸静止 */
  .hero-bg::before { animation: none; }
  .section-title, .page-head h1 { clip-path: none; transition: none; }
  .btn::before { opacity: 0; transform: translate(-7px, -50%); }
  .cat-card:hover .cat-dot, .card:hover .card-meta .chip::before { animation: none; }
}
@media print {
  .site-header, .site-footer, .toc, .toc-mobile, .to-top, .post-nav, .back-link, .cc-scrollbar { display: none !important; }
  body { background: #fff; color: #000; }
  .container { max-width: 100%; }
  .prose pre { background: #f4f4f4; color: #222; border-color: #ccc; }
}
