/* ============================================================
   VanBlog-PHP 前台样式 v2
   排版/布局对齐 VanBlog 原版（Next.js 默认主题，v0.53）
   亮/暗主题通过 [data-theme] 切换，默认深色
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-faint: #6b7280;
  --border: #e5e7eb;
  --accent: #4f46e5;
  --accent-text: #4f46e5;
  --code-bg: #f6f8fa;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-nav: 0 2px 8px rgba(0, 0, 0, 0.15);
  --radius: 0px;
  --danger: #e5484d;
  --success: #2e9e5b;
  /* markdown（GitHub Light） */
  --md-fg: #1f2328;
  --md-canvas: #ffffff;
  --md-canvas-subtle: #f6f8fa;
  --md-border: #d1d9e0;
  --md-border-muted: #d8dee4;
  --md-neutral-muted: #afb8c1;
  --md-fg-muted: #59636e;
  --md-accent: #0969da;
  --md-attention-subtle: #fff8c5;
}

html[data-theme="dark"] {
  --bg: #1b1c1f;
  --bg-card: #26282c;
  --bg-header: #26282c;
  --text: #9e9e9e;
  --text-secondary: #9e9e9e;
  --text-muted: #6e6e6e;
  --text-faint: #6e6e6e;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #9aa7ff;
  --accent-text: #c8ccd4;
  --code-bg: #232428;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-nav: 0 2px 8px rgba(0, 0, 0, 0.3);
  --danger: #e5484d;
  --success: #2e9e5b;
  /* markdown（GitHub Dark） */
  --md-fg: #e6edf3;
  --md-canvas: #26282c;
  --md-canvas-subtle: #232428;
  --md-border: #3d444d;
  --md-border-muted: #3d444d;
  --md-neutral-muted: #6e7681;
  --md-fg-muted: #8b949e;
  --md-accent: #4493f8;
  --md-attention-subtle: #3a2d12;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Open Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Segoe UI Emoji", "Segoe UI Symbol", Helvetica, Arial, -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; }

/* ============================================================
   顶部导航（sticky，对齐原站 nav）
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg-header);
  box-shadow: var(--shadow-nav);
}
.header-inner {
  display: flex;
  align-items: center;
  height: 56px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
  margin-right: 24px;
  white-space: nowrap;
}
.brand-logo { width: 28px; height: 28px; margin-right: 8px; border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-subtitle { font-size: 12px; font-weight: 400; color: var(--text-muted); }

.main-nav {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  height: 100%;
}
.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}
.main-nav li {
  display: flex;
  align-items: center;
  height: 100%;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.main-nav li:hover { transform: scale(1.06); }
.main-nav a {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}
.main-nav a:hover { color: var(--text); }
.main-nav a:hover::after,
.main-nav a.active::after { transform: scaleX(1); }
.main-nav a.active { color: var(--accent); }

.header-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, color 0.15s;
}
.icon-btn:hover { transform: scale(1.15); color: var(--text); }
.nav-toggle { margin-left: 8px; }
@media (min-width: 768px) { .nav-toggle { display: none; } }

/* 搜索快捷键徽章（对齐原站 Ctrl+K） */
.kbd-hint {
  display: none;
  align-items: center;
  font-size: 12px;
  line-height: 1;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
  margin-left: 6px;
  white-space: nowrap;
}
.kbd-hint kbd { font-family: inherit; }
@media (min-width: 640px) { .kbd-hint { display: inline-flex; } }

/* 管理后台按钮（对齐原站 title=管理后台，桌面显示） */
.admin-btn { display: none; }
@media (min-width: 768px) { .admin-btn { display: inline-flex; margin-left: 6px; } }

/* 移动端菜单 */
.mobile-nav {
  display: none;
  position: fixed;
  top: 57px;
  right: 0;
  bottom: 0;
  width: 250px;
  background: var(--bg-card);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
  z-index: 110;
  padding: 8px 0;
  overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav li { cursor: pointer; }
.mobile-nav li:hover { background: var(--code-bg); }
.mobile-nav a {
  display: block;
  width: 100%;
  padding: 6px 16px;
  font-size: 16px;
  line-height: 36px;
  color: var(--text-secondary);
}
.mobile-nav a.active { color: var(--accent); }
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  z-index: 105;
}
.mobile-nav-overlay.open { display: block; }

/* ============================================================
   主区：两栏（主内容 + 右侧作者卡，对齐原站）
   ============================================================ */
.site-main {
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 8px 8px;
}
@media (min-width: 768px) {
  .site-main { padding: 24px 16px 16px; }
}
.main-wrap {
  display: flex;
  justify-content: center;
  max-width: 1024px;
  margin: 0 auto;
}
.vanblog-main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 768px;
}
@media (min-width: 1280px) {
  .vanblog-main { max-width: 768px; }
}
.vanblog-sider {
  display: none;
  flex: 0 0 auto;
  width: 208px;
  margin-left: 8px;
}
@media (min-width: 1024px) {
  .vanblog-sider { display: block; }
}

/* 作者卡（对齐原站 author-card） */
.vanblog-sider .sticky { position: sticky; top: 72px; }
.author-card {
  width: 208px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 24px 0 16px;
  text-align: center;
}
.author-card-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
}
.author-card-name {
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 8px;
  font-size: 15px;
}
.author-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 8px;
  line-height: 1.6;
  padding: 0 12px;
}
.author-card-stats {
  display: flex;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
}
.author-card-stats a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 4px;
}
.author-card-stats .stat-num { font-weight: 700; color: var(--text); }
.author-card-stats .stat-label { color: var(--text-muted); font-size: 12px; }
.author-card-stats a:hover .stat-num,
.author-card-stats a:hover .stat-label { color: var(--accent); }
.author-card-social {
  margin-top: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.author-card-social a {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 10px;
}
.author-card-social a:hover { color: var(--accent); text-decoration: underline; }

/* 文章目录（TOC，对齐原站右侧目录） */
.toc-card {
  width: 208px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  padding: 14px 12px;
}
.toc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 55vh;
  overflow-y: auto;
}
.toc-item a {
  display: block;
  padding: 3px 6px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toc-item a:hover { color: var(--accent); }
.toc-item.active a {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(127, 127, 127, 0.07);
}
.toc-h3 a { padding-left: 18px; font-size: 12px; }

.post-list { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 768px) { .post-list { gap: 16px; } }

/* ============================================================
   文章卡片（对齐原站 post-card）
   ============================================================ */
.post-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 16px 4px;
}
@media (min-width: 640px) { .post-card { padding: 16px 12px; } }
@media (min-width: 768px) { .post-card { padding: 24px 20px; } }

.post-card-title {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.post-card-title a {
  font-size: 18px;
  font-weight: 500;
  padding: 8px 20px 8px;
  color: var(--text);
}
.post-card-title a:hover { color: var(--accent); }
.post-card-edit {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  padding: 1px 6px;
  border: none;
  border-radius: 3px;
  background: transparent;
  opacity: 0.65;
  margin-left: 4px;
  vertical-align: middle;
}
.post-card-edit:hover { opacity: 1; color: var(--accent); background: rgba(127, 127, 127, 0.08); }

.post-card-author {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.post-card-author .avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--code-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-secondary);
  overflow: hidden;
}
.post-card-author .avatar img { width: 100%; height: 100%; object-fit: cover; }

.post-card-sub-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
@media (min-width: 768px) { .post-card-sub-title { font-size: 14px; } }
.post-card-sub-title > span {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-right: 1px solid var(--text-muted);
}
.post-card-sub-title > span:last-child { border-right: none; }
.post-card-sub-title a:hover { color: var(--text); text-decoration: underline; }
.post-card-sub-title svg { margin-right: 2px; }

.badge {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}
.badge-top { background: var(--accent); color: #fff; }
.badge-lock { background: var(--code-bg); color: var(--text-secondary); }

.post-card-content {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 16px 8px 0;
  /* 首页卡片截断：最大高度 + 渐变淡出（对齐原站摘要式卡片） */
  max-height: 260px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}
@media (min-width: 768px) { .post-card-content { font-size: 15px; } }

.post-card-footer {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.post-card-footer a {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 8px;
  border: 2px solid var(--text-secondary);
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.post-card-footer a:hover { background: var(--text-secondary); color: var(--bg-card); }

/* ============================================================
   文章详情
   ============================================================ */
.article-detail { background: var(--bg-card); box-shadow: var(--shadow-card); padding: 24px 16px; }
@media (min-width: 768px) { .article-detail { padding: 32px 24px; } }
.article-header { text-align: center; margin-bottom: 16px; }
.article-title { font-size: 22px; font-weight: 600; margin: 0 0 8px; color: var(--text); }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
}
.article-meta > span {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-right: 1px solid var(--text-muted);
}
.article-meta > span:last-child { border-right: none; }
.article-meta a:hover { text-decoration: underline; }
.article-cover { margin: 0 0 16px; text-align: center; }
.article-copyright {
  margin-top: 20px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--code-bg);
  border-radius: 6px;
  text-align: center;
}
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.tag {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--code-bg);
  padding: 3px 10px;
  border-radius: 12px;
}
.tag:hover { color: var(--accent); }
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}
.article-nav a { color: var(--text-secondary); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-nav a:hover { color: var(--accent); }
.article-share { text-align: center; margin-top: 20px; }
.btn {
  display: inline-block;
  padding: 7px 18px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
}
.btn:hover { color: var(--accent); border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { color: #fff; opacity: 0.9; }
.btn-ghost { background: transparent; }

/* ============================================================
   markdown（GitHub 风格，亮/暗变量）
   ============================================================ */
.markdown-body {
  color: var(--md-fg);
  background-color: var(--md-canvas);
  font-size: 15px;
  line-height: 1.75;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.markdown-body > :first-child { margin-top: 0 !important; }
.markdown-body > :last-child { margin-bottom: 0 !important; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--md-fg);
}
.markdown-body h1 { font-size: 1.6em; padding-bottom: 0.3em; border-bottom: 1px solid var(--md-border-muted); }
.markdown-body h2 { font-size: 1.4em; padding-bottom: 0.3em; border-bottom: 1px solid var(--md-border-muted); }
.markdown-body h3 { font-size: 1.2em; }
.markdown-body h4 { font-size: 1em; }
.markdown-body h5 { font-size: 0.9em; }
.markdown-body h6 { font-size: 0.85em; color: var(--md-fg-muted); }
.markdown-body p, .markdown-body blockquote, .markdown-body ul,
.markdown-body ol, .markdown-body dl, .markdown-body table,
.markdown-body pre, .markdown-body details {
  margin-top: 0;
  margin-bottom: 16px;
}
.markdown-body p { line-height: 1.75; }
.markdown-body a { color: var(--md-accent); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
/* GFM 任务列表 + 删除线 */
.markdown-body li.task-list-item,
.markdown-body li:has(> input[type="checkbox"][disabled]) { list-style: none; }
.markdown-body ul.contains-task-list,
.markdown-body ol.contains-task-list,
.markdown-body ul:has(> li > input[type="checkbox"][disabled]) { padding-left: 0.5em; }
.markdown-body input[type="checkbox"][disabled] {
  margin: 0 0.35em 0 0;
  accent-color: var(--md-accent, #2563eb);
  transform: translateY(1px);
}
.markdown-body del { color: var(--md-fg-muted); }
.markdown-body blockquote {
  padding: 0 1em;
  color: var(--md-fg-muted);
  border-left: 0.25em solid var(--md-border-muted);
}
.markdown-body ul, .markdown-body ol { padding-left: 2em; }
.markdown-body li + li { margin-top: 0.25em; }
.markdown-body hr {
  height: 0.25em;
  padding: 0;
  margin: 24px 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--md-border-muted);
}
.markdown-body code, .markdown-body tt {
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 85%;
  padding: 0.2em 0.4em;
  margin: 0;
  background-color: var(--md-neutral-muted);
  border-radius: 6px;
}
.markdown-body pre {
  padding: 16px;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
  background-color: var(--md-canvas-subtle) !important;
  border-radius: 6px;
}
.markdown-body pre code {
  display: inline;
  padding: 0;
  margin: 0;
  font-size: 100%;
  background: transparent;
  border: 0;
  overflow: visible;
  line-height: inherit;
  word-wrap: normal;
}
.markdown-body table {
  display: block;
  width: 100%;
  overflow: auto;
  border-spacing: 0;
  border-collapse: collapse;
}
.markdown-body table th { font-weight: 600; }
.markdown-body table td, .markdown-body table th {
  padding: 6px 13px;
  border: 1px solid var(--md-border);
}
.markdown-body table tr { background-color: var(--md-canvas); border-top: 1px solid var(--md-border-muted); }
.markdown-body table tr:nth-child(2n) { background-color: var(--md-canvas-subtle); }
.markdown-body img { max-width: 100%; box-sizing: content-box; background-color: var(--md-canvas); }
.markdown-body .custom-container { margin: 16px 0; }
.markdown-body .custom-container-title { font-weight: 600; margin: 16px 0; display: flex; align-items: center; }
.markdown-body .custom-container.info {
  padding: 12px 16px;
  border-left: 4px solid var(--md-accent);
  background: var(--md-attention-subtle);
  border-radius: 6px;
}
.markdown-body .custom-container.tip {
  padding: 12px 16px;
  border-left: 4px solid var(--md-accent);
  background: var(--md-attention-subtle);
  border-radius: 6px;
}
.markdown-body .custom-container .custom-container-title { margin-top: 0; }

/* 代码高亮：暗色下覆盖为 GitHub Dark 配色 */
html[data-theme="dark"] .markdown-body .hljs-comment,
html[data-theme="dark"] .markdown-body .hljs-quote { color: #8b949e; font-style: italic; }
html[data-theme="dark"] .markdown-body .hljs-keyword,
html[data-theme="dark"] .markdown-body .hljs-selector-tag,
html[data-theme="dark"] .markdown-body .hljs-subst { color: #ff7b72; }
html[data-theme="dark"] .markdown-body .hljs-string,
html[data-theme="dark"] .markdown-body .hljs-regexp,
html[data-theme="dark"] .markdown-body .hljs-addition { color: #a5d6ff; }
html[data-theme="dark"] .markdown-body .hljs-number,
html[data-theme="dark"] .markdown-body .hljs-literal,
html[data-theme="dark"] .markdown-body .hljs-variable,
html[data-theme="dark"] .markdown-body .hljs-template-variable,
html[data-theme="dark"] .markdown-body .hljs-symbol,
html[data-theme="dark"] .markdown-body .hljs-bullet { color: #79c0ff; }
html[data-theme="dark"] .markdown-body .hljs-title,
html[data-theme="dark"] .markdown-body .hljs-name,
html[data-theme="dark"] .markdown-body .hljs-section,
html[data-theme="dark"] .markdown-body .hljs-selector-id { color: #d2a8ff; }
html[data-theme="dark"] .markdown-body .hljs-type,
html[data-theme="dark"] .markdown-body .hljs-attr,
html[data-theme="dark"] .markdown-body .hljs-attribute,
html[data-theme="dark"] .markdown-body .hljs-built_in { color: #ffa657; }
html[data-theme="dark"] .markdown-body .hljs-meta { color: #8b949e; }
html[data-theme="dark"] .markdown-body .hljs-deletion { color: #ffa198; background: rgba(255, 129, 130, 0.12); }
html[data-theme="dark"] .markdown-body .hljs-emphasis { font-style: italic; }
html[data-theme="dark"] .markdown-body .hljs-strong { font-weight: 600; }

/* ============================================================
   页脚（对齐原站 footer）
   ============================================================ */
.site-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 32px;
  padding: 8px 16px 32px;
}
@media (min-width: 768px) { .site-footer { margin-top: 48px; } }
.site-footer p { margin: 4px 0; line-height: 1.6; }
.site-footer a:hover { text-decoration: underline; color: var(--text); }
.footer-gongan { display: inline-flex; align-items: center; gap: 4px; justify-content: center; }
.footer-gongan img { width: 20px; height: 20px; }
.footer-copy { color: var(--text-muted); }

/* ============================================================
   页面头 / 空状态 / 搜索 / 分页
   ============================================================ */
.page-head { text-align: center; padding: 16px 0 8px; }
.page-head h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; color: var(--text); }
.page-head p { margin: 0; color: var(--text-muted); font-size: 13px; }
.empty-state {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state h2 { font-size: 18px; font-weight: 500; margin: 0 0 8px; color: var(--text-secondary); }
.empty-state p { margin: 0 0 16px; }
.search-form {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
}
.search-form input {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}
.search-form input:focus { outline: none; border-color: var(--accent); }
.search-result-count { text-align: center; font-size: 13px; color: var(--text-muted); margin: 16px 0 8px; }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 24px 0 8px;
  font-size: 14px;
}
.pagination .page-link { color: var(--text-secondary); padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); }
.pagination .page-link:hover { color: var(--accent); border-color: var(--accent); }
.pagination .page-info { color: var(--text-muted); }

/* ============================================================
   归档 / 友链 / 标签云 / 分类列表
   ============================================================ */
.archive { display: flex; flex-direction: column; gap: 20px; }
.archive-year-title { font-size: 16px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li { display: flex; align-items: baseline; gap: 16px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.archive-list a { color: var(--text-secondary); }
.archive-list a:hover { color: var(--accent); }
.archive-date { color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.page-links { padding: 8px 0; }
.page-title { text-align: center; font-size: 20px; font-weight: 600; margin: 0 0 16px; color: var(--text); }
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 14px;
  transition: transform 0.15s;
}
.link-card:hover { transform: scale(1.02); }
.link-card-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.link-card-body { display: flex; flex-direction: column; min-width: 0; }
.link-card-name { font-weight: 500; color: var(--text); font-size: 14px; }
.link-card-desc { color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 20px 16px;
}
.cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--code-bg);
  padding: 6px 14px;
  border-radius: 16px;
  transition: transform 0.15s;
}
.cloud-item:hover { transform: scale(1.06); color: var(--accent); }
.cloud-count { font-size: 12px; color: var(--text-muted); }

/* 分类列表 */
.cat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 14px 18px;
}
.cat-item:hover { box-shadow: var(--shadow-card); }
.cat-item:hover .cat-name { color: var(--accent); }
.cat-name { font-weight: 500; color: var(--text); }
.cat-desc { flex: 1; color: var(--text-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--code-bg);
  border-radius: 10px;
  padding: 2px 10px;
}

/* 关于页 */
.about-page .about-body { text-align: center; padding: 8px 0; }
.about-avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; }
.about-name { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.about-desc { text-align: center; color: var(--text-muted); border: none; padding: 0 8px; }
.about-site-desc { color: var(--text-muted); }
.about-email a { color: var(--accent); }
.about-since { color: var(--text-muted); font-size: 13px; }

/* ============================================================
   评论（详情页）
   ============================================================ */
.comments {
  margin-top: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 20px 16px;
}
.comments h3 { margin: 0 0 16px; font-size: 16px; font-weight: 600; color: var(--text); }
.comment-form .form-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.comment-form input, .comment-form textarea {
  flex: 1;
  min-width: 140px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}
.comment-form textarea { width: 100%; min-height: 90px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-list { list-style: none; margin: 16px 0 0; padding: 0; }
.comment-item { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-item .comment-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.comment-item .comment-name { font-weight: 600; color: var(--text-secondary); }
.comment-item .comment-content { margin: 6px 0 0; color: var(--text-secondary); font-size: 14px; word-break: break-word; }
.comment-item .comment-content a { color: var(--accent); }
.comment-item .comment-admin { color: var(--accent); font-size: 11px; border: 1px solid var(--accent); border-radius: 4px; padding: 0 4px; }
.comment-empty { color: var(--text-muted); font-size: 13px; }

/* 赞赏 */
.reward-box { text-align: center; margin-top: 20px; }
.reward-qr { display: flex; gap: 16px; justify-content: center; margin-top: 12px; }
.reward-qr img { width: 140px; height: 140px; border: 1px solid var(--border); border-radius: 6px; }

/* 文章锁定页 */
.locked-box { background: var(--bg-card); box-shadow: var(--shadow-card); padding: 32px 20px; text-align: center; }
.locked-box input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); margin-right: 8px; }
