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

:root {
  --sidebar-width: 240px;
  --toc-width: 260px;
  --header-height: 52px;
  --footer-height: 48px;
  
  /* 飞书配色 */
  --primary: #3370ff;
  --primary-light: #e8f0ff;
  --primary-hover: #245bdb;
  
  --text-title: #1f2329;
  --text-body: #373c43;
  --text-secondary: #646a73;
  --text-placeholder: #8f959e;
  --text-disabled: #bbbfc4;
  
  --bg-body: #ffffff;
  --bg-container: #f5f6f7;
  --bg-hover: #f0f1f2;
  --bg-active: #e8f0ff;
  
  --border-default: #dee0e3;
  --border-light: #e8e9eb;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 
    'Microsoft YaHei', 'Source Han Sans SC', 'Noto Sans CJK SC', 'WenQuanYi Micro Hei', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-container);
  color: var(--text-body);
  line-height: 1.5;
  font-size: 14px;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* ========== 左侧导航栏 ========== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-body);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--border-light);
  z-index: 100;
}

.sidebar-header {
  padding: 16px;
  flex-shrink: 0;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.logo-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.logo {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-title);
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.15s;
}

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


.search-box {
  position: relative;
  padding: 0 12px 12px;
  flex-shrink: 0;
}

.search-box .search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-70%);
  color: var(--text-placeholder);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 7px 12px 7px 36px;
  background-color: var(--bg-container);
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-body);
  font-size: 13px;
  outline: none;
  transition: all 0.15s;
}

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

.search-box input:focus {
  background-color: var(--bg-body);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

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

.nav-menu {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 16px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.nav-menu::-webkit-scrollbar {
  display: none !important; /* Chrome, Safari, Opera */
  width: 0 !important;
  height: 0 !important;
}

.nav-list {
  list-style: none;
}

.nav-item.loading {
  padding: 24px 12px;
  text-align: center;
}

/* 加载动画 */
.loading-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-placeholder);
  border-radius: 50%;
  animation: loadingDot 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* 目录样式 */
.nav-dir {
  list-style: none;
  margin: 0;
}

.nav-dir-header {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  font-size: 13px;
  color: var(--text-body);
  font-weight: 500;
  border-radius: 6px;
  margin: 1px 0;
  position: relative;
}

.nav-dir-header:hover {
  background-color: var(--bg-hover);
}

.nav-dir-toggle {
  font-size: 10px;
  transition: transform 0.15s;
  color: var(--text-placeholder);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-dir.expanded .nav-dir-toggle {
  transform: rotate(90deg);
}

.nav-dir-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-dir-name.has-readme {
  color: var(--text-body);
  cursor: pointer;
  transition: color 0.15s;
}

.nav-dir-name.has-readme:hover {
  color: var(--primary);
}

.nav-dir.active > .nav-dir-header .nav-dir-name {
  color: var(--primary);
  font-weight: 500;
}

.nav-dir.active > .nav-dir-header {
  background-color: var(--bg-active);
}

.nav-dir.active > .nav-dir-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.nav-dir-children {
  list-style: none;
  padding: 0 0 0 20px;
  margin: 0;
}

/* 文件项样式 */
.nav-item-file {
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  border-radius: 6px;
  margin: 1px 0;
  position: relative;
}

.nav-item-file:hover {
  background-color: var(--bg-hover);
  color: var(--text-body);
}

.nav-item-file.active {
  background-color: var(--bg-active);
  color: var(--primary);
}

.nav-item-file.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.nav-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.nav-file-icon {
  flex-shrink: 0;
  color: inherit;
}

.nav-item-file.active .nav-file-icon {
  color: var(--primary);
}

/* ========== 网站头部 ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-body);
  border-bottom: 1px solid var(--border-light);
  z-index: 101;
}

.header-content {
  max-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-title);
}

.header-logo svg {
  color: var(--primary);
}

.site-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-title);
  margin: 0;
  cursor: pointer;
  transition: color 0.15s;
}

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

.header-divider {
  width: 1px;
  height: 16px;
  background: var(--border-default);
}

.site-description {
  font-size: 13px;
  color: var(--text-placeholder);
  margin: 0;
}

.header-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}

.header-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}

.header-nav .nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-title);
}

.header-nav .nav-link svg {
  flex-shrink: 0;
}

/* ========== 网站底部 ========== */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  background: var(--bg-body);
  border-top: 1px solid var(--border-light);
  z-index: 101;
}

.footer-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 12px;
  color: var(--text-placeholder);
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-divider {
  color: var(--text-disabled);
}

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

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

.footer-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-placeholder);
}

.stat-item svg {
  flex-shrink: 0;
}

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

/* ========== 中间内容区 ========== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-right: var(--toc-width);
  margin-top: var(--header-height);
  margin-bottom: var(--footer-height);
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  background-color: var(--bg-container);
}

.view {
  display: none;
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 56px 64px;
  background-color: var(--bg-body);
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

.view.active {
  display: block;
}

/* ========== 首页 ========== */
.home-container {
  width: 100%;
}

.home-content {
  animation: fadeIn 0.2s ease-out;
}

.welcome-section {
  text-align: center;
  padding: 64px 24px;
}

.welcome-section h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-title);
}

.welcome-section > p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  background: var(--bg-container);
  border-radius: 8px;
  text-align: left;
}

.feature-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: 8px;
  color: var(--primary);
}

.feature-item h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-title);
}

.feature-item p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========== 文章内容 ========== */
.post-content {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.post-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-title);
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

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

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

.meta-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.post-view-count {
  margin-left: auto;
  padding: 4px 10px;
  background: var(--bg-container);
  border-radius: 12px;
  font-size: 12px;
}

/* ========== Markdown 内容 ========== */
.markdown-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-body);
  word-wrap: break-word;
}

.markdown-body > *:first-child {
  margin-top: 0 !important;
}

.markdown-body > *:last-child {
  margin-bottom: 0 !important;
}

/* 文章更新时间（显示在右下角） */
.post-updated-time {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-placeholder);
}

.post-updated-time svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-title);
  margin-top: 36px;
  margin-bottom: 16px;
  scroll-margin-top: 20px;
  letter-spacing: -0.01em;
}

.markdown-body h1 { 
  font-size: 26px; 
  margin-top: 0;
  font-weight: 700;
}

.markdown-body h2 { 
  font-size: 22px; 
  margin-top: 48px;
  padding-bottom: 12px; 
  border-bottom: 1px solid var(--border-light);
}

.markdown-body h3 { 
  font-size: 18px;
  margin-top: 36px;
}

.markdown-body h4 { font-size: 16px; }
.markdown-body h5 { font-size: 15px; }
.markdown-body h6 { font-size: 14px; color: var(--text-secondary); }

.markdown-body p {
  margin-bottom: 16px;
}

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

.markdown-body li {
  margin-bottom: 6px;
}

.markdown-body li > p {
  margin: 0;
}

.markdown-body li > ul,
.markdown-body li > ol {
  margin-top: 6px;
  margin-bottom: 0;
}

.markdown-body code {
  padding: 3px 8px;
  font-size: 13px;
  background-color: rgba(51, 112, 255, 0.08);
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, Menlo, Consolas, monospace;
  color: #476582;
}

.markdown-body pre {
  padding: 20px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.7;
  background-color: #fafbfc;
  border-radius: 8px;
  margin: 20px 0;
  border: 1px solid var(--border-light);
  position: relative;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  color: var(--text-body);
  font-size: 13px;
}

/* 代码块复制按钮 */
.code-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-body);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.markdown-body pre:hover .code-copy-btn {
  opacity: 1;
  pointer-events: auto;
}

.code-copy-btn:hover {
  background: var(--bg-hover);
  color: var(--text-body);
  border-color: var(--border-default);
}

.code-copy-btn:active {
  transform: scale(0.95);
}

.code-copy-btn.copied {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.code-copy-btn svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.code-copy-btn .copy-text {
  font-size: 12px;
  line-height: 1;
}

.markdown-body blockquote {
  padding: 16px 20px;
  margin: 20px 0;
  color: var(--text-secondary);
  background: linear-gradient(to right, rgba(51, 112, 255, 0.04), transparent);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
}

.markdown-body blockquote > :first-child { margin-top: 0; }
.markdown-body blockquote > :last-child { margin-bottom: 0; }

.markdown-body a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.markdown-body a:hover {
  border-bottom-color: var(--primary);
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.markdown-body img:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.markdown-body table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  font-size: 14px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.markdown-body th,
.markdown-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}

.markdown-body th {
  background: var(--bg-container);
  font-weight: 600;
  color: var(--text-title);
  font-size: 13px;
}

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

.markdown-body tbody tr:hover {
  background: rgba(51, 112, 255, 0.02);
}

.markdown-body hr {
  height: 0;
  margin: 32px 0;
  border: 0;
  border-top: 1px solid var(--border-light);
}

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

.markdown-body em {
  font-style: italic;
}

.markdown-body del {
  color: var(--text-placeholder);
}

/* 任务列表 */
.markdown-body input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--primary);
}

/* ========== 右侧目录栏 ========== */
.toc-sidebar {
  width: var(--toc-width);
  background-color: var(--bg-body);
  display: none;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: var(--header-height);
  height: calc(100vh - var(--header-height) - var(--footer-height));
  overflow: hidden;
  border-left: 1px solid var(--border-light);
  z-index: 99;
  transition: transform 0.2s;
}

.toc-sidebar.collapsed {
  transform: translateX(var(--toc-width));
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.toc-header svg {
  color: var(--text-placeholder);
}

.toc-header span {
  flex: 1;
}

.toc-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-placeholder);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
}

.toc-toggle-btn:hover {
  background: var(--bg-hover);
  color: var(--text-body);
}

.toc-toggle-btn svg {
  transition: transform 0.2s;
}

.toc-sidebar.collapsed .toc-toggle-btn svg {
  transform: rotate(180deg);
}

/* 展开按钮 */
.toc-expand-btn {
  display: none;
  position: fixed;
  right: 0;
  top: calc(var(--header-height) + 60px);
  width: 28px;
  height: 40px;
  background: var(--bg-body);
  border: 1px solid var(--border-light);
  border-right: none;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  z-index: 98;
  align-items: center;
  justify-content: center;
  color: var(--text-placeholder);
  transition: all 0.15s;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.06);
}

.toc-expand-btn:hover {
  background: var(--bg-hover);
  color: var(--text-body);
}

.toc-expand-btn.show {
  display: flex;
}

.toc-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  font-size: 13px;
}

.toc-nav ul {
  list-style: none;
}

.toc-nav a {
  display: block;
  padding: 6px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-nav a:hover {
  background: var(--bg-hover);
  color: var(--text-body);
}

.toc-nav a.active {
  background: var(--bg-active);
  color: var(--primary);
}

.toc-nav .toc-h2 a { padding-left: 12px; }
.toc-nav .toc-h3 a { padding-left: 24px; font-size: 12px; }
.toc-nav .toc-h4 a { padding-left: 36px; font-size: 12px; }

/* ========== 滚动条 ========== */
/* 隐藏侧边栏（文件目录）滚动条 */
.sidebar {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.sidebar::-webkit-scrollbar {
  display: none !important; /* Chrome, Safari, Opera */
  width: 0 !important;
  height: 0 !important;
}

/* 目录栏和文章内容保留滚动条 */
.toc-sidebar::-webkit-scrollbar,
.toc-nav::-webkit-scrollbar {
  width: 4px;
}

.toc-sidebar::-webkit-scrollbar-track,
.toc-nav::-webkit-scrollbar-track {
  background: transparent;
}

.toc-sidebar::-webkit-scrollbar-thumb,
.toc-nav::-webkit-scrollbar-thumb {
  background: var(--text-disabled);
  border-radius: 2px;
}

.toc-sidebar::-webkit-scrollbar-thumb:hover,
.toc-nav::-webkit-scrollbar-thumb:hover {
  background: var(--text-placeholder);
}

/* 移动端菜单按钮默认隐藏 */
.mobile-menu-btn {
  display: none;
}

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
  .toc-sidebar,
  .toc-expand-btn {
    display: none !important;
  }
  
  .main-content {
    margin-right: 0;
  }

  .back-to-top-btn {
    right: 24px;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .site-header {
    position: relative;
    height: 48px;
    padding: 0 12px 0 48px; /* 左侧留出菜单按钮空间 */
  }

  .header-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0;
  }

  .header-left {
    gap: 0;
  }

  .site-title {
    font-size: 15px;
  }

  .site-description,
  .header-divider {
    display: none;
  }

  .header-nav {
    gap: 0;
  }

  .header-nav .nav-link {
    padding: 6px 10px;
    font-size: 13px;
  }

  .header-nav .nav-link svg {
    display: none; /* 隐藏导航图标 */
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.2s;
    z-index: 1000;
    box-shadow: var(--shadow-md);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 7px;
    left: 8px;
    z-index: 1001;
    width: 34px;
    height: 34px;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-body);
    box-shadow: none;
    transition: all 0.15s;
  }

  .mobile-menu-btn:active {
    transform: scale(0.95);
  }

  .main-content {
    margin: 0;
    min-height: auto;
  }

  .view {
    padding: 24px 16px;
    min-height: auto;
  }

  .post-header h1 {
    font-size: 22px;
  }

  .post-meta {
    gap: 12px;
  }

  .markdown-body {
    font-size: 14px;
  }

  .site-footer {
    position: relative;
    height: auto;
    padding: 12px 16px;
  }

  .footer-content {
    flex-direction: column;
    gap: 8px;
    padding: 0;
  }

  .footer-divider {
    display: none;
  }

  .toc-sidebar,
  .toc-expand-btn {
    display: none !important;
  }

  .back-to-top-btn {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }

  .back-to-top-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* ========== PDF 图片式显示 ========== */
.pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pdf-page-img {
  max-width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  cursor: zoom-in;
  transition: box-shadow 0.2s;
}

.pdf-page-img:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.pdf-loading,
.pdf-error {
  padding: 48px;
  text-align: center;
  color: var(--text-placeholder);
  font-size: 14px;
}

.pdf-error {
  color: #e53935;
}

/* ========== 图片查看器 ========== */
.image-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease-out;
}

.image-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  color: #fff;
}

.image-viewer-info {
  font-size: 14px;
  opacity: 0.8;
}

.image-viewer-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.15s;
}

.image-viewer-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.image-viewer-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px 24px;
  overflow: auto;
}

.image-viewer-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ========== 图片模态框 ========== */
.image-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease-out;
}

.image-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  color: #fff;
  flex-shrink: 0;
}

.image-modal-title {
  font-size: 14px;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 16px;
}

.image-modal-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.image-modal-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px 24px;
  overflow: auto;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ========== 返回顶部按钮 ========== */
.back-to-top-btn {
  display: none;
  position: fixed;
  bottom: 80px;
  right: calc(var(--toc-width) + 24px);
  width: 44px;
  height: 44px;
  background: var(--bg-body);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  cursor: pointer;
  z-index: 98;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-to-top-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(51, 112, 255, 0.3);
}

.back-to-top-btn:active {
  transform: translateY(0);
}

.back-to-top-btn svg {
  width: 20px;
  height: 20px;
}
