/* 极简风格全站 CSS - 支持深浅色模式与响应式排版 */
:root {
  --bg-primary: #fbfbfb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f0f2;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #8a8a93;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border-color: #e4e4e7;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  --code-bg: #1e1e2e;
  --code-text: #cdd6f4;
  --nav-height: 64px;
}

[data-theme="dark"] {
  --bg-primary: #09090b;
  --bg-secondary: #121215;
  --bg-tertiary: #1f1f23;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --border-color: #27272a;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  --code-bg: #111116;
  --code-text: #e4e4e7;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

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

.container {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* 顶部导航 Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: rgba(251, 251, 251, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .site-header {
  background-color: rgba(9, 9, 11, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 4px 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent);
  border-radius: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

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

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

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

.mobile-menu-btn .close-icon {
  display: none;
}

.mobile-menu-btn.open .hamburger-icon {
  display: none;
}

.mobile-menu-btn.open .close-icon {
  display: block;
}

/* 主主体区域 Main */
.site-main {
  flex: 1;
  padding: 0;
}

/* 文章列表项 */
.article-list {
  display: flex;
  flex-direction: column;
}

.article-card {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

.article-card:last-child {
  border-bottom: none;
}

.article-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.meta-badge {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.article-summary {
  color: var(--text-secondary);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 文章详情页 Article Page */
.article-detail-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.article-detail-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
}

.about-page {
  padding: 12px 0;
}

.markdown-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  margin-top: 36px;
  margin-bottom: 16px;
  font-weight: 700;
  line-height: 1.3;
}

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

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

.markdown-body blockquote {
  margin: 24px 0;
  padding: 12px 20px;
  border-left: 4px solid var(--accent);
  background-color: var(--bg-tertiary);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

.markdown-body pre {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 18px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
}

.markdown-body code {
  background-color: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.markdown-body pre code {
  background: none;
  padding: 0;
}

/* 紧凑双行底部区域 Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  padding: 16px 0;
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.footer-sep {
  color: var(--border-color);
  font-size: 0.75rem;
}

.friendly-link {
  color: var(--text-secondary);
}

.friendly-link:hover {
  color: var(--accent);
}

.icp-link {
  color: var(--text-muted);
}

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

/* 响应式适配 */
@media (max-width: 640px) {
  :root {
    --nav-height: 56px;
  }

  .site-header {
    position: sticky;
    top: 0;
  }

  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    padding: 0 16px;
    position: relative;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: var(--nav-height);
    left: -16px;
    right: -16px;
    background-color: rgba(251, 251, 251, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 0 20px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding 0.3s ease;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  }

  [data-theme="dark"] .site-nav {
    background-color: rgba(9, 9, 11, 0.96);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  }

  .site-nav.open {
    max-height: 320px;
    opacity: 1;
    pointer-events: auto;
    padding: 10px 20px 14px 20px;
  }

  .nav-link {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
  }

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

  .nav-link.active {
    background-color: var(--bg-tertiary);
    color: var(--accent);
    font-weight: 600;
  }

  .nav-link:hover {
    background-color: var(--bg-tertiary);
  }

  .article-detail-title {
    font-size: 1.75rem;
  }
}

/* Canvas 防抓取联系方式容器样式 */
.contact-canvas {
  display: block;
  margin: 20px 0;
  max-width: 100%;
  box-shadow: var(--card-shadow);
  border-radius: 10px;
  vertical-align: middle;
}

/* 文章列表分页组件样式（无边框极简风格） */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.pagination-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: transparent;
  border: none;
  transition: all 0.2s ease;
  user-select: none;
}

a.pagination-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.pagination-item.active {
  color: var(--accent);
  background-color: var(--bg-tertiary);
  font-weight: 700;
}

.pagination-item.disabled {
  color: var(--text-muted);
  opacity: 0.35;
  cursor: not-allowed;
}



