/* ============================================
   shared.css - 全站共享样式文件
   暗色/浅色双主题系统 | 组件样式 | 工具类 | 动画
   ============================================ */

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

/* ============================================
   CSS 变量 - 暗色主题（默认）
   ============================================ */
:root {
  /* 主色调 */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-card: #16162a;
  --bg-hover: #1e1e3a;
  --bg-glass: rgba(10, 10, 15, 0.75);

  /* 文字颜色 */
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-accent: #6366f1;

  /* 强调色 */
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-light: rgba(99, 102, 241, 0.15);
  --accent-glow: rgba(99, 102, 241, 0.3);

  /* 边框与阴影 */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

  /* 滚动条 */
  --scrollbar-thumb: #2a2a4a;
  --scrollbar-track: transparent;

  /* 其他 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;

  /* 导航栏高度 */
  --nav-height: 64px;
}

/* ============================================
   CSS 变量 - 浅色主题
   ============================================ */
[data-theme="light"] {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e8e8ed;
  --bg-card: #ffffff;
  --bg-hover: #f0f0f5;
  --bg-glass: rgba(245, 245, 247, 0.8);

  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --text-accent: #6366f1;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.1);
  --accent-glow: rgba(99, 102, 241, 0.2);

  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.1);

  --scrollbar-thumb: #c5c5cc;
  --scrollbar-track: transparent;
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  transition: var(--transition);
}

input, textarea, select {
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

/* ============================================
   滚动条美化
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Firefox 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ============================================
   选中文字样式
   ============================================ */
::selection {
  background: var(--accent-light);
  color: var(--accent);
}

/* ============================================
   工具类
   ============================================ */

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Flex 工具 */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* 文字截断 */
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-ellipsis-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-ellipsis-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 间距 */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ============================================
   导航栏
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
  transition: var(--transition);
}

/* 滚动后毛玻璃效果 */
.navbar.scrolled {
  background: rgba(var(--bg-glass-rgb, 10, 10, 15), 0.9);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Logo - 左对齐 */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.navbar-logo:hover {
  color: var(--accent);
}

.navbar-logo .logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}

/* 导航链接 - 居中 */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.navbar-links a {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}

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

.navbar-links a.active {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
  background: none;
}

/* 右侧按钮组 */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 通用图标按钮 */
.navbar-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  font-size: 1.1rem;
}

.navbar-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* 主题切换按钮 */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  font-size: 1.1rem;
  cursor: pointer;
}

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

/* 太阳/月亮图标切换 */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  transition: var(--transition);
}

:root .theme-toggle .icon-sun {
  display: none;
}

:root .theme-toggle .icon-moon {
  display: block;
}

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

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

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

.hamburger:hover {
  background: var(--bg-hover);
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

/* 汉堡菜单展开动画 */
.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

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

/* 移动端菜单面板 */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 999;
  padding: 24px;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  transform: translateY(-10px);
  opacity: 0;
  transition: var(--transition);
}

.mobile-menu.active {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu a {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.mobile-menu a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.mobile-menu a.active {
  color: var(--accent);
  font-weight: 600;
  background: none;
}

/* ============================================
   页脚
   ============================================ */
.footer {
  margin-top: auto;
  padding: 40px 20px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  transition: var(--transition);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: var(--transition);
}

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

.footer-copy {
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.footer-powered {
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

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

/* ============================================
   文章卡片（横向布局：左图右文）
   ============================================ */
.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  text-decoration: none;
}

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

/* 图片链接 */
.article-card .card-cover-link {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
}

/* 标题链接 */
.article-card .card-title-link {
  text-decoration: none;
  color: inherit;
}

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

/* 封面图（左侧固定尺寸） */
.article-card .card-cover {
  width: 140px;
  min-width: 140px;
  height: 100px;
  min-height: 100px;
  overflow: hidden;
  position: relative;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.article-card .card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

/* 无封面图时的占位 */
.article-card .card-cover .cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-card));
  color: var(--text-tertiary);
  font-size: 1.5rem;
}

/* 卡片内容区（右侧） */
.article-card .card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

/* 标题 */
.article-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: var(--transition);
}

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

/* 摘要 */
.article-card .card-excerpt {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 底部信息栏 */
.article-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

/* 日期 */
.article-card .card-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* 分类标签 */
.article-card .card-category {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-xl);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
  transition: var(--transition);
  flex-shrink: 0;
}

.article-card:hover .card-category {
  background: var(--accent);
  color: #fff;
}

/* 文章卡片网格布局（横向卡片单列排列） */
.article-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================
   侧边栏
   ============================================ */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 侧边栏卡片通用样式 */
.sidebar-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px;
  transition: var(--transition);
}

.sidebar-card:hover {
  border-color: var(--border-hover);
}

.sidebar-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-card-title::before {
  content: '';
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent);
}

/* 用户信息卡片（头像 + 站点名） */
.sidebar-profile {
  text-align: center;
  padding: 28px 20px;
}

.sidebar-profile .profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 12px;
  overflow: hidden;
  border: 3px solid var(--accent-light);
  transition: var(--transition);
}

.sidebar-profile:hover .profile-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

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

.sidebar-profile .profile-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.sidebar-profile .profile-bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 分类列表 */
.sidebar-categories {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-categories a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.sidebar-categories a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-categories a .cat-count {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-xl);
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}

/* 标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud .tag {
  padding: 4px 12px;
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
}

.tag-cloud .tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* 归档列表 */
.sidebar-archive {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-archive a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.sidebar-archive a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-archive a .archive-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ============================================
   进入动画 - 字母逐字浮现效果
   ============================================ */
.loader-text {
  display: inline-flex;
  overflow: hidden;
}

.loader-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  animation: letterReveal 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 每个字母延迟递增，通过 JS 设置 style */
@keyframes letterReveal {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    filter: blur(4px);
  }
  60% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* ============================================
   Toast 通知样式
   ============================================ */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + 16px);
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.875rem;
  min-width: 280px;
  max-width: 400px;
  pointer-events: auto;
  animation: toastIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  backdrop-filter: blur(10px);
}

.toast.toast-out {
  animation: toastOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Toast 类型 */
.toast.success {
  border-left: 3px solid #22c55e;
}

.toast.success .toast-icon {
  color: #22c55e;
}

.toast.error {
  border-left: 3px solid #ef4444;
}

.toast.error .toast-icon {
  color: #ef4444;
}

.toast.warning {
  border-left: 3px solid #f59e0b;
}

.toast.warning .toast-icon {
  color: #f59e0b;
}

.toast.info {
  border-left: 3px solid var(--accent);
}

.toast.info .toast-icon {
  color: var(--accent);
}

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  color: var(--text-tertiary);
  font-size: 1rem;
  padding: 2px;
  cursor: pointer;
  transition: var(--transition);
}

.toast-close:hover {
  color: var(--text-primary);
}

@keyframes toastIn {
  0% {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
}

/* ============================================
   通用淡入动画
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   主内容区域布局（侧边栏 + 内容）
   ============================================ */
.main-layout {
  display: flex;
  gap: 32px;
  padding-top: calc(var(--nav-height) + 24px);
  padding-bottom: 40px;
  min-height: calc(100vh - var(--nav-height));
}

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

/* ============================================
   Markdown 渲染内容样式
   ============================================ */
.markdown-body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.markdown-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.markdown-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text-primary);
}

.markdown-body p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.markdown-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--accent);
}

.markdown-body pre {
  margin: 16px 0;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.markdown-body pre code {
  padding: 0;
  background: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  line-height: 1.6;
}

.markdown-body ul,
.markdown-body ol {
  margin: 12px 0;
  padding-left: 24px;
}

.markdown-body ul {
  list-style: disc;
}

.markdown-body ol {
  list-style: decimal;
}

.markdown-body li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.markdown-body blockquote {
  margin: 16px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-light);
  color: var(--text-secondary);
}

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

/* ============================================
   搜索弹窗
   ============================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.search-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.search-box {
  width: 90%;
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(-10px) scale(0.98);
  transition: var(--transition);
}

.search-overlay.active .search-box {
  transform: translateY(0) scale(1);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper .search-icon {
  color: var(--text-tertiary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-input-wrapper input {
  flex: 1;
  font-size: 1rem;
  color: var(--text-primary);
}

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

.search-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-item .result-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.search-result-item .result-desc {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ============================================
   响应式 - 768px 断点
   ============================================ */
@media (max-width: 768px) {
  /* 导航栏 */
  .navbar {
    padding: 0 16px;
  }

  .navbar-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* 主布局 */
  .main-layout {
    flex-direction: column;
    gap: 24px;
    padding-top: calc(var(--nav-height) + 16px);
  }

  /* 侧边栏 */
  .sidebar {
    width: 100%;
    order: -1;
  }

  /* 文章卡片网格 */
  .article-grid {
    gap: 12px;
  }

  /* 移动端横向卡片适配 */
  .article-card .card-cover {
    width: 100px;
    min-width: 100px;
    height: 80px;
    min-height: 80px;
  }

  .article-card .card-body {
    padding: 10px 12px;
    gap: 4px;
  }

  .article-card .card-title {
    font-size: 0.9rem;
  }

  .article-card .card-excerpt {
    font-size: 0.75rem;
    -webkit-line-clamp: 1;
  }

  /* 容器 */
  .container {
    padding: 0 16px;
  }

  /* Toast */
  .toast-container {
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }

  /* 页脚 */
  .footer {
    padding: 32px 16px 20px;
  }

  .footer-links {
    gap: 16px;
  }
}

/* ============================================
   加载骨架屏
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- 轮播横幅 ---------- */
.banner-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.banner-carousel .carousel-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.banner-carousel .carousel-slide.active {
  opacity: 1;
}

.banner-carousel .carousel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,15,0.85), rgba(10,10,15,0.3));
}

.banner-carousel .carousel-content {
  position: relative;
  z-index: 2;
}

/* 轮播指示点 */
.carousel-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 3;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: white;
  width: 24px;
  border-radius: 4px;
}

/* ---------- 个人简介 ---------- */
.profile-section {
  padding: 5rem 0;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 3rem;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

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

.profile-info h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.profile-info p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.profile-stats {
  display: flex;
  gap: 2rem;
}

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

.profile-stat .number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.profile-stat .label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

@media (max-width: 768px) {
  .profile-card {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  .profile-stats {
    justify-content: center;
  }
}
