/**
 * Theme Name: CyberGeek v2 MAX
 * Theme URI: https://github.com/CoolingRabbit/cybergeek-theme
 * Description: 硬件极客桌面世界观 · 极繁炫技版 Typecho 主题（CRT + Nixie + 机械键盘全家桶）
 * Version: 2.0.1
 * Author: CoolingRabbit
 * Author URI: https://github.com/CoolingRabbit/cybergeek-theme
 */

/* ==================== CSS 变量（沿用 v1 原版配色） ==================== */
:root {
  /* 配色：GitHub 深灰蓝底 + 赤陶橙主强调 + 橄榄绿/铁锈辅色 */
  --bg-primary: #0D1117;
  --bg-secondary: #161B22;
  --bg-code: #1E2530;
  --bg-terminal: #0D1117;
  --border: #30363D;
  --border-light: #21262D;
  --accent-clay: #D97757;
  --accent-clay-dark: #B85C3E;
  --accent-olive: #788C5D;
  --accent-rust: #B04A3F;

  /* 文字：标题高对比，正文适度降对比护眼（底线可读性） */
  --text-primary: #E6EDF3;
  --text-body: #C6CCD4;
  --text-secondary: #8B949E;
  --text-muted: #6E7681;

  /* Nixie 辉光管专用暖橙 */
  --nixie-core: #FFD4B8;
  --nixie-glow: #FF6B35;
  --nixie-deep: #FF4500;

  /* 字体：系统栈直出（不加载远程字体，避免大陆环境首屏阻塞），中文显式回退 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo,
               "Cascadia Code", Consolas, "Liberation Mono", monospace;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* 阴影 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow-clay: 0 0 12px rgba(217, 119, 87, 0.35);

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  /* 动效 */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;

  /* 布局 */
  --nav-height: 64px;
  --max-width: 1200px;
  --content-width: 46rem;
}

/* ==================== 全局重置 ==================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  background-color: var(--bg-primary);
  color: var(--text-body);
  line-height: 1.85;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a {
  color: var(--accent-clay);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover { color: var(--accent-clay-dark); }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

::selection {
  background: rgba(217, 119, 87, 0.35);
  color: #fff;
}

/* 细滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-clay-dark); }

/* 点阵背景纹理 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, #30363D 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

/* ==================== CRT 开机启动动画 ==================== */
/* 默认隐藏，由 JS 决定播放完整 boot（boot-play）还是快速闪入（boot-quick） */
.boot-overlay {
  position: fixed;
  inset: 0;
  background: #05070A;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* 完整开机：白噪点 → 一条亮线 → 横向展开 → 纵向展开 → 淡出 */
.boot-overlay.boot-play {
  display: flex;
  animation: bootFadeOut 0.45s ease 1.55s forwards;
}

/* 快速闪入：亮线一闪即淡出（0.5s） */
.boot-overlay.boot-quick {
  display: flex;
  background: rgba(5, 7, 10, 0.92);
  animation: bootFadeOut 0.25s ease 0.3s forwards;
}

.boot-overlay.boot-quick .boot-text { display: none; }

.boot-overlay.boot-quick .boot-line {
  animation: bootQuickLine 0.5s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

@keyframes bootQuickLine {
  0% { transform: scaleX(0) scaleY(1); opacity: 1; }
  55% { transform: scaleX(1) scaleY(1); opacity: 1; }
  100% { transform: scaleX(1) scaleY(24); opacity: 0; }
}

/* 白噪点层（仅完整 boot） */
.boot-play::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 2px 3px;
  animation: bootNoise 0.1s steps(2) infinite, bootNoiseFade 0.5s ease 0.35s forwards;
  opacity: 0.5;
}

/* 亮线（完整 boot） */
.boot-line {
  width: 100%;
  height: 2px;
  background: var(--nixie-core);
  box-shadow: 0 0 20px var(--nixie-glow), 0 0 60px var(--nixie-glow), 0 0 120px var(--nixie-deep);
  transform-origin: center;
}

.boot-play .boot-line {
  animation: bootLine 1.1s cubic-bezier(0.7, 0, 0.3, 1) 0.45s forwards;
}

/* 开机提示文字（仅完整 boot） */
.boot-text {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-olive);
  letter-spacing: 0.15em;
}

.boot-play .boot-text {
  animation: bootTextBlink 0.25s steps(2) 4;
}

@keyframes bootNoise {
  0% { background-position: 0 0, 2px 3px; }
  50% { background-position: 3px 5px, 0 0; }
  100% { background-position: 5px 1px, 4px 2px; }
}

@keyframes bootNoiseFade {
  to { opacity: 0; }
}

@keyframes bootLine {
  0% { transform: scaleX(0) scaleY(1); opacity: 1; }
  35% { transform: scaleX(1) scaleY(1); opacity: 1; }
  75% { transform: scaleX(1) scaleY(300); opacity: 0.9; }
  100% { transform: scaleX(1) scaleY(600); opacity: 0; }
}

@keyframes bootFadeOut {
  to { opacity: 0; visibility: hidden; }
}

@keyframes bootTextBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* ==================== LED 状态栏式阅读进度条 ==================== */
.led-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(48, 54, 61, 0.35);
  z-index: 1100;
}

.led-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-clay), #E89B5F);
  /* LED 灯珠分段 */
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 8px);
  mask-image: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 8px);
  box-shadow: 0 0 8px rgba(217, 119, 87, 0.6), 0 0 16px rgba(217, 119, 87, 0.3);
  transition: width 80ms linear;
}

/* ==================== 导航 ==================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition: background var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out);
}

.site-nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(13, 17, 23, 0.95);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 站点标识：终端提示符 + 闪烁光标 */
.nav-brand {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.02em;
}

.nav-brand .prompt { color: var(--accent-olive); margin-right: 5px; }

.nav-brand::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--accent-clay);
  margin-left: 6px;
  animation: cursorBlink 1.1s step-end infinite;
}

.nav-brand:hover { color: var(--accent-clay); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-menu a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  position: relative;
  padding: var(--space-xs) 0;
  letter-spacing: 0.03em;
}

.nav-menu a:hover { color: var(--nixie-core); }

/* 下划线从中间展开 + 辉光 */
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-clay);
  box-shadow: 0 0 8px var(--accent-clay);
  transition: width var(--duration-normal) var(--ease-out),
              left var(--duration-normal) var(--ease-out);
}

.nav-menu a:hover::after { width: 100%; left: 0; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* 键帽风格导航按钮 */
.nav-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 8px;
  background: linear-gradient(180deg, #2A3038 0%, #22262E 100%);
  border: 1px solid #363D48;
  border-bottom: 3px solid #15181E;
  color: var(--text-secondary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.08s var(--ease-out);
  user-select: none;
}

.nav-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-clay);
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.nav-btn-primary {
  background: linear-gradient(180deg, #C06040 0%, #A04020 100%);
  border-color: #D97757;
  border-bottom-color: #602010;
  color: #fff;
}

.nav-btn-primary:hover {
  color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3), var(--shadow-glow-clay);
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-sm);
  background: none;
  border: none;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all var(--duration-normal) var(--ease-out);
}

/* ==================== 主内容 ==================== */
.site-main {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-height);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ==================== Nixie 辉光管标题（每根管子闪烁节奏错开） ==================== */
@keyframes nixieFlicker {
  0%, 100% { opacity: 1; text-shadow: 0 0 10px rgba(255,107,53,0.8), 0 0 20px rgba(255,107,53,0.5), 0 0 40px rgba(255,69,0,0.3), 0 0 80px rgba(255,69,0,0.15); }
  4% { opacity: 0.92; text-shadow: 0 0 6px rgba(255,107,53,0.6), 0 0 12px rgba(255,107,53,0.3); }
  8% { opacity: 1; text-shadow: 0 0 12px rgba(255,107,53,0.9), 0 0 24px rgba(255,107,53,0.6), 0 0 48px rgba(255,69,0,0.35); }
  13% { opacity: 0.88; text-shadow: 0 0 5px rgba(255,107,53,0.5), 0 0 10px rgba(255,107,53,0.25); }
  18% { opacity: 1; text-shadow: 0 0 10px rgba(255,107,53,0.8), 0 0 20px rgba(255,107,53,0.5), 0 0 40px rgba(255,69,0,0.3); }
  50% { opacity: 1; text-shadow: 0 0 10px rgba(255,107,53,0.8), 0 0 20px rgba(255,107,53,0.5), 0 0 40px rgba(255,69,0,0.3), 0 0 80px rgba(255,69,0,0.15); }
  52% { opacity: 0.82; text-shadow: 0 0 4px rgba(255,107,53,0.45), 0 0 8px rgba(255,107,53,0.2); }
  54% { opacity: 1; text-shadow: 0 0 13px rgba(255,107,53,0.95), 0 0 26px rgba(255,107,53,0.65), 0 0 52px rgba(255,69,0,0.4), 0 0 96px rgba(255,69,0,0.2); }
  76% { opacity: 1; text-shadow: 0 0 10px rgba(255,107,53,0.8), 0 0 20px rgba(255,107,53,0.5), 0 0 40px rgba(255,69,0,0.3); }
  86% { opacity: 0.9; text-shadow: 0 0 7px rgba(255,107,53,0.6), 0 0 14px rgba(255,107,53,0.3); }
  94% { opacity: 1; text-shadow: 0 0 11px rgba(255,107,53,0.85), 0 0 22px rgba(255,107,53,0.55), 0 0 44px rgba(255,69,0,0.32); }
}

.nixie-title {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-block;
}

/* 每根"管子"（字符）独立闪烁，节奏由内联 --d 错开 */
.nixie-char {
  display: inline-block;
  color: var(--nixie-core);
  animation: nixieFlicker 4s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  position: relative;
  text-shadow: 0 0 10px rgba(255,107,53,0.8), 0 0 20px rgba(255,107,53,0.5), 0 0 40px rgba(255,69,0,0.3);
}

/* 管子背后的朦胧余晖 */
.nixie-char::before {
  content: attr(data-char);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--nixie-glow);
  opacity: 0.3;
  filter: blur(5px);
  z-index: -1;
}

.nixie-char:empty::before { display: none; }

/* ==================== Hero ==================== */
.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-lg);
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-clay), var(--accent-olive));
  margin: 0 auto;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(217, 119, 87, 0.5);
}

/* ==================== 整页 CRT 屏幕（全局层） ==================== */
/* 整个浏览器页面就是 CRT 屏幕本身：扫描线 + 曲面暗角 + 玻璃反光直接铺满全屏 */

/* 扫描线（微闪），位于内容之上、导航之下 */
.crt-global-scanlines {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.14) 2px,
    rgba(0, 0, 0, 0.14) 4px
  );
  pointer-events: none;
  z-index: 998;
  animation: scanlineFlicker 0.12s steps(2) infinite;
}

@keyframes scanlineFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* 曲面暗角 + 顶部玻璃反光 */
.crt-global-vignette {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 130% 90% at 50% 45%, transparent 62%, rgba(0, 0, 0, 0.38) 100%),
    radial-gradient(ellipse 120% 55% at 50% -18%, rgba(255, 255, 255, 0.045) 0%, transparent 55%),
    radial-gradient(ellipse at center, rgba(88, 166, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 999;
}

/* 角落拟物小件：品牌铭牌（左下） */
.crt-page-brand {
  position: fixed;
  left: 12px;
  bottom: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: #4a5058;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  z-index: 997;
  pointer-events: none;
}

/* 角落拟物小件：电源灯（右下，避开回到顶部键帽） */
@keyframes ledPulse {
  0% { box-shadow: 0 0 4px #27C93F, 0 0 8px rgba(39, 201, 63, 0.35); }
  50% { box-shadow: 0 0 8px #27C93F, 0 0 16px rgba(39, 201, 63, 0.55), 0 0 28px rgba(39, 201, 63, 0.25); }
  100% { box-shadow: 0 0 4px #27C93F, 0 0 8px rgba(39, 201, 63, 0.35); }
}

.crt-page-led {
  position: fixed;
  right: 12px;
  bottom: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #27C93F;
  animation: ledPulse 2.6s ease-in-out infinite;
  z-index: 997;
  pointer-events: none;
}

/* ==================== 文章卡片 ==================== */
.post-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
}

.post-card {
  position: relative;
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent-clay);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

/* 卡片 hover：辉光扫过（glow sweep） */
.post-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 212, 184, 0.08) 45%, rgba(255, 107, 53, 0.14) 50%, rgba(255, 212, 184, 0.08) 55%, transparent);
  transform: skewX(-12deg);
  transition: left 0.6s var(--ease-out);
  pointer-events: none;
  z-index: 2;
}

.post-card:hover {
  transform: translateY(-3px);
  border-left-color: var(--nixie-glow);
  box-shadow: var(--shadow-lg), 0 0 24px rgba(255, 107, 53, 0.12);
}

.post-card:hover::after { left: 130%; }

.post-card[data-category="tech"] { border-left-color: var(--accent-olive); }
.post-card[data-category="life"] { border-left-color: var(--accent-rust); }

.post-card-thumbnail {
  width: 200px;
  min-height: 100%;
  object-fit: cover;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.post-card-body {
  flex: 1;
  min-width: 0;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 3;
}

.post-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  line-height: 1.4;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-card-title a { color: inherit; }

/* hover 时 RGB 色散（chromatic aberration） */
.post-card:hover .post-card-title a {
  color: var(--nixie-core);
  text-shadow: 1.5px 0 0 rgba(255, 60, 60, 0.35), -1.5px 0 0 rgba(60, 140, 255, 0.35);
}

.post-card-excerpt {
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-secondary);
}

.post-card-meta {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
  letter-spacing: 0.03em;
}

.post-card-meta .separator { color: var(--border); }
.post-card-meta .cat-tag { color: var(--accent-olive); }

.post-card-readmore {
  display: none;
}

.post-card-empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* ==================== 文章详情页 ==================== */
.post-header {
  padding: var(--space-3xl) 0 var(--space-xl);
  text-align: center;
  max-width: var(--content-width);
  margin: 0 auto;
}

.post-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  letter-spacing: 0.03em;
}

.post-meta .separator { color: var(--border); }

/* ==================== 正文排版（可读性底线） ==================== */
.post-content,
.page-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-xl) 0 var(--space-2xl);
  font-size: 1.0625rem;
  line-height: 1.9;
}

.post-content > p,
.page-content > p { margin-bottom: 1.6em; }

.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.4;
  position: relative;
}

.post-content h2,
.page-content h2 {
  font-size: 1.5rem;
  margin: 2.4em 0 0.9em;
  padding-left: 14px;
  border-left: 3px solid var(--accent-clay);
}

.post-content h3,
.page-content h3 { font-size: 1.28rem; margin: 2em 0 0.8em; }
.post-content h4,
.page-content h4 { font-size: 1.1rem; margin: 1.8em 0 0.7em; }
.post-content h5,
.page-content h5 { font-size: 1rem; margin: 1.6em 0 0.6em; }

/* 标题 hover 锚点 */
.post-content h3:hover::before,
.post-content h4:hover::before,
.page-content h3:hover::before,
.page-content h4:hover::before {
  content: '#';
  position: absolute;
  left: -0.9em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.85em;
}

/* 正文链接：滑入下划线 + 辉光 */
.post-content a,
.page-content a {
  color: var(--accent-clay);
  background-image: linear-gradient(var(--accent-clay), var(--accent-clay));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--duration-normal) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              text-shadow var(--duration-fast) var(--ease-out);
  padding-bottom: 1px;
}

.post-content a:hover,
.page-content a:hover {
  color: var(--nixie-core);
  background-size: 100% 1px;
  text-shadow: 0 0 10px rgba(255, 107, 53, 0.4);
}

.post-content img,
.page-content img {
  border-radius: var(--radius-md);
  margin: var(--space-lg) auto;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
}

/* 引用块：中文不使用斜体 */
.post-content blockquote,
.page-content blockquote {
  border-left: 4px solid var(--accent-clay);
  background: rgba(217, 119, 87, 0.07);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-xl) 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: normal;
}

.post-content blockquote p,
.page-content blockquote p { margin-bottom: 0.8em; }
.post-content blockquote p:last-child,
.page-content blockquote p:last-child { margin-bottom: 0; }

.post-content ul,
.post-content ol,
.page-content ul,
.page-content ol {
  margin: 0 0 1.6em;
  padding-left: 1.5em;
}

.post-content li,
.page-content li { margin-bottom: 0.45em; }

.post-content li::marker,
.page-content li::marker { color: var(--accent-clay); }

/* 表格：100% 宽度 + 全单元格可换行，窄栏内完整可读；极宽表格仍可横滚 */
.post-content table,
.page-content table {
  display: block;              /* 让 overflow 兜底生效 */
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: var(--space-xl) 0;
  font-size: 0.875rem;         /* 14px，行高压紧 */
  line-height: 1.55;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.post-content th,
.page-content th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--bg-code);
  color: var(--accent-olive);
}

.post-content th,
.post-content td,
.page-content th,
.page-content td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
  /* 所有单元格（含表头）正常换行，任意长串可断行 */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  /* 最小列宽：保证每格至少能放 2-3 个汉字一行，杜绝逐字竖排 */
  min-width: 3.5em;
}

/* 表头行整体不允许被压到极小 */
.post-content thead th,
.page-content thead th {
  min-width: 4em;
}

.post-content tr:last-child td,
.page-content tr:last-child td { border-bottom: none; }

.post-content tbody tr:nth-child(even),
.page-content tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

.post-content hr,
.page-content hr {
  border: none;
  margin: var(--space-2xl) auto;
  width: 64px;
  border-top: 2px solid var(--border);
}

/* 行内代码：允许换行，绝不撑破正文栏 */
.post-content code,
.page-content code {
  font-family: var(--font-mono);
  background: var(--bg-code);
  border: 1px solid var(--border-light);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.86em;
  color: var(--accent-clay);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 正文级防溢出兜底：长 URL / 长串不越界 */
.post-content p,
.post-content li,
.page-content p,
.page-content li {
  overflow-wrap: break-word;
  word-break: normal;
}

.post-content a,
.page-content a {
  overflow-wrap: break-word;
}

/* pre 横向滚动兜底（终端化之前的原始状态也安全） */
.post-content pre,
.page-content pre {
  overflow-x: auto;
  max-width: 100%;
}

/* ==================== 终端式代码块（炫技强化） ==================== */
.code-terminal {
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: var(--space-xl) 0;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}

/* 代码块顶部扫描线微光 */
.code-terminal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.06) 3px,
    rgba(0, 0, 0, 0.06) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.terminal-header {
  background: var(--bg-secondary);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  position: relative;
  z-index: 2;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.terminal-dot.red { background: #FF5F56; box-shadow: 0 0 6px rgba(255, 95, 86, 0.5); }
.terminal-dot.yellow { background: #FFBD2E; box-shadow: 0 0 6px rgba(255, 189, 46, 0.5); }
.terminal-dot.green { background: #27C93F; box-shadow: 0 0 6px rgba(39, 201, 63, 0.5); }

.terminal-title {
  margin-left: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 复制按钮：小键帽 */
.terminal-copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: linear-gradient(180deg, #2A3038 0%, #22262E 100%);
  border: 1px solid #363D48;
  border-bottom: 3px solid #15181E;
  border-radius: 6px;
  padding: 3px 12px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.08s var(--ease-out);
  flex-shrink: 0;
  user-select: none;
}

.terminal-copy:hover {
  color: var(--nixie-core);
  border-color: var(--accent-clay);
}

.terminal-copy:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.terminal-copy.copied {
  color: #27C93F;
  border-color: #27C93F;
}

.code-terminal pre {
  background: var(--bg-terminal);
  padding: var(--space-md) var(--space-lg);
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  position: relative;
  z-index: 2;
  counter-reset: code-line;
}

.code-terminal pre code {
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  color: var(--text-body);
  font-size: inherit;
  white-space: pre;
}

/* 行号（磷光/橄榄绿）——非 shell 代码逐行渲染 */
.code-line {
  display: block;
  min-height: 1.7em;
  counter-increment: code-line;
  padding-left: 3.2em;
  position: relative;
}

.code-line::before {
  content: counter(code-line, decimal-leading-zero);
  position: absolute;
  left: 0;
  width: 2.2em;
  text-align: right;
  color: var(--accent-olive);
  opacity: 0.65;
  font-size: 0.82em;
  line-height: inherit;
  user-select: none;
}

.code-line:hover { background: rgba(217, 119, 87, 0.05); }

/* shell 终端化渲染行 */
.code-terminal .terminal-body {
  background: var(--bg-terminal);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.8;
  position: relative;
  z-index: 2;
}

.code-terminal .terminal-body .terminal-line {
  margin-bottom: 2px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.code-terminal .terminal-body .terminal-prompt { color: var(--accent-olive); }
.code-terminal .terminal-body .terminal-command { color: var(--text-primary); }
.code-terminal .terminal-body .terminal-output { color: var(--text-secondary); }
.code-terminal .terminal-body .terminal-error { color: var(--accent-rust); }
.code-terminal .terminal-body .terminal-comment { color: #D4A574; }

/* 闪烁光标 */
.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--accent-clay);
  box-shadow: 0 0 8px rgba(217, 119, 87, 0.6);
  animation: cursorBlink 1.1s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

/* ==================== 标签 ==================== */
.post-tags {
  max-width: var(--content-width);
  margin: var(--space-xl) auto;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.post-tags a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: inline-block;
  padding: 4px 14px;
  background: rgba(217, 119, 87, 0.12);
  border: 1px solid transparent;
  color: var(--accent-clay);
  border-radius: var(--radius-pill);
  transition: all var(--duration-fast) var(--ease-out);
}

.post-tags a::before {
  content: '#';
  color: var(--accent-olive);
  margin-right: 3px;
}

.post-tags a:hover {
  background: rgba(217, 119, 87, 0.22);
  color: var(--nixie-core);
  box-shadow: 0 0 10px rgba(217, 119, 87, 0.25);
}

/* ==================== 上一篇 / 下一篇 ==================== */
.post-nav {
  max-width: var(--content-width);
  margin: var(--space-2xl) auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.post-nav-prev,
.post-nav-next {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.post-nav-prev:hover,
.post-nav-next:hover {
  border-color: var(--accent-clay);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 14px rgba(217, 119, 87, 0.12);
}

.post-nav-next { text-align: right; }

.post-nav-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.post-nav-title a {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.post-nav-title a:hover { color: var(--accent-clay); }

/* ==================== 归档页 ==================== */
.archive-header {
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
}

.archive-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.archive-eyebrow .prompt { color: var(--accent-olive); }

.archive-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.archive-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.archive-list {
  max-width: 780px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* ==================== 404 终端页 ==================== */
.terminal-404 {
  max-width: 620px;
  margin: var(--space-3xl) auto;
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.terminal-404 .terminal-body {
  padding: var(--space-xl);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.9;
}

.terminal-404 .terminal-line { margin-bottom: var(--space-xs); }
.terminal-404 .terminal-prompt { color: var(--accent-olive); }
.terminal-404 .terminal-command { color: var(--text-primary); }
.terminal-404 .terminal-output { color: var(--text-secondary); }

@keyframes errorGlow {
  0%, 100% { text-shadow: 0 0 4px rgba(217, 119, 87, 0.6), 0 0 8px rgba(217, 119, 87, 0.3); }
  50% { text-shadow: 0 0 8px rgba(217, 119, 87, 0.85), 0 0 16px rgba(217, 119, 87, 0.5), 0 0 24px rgba(217, 119, 87, 0.2); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.terminal-404 .terminal-error {
  color: var(--accent-rust);
  font-weight: 700;
  animation: shake 0.5s ease-in-out;
  display: inline-block;
}

.terminal-404 .terminal-error-glow {
  color: var(--accent-clay);
  font-weight: 700;
  animation: errorGlow 2s ease-in-out infinite;
  display: inline-block;
}

.back-home-btn {
  display: inline-block;
  margin-top: var(--space-xl);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 24px;
  background: linear-gradient(180deg, #C06040 0%, #A04020 100%);
  color: #fff;
  border: 1px solid #D97757;
  border-bottom: 4px solid #602010;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(160, 64, 32, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.08s var(--ease-out);
}

.back-home-btn:hover {
  color: #fff;
  box-shadow: 0 3px 8px rgba(160, 64, 32, 0.35), var(--shadow-glow-clay);
}

.back-home-btn:active {
  transform: translateY(3px);
  border-bottom-width: 1px;
}

/* ==================== 评论区 ==================== */
.comments-section {
  max-width: var(--content-width);
  margin: var(--space-2xl) auto;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.comments-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

.comment-list { list-style: none; }

.comment-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent-clay);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.comment-author { font-weight: 600; color: var(--text-primary); }

.comment-time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.comment-content { line-height: 1.8; color: var(--text-body); }
.comment-content p:last-child { margin-bottom: 0; }

/* 评论表单 */
.comment-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.form-group { margin-bottom: var(--space-md); }

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-clay);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.18), 0 0 12px rgba(217, 119, 87, 0.12);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}

/* 提交按钮：键帽 */
.form-submit {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 26px;
  background: linear-gradient(180deg, #C06040 0%, #A04020 100%);
  color: #fff;
  border: 1px solid #D97757;
  border-bottom: 4px solid #602010;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(160, 64, 32, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.08s var(--ease-out);
}

.form-submit:hover { box-shadow: 0 3px 8px rgba(160, 64, 32, 0.35), var(--shadow-glow-clay); }

.form-submit:active {
  transform: translateY(3px);
  border-bottom-width: 1px;
}

.cancel-comment-reply { margin-bottom: var(--space-md); }

/* ==================== 机械键盘分页（3D 键程强化） ==================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) 0 var(--space-2xl);
}

.pagination-keyboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 28px;
  background: linear-gradient(180deg, #1a1d23 0%, #14161c 100%);
  border: 2px solid #2a2f3a;
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.5);
  position: relative;
}

/* 键盘底座纹理 */
.pagination-keyboard::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
}

.page-key,
.pagination-keyboard a.next,
.pagination-keyboard a.prev {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 56px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: linear-gradient(180deg, #2d3139 0%, #242830 100%);
  border: 1px solid #3a404d;
  border-bottom: 5px solid #1a1d23;
  color: #8b92a8;
  text-decoration: none;
  transition: all 0.08s var(--ease-out);
  user-select: none;
  cursor: pointer;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 键帽顶部高光 */
.page-key::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  right: 6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  border-radius: 1px;
}

.pagination-keyboard a.next:hover,
.pagination-keyboard a.prev:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #3a404d 0%, #2d3139 100%);
  border-color: var(--accent-clay);
  color: #c0c8e0;
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 14px rgba(217, 119, 87, 0.2);
}

/* 键程：按下下沉 3px，底边同步收 */
.pagination-keyboard a.next:active,
.pagination-keyboard a.prev:active {
  transform: translateY(3px);
  border-bottom-width: 2px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* 方向箭头（伪元素） */
.pagination-keyboard a.next,
.pagination-keyboard a.prev,
.page-key-nav.page-key-disabled {
  font-size: 0 !important;
  color: transparent !important;
}

.pagination-keyboard a.prev::before,
.page-key-nav.page-key-disabled:first-child::before {
  content: '';
  position: absolute;
  left: 38%;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 8px solid #a0a8c0;
}

.pagination-keyboard a.prev::after,
.page-key-nav.page-key-disabled:first-child::after {
  content: '';
  position: absolute;
  left: 46%;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 2px;
  background: #a0a8c0;
  border-radius: 1px;
}

.pagination-keyboard a.next::before,
.page-key-nav.page-key-disabled:last-of-type::before {
  content: '';
  position: absolute;
  left: 40%;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 2px;
  background: #a0a8c0;
  border-radius: 1px;
}

.pagination-keyboard a.next::after,
.page-key-nav.page-key-disabled:last-of-type::after {
  content: '';
  position: absolute;
  left: 54%;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #a0a8c0;
}

.pagination-keyboard a.prev:hover::before { border-right-color: var(--nixie-core); }
.pagination-keyboard a.prev:hover::after { background: var(--nixie-core); }
.pagination-keyboard a.next:hover::before { background: var(--nixie-core); }
.pagination-keyboard a.next:hover::after { border-left-color: var(--nixie-core); }

/* 当前页：琥珀键帽 */
.page-key-current {
  background: linear-gradient(180deg, #c45a3a 0%, #a04020 100%);
  border-color: #d47050;
  border-bottom-color: #602010;
  color: #fff;
  cursor: default;
  font-size: 1.3rem;
  box-shadow:
    0 4px 8px rgba(160, 64, 32, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 16px rgba(255, 107, 53, 0.25);
}

.page-key-current:hover { color: #fff; }

.page-key-disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.page-key-disabled:hover { transform: none !important; }

/* 归档页分页兼容 */
.page-link,
.page-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  margin: 0 4px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.page-link:hover {
  border-color: var(--accent-clay);
  color: var(--nixie-core);
  box-shadow: 0 0 10px rgba(217, 119, 87, 0.2);
}

.page-current {
  background: var(--accent-clay);
  border-color: var(--accent-clay);
  color: #fff;
  font-weight: 700;
}

/* ==================== 页脚 ==================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl) 0;
  margin-top: var(--space-2xl);
  text-align: center;
  position: relative;
  z-index: 1;
}

/* 终端状态行 */
.footer-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

.footer-status .prompt { color: var(--accent-olive); }
.footer-status .ok { color: #27C93F; }

.footer-content {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.8;
}

.footer-content a {
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--border);
}

.footer-content a:hover {
  color: var(--accent-clay);
  border-bottom-color: var(--accent-clay);
}

.footer-beian {
  margin-top: var(--space-sm);
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: nowrap !important;
}

.footer-beian a {
  color: var(--text-muted);
  white-space: nowrap;
}

.footer-beian a:hover { color: var(--accent-clay); }

.beian-sep { opacity: 0.4; margin: 0 6px; }

.beian-icon {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  vertical-align: middle;
  margin-right: 4px;
  display: inline-block;
}

/* ==================== 回到顶部（键帽） ==================== */
.back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 46px;
  height: 42px;
  background: linear-gradient(180deg, #2d3139 0%, #242830 100%);
  border: 1px solid #3a404d;
  border-bottom: 4px solid #1a1d23;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  z-index: 999;
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-family: var(--font-mono);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  border-color: var(--accent-clay);
  color: var(--nixie-core);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35), 0 0 12px rgba(217, 119, 87, 0.25);
}

.back-to-top:active {
  transform: translateY(3px);
  border-bottom-width: 1px;
}

/* ==================== 独立页面 ==================== */
.page-header {
  padding: var(--space-3xl) 0 var(--space-xl);
  text-align: center;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==================== 语法高亮 ==================== */
.hljs { color: var(--text-body); background: transparent; }
.hljs-comment, .hljs-quote { color: #D4A574; }
.hljs-keyword, .hljs-selector-tag, .hljs-subst { color: #FF7B72; }
.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable { color: #79C0FF; }
.hljs-string, .hljs-doctag { color: #A5D6FF; }
.hljs-title, .hljs-section, .hljs-selector-id { color: #D2A8FF; }
.hljs-type, .hljs-class .hljs-title, .hljs-built_in, .hljs-builtin-name { color: #FFA657; }
.hljs-tag, .hljs-name, .hljs-attribute { color: #7EE787; }
.hljs-regexp, .hljs-link { color: #A5D6FF; }
.hljs-symbol, .hljs-bullet { color: #79C0FF; }
.hljs-meta { color: var(--text-muted); }
.hljs-deletion { background: rgba(176, 74, 63, 0.2); }
.hljs-addition { background: rgba(120, 140, 93, 0.2); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  :root { --nav-height: 56px; }

  body { font-size: 1rem; }

  .nav-container { padding: 0 var(--space-md); }

  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(13, 17, 23, 0.98);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-md);
    border-bottom: 1px solid var(--border);
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-out);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .menu-toggle { display: flex; }

  .menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .menu-toggle.active span:nth-child(2) { opacity: 0; }
  .menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

  .hero { padding: var(--space-2xl) 0 var(--space-xl); }
  .hero-title { font-size: 1.55rem; }
  .hero-desc { font-size: 0.95rem; }

  .post-title { font-size: 1.5rem; }

  .post-card { flex-direction: column; }
  .post-card-thumbnail { width: 100%; height: 160px; border-right: none; border-bottom: 1px solid var(--border); }

  .post-nav { grid-template-columns: 1fr; }
  .post-nav-next { text-align: left; }

  .container { padding: 0 var(--space-md); }

  .back-to-top { bottom: var(--space-md); right: var(--space-md); }

  .terminal-404 { margin: var(--space-2xl) var(--space-md); }

  .code-terminal {
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .nixie-title { letter-spacing: 0.06em; }

  /* 小屏隐藏角落拟物小件，避免遮挡 */
  .crt-page-brand,
  .crt-page-led { display: none; }
}

/* ==================== 可访问性：减少动效兜底 ==================== */
@media (prefers-reduced-motion: reduce) {
  .boot-overlay { display: none !important; }
  .nixie-char,
  .crt-global-scanlines,
  .crt-page-led,
  .terminal-error-glow,
  .terminal-cursor,
  .nav-brand::after {
    animation: none !important;
  }
  .nixie-char {
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.6), 0 0 20px rgba(255, 107, 53, 0.35);
  }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ==================== 工具类 ==================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
