/* ============================================================
   文章系统样式：列表页 / 详情页 / 404
   与站点 style.css 变量体系配合（--primary/--text/--t2/--surface）
   ============================================================ */

/* ---------- 通用容器 ---------- */
.article-wrap { max-width: 960px; margin: 0 auto; padding: 32px 20px 60px; }
.article-breadcrumb { font-size: 13px; color: #64748b; margin-bottom: 24px; }
.article-breadcrumb a { color: #2563eb; text-decoration: none; }
.article-breadcrumb a:hover { text-decoration: underline; }

/* ---------- 列表页 ---------- */
.articles-head { text-align: center; margin-bottom: 36px; }
.articles-head h1 { font-size: 30px; font-weight: 800; margin-bottom: 10px; color: #0f172a; }
.articles-head p { color: #64748b; font-size: 15px; max-width: 640px; margin: 0 auto; line-height: 1.7; }

.article-card {
  display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 22px 26px; margin-bottom: 18px; text-decoration: none; color: inherit;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.article-card:hover { box-shadow: 0 8px 28px rgba(37,99,235,.10); transform: translateY(-2px); border-color: #bfdbfe; }
.article-card h2 { font-size: 19px; font-weight: 700; color: #0f172a; margin: 0 0 8px; line-height: 1.45; }
.article-card:hover h2 { color: #2563eb; }
.article-card .card-summary { font-size: 14px; color: #475569; line-height: 1.8; margin: 0 0 12px; }
.article-card .card-meta { font-size: 12px; color: #94a3b8; display: flex; gap: 14px; flex-wrap: wrap; }
.article-card .cat { display: inline-block; background: #eff6ff; color: #2563eb; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.article-card .read-more { color: #2563eb; font-size: 13px; font-weight: 600; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 30px; flex-wrap: wrap; }
.pagination a, .pagination span.page-info {
  min-width: 38px; height: 38px; line-height: 38px; text-align: center;
  border-radius: 10px; border: 1px solid #e2e8f0; background: #fff; color: #334155;
  font-size: 14px; text-decoration: none; padding: 0 10px;
}
.pagination a:hover { border-color: #2563eb; color: #2563eb; }
.pagination .current { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }
.pagination .disabled { color: #cbd5e1; pointer-events: none; }

/* ---------- 详情页 ---------- */
.article-detail { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 40px 44px; }
.article-detail h1.post-title {
  font-size: 28px; font-weight: 800; line-height: 1.4; color: #0f172a; margin: 0 0 14px;
}
.post-meta { font-size: 13px; color: #94a3b8; display: flex; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid #f1f5f9; margin-bottom: 22px; }
.post-meta .cat { background: #eff6ff; color: #2563eb; border-radius: 999px; padding: 2px 10px; }
.post-summary {
  background: #f8fafc; border-left: 4px solid #2563eb; border-radius: 0 10px 10px 0;
  padding: 14px 18px; font-size: 14.5px; color: #475569; line-height: 1.9; margin: 0 0 28px;
}

/* 正文排版 */
.post-content { font-size: 16px; line-height: 1.95; color: #1e293b; }
.post-content h2 {
  font-size: 22px; font-weight: 700; color: #0f172a; margin: 36px 0 14px;
  padding-left: 12px; border-left: 5px solid #2563eb; line-height: 1.4;
}
.post-content h3 { font-size: 18px; font-weight: 700; color: #0f172a; margin: 26px 0 10px; }
.post-content p { margin: 14px 0; }
.post-content ul, .post-content ol { margin: 12px 0; padding-left: 26px; }
.post-content li { margin: 7px 0; line-height: 1.9; }
.post-content ul li { list-style: disc; }
.post-content ol li { list-style: decimal; }
.post-content a { color: #2563eb; text-decoration: none; border-bottom: 1px dashed #93c5fd; }
.post-content a:hover { border-bottom-style: solid; }

.post-content blockquote {
  margin: 18px 0; padding: 12px 18px; background: #fffbeb; border-left: 4px solid #f59e0b;
  border-radius: 0 10px 10px 0; color: #78350f; font-size: 15px; line-height: 1.9;
}
.post-content blockquote p { margin: 4px 0; }

.post-content code {
  background: #f1f5f9; color: #db2777; padding: 2px 7px; border-radius: 6px;
  font-family: Consolas, Monaco, "Courier New", monospace; font-size: 14px;
}
.post-content pre {
  background: #0f172a; color: #e2e8f0; padding: 18px 20px; border-radius: 12px;
  overflow-x: auto; margin: 18px 0; font-size: 14px; line-height: 1.7;
}
.post-content pre code { background: transparent; color: inherit; padding: 0; }

.post-content table {
  width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14.5px;
  display: block; overflow-x: auto;
}
.post-content th, .post-content td { border: 1px solid #e2e8f0; padding: 10px 14px; text-align: left; }
.post-content th { background: #f1f5f9; font-weight: 700; color: #0f172a; white-space: nowrap; }
.post-content tr:nth-child(even) td { background: #f8fafc; }

.post-content img { max-width: 100%; border-radius: 10px; margin: 14px auto; display: block; box-shadow: 0 4px 16px rgba(0,0,0,.08); }

/* 相关工具区 */
.related-tools { margin-top: 40px; padding-top: 26px; border-top: 1px solid #f1f5f9; }
.related-tools h3 { font-size: 18px; font-weight: 700; margin: 0 0 16px; color: #0f172a; }
.related-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.related-tool-grid a {
  display: block; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 12px 14px; font-size: 14px; color: #334155; text-decoration: none; transition: .2s;
}
.related-tool-grid a:hover { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }

/* 上一篇/下一篇 */
.adjacent-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 30px; }
.adjacent-nav a {
  display: block; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 18px;
  text-decoration: none; color: #334155; font-size: 14px; transition: .2s; background: #fff;
}
.adjacent-nav a:hover { border-color: #93c5fd; background: #eff6ff; }
.adjacent-nav .next { text-align: right; }
.adjacent-nav .adj-label { font-size: 12px; color: #94a3b8; display: block; margin-bottom: 4px; }
.adjacent-nav .adj-title { font-weight: 600; color: #0f172a; line-height: 1.5; }
.back-to-list { display: inline-block; margin-top: 22px; color: #2563eb; text-decoration: none; font-size: 14px; }

/* 工具推荐墙（列表页底部） */
.tool-rec-wall { margin-top: 50px; }
.tool-rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tool-rec-grid a {
  display: block; text-align: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 12px 8px; font-size: 13.5px; color: #334155; text-decoration: none; transition: .2s;
}
.tool-rec-grid a:hover { background: #eff6ff; border-color: #93c5fd; color: #2563eb; transform: translateY(-2px); }

/* 404 页 */
.notfound-box { text-align: center; padding: 80px 20px; }
.notfound-box .code { font-size: 72px; font-weight: 800; color: #2563eb; line-height: 1; }
.notfound-box h1 { font-size: 22px; margin: 16px 0 10px; color: #0f172a; }
.notfound-box p { color: #64748b; font-size: 14px; margin-bottom: 26px; }
.notfound-box .btn-row a {
  display: inline-block; margin: 0 6px; padding: 10px 22px; border-radius: 10px; text-decoration: none; font-size: 14px;
}
.notfound-box .btn-primary-solid { background: #2563eb; color: #fff; }
.notfound-box .btn-ghost { border: 1px solid #cbd5e1; color: #334155; }

/* ---------- 暗色适配 ---------- */
.dark .article-card, .dark .article-detail { background: #1e293b; border-color: #334155; }
.dark .article-card h2, .dark .article-detail h1.post-title, .dark .articles-head h1,
.dark .post-content, .dark .related-tools h3, .dark .adjacent-nav .adj-title { color: #e2e8f0; }
.dark .article-card .card-summary, .dark .post-summary { color: #94a3b8; }
.dark .post-summary, .dark .related-tool-grid a, .dark .tool-rec-grid a { background: #0f172a; }
.dark .post-summary { border-left-color: #3b82f6; color: #cbd5e1; }
.dark .post-content blockquote { background: #1e293b; color: #fcd34d; }
.dark .post-content th { background: #334155; color: #e2e8f0; }
.dark .post-content th, .dark .post-content td { border-color: #334155; }
.dark .post-content tr:nth-child(even) td { background: #1e293b; }
.dark .pagination a, .dark .adjacent-nav a { background: #1e293b; border-color: #334155; color: #e2e8f0; }
.dark .article-card .cat { background: #0c4a6e; color: #7dd3fc; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .article-detail { padding: 24px 18px; }
  .article-detail h1.post-title { font-size: 22px; }
  .articles-head h1 { font-size: 24px; }
  .adjacent-nav { grid-template-columns: 1fr; }
  .adjacent-nav .next { text-align: left; }
  .post-content { font-size: 15.5px; }
  .post-content h2 { font-size: 19px; }
}
