/* ── 基础重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #333;
  background: #f9fafb;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ── 头部 ── */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111;
}

.logo:hover { text-decoration: none; color: #2563eb; }

.site-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.site-nav a {
  color: #555;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.site-nav a:hover { color: #2563eb; text-decoration: none; }

/* ── 主体 ── */
.site-main { min-height: 70vh; padding: 40px 0; }

/* ── Hero ── */
.hero {
  padding: 60px 0;
  text-align: center;
}

.hero h1 { font-size: 2.2rem; margin-bottom: 12px; color: #111; }
.hero p { font-size: 1.1rem; color: #666; max-width: 600px; margin: 0 auto; }

/* ── 文章卡片 ── */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.article-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  transition: box-shadow 0.2s;
}

.article-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.article-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.article-card h3 a { color: #111; }
.article-card h3 a:hover { color: #2563eb; text-decoration: none; }

.article-meta { font-size: 0.85rem; color: #999; margin-bottom: 10px; }

.article-excerpt {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 12px;
}

.read-more { font-size: 0.9rem; font-weight: 500; }

/* ── 文章列表 ── */
.article-list-page h1 {
  font-size: 1.6rem;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

.article-list { display: flex; flex-direction: column; gap: 0; }

.article-item {
  padding: 24px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.article-item h2 { font-size: 1.25rem; margin-bottom: 6px; }
.article-item h2 a { color: #111; }
.article-item h2 a:hover { color: #2563eb; text-decoration: none; }

/* ── 文章详情 ── */
.article-detail { background: #fff; border-radius: 8px; padding: 40px; border: 1px solid #e5e7eb; }

.article-header { margin-bottom: 32px; }

.article-header h1 {
  font-size: 1.8rem;
  line-height: 1.4;
  margin-bottom: 12px;
  color: #111;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 0.9rem;
  color: #888;
}

.article-category a {
  background: #eff6ff;
  color: #2563eb;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
}

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

.tag {
  display: inline-block;
  background: #f3f4f6;
  color: #666;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.tag:hover { background: #e5e7eb; text-decoration: none; }

.article-content {
  font-size: 1rem;
  line-height: 1.9;
}

.article-content h2 { font-size: 1.4rem; margin: 32px 0 16px; }
.article-content h3 { font-size: 1.2rem; margin: 24px 0 12px; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin-bottom: 16px; padding-left: 24px; }
.article-content li { margin-bottom: 6px; }
.article-content blockquote {
  border-left: 4px solid #2563eb;
  padding: 8px 16px;
  margin: 16px 0;
  background: #f8fafc;
  color: #555;
}
.article-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.article-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}
.article-content pre code { background: none; padding: 0; }

/* ── 文章导航 ── */
.article-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  gap: 16px;
}

.article-nav a { font-size: 0.9rem; color: #555; }

.prev-article { flex: 1; }
.next-article { flex: 1; text-align: right; }

/* ── 分页 ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 20px;
}

.page-btn {
  padding: 6px 16px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #555;
}

.page-btn:hover { background: #f3f4f6; text-decoration: none; }

.page-info { font-size: 0.9rem; color: #888; }

/* ── 页面 ── */
.page-detail { background: #fff; border-radius: 8px; padding: 40px; border: 1px solid #e5e7eb; }
.page-detail h1 { font-size: 1.8rem; margin-bottom: 24px; }

/* ── 最新文章标题 ── */
.latest-articles h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

.view-all { text-align: center; margin-top: 32px; }

.empty-tip { text-align: center; color: #999; padding: 40px 0; }

/* ── 页脚 ── */
.site-footer {
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 24px 0;
  text-align: center;
  font-size: 0.85rem;
  color: #999;
}

/* ── 响应式 ── */
@media (max-width: 768px) {
  .hero { padding: 40px 0; }
  .hero h1 { font-size: 1.6rem; }
  .article-detail, .page-detail { padding: 24px; }
  .article-header h1 { font-size: 1.4rem; }
  .article-grid { grid-template-columns: 1fr; }
  .article-nav { flex-direction: column; }
}
