/* =============================================================
   DevLog — 程序员风格主题
   深色终端质感 · 等宽字体 · 双主题（dark / light）
   ============================================================= */

/* ---------- 主题变量 ---------- */
:root {
  /* 字体 */
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* 间距与圆角 */
  --radius: 6px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --content-max: 1080px;
}

/* 默认：深色（程序员风格主色） */
[data-theme="dark"] {
  --bg: #0d1117;
  --bg-soft: #010409;
  --panel: #161b22;
  --panel-hover: #1c2129;
  --border: #30363d;
  --border-strong: #3d444d;
  --text: #c9d1d9;
  --text-strong: #e6edf3;
  --text-muted: #8b949e;
  --accent: #3fb950;       /* 终端绿 */
  --accent-blue: #58a6ff;
  --yellow: #d29922;
  --red: #f85149;
  --purple: #bc8cff;
  --orange: #ffa657;
  --mark-bg: rgba(187, 128, 9, 0.35);
  --shadow: 0 8px 24px rgba(1, 4, 9, 0.6);
  --code-bg: #0d1117;
  --blockquote-bg: rgba(88, 166, 255, 0.08);
  --table-alt: #161b22;
}

/* 浅色主题 */
[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-soft: #eaeef2;
  --panel: #ffffff;
  --panel-hover: #f0f3f6;
  --border: #d0d7de;
  --border-strong: #b6bdc6;
  --text: #1f2328;
  --text-strong: #0d1117;
  --text-muted: #656d76;
  --accent: #1a7f37;
  --accent-blue: #0969da;
  --yellow: #9a6700;
  --red: #cf222e;
  --purple: #8250df;
  --orange: #bc4c00;
  --mark-bg: rgba(210, 153, 34, 0.3);
  --shadow: 0 8px 24px rgba(140, 149, 159, 0.2);
  --code-bg: #f6f8fa;
  --blockquote-bg: rgba(9, 105, 218, 0.06);
  --table-alt: #f6f8fa;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(63, 185, 80, 0.06), transparent),
    repeating-linear-gradient(0deg, transparent, transparent 2px, transparent 2px, transparent 2px);
  transition: background 0.25s ease, color 0.25s ease;
  min-height: 100vh;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

::selection { background: var(--accent); color: #fff; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- 终端外壳 ---------- */
.terminal-shell {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- 终端顶栏 ---------- */
.terminal-header {
  background: var(--panel);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.term-dots { display: flex; gap: 6px; flex-shrink: 0; }
.term-dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block;
}
.term-dot-red { background: #ff5f56; }
.term-dot-yellow { background: #ffbd2e; }
.term-dot-green { background: #27c93f; }

.term-title {
  flex: 1;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle-icon::before { content: "◐ 主题"; }

/* ---------- 导航 ---------- */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px 16px;
  flex-wrap: wrap;
}

.site-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.site-logo:hover { text-decoration: none; }
.site-logo-symbol { color: var(--accent); }

.nav-links { display: flex; flex-wrap: wrap; gap: 4px; }

.nav-link {
  color: var(--text-muted);
  font-size: 14px;
  padding: 4px 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.nav-link:hover {
  color: var(--text-strong);
  border-color: var(--border);
  text-decoration: none;
}
.nav-link.active {
  color: var(--accent);
  background: rgba(63, 185, 80, 0.08);
  border-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 6px 8px;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
}

/* ---------- 主体布局 ---------- */
.terminal-body {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: none;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0;
}

.layout-content { min-width: 0; padding: var(--space-4) var(--space-4) var(--space-5); }

.layout-sidebar {
  padding: var(--space-4) var(--space-4) var(--space-5);
  border-left: 1px solid var(--border);
  background: var(--bg);
}

/* ---------- 终端卡片 ---------- */
.terminal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow);
}

/* ---------- 首页 Hero ---------- */
.hero { padding: var(--space-5); position: relative; overflow: hidden; }
.hero::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 90px;
  background: linear-gradient(135deg, transparent 0%, rgba(63, 185, 80, 0.06) 100%);
  pointer-events: none;
}
.hero-prompt, .hero-desc {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: var(--space-2);
}
.hero-title {
  font-size: 34px;
  font-weight: 700;
  color: var(--text-strong);
  margin: var(--space-2) 0;
  letter-spacing: -1px;
}
.hero-title::after {
  content: "▌";
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 4px;
}
.hero-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: var(--space-3);
}
.hero-output {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: var(--space-4);
}
.hero-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

@keyframes blink { 50% { opacity: 0; } }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent);
  filter: brightness(1.15);
  color: #fff;
}
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.text-link { color: var(--accent); font-size: 14px; }
.text-link:hover { text-decoration: underline; }

/* ---------- 文章列表 ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--border);
}
.section-title { font-size: 17px; color: var(--text-strong); }
.section-more { font-size: 13px; color: var(--text-muted); }
.section-more:hover { color: var(--accent); }

.post-card { padding: var(--space-3) var(--space-4); transition: border-color 0.2s; }
.post-card:hover { border-color: var(--accent); }
.post-card-title {
  font-size: 18px;
  margin-bottom: var(--space-2);
}
.post-card-title a { color: var(--text-strong); }
.post-card-title a:hover { color: var(--accent); text-decoration: none; }

.post-card-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); }
.meta-item {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.post-card-excerpt {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: var(--space-2);
}

.post-card-actions { text-align: right; }

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-2);
}
.pagination-info { color: var(--text-muted); font-size: 13px; }
.pagination-btns { display: flex; gap: var(--space-2); }

/* ---------- 文章页 ---------- */
.post-header { padding: var(--space-4) var(--space-5) var(--space-3); border-bottom: 1px dashed var(--border); }
.post-title { font-size: 28px; color: var(--text-strong); margin-bottom: var(--space-3); line-height: 1.35; }
.post-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: 13px; color: var(--text-muted); }
.post-tags { width: 100%; display: flex; flex-wrap: wrap; gap: var(--space-1); align-items: center; }

.post-content { padding: var(--space-4) var(--space-5) var(--space-5); }

/* 文章排版 */
.post-content h2, .page-content h2,
.post-content h3, .page-content h3,
.post-content h4, .page-content h4 {
  color: var(--text-strong);
  margin: 1.6em 0 0.6em;
  line-height: 1.4;
}
.post-content h2, .page-content h2 { font-size: 22px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.post-content h3, .page-content h3 { font-size: 18px; }
.post-content h4, .page-content h4 { font-size: 16px; }

.post-content p, .page-content p { margin: 0 0 1.1em; }

.post-content ul, .page-content ul,
.post-content ol, .page-content ol {
  margin: 0 0 1.1em;
  padding-left: 1.6em;
}
.post-content li, .page-content li { margin-bottom: 4px; }

.post-content code, .page-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--accent);
}

.post-content pre, .page-content pre {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  overflow-x: auto;
  margin: 0 0 1.2em;
}
.post-content pre code, .page-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

.post-content blockquote, .page-content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--blockquote-bg);
  padding: var(--space-2) var(--space-3);
  margin: 0 0 1.2em;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
}
.post-content blockquote p:last-child, .page-content blockquote p:last-child { margin-bottom: 0; }

.post-content table, .page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 14px;
}
.post-content th, .page-content th,
.post-content td, .page-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.post-content th, .page-content th { background: var(--bg-soft); color: var(--text-strong); }
.post-content tr:nth-child(even) td, .page-content tr:nth-child(even) td { background: var(--table-alt); }

.post-content hr, .page-content hr { border: none; border-top: 1px dashed var(--border); margin: 1.6em 0; }

.post-content a, .page-content a { color: var(--accent-blue); }

/* ---------- Rouge 代码高亮 ---------- */
.highlight { position: relative; }
.highlight pre { margin: 0; }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cp, .highlight .cs { color: var(--text-muted); font-style: italic; }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: var(--red); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr { color: var(--accent-blue); }
.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .mb, .highlight .mx { color: var(--yellow); }
.highlight .o, .highlight .ow { color: var(--red); }
.highlight .p { color: var(--text); }
.highlight .nf, .highlight .nl, .highlight .nx { color: var(--purple); }
.highlight .nc, .highlight .nn { color: var(--orange); }
.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi { color: var(--accent-blue); }
.highlight .nt { color: var(--accent); }
.highlight .na, .highlight .nb, .highlight .bp { color: var(--orange); }
.highlight .no, .highlight .nd, .highlight .ni { color: var(--accent-blue); }
.highlight .ge { font-style: italic; }
.highlight .gs { font-weight: bold; }
.highlight .gd { color: var(--red); }
.highlight .gi { color: var(--accent); }
.highlight .gp { color: var(--text-muted); }
.highlight .err { color: var(--red); font-weight: bold; }

/* ---------- 上一页/下一页 ---------- */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.post-nav-item {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.post-nav-item:hover { border-color: var(--accent); text-decoration: none; }
.post-nav-next { text-align: right; }
.post-nav-label { font-size: 12px; color: var(--text-muted); }
.post-nav-title { font-size: 14px; color: var(--text-strong); }

/* ---------- 评论 ---------- */
.post-comments { padding: var(--space-4) var(--space-5) var(--space-5); border-top: 1px dashed var(--border); }
.post-comments .section-title { margin-bottom: var(--space-3); }

/* ---------- 通用页面 ---------- */
.page-header { padding: var(--space-4) var(--space-5) var(--space-3); border-bottom: 1px dashed var(--border); }
.page-title { font-size: 24px; color: var(--text-strong); }
.page-subtitle { color: var(--text-muted); font-size: 14px; margin-top: var(--space-2); }
.page-content { padding: var(--space-4) var(--space-5) var(--space-5); }

/* ---------- 提示符 ---------- */
.prompt-symbol { color: var(--accent); font-weight: 700; margin-right: 4px; }
.prompt-cmd { color: var(--text-strong); }

/* ---------- chip / 标签 ---------- */
.chip {
  display: inline-block;
  font-size: 12px;
  color: var(--accent-blue);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
  transition: all 0.2s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent-blue); text-decoration: none; }
.chip-count {
  color: var(--text-muted);
  margin-left: 4px;
  font-size: 11px;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- 侧边栏 ---------- */
.sidebar-card { padding: var(--space-3) var(--space-3) var(--space-3); background: var(--panel); }
.sidebar-title {
  font-size: 14px;
  color: var(--text-strong);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--border);
}

.sidebar-author { text-align: center; }
.author-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
  margin-bottom: var(--space-2);
}
.author-name { font-weight: 700; color: var(--text-strong); margin-bottom: 4px; }
.author-bio { font-size: 12.5px; color: var(--text-muted); margin-bottom: var(--space-2); line-height: 1.6; }

.search-form { display: flex; align-items: center; gap: var(--space-2); }
.search-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }

.recent-list { list-style: none; }
.recent-list li { border-bottom: 1px dashed var(--border); }
.recent-list li:last-child { border-bottom: none; }
.recent-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 2px;
  color: var(--text);
  font-size: 13.5px;
}
.recent-link:hover { color: var(--accent); text-decoration: none; }
.recent-date { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }

.friend-list { list-style: none; }
.friend-list li { margin-bottom: 6px; }
.friend-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--text);
  transition: all 0.2s;
}
.friend-list a:hover { border-color: var(--border); background: var(--panel-hover); text-decoration: none; }
.friend-icon {
  width: 30px; height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
.friend-info { display: flex; flex-direction: column; min-width: 0; }
.friend-name { font-size: 13.5px; color: var(--text-strong); }
.friend-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 广告位 ---------- */
.ad-slot { text-align: center; }
.ad-text {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  white-space: pre-line;
  line-height: 1.8;
  padding: 4px 0;
}
.ad-text:hover { color: var(--accent); }
.ad-image { border-radius: var(--radius); border: 1px solid var(--border); }
.ad-slot .section-title { text-align: left; }

/* ---------- 标签/分类页 ---------- */
.taxonomy-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px dashed var(--border);
}
.taxonomy-group { margin-bottom: var(--space-4); }
.taxonomy-title { font-size: 18px; color: var(--text-strong); margin-bottom: var(--space-2); }
.taxonomy-count { font-size: 13px; color: var(--text-muted); }
.taxonomy-list { list-style: none; }
.taxonomy-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border);
}
.taxonomy-date { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.taxonomy-link { color: var(--text); font-size: 15px; }
.taxonomy-link:hover { color: var(--accent); }

/* ---------- 归档页 ---------- */
.archive-summary { color: var(--text-muted); font-size: 14px; margin-bottom: var(--space-4); }
.archive-summary strong { color: var(--accent); }
.archive-year { margin-bottom: var(--space-4); }
.archive-year-title { font-size: 20px; color: var(--text-strong); margin-bottom: var(--space-2); }
.archive-list { list-style: none; }
.archive-item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border);
}
.archive-date { color: var(--accent); font-size: 13px; flex-shrink: 0; width: 38px; }
.archive-link { color: var(--text); font-size: 15px; }
.archive-link:hover { color: var(--accent); }
.archive-tags { margin-left: auto; display: flex; gap: 4px; }

/* ---------- 外链页 ---------- */
.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.friend-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: 0;
  transition: border-color 0.2s, transform 0.2s;
}
.friend-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.friend-card-icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}
.friend-card-body { display: flex; flex-direction: column; min-width: 0; }
.friend-card-name { font-size: 15px; font-weight: 700; color: var(--text-strong); }
.friend-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.friend-card-url { font-size: 11.5px; color: var(--accent-blue); word-break: break-all; }
.terminal-hr { border: none; border-top: 1px dashed var(--border); margin: var(--space-4) 0; }

/* ---------- 搜索页 ---------- */
.search-form-lg { margin-bottom: var(--space-3); }
.search-form-lg .prompt-symbol { font-size: 16px; }
.search-status { color: var(--text-muted); font-size: 13px; margin-bottom: var(--space-3); }
.search-count {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--border);
}
.search-result { padding: var(--space-3) var(--space-4); }
.search-result-title { font-size: 17px; margin-bottom: var(--space-2); }
.search-result-title a { color: var(--text-strong); }
.search-result-title a:hover { color: var(--accent); text-decoration: none; }
.search-result-meta {
  display: flex;
  gap: var(--space-3);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.search-result-excerpt { color: var(--text-muted); font-size: 13.5px; margin-bottom: var(--space-2); }
mark {
  background: var(--mark-bg);
  color: var(--text-strong);
  border-radius: 3px;
  padding: 0 2px;
}
.search-empty { text-align: center; padding: var(--space-5) 0; color: var(--text-muted); }
.search-empty .prompt-symbol { display: block; font-size: 20px; margin-bottom: var(--space-2); }
.search-empty-hint { font-size: 13px; margin-top: var(--space-2); }

/* ---------- 关于页 ---------- */
.about-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover;
  display: block;
  margin: 0 auto var(--space-4);
}

/* ---------- 404 ---------- */
.error-page { text-align: center; }
.error-content { padding: var(--space-4) var(--space-5) var(--space-5); }
.error-art {
  font-size: 12px;
  color: var(--red);
  text-align: left;
  margin-bottom: var(--space-4);
  display: inline-block;
}
.error-msg { margin-bottom: var(--space-2); }
.error-output { color: var(--text-muted); margin-bottom: var(--space-4); }

/* ---------- 页脚 ---------- */
.terminal-footer {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.footer-inner { padding: var(--space-3) var(--space-4); font-size: 13px; }
.footer-line { color: var(--text-muted); }
.footer-output { color: var(--text-muted); }
.footer-output a { color: var(--accent-blue); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout-grid { grid-template-columns: 1fr; }
  .layout-sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3);
  }
  .layout-sidebar .sidebar-card { margin-bottom: 0; }
}

@media (max-width: 640px) {
  .terminal-shell { padding: 12px 8px 24px; }
  .layout-content, .layout-sidebar { padding: var(--space-3); }
  .hero { padding: var(--space-4); }
  .hero-title { font-size: 26px; }
  .post-header, .post-content, .page-header, .page-content,
  .post-nav, .post-comments { padding-left: var(--space-3); padding-right: var(--space-3); }

  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 2px;
    padding-top: var(--space-2);
    border-top: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 8px 12px; }

  .term-title { display: none; }
  .theme-toggle-icon::before { content: "◐"; }
}

/* =============================================================
   V2 美化：阅读进度条 / 返回顶部 / 目录 / 相关文章 / 打赏 / 统计
   ============================================================= */

/* ---------- 阅读进度条 ---------- */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-blue));
  z-index: 9999;
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
}

/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--accent);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 900;
  box-shadow: var(--shadow);
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  border-color: var(--accent);
  background: var(--panel-hover);
}

/* ---------- 面包屑 ---------- */
.post-breadcrumb {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  word-break: break-all;
}
.post-breadcrumb a { color: var(--accent-blue); }
.post-breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { margin: 0 6px; color: var(--border-strong); }
.breadcrumb-current { color: var(--text-muted); }

/* ---------- 置顶标记 ---------- */
.pinned-badge { font-size: 0.85em; }
.post-card.pinned {
  border-color: var(--yellow);
  background: linear-gradient(135deg, rgba(210, 153, 34, 0.05), transparent 60%);
}

/* ---------- 站点统计栏 ---------- */
.site-stats {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 var(--space-3);
}
.stat-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.stat-label { font-size: 12px; color: var(--text-muted); }

/* ---------- 文章目录 TOC ---------- */
.toc-card {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 0; }
.toc-list a {
  display: block;
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all 0.15s;
  word-break: break-all;
}
.toc-list a:hover {
  color: var(--text-strong);
  background: var(--panel-hover);
  text-decoration: none;
}
.toc-list a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(63, 185, 80, 0.08);
}
.toc-level-3 { padding-left: 12px; }

/* ---------- 文章底部信息 ---------- */
.post-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px dashed var(--border);
  font-size: 13px;
}
.post-footer-line { margin-bottom: var(--space-1); }
.post-footer-line .chip { margin-right: 4px; }
.post-copyright { color: var(--text-muted); }
.post-copyright a { color: var(--accent-blue); }

/* ---------- 相关文章 ---------- */
.related-posts { padding: var(--space-4) var(--space-5); border-top: 1px dashed var(--border); }
.related-posts .section-head { margin-bottom: var(--space-2); }
.related-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  padding: 10px 4px;
  border-bottom: 1px dashed var(--border);
  color: var(--text);
  transition: all 0.15s;
}
.related-item:last-child { border-bottom: none; }
.related-item:hover { color: var(--accent); padding-left: 10px; text-decoration: none; }
.related-item-title { font-size: 14.5px; }
.related-item-meta { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* ---------- 打赏区 ---------- */
.sponsor {
  margin: var(--space-3) var(--space-5);
  padding: var(--space-3) var(--space-4);
  text-align: center;
  border-style: dashed;
  border-color: var(--yellow);
  background: rgba(210, 153, 34, 0.04);
}
.sponsor-prompt { margin-bottom: var(--space-2); font-size: 13.5px; }
.sponsor-body { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.sponsor-qrcode {
  width: 140px;
  height: 140px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  object-fit: cover;
  transition: border-color 0.2s;
}
.sponsor-qrcode:hover { border-color: var(--yellow); }
.sponsor-hint { font-size: 12px; color: var(--text-muted); }

/* ---------- 代码复制按钮 ---------- */
.post-content pre { position: relative; padding-top: 38px; }
.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
}
.post-content pre:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
@media (hover: none) { .copy-btn { opacity: 1; } }

/* ---------- 页脚社交链接 ---------- */
.footer-social {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}
.social-link {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.2s;
}
.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ---------- 入场动画（尊重系统减弱动画设置） ---------- */
.hero, .post, .page, .post-card {
  animation: fadeInUp 0.45s ease both;
}
.post-card:nth-child(2) { animation-delay: 0.05s; }
.post-card:nth-child(3) { animation-delay: 0.1s; }
.post-card:nth-child(4) { animation-delay: 0.15s; }
.post-card:nth-child(5) { animation-delay: 0.2s; }
.post-card:nth-child(6) { animation-delay: 0.25s; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
