/* ============================================
   码迹志 (Cosolar) — Halo Theme
   青绿色技术博客主题设计系统
   ============================================ */

/* ---------- CSS Variables: Light Mode ---------- */
:root {
  /* Brand Colors */
  --color-primary: #10b981;
  --color-primary-hover: #059669;
  --color-primary-light: #34d399;
  --color-primary-bg: #ecfdf5;
  --color-primary-border: #a7f3d0;

  /* Author Widget Overlay & Text */
  --author-bg-overlay-color: #000000;
  --author-bg-overlay-opacity: 0.35;
  --author-bg-text-color: #ffffff;

  /* Neutral Colors */
  --color-bg: #f8fafc;
  --color-card: #ffffff;
  --color-card-hover: #f8fafc;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-dark: #0f172a;

  /* Layout */
  --container-max: 1200px;
  --header-height: 64px;
  --sidebar-width: 320px;
  --content-gap: 24px;
  --toc-width: 240px;

  /* Radius */
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 8px 25px -5px rgba(0, 0, 0, 0.12);

  /* Transitions */
  --transition: 0.2s ease;

  /* Typography */
  --font-sans:
    "LXGW WenKai Screen", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans CN", "Noto Sans CJK SC", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
}

/* ---------- CSS Variables: Dark Mode ---------- */
[data-theme="dark"] {
  --color-primary: #10b981;
  --color-primary-hover: #34d399;
  --color-primary-light: #6ee7b7;
  --color-primary-bg: rgba(16, 185, 129, 0.1);
  --color-primary-border: rgba(16, 185, 129, 0.3);

  --color-bg: #0f172a;
  --color-card: #1e293b;
  --color-card-hover: #334155;
  --color-text: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-border: #334155;
  --color-border-light: #1e293b;
  --color-dark: #f1f5f9;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 25px -5px rgba(0, 0, 0, 0.4);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition:
    background-color var(--transition),
    color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- 页面背景层 ---------- */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.site-bg-light,
.site-bg-dark {
  position: absolute;
  inset: 0;
  transition: opacity 0.5s ease;
}

.site-bg-light {
  opacity: 0;
}

.site-bg-dark {
  opacity: 0;
}

[data-theme="light"] .site-bg-light {
  opacity: 1;
}

[data-theme="dark"] .site-bg-dark {
  opacity: 1;
}

.site-bg-image-light,
.site-bg-image-dark {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--site-bg-img-opacity, 0.2);
}

.site-bg-canvas-light,
.site-bg-canvas-dark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---------- 全局滚动条美化（细 + 主色渐变） ---------- */
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--color-primary) 45%, transparent) transparent;
}

/* WebKit / Blink（Chrome / Safari / Edge / 移动端） */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-primary) 40%, transparent);
  border-radius: 9999px;
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background-color var(--transition);
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--color-primary) 70%, transparent);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:active {
  background: var(--color-primary);
  background-clip: padding-box;
}

/* 暗色模式下滚动条拇指颜色加深以保证对比度 */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-primary) 55%, transparent);
  background-clip: padding-box;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--color-primary) 80%, transparent);
  background-clip: padding-box;
}

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

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

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

ul,
ol {
  list-style: none;
}

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

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

/* ---------- Container ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--color-card) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  transition:
    background-color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 24px;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.header-logo:hover {
  opacity: 0.85;
}

.header-logo .logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: #fff;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 30%, transparent);
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

.header-logo:hover .logo-icon {
  transform: scale(1.05) rotate(-3deg);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.header-logo .logo-image {
  flex-shrink: 0;
  object-fit: contain;
  border-radius: var(--radius-md);
  transition: transform var(--transition);
}

.header-logo:hover .logo-image {
  transform: scale(1.05);
}

.header-logo .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.header-logo .logo-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.5px;
}

.header-logo .logo-tagline {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: flex-start;
  margin-left: 8px;
}

.nav-item {
  position: relative;
}

.header-nav .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    "Hiragino Sans GB",
    "Source Han Sans CN",
    "Noto Sans CJK SC",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  border-radius: var(--radius-full);
  letter-spacing: 0.8px;
  transition: all var(--transition);
  white-space: nowrap;
}

.header-nav .nav-link .iconfont {
  font-size: 16px;
  line-height: 1;
  transition: transform var(--transition);
}

.header-nav .nav-link:hover .iconfont {
  transform: scale(1.15);
}

.header-nav .nav-link:hover,
.nav-item:hover > .nav-link,
.nav-item.is-open > .nav-link {
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.header-nav .nav-link.active,
.nav-item.is-active > .nav-link {
  color: var(--color-primary);
  background: var(--color-primary-bg);
  font-weight: 600;
}

.header-nav > .nav-item > .nav-link.active::after,
.header-nav > .nav-item.is-active > .nav-link::after {
  content: "";
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: width var(--transition);
}

.nav-caret {
  width: 12px;
  height: 12px;
  margin-left: 2px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform var(--transition);
}

.nav-item:hover > .nav-link > .nav-caret,
.nav-item.is-open > .nav-link > .nav-caret {
  transform: rotate(180deg);
  opacity: 1;
}

/* Desktop dropdown */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 180px;
  padding: 8px;
  background: color-mix(in srgb, var(--color-card) 78%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid color-mix(in srgb, var(--color-border) 55%, transparent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 8px 28px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity var(--transition),
    transform var(--transition),
    visibility var(--transition);
  z-index: 120;
}

.nav-dropdown::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-item:hover > .nav-dropdown,
.nav-item.is-open > .nav-dropdown,
.nav-item:focus-within > .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown .nav-item {
  width: 100%;
}

.nav-dropdown .nav-link {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  justify-content: flex-start;
}

.nav-dropdown .nav-link.active::after {
  display: none;
}

.nav-dropdown .nav-caret {
  margin-left: auto;
  transform: rotate(-90deg);
}

.nav-dropdown .nav-item:hover > .nav-link > .nav-caret,
.nav-dropdown .nav-item.is-open > .nav-link > .nav-caret {
  transform: rotate(0deg);
}

/* Nested flyout (depth >= 2) */
.nav-dropdown .nav-dropdown {
  top: -8px;
  left: calc(100% + 6px);
  transform: translateX(-6px);
}

.nav-dropdown .nav-item:hover > .nav-dropdown,
.nav-dropdown .nav-item.is-open > .nav-dropdown,
.nav-dropdown .nav-item:focus-within > .nav-dropdown {
  transform: translateX(0);
}

.nav-dropdown .nav-dropdown::before {
  top: 0;
  left: -8px;
  width: 8px;
  height: 100%;
  right: auto;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Search Box */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
}

.search-box:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.search-box:hover svg {
  color: var(--color-primary);
}

.search-box svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: color var(--transition);
}

.search-box .search-placeholder {
  font-size: 13px;
  color: var(--color-text-muted);
}

.search-box .search-kbd {
  padding: 2px 7px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  line-height: 1.4;
}

/* Icon Button */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  transition: all var(--transition);
}

.icon-btn:hover {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  transform: rotate(15deg);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn .sun-icon {
  display: none;
}

.icon-btn .moon-icon {
  display: block;
}

[data-theme="dark"] .icon-btn .sun-icon {
  display: block;
}

[data-theme="dark"] .icon-btn .moon-icon {
  display: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: all var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* ============================================
   LAYOUT GRID
   ============================================ */
.site-main {
  padding: 28px 0 60px;
}

.layout-grid {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--content-gap);
  align-items: start;
}

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

/* ============================================
   POST LAYOUT (Article + TOC)
   ============================================ */
.post-layout {
  display: grid;
  grid-template-columns: 56px 1fr var(--toc-width);
  gap: var(--content-gap);
  align-items: start;
}

/* Floating Action Bar */
.post-actions {
  position: sticky;
  bottom: 40px;
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.action-btn svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition);
}

.action-btn .action-count {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.action-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.action-btn:hover svg {
  transform: scale(1.1);
}

.action-btn:active {
  transform: translateY(0);
}

/* Upvote liked state */
.action-upvote.liked {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.action-upvote.liked svg {
  fill: #fff;
  animation: upvotePop 0.4s ease;
}

@keyframes upvotePop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* Share menu */
.action-share-menu {
  position: absolute;
  left: 60px;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  transition: all var(--transition);
  z-index: 20;
}

.action-share-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.share-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.share-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

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

/* Back to top */
.action-backtop {
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.action-backtop.show {
  opacity: 1;
  visibility: visible;
}

/* 目录按钮：仅移动端底部横条显示，桌面端隐藏（桌面用左侧 TOC 侧栏） */
.action-toc {
  display: none;
}

/* TOC Sidebar */
.toc-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  max-height: calc(100vh - var(--header-height) - 40px);
  /* 容器不滚动，滚动交给内部 .toc-nav */
  overflow: hidden;
}

.toc-widget {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  /* flex 列布局：标题固定，nav 滚动 */
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-height) - 40px);
}

.toc-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.toc-title svg {
  color: var(--color-primary);
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* 内部滚动：滚动条在目录明细框内，标题固定不滚 */
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--color-primary) 45%, transparent) transparent;
}

.toc-nav::-webkit-scrollbar {
  width: 1px;
}

.toc-nav::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-primary) 40%, transparent);
  border-radius: 9999px;
}

.toc-nav::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--color-primary) 70%, transparent);
}

.toc-children {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-left: 12px;
  border-left: 2px solid var(--color-border-light);
  padding-left: 4px;
  margin-top: 2px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease;
}

.toc-children.expanded {
  display: flex;
  max-height: 1000px;
  opacity: 1;
}

.toc-item.expanded > .toc-link {
  color: var(--color-primary);
  font-weight: 500;
}

.toc-link {
  display: block;
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
}

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

.toc-link.active {
  color: var(--color-primary);
  font-weight: 600;
  background: var(--color-primary-bg);
  border-left: 2px solid var(--color-primary);
}

.toc-h2 {
  font-weight: 500;
}

.toc-h3 {
  padding-left: 8px;
  font-size: 12px;
}

.toc-h4 {
  padding-left: 8px;
  font-size: 12px;
  opacity: 0.85;
}

.toc-empty {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 12px 0;
}

.content-area {
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============================================
   CARD
   ============================================ */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--transition),
    border-color var(--transition);
}

/* ============================================
   FEATURED ARTICLE (Hero)
   ============================================ */
.featured-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
  min-height: 340px;
  display: flex;
  align-items: stretch;
  background: transparent;
  border: none;
  box-shadow: none;
}

.featured-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.featured-bg--fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 80% at 92% 8%, rgba(167, 243, 208, 0.6) 0%, transparent 60%),
    radial-gradient(70% 90% at 8% 100%, rgba(110, 231, 183, 0.5) 0%, transparent 55%),
    radial-gradient(40% 60% at 50% 40%, rgba(52, 211, 153, 0.25) 0%, transparent 70%),
    linear-gradient(135deg, #ecfdf5 0%, #d1fae5 38%, #a7f3d0 62%, #6ee7b7 100%);
  background-size:
    200% 200%,
    200% 200%,
    200% 200%,
    220% 220%;
  background-position:
    0% 0%,
    100% 100%,
    50% 50%,
    0% 0%;
  animation: topic-bg-flow 18s ease-in-out infinite;
}

.featured-bg--fallback::before,
.featured-bg--fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.featured-bg--fallback::before {
  background-image:
    radial-gradient(rgba(16, 185, 129, 0.12) 1px, transparent 1px),
    radial-gradient(rgba(16, 185, 129, 0.08) 1px, transparent 1px);
  background-size:
    28px 28px,
    56px 56px;
  background-position:
    0 0,
    14px 14px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 75%);
  opacity: 0.7;
  animation: topic-grid-drift 24s linear infinite;
}

.featured-bg--fallback::after {
  background:
    linear-gradient(115deg, transparent 38%, rgba(16, 185, 129, 0.15) 48%, transparent 58%),
    radial-gradient(30% 50% at 18% 12%, rgba(110, 231, 183, 0.2) 0%, transparent 60%),
    radial-gradient(35% 50% at 88% 92%, rgba(52, 211, 153, 0.18) 0%, transparent 60%);
  opacity: 0.9;
  animation: topic-glow-breathe 8s ease-in-out infinite;
}

[data-theme="dark"] .featured-bg--fallback {
  background:
    radial-gradient(60% 80% at 92% 8%, rgba(16, 185, 129, 0.45) 0%, transparent 60%),
    radial-gradient(70% 90% at 8% 100%, rgba(5, 150, 105, 0.35) 0%, transparent 55%),
    radial-gradient(40% 60% at 50% 40%, rgba(52, 211, 153, 0.18) 0%, transparent 70%),
    linear-gradient(135deg, #042f2e 0%, #064e3b 38%, #065f46 62%, #0f172a 100%);
}

[data-theme="dark"] .featured-bg--fallback::before {
  background-image:
    radial-gradient(rgba(167, 243, 208, 0.18) 1px, transparent 1px),
    radial-gradient(rgba(167, 243, 208, 0.1) 1px, transparent 1px);
}

[data-theme="dark"] .featured-bg--fallback::after {
  background:
    linear-gradient(115deg, transparent 38%, rgba(110, 231, 183, 0.22) 48%, transparent 58%),
    radial-gradient(30% 50% at 18% 12%, rgba(167, 243, 208, 0.25) 0%, transparent 60%),
    radial-gradient(35% 50% at 88% 92%, rgba(52, 211, 153, 0.2) 0%, transparent 60%);
}

@media (prefers-reduced-motion: reduce) {
  .featured-bg--fallback,
  .featured-bg--fallback::before,
  .featured-bg--fallback::after {
    animation: none;
  }
}

.featured-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.55) 0%,
    rgba(248, 250, 252, 0.25) 60%,
    transparent 100%
  );
  z-index: 1;
}

.featured-content {
  position: relative;
  z-index: 2;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  width: 66%;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  width: fit-content;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.featured-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  color: #064e3b;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.featured-title a {
  color: inherit;
}

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

.featured-subtitle {
  font-size: 15px;
  font-weight: 500;
  color: #1f3a2e;
}

.featured-desc {
  font-size: 14px;
  line-height: 1.7;
  color: #1f3a2e;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.featured-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: #134e3a;
  margin-top: 8px;
}

.featured-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.featured-meta svg {
  width: 14px;
  height: 14px;
}

.featured-image {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary-bg), var(--color-border-light));
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-image-placeholder {
  font-family: var(--font-mono);
  font-size: 64px;
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0.3;
}

/* ============================================
   FEATURED CAROUSEL
   ============================================ */
.featured-carousel {
  position: relative;
  margin-bottom: 28px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.carousel-track {
  position: relative;
}

.carousel-slide {
  display: none;
  margin-bottom: 0;
}

.carousel-slide.active {
  display: grid;
  animation: fadeInSlide 0.5s ease;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Carousel Arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all var(--transition);
  z-index: 10;
  opacity: 0;
}

.featured-carousel:hover .carousel-arrow {
  opacity: 1;
}

.carousel-arrow:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
}

.carousel-prev {
  left: 12px;
}

.carousel-next {
  right: 12px;
}

/* Carousel Dots */
.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.9);
}

.carousel-dot.active {
  width: 24px;
  background: var(--color-primary);
  border-color: var(--color-primary);
}

[data-theme="dark"] .carousel-arrow {
  background: rgba(30, 41, 59, 0.9);
}

[data-theme="dark"] .carousel-dot {
  background: rgba(100, 116, 139, 0.4);
  border-color: var(--color-border);
}

[data-theme="dark"] .carousel-dot.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* Single slide: hide controls */
.featured-carousel:has(.carousel-slide:only-child) .carousel-arrow,
.featured-carousel:has(.carousel-slide:only-child) .carousel-dots {
  display: none;
}

/* ============================================
   ARTICLE LIST
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  background: var(--color-primary);
  border-radius: 2px;
}

.filter-tabs {
  display: flex;
  gap: 4px;
}

.filter-tab {
  padding: 4px 12px;
  font-size: 13px;
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition);
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.filter-tab:hover {
  color: var(--color-text);
}

.filter-tab.active {
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

/* Article Card */
.article-card {
  display: flex;
  gap: 18px;
  padding: 20px;
  margin-bottom: 12px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  align-items: stretch;
  transition: all var(--transition);
}

.article-card:hover {
  border-color: var(--color-primary-border);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.article-thumb {
  flex-shrink: 0;
  width: 230px;
  align-self: stretch;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .article-thumb img {
  transform: scale(1.06);
}

.article-thumb-placeholder {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0.35;
}

.article-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.article-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
}

.article-card-title a {
  color: inherit;
}

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

.article-card-excerpt {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: auto;
  flex-wrap: wrap;
}

.article-card-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.article-card-meta svg {
  width: 13px;
  height: 13px;
}

.article-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* Pinned badge */
.pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

/* View Toggle */
.section-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: all var(--transition);
}

.view-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.view-toggle-btn:hover {
  color: var(--color-text);
}

.view-toggle-btn.active {
  color: var(--color-primary);
  background: var(--color-card);
  box-shadow: var(--shadow-sm);
}

/* Article List — Grid View */
.article-list.grid-view {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.article-list.grid-view .article-card {
  flex-direction: column;
  gap: 12px;
}

.article-list.grid-view .article-thumb {
  width: 100%;
  height: 180px;
  flex-shrink: 0;
}

.article-list.grid-view .article-card-excerpt {
  -webkit-line-clamp: 3;
}

/* ============================================
   TAGS & BADGES
   ============================================ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-primary);
  background: var(--color-primary-bg);
  border-radius: var(--radius-full);
  transition: all var(--transition);
}

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

.tag-gray {
  color: var(--color-text-secondary);
  background: var(--color-border-light);
}

.tag-gray:hover {
  color: var(--color-text);
  background: var(--color-border);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  background: var(--color-card);
}

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

/* AJAX 加载中的禁用/等待状态 */
.btn-outline.is-loading,
.pagination a.is-loading {
  pointer-events: none;
  opacity: 0.6;
  cursor: progress;
}

/* 滚动加载哨兵 */
.load-sentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 24px 0 8px;
  color: var(--color-text-muted);
  font-size: 14px;
  text-align: center;
}

.load-sentinel .sentinel-text {
  transition: opacity var(--transition);
}

.load-sentinel.is-loading .sentinel-text {
  opacity: 0.4;
}

.load-sentinel.is-loading::after {
  content: "";
  width: 18px;
  height: 18px;
  margin-left: 10px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: cosolar-spin 0.8s linear infinite;
}

@keyframes cosolar-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-sm {
  padding: 5px 14px;
  font-size: 13px;
}

/* ============================================
   SIDEBAR WIDGETS
   ============================================ */
.widget {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-title .title-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-title svg {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
}

.widget-title .widget-link {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-primary);
}

/* Announcement Widget */
.widget-announcement .announcement-content {
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  word-break: break-word;
}

.widget-announcement .announcement-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.widget-announcement .announcement-content a:hover {
  color: var(--color-primary-hover);
}

/* Sidebar Author Widget */
.widget-author {
  padding: 24px 20px 0 !important;
  position: relative;
  overflow: hidden;
}

.widget-author.has-bg {
  border-color: transparent;
  box-shadow: none;
}

.widget-author.has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(
    in srgb,
    var(--author-bg-overlay-color, #000000) calc(var(--author-bg-overlay-opacity, 0.35) * 100%),
    transparent
  );
  z-index: 0;
}

.widget-author.has-bg .author-profile {
  position: relative;
  z-index: 1;
}

.widget-author.has-bg .author-avatar {
  border: 0px solid color-mix(in srgb, var(--author-bg-text-color, #fff) 50%, transparent);
  border-radius: 50%;
}

.widget-author.has-bg .author-avatar-fallback {
  border: 1px solid color-mix(in srgb, var(--author-bg-text-color, #fff) 50%, transparent);
  background: color-mix(in srgb, var(--author-bg-text-color, #fff) 15%, transparent);
  color: var(--author-bg-text-color, #fff);
}

/* When background is set — switch text to white */
.widget-author.has-bg .author-name {
  color: var(--author-bg-text-color, #fff);
}

.widget-author.has-bg .author-bio {
  color: color-mix(in srgb, var(--author-bg-text-color, #fff) 75%, transparent);
}

.widget-author.has-bg .author-divider {
  border-top-color: color-mix(in srgb, var(--author-bg-text-color, #fff) 20%, transparent);
  opacity: 0.8;
}

.widget-author.has-bg .author-link {
  color: var(--author-bg-text-color, #fff);
  background: color-mix(in srgb, var(--author-bg-text-color, #fff) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--author-bg-text-color, #fff) 15%, transparent);
}

.widget-author.has-bg .author-link:hover {
  color: var(--author-bg-text-color, #fff);
  background: color-mix(in srgb, var(--author-bg-text-color, #fff) 22%, transparent);
  border-color: color-mix(in srgb, var(--author-bg-text-color, #fff) 30%, transparent);
}

.author-profile {
  text-align: center;
}

/* Avatar */
.widget-author .author-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
}

.widget-author .author-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--color-text);
}

.widget-author .author-bio {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

/* Divider */
.author-divider {
  height: 0;
  border-top: 1px dashed var(--color-border);
  margin: 0 -20px;
  opacity: 0.6;
}

/* Social buttons */
.widget-author .author-meta {
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 10px 0 6px;
}

.widget-author .author-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  text-decoration: none;
}

.widget-author .author-link:hover {
  color: var(--color-primary);
  background: var(--color-bg);
}

.widget-author .author-link.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.widget-author .author-link svg {
  width: 16px;
  height: 16px;
  display: block;
}

.widget-author .author-link span {
  display: none;
}

.author-stats {
  display: flex;
  justify-content: center;
  padding: 14px 0 12px;
  gap: 0;
}

.author-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  flex: 1;
  position: relative;
  transition: all 0.2s ease;
}

.author-stat + .author-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--color-border);
  opacity: 0.5;
}

.author-stat:hover .author-stat-num {
  color: var(--color-primary);
}

.author-stat-num {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  transition: color 0.2s ease;
}

.author-stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.5px;
}

.widget-author.has-bg .author-stat + .author-stat::before {
  background: color-mix(in srgb, var(--author-bg-text-color, #fff) 20%, transparent);
}

.widget-author.has-bg .author-stat-num {
  color: var(--author-bg-text-color, #fff);
}

.widget-author.has-bg .author-stat-label {
  color: color-mix(in srgb, var(--author-bg-text-color, #fff) 70%, transparent);
}

.widget-author.has-bg .author-stat:hover .author-stat-num {
  color: color-mix(in srgb, var(--author-bg-text-color, #fff) 85%, transparent);
}

/* Search Widget */

/* Search Widget */
.search-widget input {
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition);
}

.search-widget input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.search-widget .search-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.search-widget .search-row input {
  margin-top: 0;
}

/* Tag Cloud */
@keyframes tag-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.03);
  }
}

.widget-tag-cloud .tag-cloud-body {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  line-height: 1.2;
}

.widget-tag-cloud .tag-cloud-item {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  text-decoration: none;
  transition: all 0.25s ease;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  animation: tag-float 3.5s ease-in-out infinite;
  will-change: transform;
}

.widget-tag-cloud .tag-cloud-item:hover {
  animation: none;
  background: var(--color-primary);
  color: #fff;
  transform: scale(1.15);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--color-primary) 30%, transparent);
  border-color: var(--color-primary);
}

/* WeChat QR */
.widget-wechat .wechat-qr-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.widget-wechat .wechat-qr-img {
  width: 100%;
  max-width: 180px;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
}

.widget-wechat .wechat-qr-text {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  text-align: center;
}

/* Hot Tags */
.hot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.category-item:hover {
  border-color: var(--color-primary);
  background: var(--color-card-hover);
}

.category-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: 18px;
  flex-shrink: 0;
}

.category-icon svg {
  width: 18px;
  height: 18px;
}

.category-icon .iconfont {
  font-size: 18px;
  line-height: 1;
}

.category-info {
  min-width: 0;
}

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

.category-count {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Recent List */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.recent-item .recent-badge {
  flex-shrink: 0;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--color-primary);
  background: var(--color-primary-bg);
  border-radius: 4px;
  margin-top: 2px;
}

.recent-item .recent-info {
  flex: 1;
  min-width: 0;
}

.recent-item .recent-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-item .recent-title a {
  color: inherit;
}

.recent-item .recent-date {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Sidebar Links (友情链接) */
.sidebar-links-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.sidebar-link-item + .sidebar-link-item {
  border-top: 1px solid var(--color-border);
}

.sidebar-link-item:hover {
  padding-left: 4px;
}

.sidebar-link-logo {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
}

.sidebar-link-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-link-logo.is-fallback {
  background: var(--color-primary-bg);
}

.sidebar-link-logo-fallback {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
}

.sidebar-link-info {
  flex: 1;
  min-width: 0;
}

.sidebar-link-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-link-item:hover .sidebar-link-name {
  color: var(--color-primary);
}

.sidebar-link-desc {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Sidebar Feeds (订阅资讯) */
.sidebar-feeds-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-feed-item {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: all var(--transition);
}

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

.sidebar-feed-item:hover {
  padding-left: 4px;
}

.sidebar-feed-title {
  display: block;
  font-size: 13px;
  /*font-weight: 600;*/
  color: var(--color-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-feed-item:hover .sidebar-feed-title {
  color: var(--color-primary);
}

.sidebar-feed-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.sidebar-feed-source {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-feed-date {
  flex-shrink: 0;
}

/* Project List */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.project-item:hover {
  border-color: var(--color-primary);
}

.project-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-bg);
  font-size: 14px;
  flex-shrink: 0;
}

.project-info {
  flex: 1;
  min-width: 0;
}

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

.project-desc {
  font-size: 11px;
  color: var(--color-text-muted);
}

.project-stats {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.project-stats span {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 0 8px;
}

.pagination > a,
.pagination > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  transition: color var(--transition), border-color var(--transition),
    background-color var(--transition), box-shadow var(--transition),
    transform var(--transition);
}

.pagination > a:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.pagination > a:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.pagination > .disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.pagination > .disabled:hover {
  color: var(--color-text-secondary);
  border-color: var(--color-border);
  background: var(--color-card);
  transform: none;
  box-shadow: none;
}

/* 当前页码（不可点击，高亮） */
.pagination > span.page-num.is-current {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 600;
  cursor: default;
  box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.45);
}

.pagination .page-label {
  margin: 0 5px;
}

.pagination .page-arrow {
  font-size: 16px;
  line-height: 1;
}

/* 跳转 */
.pagination-jump {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.pagination-jump .jump-input {
  width: 64px;
  height: 38px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  color: var(--color-text);
  text-align: center;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.pagination-jump .jump-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.pagination-jump .jump-btn {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: color var(--transition), border-color var(--transition),
    background-color var(--transition), box-shadow var(--transition),
    transform var(--transition);
}

.pagination-jump .jump-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.pagination-jump .jump-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.pagination-jump .jump-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

@media (max-width: 640px) {
  .pagination .page-label {
    display: none;
  }
  .pagination-jump .jump-text {
    display: none;
  }
  .pagination-jump {
    margin-left: 4px;
  }
}

/* ============================================
   ARTICLE DETAIL (Post Page)
   ============================================ */
.article-detail {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.article-detail-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.article-detail-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text);
  margin-bottom: 12px;
}

.article-detail-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.article-detail-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-detail-meta svg {
  width: 15px;
  height: 15px;
}

.article-detail-cover {
  margin: -40px -40px 28px;
  height: 320px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.article-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Prose Content */
.prose {
  font-size: 15px;
  line-height: 1.85;
  color: var(--color-text);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.8em;
  margin-bottom: 0.8em;
  color: var(--color-text);
}

.prose h1 {
  font-size: 1.75em;
}

.prose h2 {
  font-size: 1.5em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--color-border);
}

.prose h3 {
  font-size: 1.25em;
}

.prose p {
  margin-bottom: 1em;
}

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

.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose blockquote {
  padding: 12px 20px;
  margin: 1.2em 0;
  border-left: 4px solid var(--color-primary);
  background: var(--color-primary-bg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text-secondary);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--color-border-light);
  border-radius: 4px;
  color: var(--color-primary);
}

/* Override bare prose pre when Mac enhancer not yet applied / disabled */
.prose pre {
  padding: 16px 20px;
  margin: 1.2em 0;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid var(--code-mac-border, var(--color-border));
  background: var(--code-mac-bg, var(--color-bg-secondary, #f6f8fa));
  color: var(--code-mac-text, inherit);
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: 0.875em;
  color: inherit;
}

.prose figure.highlight {
  margin: 1.2em 0;
  border-radius: 12px;
  overflow: auto;
  border: 1px solid var(--code-mac-border, var(--color-border));
  background: var(--code-mac-bg, var(--color-bg-secondary, #f6f8fa));
}

.prose img {
  border-radius: var(--radius-md);
  margin: 1.2em 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.prose th,
.prose td {
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  text-align: left;
}

.prose th {
  background: var(--color-border-light);
  font-weight: 600;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2em 0;
}

/* Article Footer */
.article-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.article-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

/* Post Nav (prev/next) */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

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

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

.post-nav-label {
  font-size: 12px;
  color: var(--color-text-muted);
}

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

/* ============================================
   ARCHIVES PAGE — 时间线布局
   ============================================ */
.archive-timeline {
  position: relative;
  padding-left: 28px;
  margin-top: 24px;
}

.archive-timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-border));
  border-radius: 1px;
}

.archive-year-dot {
  position: absolute;
  left: -28px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-primary-bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent);
  z-index: 1;
}

.archive-year-label {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 20px;
  padding-left: 4px;
}

.archive-month-group {
  position: relative;
  margin-bottom: 20px;
}

.archive-month-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary-light);
  border: 2px solid var(--color-card);
  box-shadow: 0 0 0 2px var(--color-primary-border);
  z-index: 1;
}

.archive-month-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.archive-post-list {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 4px 16px;
  box-shadow: var(--shadow-sm);
}

.archive-post-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background var(--transition);
}

.archive-post-list li:last-child {
  border-bottom: none;
}

.archive-post-list li:hover {
  background: var(--color-primary-bg);
  border-radius: var(--radius-sm);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}

.archive-post-date {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  flex-shrink: 0;
  width: 50px;
}

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

.archive-post-title a {
  color: inherit;
  transition: color var(--transition);
}

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

/* ============================================
   CATEGORIES & TAGS PAGE
   ============================================ */
.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  overflow: hidden;
}

.category-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.category-card .cat-cover {
  position: relative;
  height: 140px;
  overflow: hidden;
}

.category-card .cat-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.category-card:hover .cat-cover img {
  transform: scale(1.05);
}

.category-card .cat-body {
  padding: 20px;
}

.category-card .cat-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.category-card .cat-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-bg);
}

.category-card .cat-icon svg {
  width: 22px;
  height: 22px;
  color: var(--color-primary);
}

.category-card .cat-text {
  min-width: 0;
}

.category-card .cat-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.category-card .cat-count {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.category-card .cat-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

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

.tag-cloud .tag {
  font-size: 14px;
  padding: 6px 16px;
}

.tag-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.tag-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.tag-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.tag-card-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-bg);
  transition: all var(--transition);
}

.tag-card:hover .tag-card-icon {
  background: var(--color-primary);
}

.tag-card-icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  transition: color var(--transition);
}

.tag-card:hover .tag-card-icon svg {
  color: #fff;
}

.tag-card-text {
  min-width: 0;
  flex: 1;
}

.tag-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.tag-card-count {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.tag-card-desc {
  display: none;
}

.tag-card-arrow {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  opacity: 0;
  transform: translateX(-6px);
  transition: all var(--transition);
  flex-shrink: 0;
}

.tag-card:hover .tag-card-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--color-primary);
}

@media (max-width: 768px) {
  .tag-cards {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
  }

  .tag-card {
    padding: 14px 16px;
    gap: 10px;
  }

  .tag-card-icon {
    width: 36px;
    height: 36px;
  }

  .tag-card-icon svg {
    width: 18px;
    height: 18px;
  }
}

/* ============================================
   LINKS (友情链接) PAGE
   ============================================ */

/* ===== Links Hero (双栏布局) ===== */
.links-hero {
  position: relative;
  margin-bottom: 32px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  isolation: isolate;
}

.links-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.links-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.links-hero-bg--fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 80% at 92% 8%, rgba(167, 243, 208, 0.5) 0%, transparent 60%),
    radial-gradient(70% 90% at 8% 100%, rgba(110, 231, 183, 0.4) 0%, transparent 55%),
    linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 38%, #a7f3d0 62%, #6ee7b7 100%);
}

[data-theme="dark"] .links-hero-bg--fallback {
  background:
    radial-gradient(60% 80% at 92% 8%, rgba(16, 185, 129, 0.35) 0%, transparent 60%),
    radial-gradient(70% 90% at 8% 100%, rgba(5, 150, 105, 0.25) 0%, transparent 55%),
    linear-gradient(135deg, #042f2e 0%, #064e3b 38%, #065f46 62%, #0f172a 100%);
}

.links-hero-bg--fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(16, 185, 129, 0.1) 1px, transparent 1px),
    radial-gradient(rgba(16, 185, 129, 0.06) 1px, transparent 1px);
  background-size: 28px 28px, 56px 56px;
  background-position: 0 0, 14px 14px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 70%);
}

[data-theme="dark"] .links-hero-bg--fallback::before {
  background-image:
    radial-gradient(rgba(167, 243, 208, 0.15) 1px, transparent 1px),
    radial-gradient(rgba(167, 243, 208, 0.08) 1px, transparent 1px);
}

.links-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 0%, transparent 50%, rgba(248, 250, 252, 0.3) 100%);
}

[data-theme="dark"] .links-hero-overlay {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.4) 60%, rgba(0, 0, 0, 0.7) 100%);
}

.links-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 16px;
  padding: 22px 36px;
}

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

.links-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}

.links-hero-eyebrow svg {
  width: 14px;
  height: 14px;
}

.links-hero-left h1 {
  font-size: 32px;
  font-weight: 800;
  color: #064e3b;
  margin-bottom: 8px;
  line-height: 1.2;
}

.links-hero-desc {
  font-size: 14px;
  color: #065f46;
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 520px;
}

[data-theme="dark"] .links-hero-left h1 {
  color: #f1f5f9;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .links-hero-desc {
  color: rgba(241, 245, 249, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Hero 统计栏 (集成在 Hero 内) */
.links-hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.links-hero-stat {
  display: flex;
  align-items: center;
  gap: 10px;
}

.links-hero-stat-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  color: #0f766e;
  backdrop-filter: blur(4px);
}

[data-theme="dark"] .links-hero-stat-icon {
  background: rgba(255, 255, 255, 0.12);
  color: #6ee7b7;
}

.links-hero-stat-icon svg {
  width: 18px;
  height: 18px;
}

.links-hero-stat-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.links-hero-stat-num {
  font-size: 20px;
  font-weight: 800;
  color: #064e3b;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.links-hero-stat-label {
  font-size: 12px;
  color: #0f766e;
  opacity: 0.7;
}

[data-theme="dark"] .links-hero-stat-num {
  color: #f1f5f9;
}

[data-theme="dark"] .links-hero-stat-label {
  color: rgba(241, 245, 249, 0.7);
}

.links-hero-stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(15, 118, 110, 0.2);
  flex-shrink: 0;
}

[data-theme="dark"] .links-hero-stat-divider {
  background: rgba(255, 255, 255, 0.15);
}

/* ===== 友链列表区域 ===== */
.links-section {
  margin-bottom: 32px;
}

.links-section-header {
  margin-bottom: 20px;
}

.links-section-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.links-section-header h2 svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
}

/* ===== 筛选 + 搜索工具栏 ===== */
.links-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.link-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-filters .link-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition);
}

.link-filters .link-filter:hover {
  color: var(--color-primary);
  background: var(--color-primary-bg);
  border-color: var(--color-primary-border);
}

.link-filters .link-filter.active {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.link-filters .link-filter small {
  font-size: 11px;
  padding: 0 6px;
  line-height: 16px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.06);
  transition: all var(--transition);
}

.link-filters .link-filter.active small {
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.85);
}

/* 搜索框 */
.links-search {
  position: relative;
  flex-shrink: 0;
}

.links-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.links-search input {
  width: 200px;
  padding: 8px 14px 8px 36px;
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  outline: none;
  transition: all var(--transition);
  font-family: inherit;
}

.links-search input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
  width: 240px;
}

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

/* 搜索无结果提示 */
.links-search-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.links-search-empty svg {
  width: 40px;
  height: 40px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  opacity: 0.5;
}

.links-search-empty p {
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: 4px;
  font-weight: 500;
}

.links-search-empty small {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ===== 链接分组 ===== */
.link-group {
  margin-bottom: 32px;
}

.link-group-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--color-border);
}

.link-group-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.link-group-header small {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ===== 卡片网格 ===== */
.link-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* ===== 友链卡片 ===== */
.link-card {
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 18px;
  text-decoration: none;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary-bg), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.link-card:hover {
  border-color: var(--color-primary-border);
  box-shadow: 0 8px 24px -6px rgba(16, 185, 129, 0.15);
  transform: translateY(-3px);
}

.link-card:hover::before {
  opacity: 0.5;
}

/* 卡片头部：Logo + 标题 + 外链图标 */
.link-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.link-card-logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: 17px;
  font-weight: 700;
}

.link-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-card-logo.is-fallback {
  background: var(--color-primary-bg);
}

.link-card-title-row {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.link-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card-url {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-card-external {
  width: 15px;
  height: 15px;
  color: var(--color-text-muted);
  opacity: 0.5;
  transition: all var(--transition);
  flex-shrink: 0;
  margin-top: 2px;
}

.link-card:hover .link-card-external {
  opacity: 1;
  color: var(--color-primary);
}

/* 卡片描述 */
.link-card-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* 卡片底部：标签 + 状态徽章 */
.link-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
}

.link-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  color: #0f766e;
  background: #ccfbf1;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

[data-theme="dark"] .link-tag {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
}

.link-card-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* 状态徽章 */
.link-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

.link-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.link-badge--ok {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.12);
}

.link-badge--off {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.12);
}

.link-badge--check {
  color: #d97706;
  background: rgba(217, 119, 6, 0.12);
}

[data-theme="dark"] .link-badge--ok {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
}

[data-theme="dark"] .link-badge--off {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
}

[data-theme="dark"] .link-badge--check {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
}

.link-badge--back {
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.12);
}

.link-badge--back-miss {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
}

[data-theme="dark"] .link-badge--back {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

[data-theme="dark"] .link-badge--back-miss {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.15);
}

/* ===== RSS 资讯列表 ===== */
.link-feeds {
  margin-top: 40px;
}

.link-feeds-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--color-border);
}

.link-feeds-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.link-feeds-header small {
  font-size: 12px;
  color: var(--color-text-muted);
}

.link-feeds-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.link-feed-item {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

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

.link-feed-link {
  display: block;
  padding: 14px 16px;
  text-decoration: none;
}

.link-feed-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-feed-item:hover .link-feed-title {
  color: var(--color-primary);
}

.link-feed-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.link-feed-author {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-comments {
  margin-top: 40px;
}

/* ===== 申请友链 CTA ===== */
.links-cta {
  position: relative;
  margin-top: 40px;
  padding: 40px 32px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background:
    radial-gradient(100% 120% at 50% 0%, var(--color-primary-bg) 0%, transparent 55%),
    var(--color-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

[data-theme="dark"] .links-cta {
  background:
    radial-gradient(100% 120% at 50% 0%, rgba(16, 185, 129, 0.15) 0%, transparent 55%),
    var(--color-card);
}

.links-cta-decoration {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.links-cta-decoration--left {
  bottom: 0;
  left: 0;
  width: 100px;
  height: 100px;
  opacity: 0.8;
}

.links-cta-decoration--left svg {
  width: 100%;
  height: 100%;
}

.links-cta-decoration--right {
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  opacity: 0.7;
}

.links-cta-decoration--right svg {
  width: 100%;
  height: 100%;
}

.links-cta-decoration--leaf1 {
  top: 20%;
  left: 12%;
  width: 30px;
  height: 30px;
  opacity: 0.5;
  animation: leafFloat 6s ease-in-out infinite;
}

.links-cta-decoration--leaf1 svg {
  width: 100%;
  height: 100%;
}

.links-cta-decoration--leaf2 {
  bottom: 25%;
  right: 15%;
  width: 24px;
  height: 24px;
  opacity: 0.4;
  animation: leafFloat 8s ease-in-out infinite reverse;
}

.links-cta-decoration--leaf2 svg {
  width: 100%;
  height: 100%;
}

@keyframes leafFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(8deg);
  }
}

.links-cta-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.links-cta-inner p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 500px;
}

.links-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-card);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition);
  margin-top: 4px;
}

.links-cta-btn:hover {
  color: #fff;
  background: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.links-cta-btn svg {
  width: 16px;
  height: 16px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .links-hero-content {
    padding: 22px 20px;
  }

  .links-hero-left h1 {
    font-size: 24px;
  }

  .links-hero-stats {
    gap: 12px;
  }

  .links-hero-stat-num {
    font-size: 17px;
  }

  .links-hero-stat-icon {
    width: 30px;
    height: 30px;
  }

  .links-hero-stat-icon svg {
    width: 15px;
    height: 15px;
  }

  .links-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .links-search input,
  .links-search input:focus {
    width: 100%;
  }

  .link-cards {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .link-card {
    padding: 14px;
  }

  .link-card-logo {
    width: 36px;
    height: 36px;
    font-size: 14px;
    border-radius: 8px;
  }

  .link-card-name {
    font-size: 14px;
  }

  .link-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .link-filters .link-filter {
    flex-shrink: 0;
  }

  .links-cta {
    padding: 28px 20px;
  }

  .links-cta-inner h3 {
    font-size: 16px;
  }
}

/* ============================================
   PAGE HEADER (for archive/tag/category pages)
   ============================================ */
/* ============================================
   TOPIC HERO (Category archive header)
   ============================================ */
.topic-hero {
  position: relative;
  margin-bottom: 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  isolation: isolate;
}

.topic-hero-bg,
.topic-hero-bg--fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.topic-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.topic-hero-bg--fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 80% at 92% 8%, rgba(167, 243, 208, 0.6) 0%, transparent 60%),
    radial-gradient(70% 90% at 8% 100%, rgba(110, 231, 183, 0.5) 0%, transparent 55%),
    radial-gradient(40% 60% at 50% 40%, rgba(52, 211, 153, 0.25) 0%, transparent 70%),
    linear-gradient(135deg, #ecfdf5 0%, #d1fae5 38%, #a7f3d0 62%, #6ee7b7 100%);
  background-size:
    200% 200%,
    200% 200%,
    200% 200%,
    220% 220%;
  background-position:
    0% 0%,
    100% 100%,
    50% 50%,
    0% 0%;
  animation: topic-bg-flow 18s ease-in-out infinite;
}

[data-theme="dark"] .topic-hero-bg--fallback {
  background:
    radial-gradient(60% 80% at 92% 8%, rgba(16, 185, 129, 0.45) 0%, transparent 60%),
    radial-gradient(70% 90% at 8% 100%, rgba(5, 150, 105, 0.35) 0%, transparent 55%),
    radial-gradient(40% 60% at 50% 40%, rgba(52, 211, 153, 0.18) 0%, transparent 70%),
    linear-gradient(135deg, #042f2e 0%, #064e3b 38%, #065f46 62%, #0f172a 100%);
}

@keyframes topic-bg-flow {
  0% {
    background-position:
      0% 0%,
      100% 100%,
      50% 40%,
      0% 50%;
  }
  25% {
    background-position:
      30% 20%,
      70% 80%,
      55% 45%,
      50% 50%;
  }
  50% {
    background-position:
      50% 40%,
      50% 50%,
      60% 50%,
      100% 50%;
  }
  75% {
    background-position:
      25% 25%,
      75% 75%,
      52% 42%,
      50% 0%;
  }
  100% {
    background-position:
      0% 0%,
      100% 100%,
      50% 40%,
      0% 50%;
  }
}

/* 纯 CSS 几何装饰层：网格 + 光斑 + 波纹，叠加在 fallback 背景上 */
.topic-hero-bg--fallback::before,
.topic-hero-bg--fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 细网格（点阵）— 缓慢漂移 */
.topic-hero-bg--fallback::before {
  background-image:
    radial-gradient(rgba(16, 185, 129, 0.12) 1px, transparent 1px),
    radial-gradient(rgba(16, 185, 129, 0.08) 1px, transparent 1px);
  background-size:
    28px 28px,
    56px 56px;
  background-position:
    0 0,
    14px 14px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 75%);
  opacity: 0.7;
  animation: topic-grid-drift 24s linear infinite;
}

[data-theme="dark"] .topic-hero-bg--fallback::before {
  background-image:
    radial-gradient(rgba(167, 243, 208, 0.18) 1px, transparent 1px),
    radial-gradient(rgba(167, 243, 208, 0.1) 1px, transparent 1px);
  opacity: 0.6;
}

@keyframes topic-grid-drift {
  0% {
    background-position:
      0 0,
      14px 14px;
  }
  100% {
    background-position:
      28px 28px,
      42px 42px;
  }
}

/* 大光斑 + 对角光线 — 呼吸式明暗变化 */
.topic-hero-bg--fallback::after {
  background:
    linear-gradient(115deg, transparent 38%, rgba(16, 185, 129, 0.15) 48%, transparent 58%),
    radial-gradient(30% 50% at 18% 12%, rgba(110, 231, 183, 0.2) 0%, transparent 60%),
    radial-gradient(35% 50% at 88% 92%, rgba(52, 211, 153, 0.18) 0%, transparent 60%);
  opacity: 0.9;
  animation: topic-glow-breathe 8s ease-in-out infinite;
}

[data-theme="dark"] .topic-hero-bg--fallback::after {
  background:
    linear-gradient(115deg, transparent 38%, rgba(110, 231, 183, 0.22) 48%, transparent 58%),
    radial-gradient(30% 50% at 18% 12%, rgba(167, 243, 208, 0.25) 0%, transparent 60%),
    radial-gradient(35% 50% at 88% 92%, rgba(52, 211, 153, 0.2) 0%, transparent 60%);
  opacity: 0.85;
}

@keyframes topic-glow-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.04);
  }
}

/* 尊重用户减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .topic-hero-bg--fallback,
  .topic-hero-bg--fallback::before,
  .topic-hero-bg--fallback::after {
    animation: none;
  }
}

.topic-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.15) 60%,
    rgba(255, 255, 255, 0.4) 100%
  );
}

/* 有封面图时蒙层仅在底部轻微提亮，保证深字可读 */
.topic-hero-bg ~ .topic-hero-overlay {
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 50%,
    rgba(248, 250, 252, 0.25) 80%,
    rgba(248, 250, 252, 0.55) 100%
  );
}

.topic-hero-inner {
  position: relative;
  z-index: 2;
  padding: 36px 36px 30px;
  width: 100%;
  color: #064e3b;
}

.topic-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.topic-eyebrow svg {
  width: 13px;
  height: 13px;
}

.topic-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
  color: #064e3b;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.topic-desc {
  font-size: 15px;
  line-height: 1.65;
  color: #1f3a2e;
  max-width: 640px;
  margin-bottom: 20px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.topic-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topic-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.topic-stat-num {
  font-size: 20px;
  font-weight: 700;
  color: #064e3b;
  font-family: var(--font-mono);
}

.topic-stat-label {
  font-size: 13px;
  color: #134e3a;
}

.topic-stat-icon {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
}

.topic-stat-divider {
  width: 1px;
  height: 16px;
  background: rgba(6, 78, 59, 0.25);
}

.topic-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #064e3b;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: all var(--transition);
}

.topic-back-link:hover {
  color: var(--color-primary-hover);
}

[data-theme="dark"] .topic-back-link {
  color: rgba(241, 245, 249, 0.85);
}

[data-theme="dark"] .topic-back-link:hover {
  color: var(--color-primary-light);
}

/* ============================================
   DARK MODE: 专题封面 & 轮播图
   暗色环境下背景图压暗，文字改浅色保证可读
   ============================================ */
[data-theme="dark"] .topic-hero-overlay,
[data-theme="dark"] .topic-hero-bg ~ .topic-hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.35) 55%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

[data-theme="dark"] .topic-hero-inner,
[data-theme="dark"] .topic-title,
[data-theme="dark"] .topic-stat-num {
  color: #f1f5f9;
}

[data-theme="dark"] .topic-desc {
  color: rgba(241, 245, 249, 0.88);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .topic-title {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .topic-stat-label {
  color: rgba(241, 245, 249, 0.72);
}

[data-theme="dark"] .topic-stat-icon {
  color: var(--color-primary-light);
}

[data-theme="dark"] .topic-stat-divider {
  background: rgba(241, 245, 249, 0.25);
}

[data-theme="dark"] .featured-overlay {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.35) 60%,
    transparent 100%
  );
}

[data-theme="dark"] .featured-bg ~ .featured-overlay {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.25) 60%,
    transparent 100%
  );
}

[data-theme="dark"] .featured-title,
[data-theme="dark"] .featured-subtitle,
[data-theme="dark"] .featured-desc {
  color: #f1f5f9;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .featured-meta {
  color: rgba(241, 245, 249, 0.72);
}

/* Responsive */
@media (max-width: 768px) {
  .topic-hero {
    min-height: 180px;
  }
  .topic-hero-inner {
    padding: 26px 22px 22px;
  }
  .topic-title {
    font-size: 24px;
  }
  .topic-desc {
    font-size: 14px;
    margin-bottom: 16px;
  }
  .topic-stat-num {
    font-size: 17px;
  }
  .topic-stats {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .topic-hero {
    min-height: 160px;
    border-radius: var(--radius-md);
  }
  .topic-hero-inner {
    padding: 22px 18px 18px;
  }
  .topic-title {
    font-size: 21px;
  }
  .topic-eyebrow {
    font-size: 11px;
    padding: 3px 10px;
  }
  .topic-stat-divider:nth-of-type(4),
  .topic-stat:last-child {
    display: none;
  }
}

.page-hero {
  position: relative;
  margin-bottom: 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 180px;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  isolation: isolate;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.page-hero-bg--fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 80% at 92% 8%, rgba(167, 243, 208, 0.6) 0%, transparent 60%),
    radial-gradient(70% 90% at 8% 100%, rgba(110, 231, 183, 0.5) 0%, transparent 55%),
    radial-gradient(40% 60% at 50% 40%, rgba(52, 211, 153, 0.25) 0%, transparent 70%),
    linear-gradient(135deg, #ecfdf5 0%, #d1fae5 38%, #a7f3d0 62%, #6ee7b7 100%);
  background-size:
    200% 200%,
    200% 200%,
    200% 200%,
    220% 220%;
  background-position:
    0% 0%,
    100% 100%,
    50% 50%,
    0% 0%;
  animation: topic-bg-flow 18s ease-in-out infinite;
}

[data-theme="dark"] .page-hero-bg--fallback {
  background:
    radial-gradient(60% 80% at 92% 8%, rgba(16, 185, 129, 0.45) 0%, transparent 60%),
    radial-gradient(70% 90% at 8% 100%, rgba(5, 150, 105, 0.35) 0%, transparent 55%),
    radial-gradient(40% 60% at 50% 40%, rgba(52, 211, 153, 0.18) 0%, transparent 70%),
    linear-gradient(135deg, #042f2e 0%, #064e3b 38%, #065f46 62%, #0f172a 100%);
}

.page-hero-bg--fallback::before,
.page-hero-bg--fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.page-hero-bg--fallback::before {
  background-image:
    radial-gradient(rgba(16, 185, 129, 0.12) 1px, transparent 1px),
    radial-gradient(rgba(16, 185, 129, 0.08) 1px, transparent 1px);
  background-size:
    28px 28px,
    56px 56px;
  background-position:
    0 0,
    14px 14px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 75%);
  opacity: 0.7;
  animation: topic-grid-drift 24s linear infinite;
}

[data-theme="dark"] .page-hero-bg--fallback::before {
  background-image:
    radial-gradient(rgba(167, 243, 208, 0.18) 1px, transparent 1px),
    radial-gradient(rgba(167, 243, 208, 0.1) 1px, transparent 1px);
  opacity: 0.6;
}

.page-hero-bg--fallback::after {
  background:
    linear-gradient(115deg, transparent 38%, rgba(16, 185, 129, 0.15) 48%, transparent 58%),
    radial-gradient(30% 50% at 18% 12%, rgba(110, 231, 183, 0.2) 0%, transparent 60%),
    radial-gradient(35% 50% at 88% 92%, rgba(52, 211, 153, 0.18) 0%, transparent 60%);
  opacity: 0.9;
  animation: topic-glow-breathe 8s ease-in-out infinite;
}

[data-theme="dark"] .page-hero-bg--fallback::after {
  background:
    linear-gradient(115deg, transparent 38%, rgba(110, 231, 183, 0.22) 48%, transparent 58%),
    radial-gradient(30% 50% at 18% 12%, rgba(167, 243, 208, 0.25) 0%, transparent 60%),
    radial-gradient(35% 50% at 88% 92%, rgba(52, 211, 153, 0.2) 0%, transparent 60%);
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .page-hero-bg--fallback,
  .page-hero-bg--fallback::before,
  .page-hero-bg--fallback::after {
    animation: none;
  }
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 50%,
    rgba(248, 250, 252, 0.25) 80%,
    rgba(248, 250, 252, 0.55) 100%
  );
}

.page-hero-inner {
  position: relative;
  z-index: 2;
  padding: 32px 36px 28px;
  width: 100%;
  color: #064e3b;
}

.page-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.page-hero-eyebrow svg {
  width: 14px;
  height: 14px;
}

.page-hero-inner h1 {
  font-size: 26px;
  font-weight: 800;
  color: #064e3b;
  margin-bottom: 6px;
}

.page-hero-desc {
  font-size: 14px;
  color: #065f46;
  opacity: 0.85;
}

[data-theme="dark"] .page-hero {
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .page-hero-inner {
  color: #f1f5f9;
}

[data-theme="dark"] .page-hero-inner h1 {
  color: #f1f5f9;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .page-hero-desc {
  color: rgba(241, 245, 249, 0.88);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .page-hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.35) 55%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

[data-theme="dark"] .page-hero-bg ~ .page-hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.3) 50%,
    rgba(0, 0, 0, 0.65) 100%
  );
}

@media (max-width: 768px) {
  .page-hero {
    min-height: 150px;
  }
  .page-hero-inner {
    padding: 24px 20px 20px;
  }
  .page-hero-inner h1 {
    font-size: 22px;
  }
}

.page-header-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.page-header-card h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.page-header-card .page-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  padding: 48px 0 24px;
  margin-top: 40px;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--footer-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--footer-bg-img-opacity, 0);
  z-index: 0;
  pointer-events: none;
}

[data-theme="dark"] .site-footer::before {
  background-image: var(--footer-bg-image-dark, var(--footer-bg-image));
  opacity: var(--footer-bg-img-opacity-dark, var(--footer-bg-img-opacity, 0));
}

.site-footer > .container {
  position: relative;
  z-index: 1;
}

/* 多栏页脚主体 */
.footer-main {
  display: grid;
  grid-template-columns: 1.0fr 1.8fr 1.1fr;
  gap: 10px 48px;
  padding-bottom: 10px;
}

/* Sidebar author profile (also uses .author-* classes) */
.author-avatar {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-card);
  border: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-avatar-fallback {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-primary);
}

.author-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px;
  display: inline-block;
}

.author-bio {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0 0 10px;
  line-height: 1.6;
}

.author-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.author-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.author-link:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-card);
}

.author-link.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.author-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Brand */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text);
  text-decoration: none;
  transition: opacity var(--transition);
}

.footer-logo:hover {
  opacity: 0.85;
}

.footer-logo-image {
  object-fit: contain;
  border-radius: var(--radius-md);
}

.footer-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.footer-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.footer-logo-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--footer-social-color-dark, var(--footer-social-color, var(--color-text)));
  line-height: 1.2;
}

.footer-logo-tagline {
  font-size: 11px;
  font-weight: 500;
  color: var(--footer-social-color-dark, var(--footer-social-color, var(--color-text-muted)));
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.2;
}

.footer-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--footer-social-color-dark, var(--footer-social-color, var(--color-text-secondary)));
  margin: 0;
  max-width: 280px;
}

.footer-desc:empty {
  display: none;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--footer-social-color, var(--color-primary));
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  transition: all var(--transition);
}

.footer-social-link:hover {
  color: var(--footer-social-color, var(--color-primary));
  border-color: var(--footer-social-color, var(--color-primary));
  background: color-mix(in srgb, var(--footer-social-color, var(--color-primary)) 12%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--footer-social-color, var(--color-primary)) 18%, transparent);
}

[data-theme="dark"] .footer-social-link {
  color: var(--footer-social-color-dark, var(--footer-social-color, var(--color-primary)));
  border-color: var(--color-border);
}

[data-theme="dark"] .footer-social-link:hover {
  color: var(--footer-social-color-dark, var(--footer-social-color, var(--color-primary)));
  border-color: var(--footer-social-color-dark, var(--footer-social-color, var(--color-primary)));
  background: color-mix(in srgb, var(--footer-social-color-dark, var(--footer-social-color, var(--color-primary))) 12%, transparent);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--footer-social-color-dark, var(--footer-social-color, var(--color-primary))) 18%, transparent);
}

.footer-social-link.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.footer-social-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* ===== Footer Middle Section: 网站统计卡片 ===== */
.footer-middle {
  min-width: 0;
}

/* 统计卡片 */
.footer-card.footer-profile-card {
  padding: 0;
  overflow: hidden;
}

/* 统计网格 */
.footer-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
}

.footer-stat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 4px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--color-primary) 3%, var(--color-card));
  border: 1px solid var(--color-border-light, var(--color-border));
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  min-width: 0;
  text-align: center;
}

.footer-stat-cell:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-card));
  transform: translateY(-2px);
}

.footer-stat-cell-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: #fff;
  flex-shrink: 0;
}

.footer-stat-cell-icon svg {
  width: 13px;
  height: 13px;
}

.footer-stat-cell-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.footer-stat-cell-value-text {
  font-size: 12px;
  font-weight: 600;
}

.footer-stat-cell-label {
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* 统计图标配色 */
.footer-stat-icon-post {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover, var(--color-primary)));
  box-shadow: 0 2px 6px color-mix(in srgb, var(--color-primary) 30%, transparent);
}
.footer-stat-icon-category {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}
.footer-stat-icon-tag {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}
.footer-stat-icon-visit {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  box-shadow: 0 2px 6px rgba(6, 182, 212, 0.3);
}
.footer-stat-icon-like {
  background: linear-gradient(135deg, #ec4899, #be185d);
  box-shadow: 0 2px 6px rgba(236, 72, 153, 0.3);
}
.footer-stat-icon-comment {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}
.footer-stat-icon-join {
  background: linear-gradient(135deg, #64748b, #475569);
  box-shadow: 0 2px 6px rgba(100, 116, 139, 0.3);
}
.footer-stat-icon-location {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

/* 旧的链接列表样式保留为空类，避免兼容性问题（已无元素使用） */
.footer-links {
  display: none;
}
.footer-link-item {
  display: none;
}

/* Subscribe */
.footer-subscribe {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-subscribe-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  letter-spacing: 0.3px;
}

.footer-subscribe-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0;
}

.footer-subscribe-form {
  display: flex;
  gap: 8px;
  position: relative;
}

/* 订阅提示气泡 */
.footer-subscribe-tip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 10;
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  color: #fff;
  background: #1f293b;
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-subscribe-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 24px;
  border: 6px solid transparent;
  border-top-color: #1f293b;
}

.footer-subscribe-tip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.footer-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.footer-input-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
  transition: color var(--transition);
}

.footer-input-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition);
}

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

.footer-input-wrap input:focus {
  border-color: var(--color-primary);
  background: var(--color-card);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.footer-input-wrap:focus-within svg {
  color: var(--color-primary);
}

.footer-subscribe-btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.footer-subscribe-btn:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 35%, transparent);
}

.footer-subscribe-form[action="#"] .footer-subscribe-btn {
  cursor: default;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.footer-legal svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
}

.footer-legal a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

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

.footer-legal span {
  color: var(--color-border);
}


.footer-bottom {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding-top: 24px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer-bottom::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--color-primary) 45%, transparent),
    transparent
  );
}

/* 版权信息 + 备案徽章 */
.footer-copy {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
}

.footer-copy-text {
  color: var(--color-text-muted);
}

.footer-copy-text a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

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

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 7px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  /*color: var(--color-text-secondary);*/
  /*background: var(--color-bg);*/
  /*border: 1px solid var(--color-border);*/
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition);
}

.footer-badge:hover {
  color: var(--color-primary);
  border-color: color-mix(in srgb, var(--color-primary) 50%, var(--color-border));
  background: var(--color-primary-bg);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.footer-badge-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.footer-badge:hover .footer-badge-icon {
  transform: scale(1.08);
}

/* Powered by / Theme */
.footer-powered {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 13px;
}

.footer-powered-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer-powered-icon {
  width: 13px;
  height: 13px;
  color: var(--color-primary);
}

.footer-powered-dot {
  color: var(--color-border);
  user-select: none;
}

.footer-powered a {
  color: var(--color-text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}

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

@media (max-width: 1024px) {
  .footer-profile-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 20px;
    text-align: center;
  }

  .footer-brand {
    align-items: center;
  }

  .footer-desc {
    max-width: none;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-subscribe {
    width: 100%;
  }

  .footer-subscribe-form {
    flex-wrap: wrap;
  }

  .footer-input-wrap,
  .footer-subscribe-btn {
    width: 100%;
  }

  .footer-legal {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 14px;
    text-align: center;
  }

  .footer-copy,
  .footer-powered {
    justify-content: center;
  }
}

/* ============================================
   UTILITY
   ============================================ */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-8 {
  margin-top: 2rem;
}

.hidden {
  display: none !important;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  opacity: 0.4;
}

/* 触屏设备：轮播箭头常驻显示（无 hover） */
@media (hover: none) {
  .featured-carousel .carousel-arrow {
    opacity: 1;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
/* 平板（769–1024px）：收窄内容、缩小说边栏，避免两栏挤压 */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 280px;
    --content-gap: 18px;
  }

  .featured-card {
    min-height: 280px;
  }

  .featured-content {
    padding: 28px 24px;
  }

  .article-detail {
    padding: 32px 28px;
  }

  .article-detail-cover {
    margin: -32px -28px 24px;
    height: 260px;
  }

  .page-header-card {
    padding: 24px 26px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  body {
    /* 给底部浮动操作栏留出空间，避免遮挡正文/评论 */
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* 文章页底部需多留空间，避开浮动操作栏 */
  .post-layout ~ * {
    margin-bottom: 0;
  }

  body:has(.post-actions) {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .header-inner {
    gap: 12px;
  }

  .header-logo {
    gap: 8px;
  }

  .header-logo .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .header-logo .logo-name {
    font-size: 15px;
    letter-spacing: 0.3px;
  }

  .header-actions {
    gap: 6px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .search-box {
    padding: 7px 10px;
  }

  .section-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .section-title {
    font-size: 16px;
  }

  .filter-tab {
    padding: 4px 10px;
    font-size: 12px;
  }

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

  /* 桌面端左侧浮动操作栏：移动端转为贴底毛玻璃横条 */
  .post-actions {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    flex-direction: row;
    gap: 0;
    align-items: stretch;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--color-card) 92%, transparent);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border: none;
    border-top: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
    border-radius: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    z-index: 100;
    max-width: none;
  }

  /* 阅读进度条：贴在横条最上方，彩色渐变细条 */
  .reading-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 1px;
    width: 0;
    background: linear-gradient(
      90deg,
      var(--color-primary) 0%,
      var(--color-primary-light) 50%,
      #f59e0b 100%
    );
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px color-mix(in srgb, var(--color-primary) 50%, transparent);
    transition: width 0.1s linear;
    z-index: 101;
  }

  /* 目录按钮百分比文字 */
  .post-actions .action-toc .toc-percent {
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--color-primary);
    min-width: 28px;
    text-align: center;
  }

  /* 按钮平分宽度，去除独立卡片感 */
  .post-actions .action-btn {
    flex: 1;
    width: auto;
    height: 44px;
    flex-direction: row;
    gap: 6px;
    box-shadow: none;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
  }

  .post-actions .action-btn svg {
    width: 19px;
    height: 19px;
  }

  .post-actions .action-btn .action-count {
    font-size: 12px;
  }

  .post-actions .action-btn:hover,
  .post-actions .action-btn:active {
    transform: none;
    background: color-mix(in srgb, var(--color-primary-bg) 70%, transparent);
    color: var(--color-primary);
    box-shadow: none;
  }

  /* 点赞激活态：主色实心 */
  .post-actions .action-upvote.liked {
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary-bg) 80%, transparent);
  }

  /* 分享菜单：从底部向上展开，居中浮动卡片 */
  .post-actions .action-share-menu {
    left: 50%;
    right: auto;
    bottom: calc(64px + env(safe-area-inset-bottom));
    top: auto;
    transform: translateX(-50%) translateY(8px);
    flex-direction: row;
    gap: 4px;
    padding: 8px;
    border-radius: var(--radius-lg);
  }

  .post-actions .action-share-menu.show {
    transform: translateX(-50%) translateY(0);
  }

  .post-actions .share-item {
    flex-direction: column;
    gap: 4px;
    padding: 8px 14px;
    font-size: 11px;
    border-radius: var(--radius-md);
  }

  .post-actions .share-item svg {
    width: 20px;
    height: 20px;
  }

  /* 回顶按钮并入横条，默认可见（不受桌面端 .show 滚动控制） */
  .post-actions .action-backtop {
    opacity: 1;
    visibility: visible;
  }

  /* 回顶按钮禁用态：已在顶部时不可点击 */
  .post-actions .action-backtop.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
  }

  /* 目录按钮：移动端横条里显示 */
  .post-actions .action-toc {
    display: flex;
  }

  /* 桌面端 TOC 侧栏隐藏，由 FAB + 抽屉接管 */
  .toc-sidebar {
    display: none;
  }

  .header-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 14px 14px calc(20px + env(safe-area-inset-bottom));
    /* 毛玻璃透明背景 */
    background: color-mix(in srgb, var(--color-bg) 95%, transparent);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border-top: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
    gap: 6px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: none;
    transform: translateY(-16px);
    opacity: 0;
    transition:
      transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.28s ease;
  }

  .header-nav.open {
    display: flex;
    pointer-events: auto;
    transform: translateY(0);
    opacity: 1;
  }

  /* 菜单项：圆角、轻背景、错峰入场动画 */
  .header-nav > .nav-item {
    opacity: 0;
    transform: translateX(-24px);
    transition:
      transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.26s ease;
  }

  .header-nav.open > .nav-item {
    opacity: 1;
    transform: translateX(0);
  }
  .header-nav.open > .nav-item:nth-child(1) {
    transition-delay: 0.06s;
  }
  .header-nav.open > .nav-item:nth-child(2) {
    transition-delay: 0.12s;
  }
  .header-nav.open > .nav-item:nth-child(3) {
    transition-delay: 0.18s;
  }
  .header-nav.open > .nav-item:nth-child(4) {
    transition-delay: 0.24s;
  }
  .header-nav.open > .nav-item:nth-child(5) {
    transition-delay: 0.3s;
  }
  .header-nav.open > .nav-item:nth-child(6) {
    transition-delay: 0.36s;
  }
  .header-nav.open > .nav-item:nth-child(n + 7) {
    transition-delay: 0.42s;
  }

  .header-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
    background: color-mix(in srgb, var(--color-card) 70%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-border) 45%, transparent);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    width: 100%;
  }

  .header-nav .nav-link:active {
    color: var(--color-primary);
    border-color: var(--color-primary-border);
  }

  .header-nav .nav-link .iconfont {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 20px;
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary-bg) 75%, transparent);
    border-radius: 50%;
    flex-shrink: 0;
  }

  .header-nav .nav-link > span {
    flex: 1;
    min-width: 0;
    letter-spacing: 0.3px;
  }

  .header-nav .nav-caret {
    width: 18px;
    height: 18px;
    margin-left: auto;
    opacity: 0.65;
  }

  .header-nav .nav-item.is-open > .nav-link > .nav-caret {
    transform: rotate(180deg);
  }

  .header-nav .nav-link.active,
  .header-nav .nav-item.is-active > .nav-link {
    color: var(--color-primary);
    font-weight: 600;
    background: color-mix(in srgb, var(--color-primary-bg) 60%, transparent);
    border-color: var(--color-primary-border);
  }

  .header-nav .nav-link.active::after,
  .header-nav .nav-item.is-active > .nav-link::after {
    display: none;
  }

  .header-nav .nav-link.active .iconfont,
  .header-nav .nav-item.is-active > .nav-link .iconfont {
    color: #fff;
    background: var(--color-primary);
  }

  /* Mobile accordion submenu */
  .header-nav .nav-dropdown {
    position: static;
    min-width: 0;
    width: 100%;
    margin-top: 6px;
    padding: 0 0 0 18px;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    gap: 6px;
  }

  .header-nav .nav-dropdown::before {
    display: none;
  }

  .header-nav .nav-item.is-open > .nav-dropdown {
    display: flex;
    flex-direction: column;
  }

  .header-nav .nav-dropdown .nav-link {
    padding: 12px 14px;
    font-size: 15px;
  }

  .header-nav .nav-dropdown .nav-caret {
    transform: none;
  }

  .header-nav .nav-dropdown .nav-item.is-open > .nav-link > .nav-caret {
    transform: rotate(180deg);
  }

  .header-nav .nav-dropdown .nav-dropdown {
    left: auto;
    top: auto;
    padding-left: 14px;
  }

  .header-logo .logo-tagline {
    display: none;
  }

  .search-box .search-placeholder {
    display: none;
  }

  .search-box .search-kbd {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

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

  .sidebar {
    display: none;
  }

  .site-main {
    padding: 20px 0 40px;
  }

  .featured-content {
    padding: 20px;
  }

  .featured-title {
    font-size: 20px;
  }

  .article-card {
    padding: 16px;
  }

  .article-thumb {
    width: 110px;
    height: auto;
    align-self: stretch;
  }

  .article-detail {
    padding: 24px 20px;
  }

  .article-detail-cover {
    margin: -24px -20px 20px;
    height: 200px;
  }

  .article-detail-title {
    font-size: 22px;
  }

  .article-detail-header {
    margin-bottom: 20px;
    padding-bottom: 18px;
  }

  .article-detail-meta {
    gap: 12px;
    font-size: 12px;
  }

  .prose {
    font-size: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .prose h1 {
    font-size: 1.5em;
  }

  .prose h2 {
    font-size: 1.35em;
  }

  .prose h3 {
    font-size: 1.15em;
  }

  .prose pre {
    padding: 14px 16px;
    font-size: 0.82em;
    border-radius: var(--radius-md);
  }

  .prose blockquote {
    padding: 10px 14px;
  }

  .prose th,
  .prose td {
    padding: 8px 10px;
  }

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

  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 36px 32px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 14px;
    text-align: center;
  }

  .footer-copy,
  .footer-powered {
    justify-content: center;
  }

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

  .archive-post-date {
    width: auto;
    font-size: 12px;
  }
}

/* 移动端 TOC 底部抽屉（由底部横条 #tocBtn 触发，≤768px 显示） */
.toc-drawer-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 200;
  /* 默认不参与命中检测，避免移动端 display:block 后吞掉整页点击 */
  pointer-events: none;
}

.toc-drawer-mask.show {
  opacity: 1;
  /* 仅在显示遮罩时才响应点击（点击遮罩关闭抽屉） */
  pointer-events: auto;
}

.toc-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 65vh;
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(100%);
  transition: transform 0.28s ease;
  z-index: 201;
  visibility: hidden;
}

.toc-drawer.open {
  transform: translateY(0);
  visibility: visible;
}

.toc-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.toc-drawer-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.toc-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.toc-drawer-close:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.toc-drawer-close svg {
  width: 18px;
  height: 18px;
}

.toc-drawer-nav {
  overflow-y: auto;
  padding: 12px 18px 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--color-primary) 45%, transparent) transparent;
}

.toc-drawer-nav::-webkit-scrollbar {
  width: 3px;
}

.toc-drawer-nav::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-primary) 40%, transparent);
  border-radius: 9999px;
}

.toc-drawer-nav::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--color-primary) 70%, transparent);
}

@media (max-width: 768px) {
  .toc-drawer-mask {
    display: block;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 14px;
  }

  .article-card {
    flex-direction: column;
  }

  .article-thumb {
    width: 100%;
    height: 160px;
    align-self: auto;
  }

  .article-card-title {
    font-size: 15px;
  }

  .article-card-excerpt {
    -webkit-line-clamp: 3;
  }

  .category-cards {
    grid-template-columns: 1fr;
  }

  .featured-content {
    padding: 18px 16px;
  }

  .featured-title {
    font-size: 18px;
  }

  .featured-desc {
    font-size: 13px;
  }

  .featured-meta {
    gap: 10px;
    font-size: 12px;
  }

  .archive-post-list li {
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 10px 14px;
  }

  .archive-post-date {
    width: auto;
    font-size: 12px;
  }

  .archive-post-title {
    font-size: 13px;
    flex: 1;
    min-width: 0;
  }

  .archive-timeline {
    padding-left: 18px;
  }

  .archive-timeline::before {
    left: 4px;
  }

  .archive-year-dot {
    left: -18px;
    width: 10px;
    height: 10px;
  }

  .archive-month-dot {
    left: -15px;
    width: 6px;
    height: 6px;
  }

  .archive-year-label {
    font-size: 16px;
  }

  .article-detail {
    padding: 20px 16px;
  }

  .article-detail-cover {
    margin: -20px -16px 18px;
    height: 170px;
  }

  .article-detail-title {
    font-size: 20px;
  }

  .page-header-card {
    padding: 22px 18px;
  }

  .page-header-card h1 {
    font-size: 19px;
  }

  .widget {
    padding: 16px;
  }

  .pagination > a,
  .pagination > span {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }

  .article-list.grid-view {
    grid-template-columns: 1fr;
  }

  .article-list.grid-view .article-thumb {
    height: 160px;
  }
}

/* ============================================
   IMAGE VIEWER（文章图片点击放大查看器）
   ============================================ */
.prose img {
  cursor: zoom-in;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.image-viewer.open {
  opacity: 1;
  visibility: visible;
}

.image-viewer img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform-origin: center;
  transition: transform 0.15s ease;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

.image-viewer img:active {
  cursor: grabbing;
}

.image-viewer-tip {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* ==================== Feed Page (RSS 资讯) ==================== */

/* Plugin Not Installed Notice */
.feed-notice {
  text-align: center;
  padding: 80px 24px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.feed-notice-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

.feed-notice-icon svg {
  width: 32px;
  height: 32px;
}

.feed-notice h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--color-text);
}

.feed-notice p {
  color: var(--color-text-secondary);
  font-size: 14px;
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Hero Metrics */
.feed-hero-inner {
  padding-top: 30px;
  padding-bottom: 30px;
}

.feed-hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.feed-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-hero-stat-num {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.feed-hero-stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  letter-spacing: 0.5px;
}

.feed-hero-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--color-border);
}

/* Three-Column Feed Layout */
.feed-layout {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: var(--content-gap);
  align-items: start;
  margin-top: var(--content-gap);
}

/* Sidebar (Left & Right) */
.feed-sidebar--left {
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.feed-sidebar--right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.feed-sidebar-inner {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.feed-sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
  padding: 0 4px;
  letter-spacing: 0.3px;
}

.feed-sidebar-title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Channel Navigation */
.feed-channel-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}

.feed-channel-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.feed-channel-list a:hover {
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

.feed-channel-list a.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
}

.feed-channel-list a small {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--color-border-light);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  transition: all var(--transition);
}

.feed-channel-list a:hover small {
  background: color-mix(in srgb, var(--color-primary) 15%, transparent);
  color: var(--color-primary);
}

.feed-channel-list a.active small {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Manage Button */
.feed-manage-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-primary);
  background: var(--color-primary-bg);
  text-decoration: none;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.feed-manage-btn:hover {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  border-color: var(--color-primary-border);
}

.feed-manage-btn svg {
  width: 16px;
  height: 16px;
}

/* Feed Main (Center Column) */
.feed-main {
  min-width: 0;
}

/* Feed Section (header + list as one unit) — wrapped in a single bordered panel */
.feed-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 24px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.feed-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feed-section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.feed-section-title h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  letter-spacing: 0.2px;
}

.feed-toolbar-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--color-border-light);
  transition: all var(--transition);
  flex-shrink: 0;
}

.feed-toolbar-reset:hover {
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.feed-toolbar-reset svg {
  width: 14px;
  height: 14px;
}

/* Feed List — clean timeline style, no per-item cards */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Feed Item — minimal, divided by hairline separators */
.feed-item {
  padding: 16px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid var(--color-border-light);
  transition: all var(--transition);
}

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

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

.feed-item:hover .feed-item-title {
  color: var(--color-primary);
}

.feed-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.feed-item-source {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

/* Colored rounded-square avatar like InfoQ style */
.feed-item-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

[data-theme="dark"] .feed-item-avatar {
  background: transparent;
}

.feed-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-item-author {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Time on right side */
.feed-item-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.feed-item-time svg {
  width: 13px;
  height: 13px;
  opacity: 0.6;
}

.feed-item-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.feed-item-time svg {
  width: 13px;
  height: 13px;
  opacity: 0.7;
}

/* Title — bold, prominent */
.feed-item-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text);
  text-decoration: none;
  margin-bottom: 6px;
  transition: color var(--transition);
}

.feed-item-title:hover {
  color: var(--color-primary);
}

/* Summary — muted, multi-line clamp */
.feed-item-summary {
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Empty State — clean, no heavy card */
.feed-empty {
  text-align: center;
  padding: 64px 24px;
}

.feed-empty svg {
  width: 48px;
  height: 48px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  opacity: 0.4;
}

.feed-empty p {
  font-size: 15px;
  color: var(--color-text);
  margin-bottom: 8px;
  font-weight: 500;
}

.feed-empty small {
  font-size: 12px;
  color: var(--color-text-muted);
  max-width: 360px;
  display: block;
  margin: 0 auto;
  line-height: 1.6;
}

/* Load More — clean text link style */
.feed-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: var(--color-border-light);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.feed-load-more:hover {
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.feed-load-more svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition);
}

.feed-load-more:hover svg {
  transform: translateY(2px);
}

.feed-load-more.loading {
  pointer-events: none;
  opacity: 0.7;
}

/* Right Sidebar Widgets */
.feed-widget {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

/* Overview Widget — minimal, no lines */
.feed-overview-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-bottom: 8px;
}

.feed-overview-hero-num {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.feed-overview-hero-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.feed-overview-hero-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 3px;
}

.feed-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  margin-top: 10px;
}

.feed-overview-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 8px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-bg);
  transition: background var(--transition);
  cursor: default;
}

.feed-overview-cell:hover {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.feed-overview-cell-icon {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
  opacity: 0.75;
}

.feed-overview-cell-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.feed-overview-cell-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
}

.feed-overview-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.feed-overview-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.feed-overview-dot.is-ok {
  background: #2ecc71;
  box-shadow: 0 0 0 3px color-mix(in srgb, #2ecc71 22%, transparent);
}

.feed-overview-dot.is-warn {
  background: #f39c12;
  box-shadow: 0 0 0 3px color-mix(in srgb, #f39c12 22%, transparent);
}

/* Active Channels */
.feed-active-channels {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}

.feed-active-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition);
}

.feed-active-channel:hover {
  background: var(--color-border-light);
}

.feed-active-channel-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--color-border);
}

.feed-active-channel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-active-channel-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.feed-active-channel-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-active-channel-info small {
  font-size: 10px;
  color: var(--color-text-muted);
}

.feed-active-channel-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
}

/* Verification status dot */
.feed-verify-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--transition);
}

.feed-verify-dot.is-ok {
  background: #2ecc71;
  box-shadow: 0 0 0 3px color-mix(in srgb, #2ecc71 18%, transparent);
}

.feed-verify-dot.is-warn {
  background: #e67e22;
  box-shadow: 0 0 0 3px color-mix(in srgb, #e67e22 18%, transparent);
}

.feed-verify-dot.is-gray {
  background: var(--color-text-muted);
  opacity: 0.35;
}

/* Status text */
.feed-verify-text {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 450;
}

/* RSS feed count badge */
.feed-rss-count {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-weight: 500;
}

/* Status code pill */
.feed-verify-code {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0 5px;
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
  line-height: 16px;
}

/* External arrow icon */
.feed-verify-arrow {
  display: inline-flex;
  align-items: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.feed-active-channel:hover .feed-verify-arrow {
  opacity: 0.6;
}

.feed-verify-arrow svg {
  width: 12px;
  height: 12px;
  color: var(--color-primary);
}

/* Quote Widget */
.feed-quote {
  background: linear-gradient(135deg, var(--color-primary-bg), color-mix(in srgb, var(--color-primary) 5%, var(--color-card)));
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
}

.feed-quote-icon {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
  opacity: 0.4;
  margin: 0 auto 10px;
  display: block;
}

.feed-quote-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 8px;
  font-style: italic;
}

.feed-quote-author {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-style: normal;
}

/* Links CTA */
.feed-links-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.feed-links-cta:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.feed-links-cta svg {
  width: 16px;
  height: 16px;
}

.feed-links-cta svg:last-child {
  transition: transform var(--transition);
}

.feed-links-cta:hover svg:last-child {
  transform: translateX(3px);
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .feed-layout {
    grid-template-columns: 200px 1fr 240px;
    gap: 20px;
  }
}

@media (max-width: 1024px) {
  .feed-layout {
    grid-template-columns: 1fr;
  }

  .feed-sidebar--left,
  .feed-sidebar--right {
    position: static;
  }

  .feed-sidebar--left .feed-sidebar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }

  .feed-channel-list {
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 0;
    flex: 1;
  }

  .feed-channel-list a {
    white-space: nowrap;
  }

  .feed-sidebar-title {
    margin-bottom: 0;
    white-space: nowrap;
  }

  .feed-manage-btn {
    margin-left: auto;
  }

  .feed-sidebar--right {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .feed-widget,
  .feed-quote,
  .feed-links-cta {
    flex: 1 1 280px;
  }
}

@media (max-width: 768px) {
  .feed-hero-inner {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .feed-hero-stats {
    gap: 12px;
  }

  .feed-hero-stat-num {
    font-size: 1.4rem;
  }

  .feed-hero-stat-divider {
    height: 24px;
  }

  .feed-sidebar--right {
    flex-direction: column;
  }

  .feed-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .feed-item-author {
    max-width: 200px;
  }
}
