/* ==========================================================================
   LeeYee — 个人博客与日常记录 (Editorial Anime Zine Style)
   遵循 DESIGN.md 去 AI 味 · 日系独立杂志 / 轻小说画集感设计规范
   ========================================================================== */

:root {
  /* === 1. 纸张背景与卡片表面（日间：温暖米白纸张 Warm Ivory Paper） === */
  --bg-primary: #faf8f6;
  --bg-secondary: #f4f0ec;
  --surface-card: #ffffff;
  --surface-card-hover: #fcfaf8;
  --surface-nav: rgba(250, 248, 246, 0.88);
  --surface-code: #f5f2ee;
  --surface-terminal: #18181b;

  /* === 2. 点缀色系统（柔和鼠尾草绿 & 静谧冷灰蓝） === */
  --primary: #5b7c70;
  --primary-deep: #4a685e;
  --primary-soft: rgba(91, 124, 112, 0.10);
  --secondary: #5b7a9c;
  --secondary-soft: rgba(91, 122, 156, 0.10);

  /* === 3. 文本色彩层级（高对比深炭墨色，拒绝纯黑与渐变） === */
  --text-primary: #262424;
  --text-secondary: #5a5552;
  --text-muted: #8c8580;
  --text-on-primary: #ffffff;

  /* === 4. 边框与克制阴影（1px 杂志网格细线） === */
  --border-color: #e8e2dc;
  --border-subtle: #f0ebe6;
  --border-hover: #d5cbc2;
  --shadow-subtle: 0 2px 6px rgba(38, 36, 36, 0.03);
  --shadow-hover: 0 8px 24px rgba(38, 36, 36, 0.06);

  /* === 5. 圆角与动效设计令牌 === */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* === 6. 字体栈规范（移除幼圆，采用现代无衬线 + 杂志衬线 + 严格等宽） === */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Noto Sans CJK SC", "HarmonyOS Sans SC", "Microsoft YaHei",
               "Segoe UI", Roboto, sans-serif;
  --font-serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC",
                "STSong", Georgia, serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "Fira Code", "SFMono-Regular",
               "Consolas", "Liberation Mono", monospace;
}

[data-theme="dark"] {
  /* === 夜间模式：哑光深炭灰（Matte Charcoal Night） === */
  --bg-primary: #16161a;
  --bg-secondary: #1e1e24;
  --surface-card: #1e1e24;
  --surface-card-hover: #24242b;
  --surface-nav: rgba(22, 22, 26, 0.88);
  --surface-code: #25252d;
  --surface-terminal: #121215;

  --primary: #91b6a8;
  --primary-deep: #a8cabb;
  --primary-soft: rgba(145, 182, 168, 0.14);
  --secondary: #7d9fc2;
  --secondary-soft: rgba(125, 159, 194, 0.14);

  --text-primary: #e6e4e0;
  --text-secondary: #a8a49e;
  --text-muted: #6e6a66;

  --border-color: #2c2c35;
  --border-subtle: #23232a;
  --border-hover: #3d3d4a;
  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.4);
}

/* === 基础重置 === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  line-height: 1.75;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--primary-soft);
  color: var(--primary-deep);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: var(--radius-pill);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* === 顶部阅读进度条（极细实色鼠尾草绿线） === */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--primary);
  z-index: 250;
  transition: width 0.1s ease-out, opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.reading-progress-bar.active {
  opacity: 1;
}

/* === 顶部极简导航栏（Editorial Header） === */
.site-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  background: var(--surface-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.navbar-inner {
  max-width: 1120px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.brand-title {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.nav-item {
  position: relative;
  height: 100%;
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--text-primary);
}

.nav-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 极简搜索框 */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input {
  width: 200px;
  height: 34px;
  padding: 0 28px 0 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-family: var(--font-sans);
  outline: none;
  transition: width 0.25s var(--ease-out), border-color 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  width: 240px;
  border-color: var(--primary);
}

.search-clear-btn {
  position: absolute;
  right: 7px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear-btn.visible {
  display: inline-flex;
}

.search-clear-btn:hover {
  color: var(--text-primary);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* === 首屏非对称杂志画框（Editorial Hero Section，DESIGN.md 6.2） === */
.editorial-hero {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 36px;
}

.editorial-hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 36px;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 44px;
  align-items: center;
}

.hero-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.hero-title {
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.hero-lead {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.hero-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.hero-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hero-topic-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-right: 2px;
}

.hero-topic-btn {
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.hero-topic-btn:hover {
  border-color: var(--primary);
  color: var(--primary-deep);
}

/* 右侧画集级插画画框（100% 无遮挡展示 images/hero-banner.png） */
.hero-art-frame {
  background: var(--surface-card);
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
}

.hero-art-img-wrap {
  overflow: hidden;
  border-radius: var(--radius-sm);
  aspect-ratio: 16 / 10;
  background: var(--bg-secondary);
}

.hero-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-art-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px 2px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* === 主体双栏容器 === */
.main-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.two-col-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 40px;
  align-items: start;
}

/* === 文字分类切换栏（Category Tabs） === */
.category-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.category-tab-btn {
  position: relative;
  padding: 0 2px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  transition: color 0.2s ease;
}

.category-tab-btn:hover {
  color: var(--text-primary);
}

.category-tab-btn.active {
  color: var(--primary-deep);
  font-weight: 600;
}

.category-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.category-tab-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.category-tab-btn.active .category-tab-count {
  color: var(--primary);
}

/* 搜索状态提示条 */
.search-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.search-status-banner strong {
  color: var(--text-primary);
}

.text-action-btn {
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.text-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary-deep);
}

/* === 六大分类低饱和色彩圆点（DESIGN.md 2.2 规范，零 Emoji） === */
.cat-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: var(--primary);
}

.cat-dot[data-cat="折腾"] { background: #c87d4b; }
[data-theme="dark"] .cat-dot[data-cat="折腾"] { background: #e09f67; }

.cat-dot[data-cat="技术"] { background: #4a7c9b; }
[data-theme="dark"] .cat-dot[data-cat="技术"] { background: #72a6c7; }

.cat-dot[data-cat="AI"] { background: #7d6b9e; }
[data-theme="dark"] .cat-dot[data-cat="AI"] { background: #a594c7; }

.cat-dot[data-cat="评测"] { background: #4d8b74; }
[data-theme="dark"] .cat-dot[data-cat="评测"] { background: #6eb59b; }

.cat-dot[data-cat="Coding"] { background: #4a685e; }
[data-theme="dark"] .cat-dot[data-cat="Coding"] { background: #a8cabb; }

.cat-dot[data-cat="校园"] { background: #6c7a89; }
[data-theme="dark"] .cat-dot[data-cat="校园"] { background: #95a5b5; }

/* === 杂志目录流式文章卡片（Editorial Article Item） === */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  padding: 24px 28px;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

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

.card-date {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

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

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 8px;
}

.card-title-link {
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.article-card:hover .card-title-link {
  color: var(--primary-deep);
}

.card-summary {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.75;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.read-more-link {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s ease;
}

.article-card:hover .read-more-link {
  color: var(--primary-deep);
}

/* 搜索高亮标记 */
mark.search-hl {
  background: var(--primary-soft);
  color: var(--primary-deep);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* === 极简分页栏 === */
.pagination-wrap {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary-deep);
}

.page-btn.active {
  background: var(--text-primary);
  color: var(--surface-card);
  border-color: var(--text-primary);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* === 右侧极简边栏（宽度 280px） === */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 80px;
}

.sidebar-card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
  padding: 20px;
}

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 1. 个人简介卡 */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.profile-name {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.profile-sub {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.profile-bio {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 14px;
}

.profile-stats-line {
  padding: 10px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.83rem;
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--border-subtle);
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  width: 100%;
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
}

.profile-link-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.profile-link-row:hover {
  color: var(--primary-deep);
}

.profile-link-domain {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
}

.profile-link-row:hover .profile-link-domain {
  color: var(--primary-deep);
}

.profile-link-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 2. 插画角落卡（Illustration Corner） */
.illust-frame {
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  margin-bottom: 12px;
  cursor: pointer;
}

.illust-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.2s ease;
}

.illust-note {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* === 文章详情页（#/article/:slug） === */
.article-detail-header {
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
}

.back-to-list-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 16px;
  transition: color 0.2s ease;
}

.back-to-list-btn:hover {
  color: var(--primary-deep);
}

.article-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.article-detail-title {
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* 极简左侧细线导读引言（Pull-Quote Summary，DESIGN.md 6.4.2） */
.article-pullquote {
  padding: 4px 0 4px 16px;
  margin-bottom: 28px;
  border-left: 2px solid var(--primary);
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.8;
}

/* 文章正文卡片 */
.article-body-card {
  padding: 36px 40px;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
}

/* Markdown 正文排版（DESIGN.md 3.2 规范） */
.markdown-body {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-primary);
  word-break: break-word;
}

.markdown-body p {
  margin-bottom: 1.25em;
}

.markdown-body a {
  color: var(--primary-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body a:hover {
  color: var(--secondary);
}

.markdown-body h2 {
  font-size: 1.35rem;
  line-height: 1.4;
  font-weight: 600;
  margin: 2.1em 0 0.85em;
  padding-bottom: 0.45em;
  padding-left: 12px;
  border-left: 2px solid var(--primary);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  scroll-margin-top: 80px;
}

.markdown-body h3 {
  font-size: 1.12rem;
  line-height: 1.45;
  font-weight: 600;
  margin: 1.6em 0 0.65em;
  color: var(--text-primary);
  scroll-margin-top: 80px;
}

.markdown-body h4 {
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 600;
  margin: 1.35em 0 0.55em;
  color: var(--text-primary);
  scroll-margin-top: 80px;
}

.heading-anchor {
  opacity: 0;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--text-muted);
  margin-left: 6px;
  text-decoration: none !important;
  transition: opacity 0.2s ease;
}

.markdown-body h2:hover .heading-anchor,
.markdown-body h3:hover .heading-anchor,
.markdown-body h4:hover .heading-anchor {
  opacity: 1;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0.6em 0 1.25em 1.5em;
}

.markdown-body li {
  margin-bottom: 0.45em;
  line-height: 1.8;
}

.markdown-body li.task-list-item {
  list-style: none;
  margin-left: -1.2em;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.task-checkbox {
  margin-top: 6px;
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.markdown-body blockquote {
  margin: 1.25em 0;
  padding: 12px 18px;
  border-left: 2px solid var(--border-hover);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

.markdown-body hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 2em 0;
}

/* 行内代码 */
.markdown-body code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-code);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

/* 普通代码块 */
.code-block-wrapper {
  margin: 1.4em 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--surface-code);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.code-copy-btn {
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.code-copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary-deep);
}

.code-block-pre {
  margin: 0;
  padding: 14px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-primary);
}

/* 语法高亮 Token 颜色 */
.tok-comment { color: var(--text-muted); font-style: italic; }
.tok-string { color: #4d8b74; }
[data-theme="dark"] .tok-string { color: #6eb59b; }
.tok-keyword { color: var(--primary-deep); font-weight: 600; }
.tok-number { color: #c87d4b; }
[data-theme="dark"] .tok-number { color: #e09f67; }

/* === 专业极简暗色终端窗口（```ansi 专属样式，DESIGN.md 6.4.3 规范） === */
.terminal-window {
  margin: 1.6em 0;
  border-radius: var(--radius-sm);
  background: #141417;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #202024;
  border-bottom: 1px solid #2e2e34;
}

.terminal-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.terminal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #45454d;
  display: inline-block;
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #a1a1aa;
}

.terminal-copy-btn {
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid #3f3f46;
  background: #27272a;
  color: #d4d4d8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
}

.terminal-copy-btn:hover {
  border-color: #71717a;
  color: #ffffff;
}

.terminal-body {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: #e4e4e7;
  background: #141417;
  white-space: pre;
  tab-size: 4;
}

.terminal-body a {
  color: #7dd3fc;
  text-decoration: underline;
}

/* ANSI SGR 色彩与样式映射 */
.ansi-bold { font-weight: 700; }
.ansi-italic { font-style: italic; }
.ansi-underline { text-decoration: underline; }

.ansi-fg-30 { color: #27272a; }
.ansi-fg-31 { color: #f87171; }
.ansi-fg-32 { color: #4ade80; }
.ansi-fg-33 { color: #facc15; }
.ansi-fg-34 { color: #60a5fa; }
.ansi-fg-35 { color: #f472b6; }
.ansi-fg-36 { color: #22d3ee; }
.ansi-fg-37 { color: #f8fafc; }

.ansi-bg-40 { background-color: #18181b; padding: 1px 4px; border-radius: 3px; }
.ansi-bg-41 { background-color: #be123c; color: #ffffff; padding: 1px 5px; border-radius: 3px; }
.ansi-bg-42 { background-color: #047857; color: #ffffff; padding: 1px 5px; border-radius: 3px; }
.ansi-bg-43 { background-color: #b45309; color: #ffffff; padding: 1px 5px; border-radius: 3px; }
.ansi-bg-44 { background-color: #1d4ed8; color: #ffffff; padding: 1px 5px; border-radius: 3px; }
.ansi-bg-45 { background-color: #7e22ce; color: #ffffff; padding: 1px 5px; border-radius: 3px; }
.ansi-bg-46 { background-color: #0e7490; color: #ffffff; padding: 1px 5px; border-radius: 3px; }
.ansi-bg-47 { background-color: #e4e4e7; color: #18181b; padding: 1px 5px; border-radius: 3px; }

/* === 日系细线表格（DESIGN.md 6.4.4 规范） === */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 1.4em 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--surface-card);
}

.markdown-body thead th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.markdown-body tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.markdown-body tbody tr:last-child td {
  border-bottom: none;
}

.markdown-body tbody tr:hover {
  background: var(--surface-card-hover);
}

/* 文章内图片与灯箱触发 */
.article-img-figure {
  margin: 1.5em 0;
  text-align: center;
}

.article-img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin: 0 auto;
  cursor: zoom-in;
}

.article-img-caption {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === 详情页右侧悬浮大纲目录（Sticky TOC） === */
.toc-list {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-color);
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.toc-link {
  display: block;
  padding: 5px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.45;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.toc-link[data-level="3"] {
  padding-left: 24px;
  font-size: 0.78rem;
}

.toc-link[data-level="4"] {
  padding-left: 34px;
  font-size: 0.75rem;
}

.toc-link:hover {
  color: var(--text-primary);
}

.toc-link.active {
  color: var(--primary-deep);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* 文章底部版权与上下篇导航 */
.article-copyright-box {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.prev-next-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.prev-next-card {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s ease;
}

.prev-next-card:hover {
  border-color: var(--primary);
}

.prev-next-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.prev-next-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* === 归档页（Editorial Archive Index，DESIGN.md 6.5.1） === */
.page-section-header {
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
}

.page-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.page-section-sub {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.archive-month-group {
  margin-bottom: 32px;
}

.archive-month-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.archive-list {
  display: flex;
  flex-direction: column;
}

.archive-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--border-subtle);
  transition: background-color 0.15s ease;
}

.archive-row:hover {
  background-color: var(--surface-card-hover);
}

.archive-row-left {
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-width: 0;
}

.archive-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.archive-title {
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--text-primary);
}

.archive-row:hover .archive-title {
  color: var(--primary-deep);
}

.archive-row-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === 关于博主页（#/about，DESIGN.md 6.5.2） === */
.about-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-card {
  padding: 28px 32px;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
}

.about-profile-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.about-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.about-section-heading {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.infra-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.infra-box {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
}

.infra-box-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.infra-list {
  padding-left: 16px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.infra-list li {
  margin-bottom: 4px;
}

/* === 空状态与 404 视图 === */
.empty-state-card {
  padding: 48px 24px;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.empty-state-img {
  max-width: 220px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.solid-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--text-primary);
  background: var(--text-primary);
  color: var(--surface-card);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.solid-btn:hover {
  opacity: 0.88;
  color: var(--surface-card);
}

/* === 页脚与右下角返回顶部按钮 === */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  padding: 28px 24px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

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

.floating-tools {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
}

.float-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  color: var(--text-secondary);
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.float-btn:hover {
  border-color: var(--primary);
  color: var(--primary-deep);
}

/* Toast 提示气泡（无 Emoji，克制干净） */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editorial-toast {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: var(--surface-card);
  font-size: 0.84rem;
  box-shadow: var(--shadow-hover);
}

/* 灯箱预览层 */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 21, 0.88);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox-backdrop.open {
  display: flex;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: var(--radius-sm);
}

/* === 响应式断点适配 === */
@media (max-width: 960px) {
  .editorial-hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .two-col-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 680px) {
  .site-navbar {
    height: auto;
    padding: 10px 0;
  }

  .navbar-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand-sub {
    display: none;
  }

  .nav-links {
    order: 3;
    width: 100%;
    gap: 18px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
  }

  .search-input,
  .search-input:focus {
    width: 165px;
  }

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

  .article-body-card,
  .about-card {
    padding: 20px 18px;
  }

  .prev-next-grid {
    grid-template-columns: 1fr;
  }

  .archive-row {
    flex-direction: column;
    gap: 4px;
  }
}
