/* ===================================
   MijiDoc — 知识库文档主题
   灵感来自 mijidoc-demo.mijihub.cn
   8 色主题 + 明暗模式 + 卡片式分类
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* === 7 主题色 === */
:root {
  --theme-h: 215; --theme-s: 16%; --theme-l: 47%;
}
.theme-default { --theme-h: 215; --theme-s: 16%; --theme-l: 47%; }
.theme-blue    { --theme-h: 221; --theme-s: 83%; --theme-l: 53%; }
.theme-orange  { --theme-h: 25;  --theme-s: 95%; --theme-l: 53%; }
.theme-green   { --theme-h: 142; --theme-s: 71%; --theme-l: 45%; }
.theme-red     { --theme-h: 0;   --theme-s: 84%; --theme-l: 60%; }
.theme-cyan    { --theme-h: 189; --theme-s: 94%; --theme-l: 43%; }
.theme-purple  { --theme-h: 271; --theme-s: 81%; --theme-l: 56%; }

/* Primary colors — MUST be alongside theme vars for CSS cascade */
.theme-default,
.theme-blue,
.theme-orange,
.theme-green,
.theme-red,
.theme-cyan,
.theme-purple,
body {
  --primary: hsl(var(--theme-h), var(--theme-s), var(--theme-l));
  --primary-light: hsl(var(--theme-h), var(--theme-s), 94%);
  --primary-dark: hsl(var(--theme-h), var(--theme-s), 35%);
}

:root {
  --primary: hsl(var(--theme-h), var(--theme-s), var(--theme-l));
  --primary-light: hsl(var(--theme-h), var(--theme-s), 94%);
  --primary-dark: hsl(var(--theme-h), var(--theme-s), 35%);

  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --radius: 8px;
  --radius-sm: 6px;

  --font-sans: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", Consolas, monospace;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;
  --space-4xl: 64px;
}

/* === Dark Mode === */
html.dark-theme {
  color-scheme: dark;
  --bg: #111827;
  --bg-secondary: #1f2937;
  --bg-card: #1f2937;
  --text: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border: #374151;
  --border-light: #1f2937;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,.4);
  --primary: hsl(var(--theme-h), var(--theme-s), 60%);
  --primary-light: hsl(var(--theme-h), var(--theme-s), 20%);
  --primary-dark: hsl(var(--theme-h), var(--theme-s), 75%);
}

/* Fallback: respect system preference on first visit (before JS runs) */
@media (prefers-color-scheme: dark) {
  html:not(.theme-loaded) {
    color-scheme: dark;
    --bg: #111827;
    --bg-secondary: #1f2937;
    --bg-card: #1f2937;
    --text: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border: #374151;
    --border-light: #1f2937;
    --shadow: 0 1px 3px rgba(0,0,0,.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,.4);
  }
}

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
  margin-left: var(--space-sm);
}

.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* SVG icons inside toggle */
.theme-toggle svg {
  width: 18px;
  height: 18px;
}

html:not(.dark-theme) .icon-moon { display: none; }
html.dark-theme .icon-sun        { display: none; }

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s ease, color 0.3s ease;
}

html.font-small  { font-size: 14px; }
html.font-medium { font-size: 16px; }
html.font-large  { font-size: 18px; }

a {
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
a:hover { color: var(--primary-dark); }

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===================================
   Layout
   =================================== */

.max-narrow  { --max-w: 720px; }
.max-medium  { --max-w: 960px; }
.max-wide    { --max-w: 1200px; }

.site-main {
  max-width: var(--max-w, 960px);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ===================================
   Header — 顶部导航
   =================================== */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: var(--max-w, 960px);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

.brand a { color: var(--text); }
.brand a:hover { color: var(--primary); }

.brand-logo {
  height: 30px;
  width: auto;
  max-height: 40px;
  vertical-align: middle;
}

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

.site-nav a {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* ===================================
   Appearance Toolbar
   =================================== */

.appearance-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) 0;
}

.appearance-inner {
  max-width: var(--max-w, 960px);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
  font-size: 13px;
  color: var(--text-secondary);
}

.appearance-group {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.appearance-label {
  white-space: nowrap;
  margin-right: var(--space-xs);
}

.appearance-group button,
.appearance-group a {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  min-height: 32px;
  transition: all 0.15s ease;
}

.appearance-group button:hover,
.appearance-group button.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* Theme color dots */
.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  min-height: unset;
  transition: transform 0.15s ease;
}

.color-dot:hover,
.color-dot.active {
  transform: scale(1.2);
  border-color: var(--text);
}

.color-dot.default { background: #64748b; }
.color-dot.blue    { background: #3b82f6; }
.color-dot.orange  { background: #f97316; }
.color-dot.green   { background: #22c55e; }
.color-dot.red     { background: #ef4444; }
.color-dot.cyan    { background: #06b6d4; }
.color-dot.purple  { background: #a855f7; }

/* ===================================
   Hero — 首页大图区
   =================================== */

.hero-section {
  padding: var(--space-4xl) 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto var(--space-xl);
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 32px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.hero-cta:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* ===================================
   Section Headers
   =================================== */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  position: relative;
  padding-left: var(--space-md);
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: var(--primary);
  border-radius: 2px;
}

.section-more {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.section-more:hover { color: var(--primary); }

/* ===================================
   Recommended + Latest Posts
   =================================== */

.posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-3xl);
}

@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

.posts-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.posts-column .post-card:nth-child(n+5) { display: none; }

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  transition: all 0.2s ease;
}

.post-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.post-card .post-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.post-card .post-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: var(--space-xs);
}

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

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

.post-card .post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.post-card .post-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
  font-weight: 500;
}

.post-card .post-tag:hover {
  background: var(--primary);
  color: #fff;
}

/* ===================================
   Memos — 闪念笔记
   =================================== */

.memos-page {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.memos-page .page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.memos-page .page-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: var(--space-xl);
}

.memos-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

.memo-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: var(--space-2xl);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}

.memo-bubble:hover {
  box-shadow: var(--shadow-md);
}

.memo-date {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: var(--space-lg);
  position: relative;
  padding-bottom: var(--space-md);
}

.memo-date::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.memo-text {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
}

.memo-text p {
  margin: 0;
}

.memo-text p + p {
  margin-top: var(--space-md);
}

.memo-text a {
  color: var(--primary);
}

.memo-text img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin-top: var(--space-md);
}

/* ===================================
   Category Cards (标签分类)
   =================================== */

.categories-section {
  margin-bottom: var(--space-3xl);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-lg);
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  transition: all 0.2s ease;
}

.category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.category-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.category-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}

.category-random {
  font-size: 13px;
  line-height: 1.5;
}

.category-random a {
  color: var(--text-secondary);
}

.category-random a:hover {
  color: var(--primary);
}

.category-posts {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.category-posts a {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
  display: block;
}

.category-posts a:last-child {
  border-bottom: none;
}

.category-posts a:hover {
  color: var(--primary);
}

/* ===================================
   Blog / Tag list page (flat list)
   =================================== */

.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-xl) 0 var(--space-3xl);
}

.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  transition: all 0.2s ease;
}

.list-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.list-card .list-date {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-mono);
  min-width: 5em;
}

.list-card .list-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

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

.list-card .list-title a:hover {
  color: var(--primary);
}

/* ===================================
   Page Header
   =================================== */

.page-header {
  padding: var(--space-2xl) 0 var(--space-lg);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-xl);
}

.page-header .page-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ===================================
   Pagination
   =================================== */

.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-xl) 0 var(--space-3xl);
}

.pagination a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  min-height: 44px;
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ===================================
   Post Detail
   =================================== */

.post-detail {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.post-detail .post-header {
  margin-bottom: var(--space-xl);
  padding-bottom: 0;
}

.post-detail .post-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.post-detail .post-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: var(--space-lg);
}

.post-detail .post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.post-detail .post-meta .tag {
  font-size: 12px;
  padding: 3px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
  font-weight: 500;
}

.post-detail .post-meta .tag:hover {
  background: var(--primary);
  color: #fff;
}

.post-content {
  font-size: inherit;
  line-height: 1.85;
}

.post-content p { margin: 0 0 var(--space-lg); }
.post-content p:empty { display: none; }

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

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--space-xl) auto;
  border-radius: var(--radius-sm);
}

.post-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: var(--space-2xl) 0 var(--space-md);
}

.post-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: var(--space-xl) 0 var(--space-sm);
}

.post-content blockquote {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.post-content blockquote p { margin: 0; }

.post-content ul, .post-content ol {
  margin: var(--space-md) 0 var(--space-lg);
  padding-left: var(--space-2xl);
}

.post-content li { margin-bottom: var(--space-xs); }

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--primary-dark);
}

.post-content pre {
  margin: var(--space-lg) 0;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.7;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-2xl) 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  font-size: 14px;
}

.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
}

.post-content th {
  background: var(--bg-secondary);
  font-weight: 600;
}

/* Post tags */
.post-tags-section {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.post-tags-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-right: var(--space-xs);
}

.post-tag {
  font-size: 12px;
  padding: 3px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
}

.post-tag:hover {
  background: var(--primary);
  color: #fff;
}

/* Prev / Next */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.post-nav a {
  display: block;
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.post-nav a:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.post-nav .nav-label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.post-nav .nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
}

/* ===================================
   Comments
   =================================== */

#comments {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.comments-header {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

/* ===================================
   Tags Page
   =================================== */

.tags-page {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.tags-page .page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.tags-page .page-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: var(--space-xl);
}

.tags-wall {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.tag-bubble {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow);
  font-size: 15px;
  color: var(--text);
  transition: all 0.2s ease;
}

.tag-bubble:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: var(--primary);
}

.tag-name {
  font-weight: 600;
}

.tag-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 2px 10px;
  border-radius: 10px;
}

/* ===================================
   Links / 友链
   =================================== */

.links-page {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.links-page .page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.links-page .page-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: var(--space-xl);
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.link-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--text);
  transition: all 0.2s ease;
}

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

.link-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border-light);
}

.link-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.link-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.link-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ===================================
   Archives — 时间线归档
   =================================== */

.archives-page {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.archives-page .page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.archives-page .page-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: var(--space-xl);
}

.archives-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.archive-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: var(--space-lg) var(--space-xl);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}

.archive-bubble:hover {
  box-shadow: var(--shadow-md);
}

.archive-date {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: var(--space-sm);
}

.archive-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: var(--space-sm);
}

.archive-title a { color: var(--text); }
.archive-title a:hover { color: var(--primary); }

.archive-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.archive-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
}

.archive-tag:hover {
  background: var(--primary);
  color: #fff;
}

/* ===================================
   404
   =================================== */

.error-page {
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
}

.error-code {
  font-size: 6rem;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
  margin-bottom: var(--space-md);
}

.error-message {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.error-link {
  display: inline-flex;
  padding: var(--space-sm) var(--space-2xl);
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
}

.error-link:hover { background: var(--primary-dark); color: #fff; }

/* ===================================
   Footer
   =================================== */

.site-footer {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary); }

/* ===================================
   Empty
   =================================== */

.empty-block {
  text-align: center;
  padding: var(--space-3xl) 0;
  color: var(--text-muted);
  font-size: 15px;
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 768px) {
  .hero-title { font-size: 1.75rem; }
  .hero-subtitle { font-size: 1rem; }
  .section-title { font-size: 1.1rem; }

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

  .list-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

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

@media (max-width: 480px) {
  .posts-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr; }
  .site-nav a { font-size: 13px; padding: 4px 8px; }
  .memo-bubble { padding: var(--space-lg); }
}
