/* ── 设计变量（参考 zhidaow.com 配色体系）───────────── */
:root {
  --c-bg: #f7f9fa;
  --c-bg-alt: #eef2f6;
  --c-bg-soft: #f1f5f8;
  --c-surface: #ffffff;
  --c-surface-alt: #fbfcfd;
  --c-border: #e6ebf0;
  --c-border-strong: #d4dce4;
  --c-text: #142032;
  --c-text-secondary: #4a5a72;
  --c-text-muted: #8593a6;
  --c-primary: #10b981;
  --c-primary-dark: #059669;
  --c-primary-darker: #047857;
  --c-primary-light: #d1fae5;
  --c-primary-soft: #ecfdf5;
  --c-accent: #3b82f6;
  --c-accent-dark: #2563eb;
  --c-accent-soft: #eff6ff;
  --c-warn: #f59e0b;
  --c-danger: #ef4444;
  --c-highlight: #f0fdf4;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 2px rgba(20, 32, 50, 0.04);
  --shadow-sm: 0 1px 3px rgba(20, 32, 50, 0.05), 0 1px 2px rgba(20, 32, 50, 0.03);
  --shadow-md: 0 4px 14px rgba(20, 32, 50, 0.07), 0 2px 4px rgba(20, 32, 50, 0.04);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ── 基础 ─────────────────────────────────────────── */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--c-primary-light); }

a { color: var(--c-primary-dark); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--c-primary-darker); }

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── 页头 ─────────────────────────────────────────── */
.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 36px;
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  flex-wrap: wrap;
}

.site-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: 0.01em;
}

.site-title:hover { color: var(--c-primary-dark); }

.site-nav a {
  margin-left: 6px;
  color: var(--c-text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.site-nav a:hover {
  color: var(--c-primary-dark);
  background: var(--c-primary-soft);
}

/* ── 页脚 ─────────────────────────────────────────── */
.site-footer {
  margin-top: 64px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--c-border);
  color: var(--c-text-muted);
  font-size: 0.875rem;
  text-align: center;
}

.site-footer a { color: var(--c-text-muted); }
.site-footer a:hover { color: var(--c-primary-dark); }
.footer-admin { margin-left: 10px; }

/* ── 首页双栏 ─────────────────────────────────────── */
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 32px;
}

@media (max-width: 800px) {
  .home-layout { grid-template-columns: minmax(0, 1fr); }
}

.sidebar .widget {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.widget-title {
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 0.92rem;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--c-primary);
}

.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.88rem;
}

.archive-list li a { color: var(--c-text-secondary); }
.archive-list li a:hover { color: var(--c-primary-dark); }
.archive-list .count {
  color: var(--c-text-muted);
  font-size: 0.78rem;
  background: var(--c-bg-soft);
  border-radius: var(--radius-full);
  padding: 0 9px;
  min-width: 26px;
  text-align: center;
}

.search-box form { display: flex; gap: 8px; }

.search-box input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 0.88rem;
  background: var(--c-surface-alt);
  color: var(--c-text);
  outline: none;
  transition: all 0.15s ease;
}

.search-box input[type="text"]:focus {
  border-color: var(--c-primary);
  background: var(--c-surface);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}

.search-box button {
  border: none;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 7px 16px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 0.15s ease;
}

.search-box button:hover { background: var(--c-primary-dark); }

/* ── 文章卡片 ─────────────────────────────────────── */
.post-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--c-border-strong);
  transform: translateY(-1px);
}

.post-card-title {
  display: block;
  font-size: 1.22rem;
  font-weight: 650;
  color: var(--c-text);
  margin-bottom: 8px;
  line-height: 1.45;
}

.post-card-title:hover { color: var(--c-primary-dark); }

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  margin-bottom: 12px;
}

.post-card-meta-bottom { margin: 12px 0 0; }

.post-card-cover {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border: 1px solid var(--c-border);
}

.post-card-summary {
  margin: 0;
  color: var(--c-text-secondary);
  font-size: 0.94rem;
  line-height: 1.8;
}

.post-card-views { margin-left: auto; }

.chip {
  display: inline-block;
  padding: 2px 12px;
  border-radius: var(--radius-full);
  background: var(--c-bg-soft);
  color: var(--c-text-secondary);
  font-size: 0.78rem;
  transition: all 0.15s ease;
}

.chip:hover {
  background: var(--c-accent-soft);
  color: var(--c-accent-dark);
}

.chip-category { background: var(--c-primary-soft); color: var(--c-primary-darker); }
.chip-category:hover { background: var(--c-primary-light); color: var(--c-primary-darker); }

/* ── 文章页 ───────────────────────────────────────── */
.post-full {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 34px 38px;
  box-shadow: var(--shadow-xs);
}

@media (max-width: 640px) {
  .post-full { padding: 24px 20px; }
}

.post-title {
  font-size: 1.7rem;
  margin: 0 0 12px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--c-text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--c-border);
}

.post-cover { width: 100%; border-radius: var(--radius-sm); margin-bottom: 20px; border: 1px solid var(--c-border); }

/* 目录 */
.toc {
  background: var(--c-highlight);
  border: 1px solid var(--c-primary-light);
  border-left: 3px solid var(--c-primary);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  margin-bottom: 26px;
  font-size: 0.9rem;
}

.toc-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--c-primary-darker);
  font-size: 0.88rem;
}

.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { padding: 3px 0; }
.toc li a { color: var(--c-text-secondary); font-size: 0.88rem; }
.toc li a:hover { color: var(--c-primary-dark); }
.toc .toc-l2 { margin-left: 0; font-weight: 500; }
.toc .toc-l3 { margin-left: 18px; }
.toc .toc-l4 { margin-left: 36px; }
.toc .toc-l5, .toc .toc-l6 { margin-left: 54px; }

/* 正文 Markdown */
.markdown { overflow-wrap: break-word; color: var(--c-text); }
.markdown a { overflow-wrap: anywhere; }

.markdown h1, .markdown h2, .markdown h3,
.markdown h4, .markdown h5, .markdown h6 {
  line-height: 1.4;
  margin: 1.7em 0 0.7em;
  color: var(--c-text);
}

.markdown h2 {
  font-size: 1.35rem;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--c-border);
}

.markdown h3 { font-size: 1.15rem; }
.markdown h4 { font-size: 1.05rem; }

.markdown p { margin: 0.95em 0; }

.markdown img { max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--c-border); }

.markdown blockquote {
  margin: 1.1em 0;
  padding: 10px 18px;
  border-left: 3px solid var(--c-primary);
  background: var(--c-highlight);
  color: var(--c-text-secondary);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.markdown code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--c-primary-soft);
  color: var(--c-primary-darker);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
}

.markdown pre {
  background: #1b2a3a;
  color: #d7e2ee;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  line-height: 1.65;
  box-shadow: var(--shadow-sm);
  /* 长行自动换行：窄窗口下内容不再藏进横向滚动 */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
}

.markdown pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.85rem;
}

.markdown table {
  border-collapse: collapse;
  margin: 1.3em 0;
  max-width: 100%;
  font-size: 0.92rem;
  border-radius: var(--radius-xs);
  overflow-x: auto;
  display: block;
  white-space: nowrap;
}

.markdown table::-webkit-scrollbar { height: 8px; }
.markdown table::-webkit-scrollbar-thumb {
  background: var(--c-border-strong);
  border-radius: 4px;
}

.markdown th, .markdown td {
  border: 1px solid var(--c-border);
  padding: 7px 13px;
}

.markdown th { background: var(--c-bg-soft); font-weight: 600; }
.markdown tr:nth-child(even) td { background: var(--c-surface-alt); }

.markdown hr { border: none; border-top: 1px solid var(--c-border); margin: 2.2em 0; }

.markdown li { margin: 0.3em 0; }

.post-tags { margin-top: 30px; display: flex; gap: 8px; flex-wrap: wrap; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px dashed var(--c-border-strong);
  font-size: 0.92rem;
}

.post-nav a {
  color: var(--c-text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  background: var(--c-bg-soft);
  transition: all 0.15s ease;
}

.post-nav a:hover { background: var(--c-primary-soft); color: var(--c-primary-dark); }

/* ── 评论 ─────────────────────────────────────────── */
.comments { margin-top: 44px; }

.comments h2 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--c-primary);
}

.comment { display: flex; gap: 13px; margin: 22px 0; }

.comment-avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--c-primary-soft);
  color: var(--c-primary-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.comment-main { flex: 1; min-width: 0; }

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--c-text-muted);
}

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

.comment-body {
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  margin-top: 7px;
  font-size: 0.94rem;
}

.comment-body p { margin: 0.4em 0; }

.comment-empty { color: var(--c-text-muted); font-size: 0.92rem; }

.comment-form { margin-top: 30px; }

.comment-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.comment-form input, .comment-form textarea {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-family: inherit;
  font-size: 0.92rem;
  background: var(--c-surface-alt);
  color: var(--c-text);
  outline: none;
  transition: all 0.15s ease;
}

.comment-form input:focus, .comment-form textarea:focus {
  border-color: var(--c-primary);
  background: var(--c-surface);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}

.comment-form textarea { resize: vertical; }

.comment-form button {
  margin-top: 12px;
  background: var(--c-primary);
  border: none;
  color: #fff;
  padding: 9px 26px;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.comment-form button:hover { background: var(--c-primary-dark); box-shadow: var(--shadow-sm); }

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0;
}

/* ── 列表页头 / 分页 / 空态 / flash ──────────────── */
.listing-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
}

.listing-header h1 { font-size: 1.35rem; margin: 0; }
.listing-header .count {
  color: var(--c-text-muted);
  font-size: 0.85rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-full);
  padding: 1px 12px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 30px 0;
  font-size: 0.92rem;
}

.page-link {
  color: var(--c-text-secondary);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-full);
  padding: 6px 18px;
  transition: all 0.15s ease;
}

.page-link:hover {
  background: var(--c-primary-soft);
  border-color: var(--c-primary-light);
  color: var(--c-primary-dark);
}

.page-info { color: var(--c-text-muted); }

.empty {
  background: var(--c-surface);
  border: 1px dashed var(--c-border-strong);
  border-radius: var(--radius-md);
  padding: 44px;
  text-align: center;
  color: var(--c-text-muted);
}

.flash {
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}

.flash.info { background: var(--c-primary-soft); color: var(--c-primary-darker); border: 1px solid var(--c-primary-light); }
.flash.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── 后台 ─────────────────────────────────────────── */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-nav a {
  color: var(--c-text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  transition: all 0.15s ease;
}

.admin-nav a.active {
  color: var(--c-primary-dark);
  background: var(--c-primary-soft);
  font-weight: 600;
}

.admin-nav a:hover { color: var(--c-primary-dark); background: var(--c-primary-soft); }

.admin-nav .btn-new {
  margin-left: auto;
  color: #fff;
  background: var(--c-primary);
  padding: 7px 18px;
  border-radius: var(--radius-full);
}

.admin-nav .btn-new:hover { background: var(--c-primary-dark); }

.admin-subnav { display: flex; gap: 6px; margin-bottom: 20px; font-size: 0.9rem; }
.admin-subnav a { color: var(--c-text-secondary); padding: 4px 12px; border-radius: var(--radius-full); }
.admin-subnav a.active { color: var(--c-primary-dark); background: var(--c-primary-soft); font-weight: 600; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.9rem;
  box-shadow: var(--shadow-xs);
}

.admin-table th, .admin-table td {
  padding: 11px 15px;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
}

.admin-table th { background: var(--c-bg-soft); color: var(--c-text-secondary); font-weight: 600; }
.admin-table tr:last-child td { border-bottom: none; }

.status { font-size: 0.78rem; padding: 2px 10px; border-radius: var(--radius-full); }
.status-publish, .status-approved { background: var(--c-primary-soft); color: var(--c-primary-darker); }
.status-draft, .status-waiting { background: #fffbeb; color: #b45309; }
.status-hidden, .status-spam { background: #fef2f2; color: #b91c1c; }

.inline-form, .admin-comment-actions form { display: inline; }

button.danger { color: var(--c-danger) !important; }

.admin-form label {
  display: block;
  margin-bottom: 15px;
  font-size: 0.88rem;
  color: var(--c-text-secondary);
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="url"],
.admin-form input[type="number"],
.admin-form select,
.admin-form textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--c-text);
  background: var(--c-surface-alt);
  outline: none;
  transition: all 0.15s ease;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: var(--c-primary);
  background: var(--c-surface);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}

.admin-form textarea { font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.65; }

.admin-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
}

.admin-form button[type="submit"] {
  background: var(--c-primary);
  border: none;
  color: #fff;
  padding: 10px 30px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.admin-form button[type="submit"]:hover { background: var(--c-primary-dark); }

.admin-comment {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 15px 19px;
  margin-bottom: 14px;
}

.admin-comment-head { display: flex; gap: 12px; align-items: baseline; font-size: 0.86rem; flex-wrap: wrap; }
.admin-comment-head time { color: var(--c-text-muted); }
.admin-comment-post { font-size: 0.84rem; color: var(--c-text-muted); margin: 5px 0; }
.admin-comment-body {
  font-size: 0.92rem;
  white-space: pre-wrap;
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xs);
  padding: 11px 15px;
  margin: 9px 0;
}

.admin-comment-actions { display: flex; gap: 10px; }

.admin-comment-actions button {
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  border-radius: var(--radius-full);
  padding: 4px 16px;
  font-size: 0.84rem;
  color: var(--c-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-comment-actions button:hover {
  border-color: var(--c-primary-light);
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
}

.login-box {
  max-width: 370px;
  margin: 70px auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.login-box h1 { font-size: 1.3rem; margin-top: 0; }

.login-box label { display: block; margin-bottom: 15px; font-size: 0.88rem; color: var(--c-text-secondary); }

.login-box input {
  display: block;
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 0.95rem;
  background: var(--c-surface-alt);
  outline: none;
  transition: all 0.15s ease;
}

.login-box input:focus {
  border-color: var(--c-primary);
  background: var(--c-surface);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}

.login-box button {
  width: 100%;
  background: var(--c-primary);
  border: none;
  color: #fff;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.login-box button:hover { background: var(--c-primary-dark); }

.logout-form { margin-left: 8px; }

.logout-form button {
  border: none;
  background: none;
  color: var(--c-text-muted);
  cursor: pointer;
  font-size: 0.92rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.logout-form button:hover { color: var(--c-danger); background: #fef2f2; }

/* ── 归档时间线页 ─────────────────────────────────── */
.archive-full { display: flex; flex-direction: column; gap: 28px; }

.archive-year-section {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  box-shadow: var(--shadow-xs);
}

.archive-year {
  font-size: 1.15rem;
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.archive-year-count {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--c-text-muted);
  background: var(--c-primary-soft);
  color: var(--c-primary-darker);
  border-radius: var(--radius-full);
  padding: 1px 10px;
}

.archive-post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--c-border);
  margin-left: 6px;
}

.archive-post-list li {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 6px 0 6px 18px;
}

.archive-post-list li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-primary-light);
  border: 2px solid var(--c-primary);
}

.archive-post-list time {
  flex: none;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  font-variant-numeric: tabular-nums;
}

.archive-post-list a { color: var(--c-text-secondary); font-size: 0.94rem; }
.archive-post-list a:hover { color: var(--c-primary-dark); }

/* ── 归档页年份导航 ───────────────────────────────── */
.archive-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  position: sticky;
  top: 70px;
  z-index: 9;
  padding: 8px 4px;
  margin: -8px -4px 20px;
  background: linear-gradient(var(--c-bg) 82%, transparent);
}

.archive-nav-link {
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  color: var(--c-text-secondary);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-full);
  padding: 3px 14px;
  transition: all 0.15s ease;
}

.archive-nav-link:hover {
  color: var(--c-primary-dark);
  background: var(--c-primary-soft);
  border-color: var(--c-primary-light);
}

/* 年份区块锚点落点让出吸顶空间 */
.archive-year-section { scroll-margin-top: 132px; }

/* ── 归档列表行交互升级 ──────────────────────────── */
.archive-post-list li {
  border-radius: var(--radius-xs);
  transition: background 0.15s ease;
}

.archive-post-list li:hover { background: var(--c-primary-soft); }

.archive-post-list li:hover::before {
  background: var(--c-primary);
  box-shadow: 0 0 0 4px var(--c-primary-soft);
}

.archive-post-list time {
  min-width: 96px;
  letter-spacing: 0.02em;
}

.archive-post-list a { flex: 1; }

@media (max-width: 560px) {
  .archive-post-list li { flex-direction: column; gap: 2px; }
  .archive-post-list time { min-width: 0; }
}

/* ── 回到顶部 ───────────────────────────────────── */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 28px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--c-primary-light);
  background: var(--c-surface);
  color: var(--c-primary-dark);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
  z-index: 20;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover { background: var(--c-primary-soft); }

/* ── 404 页 ──────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 70px 20px 50px;
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--c-primary-light);
  -webkit-text-stroke: 2px var(--c-primary);
  letter-spacing: 0.05em;
}

.error-title { font-size: 1.4rem; margin: 18px 0 8px; }

.error-msg { color: var(--c-text-muted); font-size: 0.95rem; margin: 0 0 26px; }

.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.error-btn {
  display: inline-block;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 26px;
  font-size: 0.93rem;
  font-weight: 500;
  transition: background 0.15s ease;
}

.error-btn:hover { background: var(--c-primary-dark); }

.error-btn-ghost {
  background: var(--c-surface);
  color: var(--c-text-secondary);
  border: 1px solid var(--c-border);
}

.error-btn-ghost:hover { background: var(--c-primary-soft); color: var(--c-primary-dark); }

/* ── 键盘导航焦点态 ──────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ── 动效降级 ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ── 打印样式 ────────────────────────────────────── */
@media print {
  .site-header,
  .site-footer,
  .archive-nav,
  .back-to-top,
  .sidebar,
  .comment-form,
  .pagination,
  .flash {
    display: none !important;
  }

  body { background: #fff; }
  .post-full,
  .archive-year-section { border: none; box-shadow: none; }
}

/* 锚点跳转的平滑滚动 */
html { scroll-behavior: smooth; }

/* ── 首页 Hero ───────────────────────────────────── */
.hero {
  text-align: center;
  padding: 44px 20px 40px;
  margin-bottom: 32px;
  background:
    radial-gradient(640px 220px at 50% -40px, var(--c-primary-soft), transparent),
    var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.hero-title {
  font-size: 2rem;
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}

.hero-desc {
  color: var(--c-text-secondary);
  margin: 0 0 22px;
  font-size: 0.98rem;
}

.hero-search {
  display: flex;
  max-width: 480px;
  margin: 0 auto 20px;
  gap: 8px;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font-size: 0.95rem;
  background: var(--c-surface-alt);
  color: var(--c-text);
  outline: none;
  transition: all 0.15s ease;
}

.hero-search input:focus {
  border-color: var(--c-primary);
  background: var(--c-surface);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}

.hero-search button {
  border: none;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 10px 26px;
  font-size: 0.93rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.hero-search button:hover { background: var(--c-primary-dark); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

.hero-stat {
  background: var(--c-bg-soft);
  border-radius: var(--radius-full);
  padding: 3px 14px;
}

.hero-stat b { color: var(--c-primary-darker); font-weight: 700; }

.hero-rss {
  color: var(--c-text-muted);
  background: var(--c-bg-soft);
  border-radius: var(--radius-full);
  padding: 3px 14px;
}

.hero-rss:hover { background: var(--c-primary-soft); color: var(--c-primary-dark); }

/* ── 文章卡片（缩略图 + 精选态）────────────────── */
.post-card { display: flex; gap: 18px; }

.post-card-thumb {
  flex: none;
  width: 168px;
  align-self: stretch;
  min-height: 110px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--c-border);
  background: var(--c-bg-soft);
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.post-card:hover .post-card-thumb img { transform: scale(1.04); }

.post-card-body { flex: 1; min-width: 0; }

.post-card-title { display: block; margin-bottom: 8px; }

.post-card .post-card-meta:not(.post-card-meta-bottom) { margin-bottom: 8px; }

.post-card-views { white-space: nowrap; }

.chip-featured {
  background: var(--c-primary);
  color: #fff;
  margin-left: auto;
}

.chip-count {
  margin-left: 4px;
  font-size: 0.7rem;
  opacity: 0.7;
}

/* 精选大卡：第一篇 */
.post-card-featured {
  border-color: var(--c-primary-light);
  background: linear-gradient(135deg, var(--c-highlight), var(--c-surface) 45%);
}

.post-card-featured .post-card-title { font-size: 1.4rem; }

.post-card-featured .post-card-summary { font-size: 0.98rem; }

/* ── 侧栏列表 ───────────────────────────────────── */
.side-list { list-style: none; margin: 0; padding: 0; }

.side-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.88rem;
}

.side-list li a { color: var(--c-text-secondary); }
.side-list li a:hover { color: var(--c-primary-dark); }

.side-list .count {
  color: var(--c-text-muted);
  font-size: 0.76rem;
  background: var(--c-bg-soft);
  border-radius: var(--radius-full);
  padding: 0 9px;
  min-width: 24px;
  text-align: center;
}

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

/* ── 文章页布局：宽屏下右侧吸附目录 ────────────── */
.post-layout { display: block; }

.post-aside { display: none; }

@media (min-width: 1240px) {
  .container { max-width: 1080px; }

  .post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 232px;
    gap: 32px;
    align-items: start;
  }

  .post-aside {
    display: block;
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 120px);
    overflow: auto;
    overflow-wrap: anywhere;
  }

  .post-aside::-webkit-scrollbar { width: 6px; }
  .post-aside::-webkit-scrollbar-thumb {
    background: var(--c-border-strong);
    border-radius: 3px;
  }

  .post-aside .toc { position: static; margin-bottom: 0; }
}

.post-header { margin-bottom: 4px; }

.post-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--c-text-muted);
  display: inline-block;
}

/* ── 阅读进度条 ─────────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-dark));
  z-index: 30;
  transition: width 0.05s linear;
}

/* ── 代码块复制按钮 ─────────────────────────────── */
.markdown pre { position: relative; }

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid rgba(215, 226, 238, 0.25);
  background: rgba(27, 42, 58, 0.65);
  color: #d7e2ee;
  border-radius: var(--radius-xs);
  padding: 3px 12px;
  font-size: 0.76rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.markdown pre:hover .copy-btn,
.copy-btn:focus-visible,
.copy-btn.copied { opacity: 1; }

.copy-btn.copied {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

/* ── 页脚技术标注 ────────────────────────────────── */
.footer-powered {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--c-text-muted);
}

.footer-powered a {
  color: var(--c-text-secondary);
  font-weight: 500;
  border-bottom: 1px dashed var(--c-border-strong);
  padding-bottom: 1px;
}

.footer-powered a:hover {
  color: var(--c-primary-dark);
  border-bottom-color: var(--c-primary);
}

.footer-dot { margin: 0 4px; }
