/* ==========================================================================
   Mono Theme — style.css
   极致极简主义，严格灰度，硬直角，线框图美学
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS 变量
   -------------------------------------------------------------------------- */
:root {
  /* 颜色 */
  --color-bg:           #F4F4F4;
  --color-surface:      #FFFFFF;
  --color-border:       #111111;
  --color-border-light: #CCCCCC;
  --color-border-mid:   #888888;
  --color-text:         #111111;
  --color-text-muted:   #555555;
  --color-text-faint:   #999999;
  --color-hover-bg:     #F0F0F0;
  --color-header-bg:    #FFFFFF;
  --color-footer-bg:    #222222;
  --color-footer-text:  #CCCCCC;

  /* 排版 */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Noto Sans SC", "WenQuanYi Micro Hei", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;

  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.5rem;    /* 24px */
  --text-3xl:  1.875rem;  /* 30px */

  --leading-tight:  1.3;
  --leading-normal: 1.7;
  --leading-loose:  2;

  /* 间距 */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* 布局 */
  --layout-max:     1200px;
  --sidebar-width:  260px;
  --header-height:  56px;

  /* 边框 */
  --border:       1px solid var(--color-border);
  --border-light: 1px solid var(--color-border-light);
  --border-mid:   1px solid var(--color-border-mid);
  --border-2:     2px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

ul, ol {
  list-style: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* --------------------------------------------------------------------------
   3. 外层页面容器
   -------------------------------------------------------------------------- */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.layout-container {
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* 主体双栏区域 */
.layout-body {
  flex: 1;
  max-width: var(--layout-max);
  margin: var(--space-6) auto;
  padding: 0 var(--space-6);
  width: 100%;
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}

/* --------------------------------------------------------------------------
   4. 顶部导航
   -------------------------------------------------------------------------- */
.site-header {
  background-color: var(--color-header-bg);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

/* Logo */
.site-logo {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--color-text);
  text-decoration: none;
}

.site-logo:hover {
  text-decoration: none;
  opacity: 0.75;
}

/* 导航菜单 */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-menu a {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  border-left: var(--border-light);
  transition: background 0.1s;
}

.nav-menu a:first-child {
  border-left: none;
}

.nav-menu a:hover {
  background-color: var(--color-hover-bg);
  text-decoration: none;
}

.nav-menu a.active {
  background-color: var(--color-text);
  color: var(--color-surface);
}

/* 搜索按钮 */
.header-search {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.btn-search {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--border);
  background: var(--color-surface);
  cursor: pointer;
  transition: background 0.1s;
}

.btn-search:hover {
  background: var(--color-hover-bg);
}

.btn-search svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-text);
  fill: none;
}

/* 移动端汉堡菜单按钮 */
.btn-hamburger {
  display: none;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: var(--border);
  background: var(--color-surface);
  cursor: pointer;
}

.btn-hamburger span {
  display: block;
  width: 16px;
  height: 1px;
  background: var(--color-text);
  transition: transform 0.2s, opacity 0.2s;
}

.btn-hamburger.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.btn-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.btn-hamburger.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   5. 侧边栏
   -------------------------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* 侧边栏通用块 */
.sidebar-block {
  background: var(--color-surface);
  border: var(--border);
}

.sidebar-block-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-light);
  background: var(--color-hover-bg);
}

/* 个人信息块 */
.sidebar-profile {
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border: var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-hover-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-placeholder svg {
  width: 32px;
  height: 32px;
  stroke: var(--color-border-light);
  fill: none;
}

.profile-name {
  font-size: var(--text-base);
  font-weight: 700;
  line-height: var(--leading-tight);
}

.profile-bio {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
  word-break: break-all;
}

/* 社交链接 */
.sidebar-social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.social-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: var(--border-light);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  transition: border-color 0.1s, color 0.1s;
}

.social-link:hover {
  border-color: var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}

.social-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

/* 分类列表 */
.sidebar-list {
  padding: var(--space-2) 0;
}

.sidebar-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-list-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
  transition: background 0.1s;
}

.sidebar-list-item a:hover {
  background: var(--color-hover-bg);
  text-decoration: none;
}

.sidebar-list-count {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}

/* 标签云 */
.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.sidebar-tag {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border: var(--border-light);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  transition: border-color 0.1s, color 0.1s, background 0.1s;
}

.sidebar-tag:hover {
  border-color: var(--color-border);
  color: var(--color-text);
  background: var(--color-hover-bg);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   6. 主内容区
   -------------------------------------------------------------------------- */
.main-feed {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* --------------------------------------------------------------------------
   7. 文章卡片
   -------------------------------------------------------------------------- */
.post-card {
  background: var(--color-surface);
  border: var(--border);
  display: flex;
  gap: 0;
  transition: background 0.1s;
}

.post-card:hover {
  background: var(--color-hover-bg);
}

/* 缩略图 */
.card-thumbnail {
  display: block;
  width: 180px;
  flex-shrink: 0;
  border-right: var(--border);
  overflow: hidden;
  aspect-ratio: 3 / 2;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}

.card-thumbnail:hover img {
  opacity: 0.85;
}

.card-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: var(--color-hover-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-right: var(--border);
}

.card-thumbnail-placeholder svg {
  width: 32px;
  height: 32px;
  stroke: var(--color-border-light);
  fill: none;
}

.card-thumbnail-placeholder span {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.05em;
}

/* 文章信息 */
.card-body {
  flex: 1;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: var(--leading-tight);
}

.card-title a {
  color: var(--color-text);
  text-decoration: none;
}

.card-title a:hover {
  text-decoration: underline;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.card-meta time {
  font-variant-numeric: tabular-nums;
}

.card-meta-sep {
  color: var(--color-border-light);
}

.card-meta a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.card-meta a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

.card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-readmore {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
  margin-top: auto;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1px;
}

.card-readmore:hover {
  text-decoration: none;
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   8. 分页
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: var(--border);
  background: var(--color-surface);
  overflow: hidden;
}

.pagination-item {
  display: block;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text);
  border-right: var(--border-light);
  transition: background 0.1s;
  text-decoration: none;
}

.pagination-item:last-child {
  border-right: none;
}

.pagination-item:hover {
  background: var(--color-hover-bg);
  text-decoration: none;
}

.pagination-item.current {
  background: var(--color-text);
  color: var(--color-surface);
  font-weight: 700;
}

.pagination-item.disabled {
  color: var(--color-text-faint);
  cursor: not-allowed;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   9. 页脚
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--color-footer-bg);
  border-top: var(--border);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.footer-copyright {
  font-size: var(--text-sm);
  color: var(--color-footer-text);
  line-height: var(--leading-normal);
}

.footer-links {
  display: flex;
  gap: var(--space-5);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-footer-text);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.1s;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   10. 文章详情页
   -------------------------------------------------------------------------- */
.post-layout {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}

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

.post-toc-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
}

/* 文章头部 */
.post-header {
  background: var(--color-surface);
  border: var(--border);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.post-header-body {
  padding: var(--space-8);
}

.post-cover {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  display: block;
}

.post-category-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  border: var(--border-light);
  padding: 2px var(--space-2);
  margin-bottom: var(--space-3);
  text-decoration: none;
}

.post-category-label:hover {
  border-color: var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}

.post-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  padding-top: var(--space-4);
  border-top: var(--border-light);
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.post-meta-item svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}

/* 文章正文 */
.post-content {
  background: var(--color-surface);
  border: var(--border);
  border-top: none;
  padding: var(--space-8);
}

/* 正文排版 */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-weight: 700;
  line-height: var(--leading-tight);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
}

.post-content h2 {
  font-size: var(--text-2xl);
  border-bottom: var(--border-light);
}

.post-content h3 {
  font-size: var(--text-xl);
}

.post-content h4 {
  font-size: var(--text-lg);
}

.post-content p {
  margin-bottom: var(--space-5);
  line-height: var(--leading-normal);
}

.post-content a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover {
  opacity: 0.65;
}

.post-content ul,
.post-content ol {
  margin-bottom: var(--space-5);
  padding-left: var(--space-6);
}

.post-content ul {
  list-style: disc;
}

.post-content ol {
  list-style: decimal;
}

.post-content li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-normal);
}

.post-content blockquote {
  border-left: var(--border-2);
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  background: var(--color-hover-bg);
  color: var(--color-text-muted);
  font-style: italic;
}

.post-content pre {
  background: var(--color-text);
  color: #F4F4F4;
  padding: var(--space-5);
  overflow-x: auto;
  margin-bottom: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  border: var(--border);
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.post-content p code,
.post-content li code {
  background: var(--color-hover-bg);
  border: var(--border-light);
  padding: 1px var(--space-2);
  font-size: var(--text-sm);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border: var(--border);
  margin: var(--space-5) auto;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
}

.post-content th,
.post-content td {
  border: var(--border-light);
  padding: var(--space-3) var(--space-4);
  text-align: left;
}

.post-content th {
  background: var(--color-hover-bg);
  font-weight: 700;
}

.post-content hr {
  border: none;
  border-top: var(--border-light);
  margin: var(--space-8) 0;
}

/* 文章标签 */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  border: var(--border);
  border-top: none;
  background: var(--color-surface);
}

.post-tag {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border: var(--border-light);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: border-color 0.1s, color 0.1s;
}

.post-tag:hover {
  border-color: var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}

/* 上下篇导航 */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.post-nav-item {
  background: var(--color-surface);
  border: var(--border);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-decoration: none;
  transition: background 0.1s;
}

.post-nav-item:hover {
  background: var(--color-hover-bg);
  text-decoration: none;
}

.post-nav-item.prev {
  text-align: left;
}

.post-nav-item.next {
  text-align: right;
  grid-column: 2;
}

.post-nav-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.post-nav-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* TOC 侧边栏 */
.toc-block {
  background: var(--color-surface);
  border: var(--border);
}

.toc-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-light);
  background: var(--color-hover-bg);
}

.toc-list {
  padding: var(--space-3) 0;
  max-height: 60vh;
  overflow-y: auto;
}

.toc-item {
  display: block;
}

.toc-item a {
  display: block;
  padding: var(--space-1) var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
  transition: color 0.1s, background 0.1s;
  text-decoration: none;
  border-left: 2px solid transparent;
}

.toc-item a:hover {
  color: var(--color-text);
  background: var(--color-hover-bg);
  text-decoration: none;
}

.toc-item a.active {
  color: var(--color-text);
  font-weight: 600;
  border-left-color: var(--color-text);
  background: var(--color-hover-bg);
}

.toc-item.toc-h3 a {
  padding-left: var(--space-8);
}

.toc-item.toc-h4 a {
  padding-left: calc(var(--space-8) + var(--space-4));
}

/* --------------------------------------------------------------------------
   11. 归档页
   -------------------------------------------------------------------------- */
.archive-group {
  margin-bottom: var(--space-6);
}

.archive-year {
  font-size: var(--text-2xl);
  font-weight: 700;
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface);
  border: var(--border);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.archive-year-count {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-faint);
}

.archive-list {
  background: var(--color-surface);
  border: var(--border);
  border-top: none;
}

.archive-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-5);
  border-bottom: var(--border-light);
  transition: background 0.1s;
}

.archive-item:last-child {
  border-bottom: none;
}

.archive-item:hover {
  background: var(--color-hover-bg);
}

.archive-date {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.archive-title {
  font-size: var(--text-base);
  color: var(--color-text);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.archive-title:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   12. 标签云 & 分类页
   -------------------------------------------------------------------------- */
.page-header {
  background: var(--color-surface);
  border: var(--border);
  padding: var(--space-6) var(--space-8);
  margin-bottom: var(--space-4);
}

.page-header-title {
  font-size: var(--text-2xl);
  font-weight: 700;
}

.page-header-desc {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.tags-cloud {
  background: var(--color-surface);
  border: var(--border);
  padding: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: baseline;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: var(--border-light);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: border-color 0.1s, color 0.1s, background 0.1s;
}

.tag-cloud-item:hover {
  border-color: var(--color-border);
  color: var(--color-text);
  background: var(--color-hover-bg);
  text-decoration: none;
}

.tag-cloud-count {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* 分类卡片网格 */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.category-card {
  background: var(--color-surface);
  border: var(--border);
  display: block;
  text-decoration: none;
  transition: background 0.1s;
}

.category-card:hover {
  background: var(--color-hover-bg);
  text-decoration: none;
}

.category-card-cover {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-bottom: var(--border);
  display: block;
}

.category-card-cover-placeholder {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--color-hover-bg);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-card-body {
  padding: var(--space-4);
}

.category-card-name {
  font-weight: 700;
  font-size: var(--text-base);
}

.category-card-count {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-1);
}

/* --------------------------------------------------------------------------
   13. 友情链接
   -------------------------------------------------------------------------- */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}

.link-card {
  background: var(--color-surface);
  border: var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  text-decoration: none;
  transition: background 0.1s;
}

.link-card:hover {
  background: var(--color-hover-bg);
  text-decoration: none;
}

.link-card-name {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
}

.link-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.link-card-url {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   14. 通用页面（关于）
   -------------------------------------------------------------------------- */
.prose-page {
  background: var(--color-surface);
  border: var(--border);
  padding: var(--space-8);
}

/* --------------------------------------------------------------------------
   15. 404 页面
   -------------------------------------------------------------------------- */
.error-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
}

.error-inner {
  background: var(--color-surface);
  border: var(--border);
  padding: var(--space-12) var(--space-10);
  text-align: center;
  max-width: 480px;
  width: 100%;
}

.error-code {
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-border-light);
  margin-bottom: var(--space-4);
}

.error-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.error-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.btn-back {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  border: var(--border);
  background: var(--color-text);
  color: var(--color-surface);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.1s;
}

.btn-back:hover {
  opacity: 0.8;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   16. 评论区
   -------------------------------------------------------------------------- */
.comment-section {
  background: var(--color-surface);
  border: var(--border);
  border-top: none;
  padding: var(--space-6) var(--space-8);
}

.comment-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  padding-bottom: var(--space-4);
  border-bottom: var(--border-light);
  margin-bottom: var(--space-5);
}

/* --------------------------------------------------------------------------
   17. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 220px;
  }

  .post-toc-sidebar {
    width: 200px;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
  }

  /* 汉堡菜单显示，导航隐藏 */
  .btn-hamburger {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: var(--border);
    flex-direction: column;
    z-index: 99;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu a {
    border-left: none;
    border-bottom: var(--border-light);
    padding: var(--space-4) var(--space-6);
  }

  .site-header {
    position: relative;
  }

  /* 双栏变单栏 */
  .layout-body {
    flex-direction: column;
    padding: 0 var(--space-4);
    margin: var(--space-4) auto;
  }

  .sidebar {
    width: 100%;
    order: -1;
  }

  /* 侧边栏折叠 */
  .sidebar-collapse-btn {
    display: flex;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border: var(--border);
    font-size: var(--text-sm);
    font-weight: 600;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
  }

  .sidebar-collapsible {
    display: none;
    flex-direction: column;
    gap: var(--space-3);
    padding-top: var(--space-3);
  }

  .sidebar-collapsible.open {
    display: flex;
  }

  /* 文章卡片 */
  .card-thumbnail {
    width: 120px;
  }

  /* 文章详情 */
  .post-layout {
    flex-direction: column;
  }

  .post-toc-sidebar {
    display: none;
  }

  .post-main {
    width: 100%;
  }

  .post-content table {
    display: block;
    overflow-x: auto;
  }

  .post-content pre {
    overflow-x: auto;
  }

  .post-title {
    font-size: var(--text-2xl);
  }

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

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-item.next {
    grid-column: 1;
    text-align: left;
  }

  /* 归档 */
  .archive-item {
    flex-direction: column;
    gap: var(--space-1);
  }

  /* 布局容器 */
  .layout-container {
    padding: 0 var(--space-4);
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-5) var(--space-4);
  }
}

@media (max-width: 480px) {
  .post-card {
    flex-direction: column;
  }

  .card-thumbnail {
    width: 100%;
    border-right: none;
    border-bottom: var(--border);
  }

  .categories-grid,
  .links-grid {
    grid-template-columns: 1fr;
  }
}
