/* ================================================================ */
/* ====== 可修改区域：主题颜色变量 ====== */
/* 修改这里的颜色值即可改变整个网站的主题色 */
/* ================================================================ */
:root {
  /* 主色调 - 深色清爽主题 */
  --bg-primary: #0d1117;       /* 主背景色 */
  --bg-secondary: #161b22;     /* 卡片/侧栏背景色 */
  --bg-tertiary: #21262d;      /* 悬停/高亮背景色 */
  --text-primary: #e6edf3;     /* 主文字颜色 */
  --text-secondary: #8b949e;   /* 次要文字颜色 */
  --text-link: #58a6ff;        /* 链接颜色 */
  --accent: #58a6ff;           /* 强调色（蓝色） */
  --accent-hover: #79c0ff;     /* 强调色悬停 */
  --accent-glow: rgba(88, 166, 255, 0.15); /* 强调色发光 */
  --border: #30363d;           /* 边框颜色 */
  --border-subtle: #21262d;    /* 更淡的边框 */
  --code-bg: #1c2128;          /* 代码块背景色 */
  --success: #3fb950;          /* 成功/绿色 */
  --success-bg: rgba(63, 185, 80, 0.1);
  --warning: #d29922;          /* 警告/黄色 */
  --warning-bg: rgba(210, 153, 34, 0.1);
  --danger: #f85149;           /* 危险/红色 */
  --danger-bg: rgba(248, 81, 73, 0.1);
  --purple: #bc8cff;           /* 紫色 */
  --purple-bg: rgba(188, 140, 255, 0.1);
  --scrollbar-thumb: #30363d;  /* 滚动条颜色 */
  --scrollbar-track: #0d1117;  /* 滚动条轨道 */

  /* 布局尺寸 */
  --sidebar-width: 260px;      /* 侧栏展开宽度 */
  --header-height: 56px;       /* 顶部导航高度 */
  --content-max-width: 860px;  /* 内容区最大宽度 */

  /* iOS 风格缓动函数 */
  --ease-ios: cubic-bezier(.4, .0, .2, 1);
  --ease-ios-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-ios-out: cubic-bezier(.0, .0, .2, 1);
  --ease-ios-in: cubic-bezier(.4, .0, 1, 1);

  /* 阴影 */
  --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 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(88, 166, 255, 0.08);
}

/* ================================================================ */
/* 全局重置 */
/* ================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* 背景微纹理 */
  background-image: 
    radial-gradient(ellipse at 20% 50%, rgba(88, 166, 255, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(188, 140, 255, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(63, 185, 80, 0.02) 0%, transparent 50%);
  background-attachment: fixed;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.25s var(--ease-ios-out);
}

a:hover {
  color: var(--accent-hover);
}

/* 选中文本样式 */
::selection {
  background-color: rgba(88, 166, 255, 0.3);
  color: #fff;
}

/* ================================================================ */
/* 顶部导航栏 */
/* ================================================================ */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 1000;
  gap: 12px;
  /* iOS 毛玻璃效果 */
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  background-color: rgba(22, 27, 34, 0.85);
}

/* 导航栏底部发光线条 */
.top-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--border) 15%, 
    var(--accent) 50%, 
    var(--border) 85%, 
    transparent 100%
  );
  opacity: 0.3;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 汉堡菜单按钮 - iOS 风格动画 */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  width: 36px;
  height: 36px;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  transition: background-color 0.2s var(--ease-ios-out);
}

.menu-toggle:hover {
  background-color: var(--bg-tertiary);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: all 0.35s var(--ease-ios);
  transform-origin: center;
}

/* 汉堡菜单打开状态动画（三条线 → X） */
.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Logo 和站点名称 */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
  transition: opacity 0.2s var(--ease-ios-out);
  position: relative;
}

.logo:hover {
  color: var(--text-primary);
  opacity: 0.8;
}

.logo-img {
  height: 28px;
  width: auto;
  border-radius: 6px;
  transition: transform 0.3s var(--ease-ios);
}

.logo:hover .logo-img {
  transform: scale(1.05);
}

/* 搜索框 */
.header-center {
  flex: 1;
  max-width: 400px;
  margin: 0 auto;
}

.search-box {
  position: relative;
  width: 100%;
}

#searchInput {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.3s var(--ease-ios);
  /* 搜索图标占位 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px;
}

#searchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 15px rgba(88, 166, 255, 0.05);
  background-color: var(--bg-secondary);
}

#searchInput::placeholder {
  color: var(--text-secondary);
}

/* 搜索结果下拉 - iOS 风格弹窗 */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 1001;
  box-shadow: var(--shadow-lg);
  /* iOS 弹出动画 */
  transform-origin: top center;
  animation: searchPopIn 0.35s var(--ease-ios-spring);
}

@keyframes searchPopIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(-8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s var(--ease-ios-out);
  position: relative;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: var(--bg-tertiary);
}

.search-result-item:active {
  background-color: rgba(88, 166, 255, 0.1);
  transition: none;
}

.search-result-item .result-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.search-result-item .result-path {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 2px;
}

.search-result-item .result-match {
  color: var(--accent);
  font-size: 0.8rem;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 顶部导航链接 */
.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all 0.25s var(--ease-ios-out);
  position: relative;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--accent);
}

/* 导航链接底部指示条（iOS 风格） */
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background-color: var(--accent);
  border-radius: 1px;
  animation: indicatorIn 0.3s var(--ease-ios-spring);
  box-shadow: 0 0 6px var(--accent);
}

@keyframes indicatorIn {
  0% {
    width: 0;
    opacity: 0;
  }
  100% {
    width: 20px;
    opacity: 1;
  }
}

/* ================================================================ */
/* 遮罩层（移动端）- iOS 风格淡入淡出 */
/* ================================================================ */
.overlay {
  display: block;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0);
  z-index: 99;
  pointer-events: none;
  transition: background-color 0.4s var(--ease-ios);
}

.overlay.active {
  background-color: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

/* ================================================================ */
/* 布局容器 */
/* ================================================================ */
.layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ================================================================ */
/* 左侧导航栏（侧栏） */
/* ================================================================ */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow: hidden;
  transition: width 0.4s var(--ease-ios), min-width 0.4s var(--ease-ios), border-color 0.4s var(--ease-ios);
  display: flex;
  flex-direction: column;
}

/* 侧栏折叠状态 - 只保留一条窄条，上面有展开按钮 */
.sidebar.collapsed {
  width: 44px;
  min-width: 44px;
  border-right-color: var(--border);
  overflow: visible;
}

/* 折叠时侧栏内容隐藏，只显示展开按钮区域 */
.sidebar.collapsed .sidebar-nav,
.sidebar.collapsed .sidebar-title {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 12px 0;
  border-bottom-color: transparent;
}

.sidebar.collapsed .sidebar-collapse {
  writing-mode: vertical-lr;
  letter-spacing: 2px;
  padding: 8px 4px;
  font-size: 0.75rem;
  border-radius: 6px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 45px;
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-collapse {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  transition: all 0.25s var(--ease-ios-out);
  flex-shrink: 0;
}

.sidebar-collapse:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.sidebar-collapse:active {
  transform: scale(0.92);
}

/* 侧栏导航树 */
.sidebar-nav {
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-loading {
  padding: 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
}

/* 导航树节点 */
.nav-tree-item {
  display: block;
}

.nav-tree-link {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.25s var(--ease-ios-out);
  border-left: 3px solid transparent;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  font-weight: 500;
}

/* iOS 风格点击涟漪效果 */
.nav-tree-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s var(--ease-ios-out);
}

.nav-tree-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.nav-tree-link:active::before {
  opacity: 0.06;
}

.nav-tree-link.active {
  color: var(--accent);
  background: linear-gradient(90deg, rgba(88, 166, 255, 0.1), transparent);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* 分类标题（不可点击） */
.nav-tree-category {
  padding: 12px 16px 4px;
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: default;
  opacity: 0.7;
}

/* 子节点缩进 */
.nav-tree-item.depth-1 .nav-tree-link { padding-left: 28px; }
.nav-tree-item.depth-2 .nav-tree-link { padding-left: 40px; }
.nav-tree-item.depth-3 .nav-tree-link { padding-left: 52px; }

/* ================================================================ */
/* 主内容区 */
/* ================================================================ */
.main-content {
  flex: 1;
  padding: 32px 24px;
  max-width: var(--content-max-width);
  margin: 0 auto;
  width: 100%;
  min-height: calc(100vh - var(--header-height) - 60px);
  /* 页面切换淡入动画 */
  animation: contentFadeIn 0.4s var(--ease-ios-out);
}

@keyframes contentFadeIn {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-placeholder {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.content-placeholder h1 {
  color: var(--text-primary);
  margin-bottom: 16px;
  font-size: 2rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.content-placeholder .hint {
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ================================================================ */
/* Markdown 渲染样式 */
/* ================================================================ */
.markdown-body {
  color: var(--text-primary);
  line-height: 1.8;
  word-wrap: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin-top: 32px;
  margin-bottom: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  /* 平滑滚动锚点 */
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.markdown-body h1 { 
  font-size: 2rem; 
  border-bottom: 1px solid var(--border); 
  padding-bottom: 10px; 
  margin-top: 0;
  letter-spacing: -0.02em;
}
.markdown-body h2 { 
  font-size: 1.5rem; 
  border-bottom: 1px solid var(--border-subtle); 
  padding-bottom: 8px; 
  letter-spacing: -0.01em;
}
.markdown-body h3 { 
  font-size: 1.25rem; 
  color: var(--accent-hover);
}
.markdown-body h4 { 
  font-size: 1.1rem; 
}

.markdown-body p {
  margin-bottom: 16px;
}

.markdown-body a {
  color: var(--text-link);
  position: relative;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body img {
  max-width: 100%;
  border-radius: 12px;
  margin: 20px 0;
  transition: transform 0.3s var(--ease-ios), box-shadow 0.3s var(--ease-ios);
  box-shadow: var(--shadow-sm);
}

.markdown-body img:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-md);
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  margin: 20px 0;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(88, 166, 255, 0.03) 100%);
  border-radius: 0 12px 12px 0;
  color: var(--text-secondary);
  position: relative;
}

.markdown-body blockquote::before {
  content: '"';
  position: absolute;
  top: -8px;
  left: 8px;
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.15;
  font-family: Georgia, serif;
  line-height: 1;
}

.markdown-body code {
  background-color: var(--code-bg);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.875em;
  color: var(--accent-hover);
  border: 1px solid rgba(88, 166, 255, 0.1);
}

.markdown-body pre {
  background: linear-gradient(135deg, var(--code-bg) 0%, #1a1f2e 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
  position: relative;
}

.markdown-body pre::before {
  content: '```';
  position: absolute;
  top: 8px;
  right: 14px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.4;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

.markdown-body pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.85rem;
  line-height: 1.7;
  border: none;
}

.markdown-body ul,
.markdown-body ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.markdown-body li {
  margin-bottom: 6px;
}

.markdown-body li::marker {
  color: var(--accent);
}

.markdown-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.markdown-body th,
.markdown-body td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.markdown-body th {
  background-color: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.markdown-body tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.015);
}

.markdown-body tr:hover {
  background-color: rgba(88, 166, 255, 0.04);
}

.markdown-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 32px 0;
}

.markdown-body .task-list-item {
  list-style: none;
}

.markdown-body .task-list-item input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--accent);
}

/* ================================================================ */
/* 文章内目录（TOC） */
/* ================================================================ */
.article-toc {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(88, 166, 255, 0.03) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
  transition: box-shadow 0.3s var(--ease-ios), border-color 0.3s var(--ease-ios);
}

.article-toc:hover {
  box-shadow: var(--shadow-glow);
  border-color: rgba(88, 166, 255, 0.2);
}

.article-toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.article-toc-list {
  list-style: none;
  padding: 0;
}

.article-toc-list li {
  margin-bottom: 4px;
}

.article-toc-list a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: block;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.2s var(--ease-ios-out);
}

.article-toc-list a:hover {
  color: var(--accent);
  background-color: rgba(88, 166, 255, 0.08);
  padding-left: 14px;
}

.article-toc-list .toc-h2 { padding-left: 16px; }
.article-toc-list .toc-h3 { padding-left: 32px; }

/* ================================================================ */
/* 文章列表页样式 */
/* ================================================================ */
.article-list {
  display: grid;
  gap: 12px;
}

.article-card {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(22, 27, 34, 0.8) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s var(--ease-ios);
  position: relative;
  overflow: hidden;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s var(--ease-ios);
}

.article-card:hover::before {
  opacity: 1;
}

.article-card:hover {
  border-color: rgba(88, 166, 255, 0.3);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.article-card:active {
  transform: translateY(-1px);
  transition-duration: 0.1s;
}

.article-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: color 0.2s var(--ease-ios);
}

.article-card:hover .article-card-title {
  color: var(--accent-hover);
}

.article-card-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.article-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.article-card-tag {
  background-color: rgba(88, 166, 255, 0.12);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  transition: all 0.2s var(--ease-ios-out);
  border: 1px solid rgba(88, 166, 255, 0.1);
}

.article-card-tag:hover {
  background-color: rgba(88, 166, 255, 0.2);
  border-color: rgba(88, 166, 255, 0.2);
}

/* ================================================================ */
/* 页脚 */
/* ================================================================ */
.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(0deg, var(--bg-secondary) 0%, transparent 100%);
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.2;
}

/* ================================================================ */
/* 自定义滚动条 - iOS 风格 */
/* ================================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
  min-height: 40px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Firefox 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* ================================================================ */
/* 响应式设计 */
/* ================================================================ */

/* 平板及以下 - 侧栏变为抽屉式 */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    z-index: 100;
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    transition: transform 0.4s var(--ease-ios);
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    overflow-y: auto;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* 移动端：collapsed 只影响内部布局，不影响抽屉显隐 */
  .sidebar.collapsed {
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    border-right: 1px solid var(--border);
    overflow-y: auto;
  }

  /* 移动端折叠时恢复内部元素显示 */
  .sidebar.collapsed .sidebar-nav,
  .sidebar.collapsed .sidebar-title {
    display: block;
  }

  .sidebar.collapsed .sidebar-header {
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }

  .sidebar.collapsed .sidebar-collapse {
    writing-mode: horizontal-tb;
    letter-spacing: normal;
    padding: 4px 8px;
    font-size: 0.7rem;
  }

  .main-content {
    padding: 24px 16px;
  }
}

/* 手机 */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .header-center {
    max-width: none;
    margin: 0;
  }

  .header-right {
    display: none;
  }

  .main-content {
    padding: 16px 12px;
  }

  .markdown-body h1 { font-size: 1.6rem; }
  .markdown-body h2 { font-size: 1.3rem; }
  .markdown-body h3 { font-size: 1.1rem; }

  .article-card {
    padding: 14px;
  }
  
  .content-placeholder {
    padding: 40px 16px;
  }
  
  .content-placeholder h1 {
    font-size: 1.5rem;
  }
}

/* 小屏手机 */
@media (max-width: 480px) {
  .logo .site-title {
    font-size: 0.9rem;
  }

  #searchInput {
    font-size: 0.8rem;
    padding: 6px 10px 6px 32px;
    background-position: 10px center;
  }
}

/* ================================================================
   视频容器（文章内嵌视频，居中显示）
   ================================================================ */
.video-container {
  text-align: center;
  margin: 24px 0;
}

/* 封面容器：16:9 横屏展示封面 */
.video-container .video-cover {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.3s var(--ease-ios), transform 0.3s var(--ease-ios);
  background: var(--bg-tertiary, #161b22);
}

.video-container .video-cover:hover {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-1px);
}

.video-container .video-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.5s var(--ease-ios);
}

.video-container .video-cover:hover img {
  transform: scale(1.03);
}

/* 封面上的播放按钮 */
.video-container .video-cover .play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(0,0,0,0.65);
  border: 3px solid rgba(255,255,255,0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-ios);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.video-container .video-cover:hover .play-btn {
  background: rgba(0,0,0,0.85);
  transform: translate(-50%, -50%) scale(1.12);
  border-color: #fff;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.video-container .video-cover .play-btn::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 13px 0 13px 22px;
  border-color: transparent transparent transparent rgba(255,255,255,0.95);
  margin-left: 5px;
}

/* 视频本身（替换封面后显示） */
.video-container video {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  border-radius: 12px;
  background: #000;
  box-shadow: var(--shadow-md);
}

.video-container iframe {
  width: 100%;
  max-width: 720px;
  height: 405px;
  border: none;
  border-radius: 12px;
}

.video-container .video-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  background: var(--bg-tertiary, #161b22);
  border: 2px dashed var(--border, #30363d);
  border-radius: 12px;
  color: var(--text-secondary, #8b949e);
  font-size: 0.9rem;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.3s var(--ease-ios);
}

.video-container .video-placeholder:hover {
  border-color: var(--accent, #58a6ff);
  color: var(--accent, #58a6ff);
}

/* ================================================================
   联系客服按钮样式
   ================================================================ */
.contact-card {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(22, 27, 34, 0.9) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin: 20px 0;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease-ios);
}

.contact-card:hover {
  box-shadow: var(--shadow-md);
}

.contact-card .contact-item {
  margin: 16px 0;
}

.contact-card .contact-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.contact-card .contact-value {
  font-size: 1.05rem;
  color: var(--text-primary);
  word-break: break-all;
}

.contact-card .btn-telegram {
  display: inline-block;
  background: linear-gradient(135deg, #0088cc 0%, #0099dd 100%);
  color: #fff;
  padding: 12px 32px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s var(--ease-ios);
  box-shadow: 0 2px 8px rgba(0, 136, 204, 0.3);
  position: relative;
  overflow: hidden;
}

.contact-card .btn-telegram::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s var(--ease-ios);
}

.contact-card .btn-telegram:hover {
  background: linear-gradient(135deg, #0077b5 0%, #0088cc 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 136, 204, 0.4);
}

.contact-card .btn-telegram:hover::before {
  opacity: 1;
}

.contact-card .btn-telegram:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 136, 204, 0.3);
}

.contact-card .divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 20px 0;
}

.contact-card .qq-group {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(88, 166, 255, 0.03) 100%);
  border: 1px dashed rgba(88, 166, 255, 0.3);
  border-radius: 10px;
  padding: 20px;
  margin-top: 12px;
  transition: border-color 0.3s var(--ease-ios);
}

.contact-card .qq-group:hover {
  border-color: rgba(88, 166, 255, 0.5);
}

.contact-card .qq-group .group-title {
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
}

.contact-card .qq-group .group-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* ================================================================
   Toast 弹窗提示
   ================================================================ */
.toast-copy {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #1a1f2e 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 32px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-ios), transform 0.35s var(--ease-ios-spring);
  min-width: 240px;
}

.toast-copy.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.toast-copy .toast-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  display: block;
  animation: toastBounce 0.5s var(--ease-ios-spring);
}

@keyframes toastBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.toast-copy .toast-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.toast-copy .toast-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.toast-copy .toast-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent) 0%, #4a8fd4 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s var(--ease-ios);
  box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
}

.toast-copy .toast-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.4);
}

.toast-copy .toast-btn:active {
  transform: translateY(0);
}
