/* site/blog/blog.css
 * 博客列表 + 详情样式（GEO 友好排版）
 * 列表页（blog.html）+ 详情页（site/post/{slug}.html）
 */

/* ============ 列表页：搜索 + 分类筛选 ============ */
.blog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
  padding: 24px;
  background: #f8f9fa;
  border-radius: 12px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  height: 44px;
}
.search-box svg {
  width: 20px;
  height: 20px;
  color: #9ca3af;
  flex-shrink: 0;
}
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  font-family: inherit;
  color: #111827;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
/* 主类目 chips：更大、更醒目 */
.main-filter-row .filter-chip {
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 500;
}
/* 子类目 chips：略小、略浅 */
.sub-filter-row {
  padding-left: 16px;
  border-left: 3px solid #fde68a;
  margin-left: 8px;
}
.sub-filter-row .filter-chip {
  padding: 5px 12px;
  font-size: 13px;
}
.filter-label {
  font-size: 14px;
  color: #6b7280;
  margin-right: 4px;
  font-weight: 500;
}
.sub-filter-row .filter-label {
  color: #b45309;
}
.filter-chip {
  display: inline-block;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 14px;
  color: #4b5563;
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}
.filter-chip:hover {
  border-color: #ff6b35;
  color: #ff6b35;
}
.filter-chip.active {
  background: #ff6b35;
  color: #fff;
  border-color: #ff6b35;
}
.sub-filter-row .filter-chip.active {
  background: #b45309;
  border-color: #b45309;
}

.result-count {
  color: #6b7280;
  font-size: 14px;
  margin: 0 0 16px;
}

/* ============ 分页器 ============ */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 40px 0 8px;
  padding: 16px 0;
}
.pagination .page-btn,
.pagination .page-num {
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #4b5563;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.pagination .page-num {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.pagination .page-btn:hover:not(:disabled),
.pagination .page-num:hover {
  border-color: #ff6b35;
  color: #ff6b35;
}
.pagination .page-num.active {
  background: #ff6b35;
  color: #fff;
  border-color: #ff6b35;
  font-weight: 600;
}
.pagination .page-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  background: #f9fafb;
}
.pagination .page-gap {
  min-width: 32px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 14px;
  letter-spacing: 1px;
  user-select: none;
}
@media (max-width: 480px) {
  .pagination .page-btn,
  .pagination .page-num {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }
}

/* ============ 列表卡片 ============ */
.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.post-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all .25s;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  border-color: #ff6b35;
}
.post-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.post-card-cover {
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: #f3f4f6;
}
.post-card-cover-placeholder {
  background: linear-gradient(135deg, #ff6b35 0%, #f59e0b 100%);
}
.post-card-body {
  padding: 20px;
}
.post-card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}
.post-card-category {
  display: inline-block;
  font-size: 12px;
  color: #ff6b35;
  background: rgba(255, 107, 53, 0.1);
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 500;
}
.post-card-subcategory {
  display: inline-block;
  font-size: 11px;
  color: #92400e;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 400;
}
.post-card-subcategory::before {
  content: '› ';
  color: #d97706;
}
.post-card-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: #111827;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-summary {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: #9ca3af;
  align-items: center;
}

/* ============ 详情页（共用于 blog.html post.html fallback / 独立 post/{slug}.html）============ */
.post-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}
.breadcrumbs {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
}
.breadcrumbs a {
  color: #ff6b35;
  text-decoration: none;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}
.breadcrumbs span:not(:last-child)::after {
  content: ' / ';
  margin: 0 4px;
  color: #d1d5db;
}

.post-header {
  margin-bottom: 32px;
}
.post-header-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.post-header h1 {
  font-size: 36px;
  line-height: 1.3;
  color: #111827;
  margin: 12px 0 16px;
  font-weight: 700;
}
.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #6b7280;
  font-size: 14px;
  align-items: center;
}
.reading-time {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.reading-time svg {
  width: 14px;
  height: 14px;
}

.tldr {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-left: 4px solid #ff6b35;
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0 32px;
  font-size: 15px;
  line-height: 1.7;
  color: #7c2d12;
}
.tldr strong {
  color: #9a3412;
  margin-right: 4px;
}

.post-content {
  font-size: 16px;
  line-height: 1.85;
  color: #374151;
}
.post-content h2 {
  font-size: 26px;
  margin: 40px 0 16px;
  color: #111827;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 2px solid #ff6b35;
}
.post-content h3 {
  font-size: 20px;
  margin: 32px 0 12px;
  color: #111827;
  font-weight: 600;
}
.post-content h4 {
  font-size: 17px;
  margin: 24px 0 10px;
  color: #111827;
  font-weight: 600;
}
.post-content p {
  margin: 16px 0;
}
.post-content ul,
.post-content ol {
  margin: 16px 0;
  padding-left: 28px;
}
.post-content li {
  margin: 6px 0;
}
.post-content strong {
  color: #111827;
  font-weight: 600;
}
.post-content blockquote {
  border-left: 4px solid #ff6b35;
  padding: 12px 20px;
  background: #f9fafb;
  margin: 20px 0;
  color: #4b5563;
  border-radius: 0 8px 8px 0;
}
.post-content blockquote p {
  margin: 0;
}
.post-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: #b91c1c;
  font-family: 'SF Mono', Consolas, 'Liberation Mono', monospace;
}
.post-content pre {
  background: #1f2937;
  color: #f9fafb;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
  line-height: 1.6;
}
.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 14px;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.post-content th,
.post-content td {
  border: 1px solid #e5e7eb;
  padding: 10px 14px;
  text-align: left;
}
.post-content th {
  background: #f9fafb;
  font-weight: 600;
  color: #111827;
}
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
  display: block;
}
.post-content a {
  color: #ff6b35;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.post-content a:hover {
  border-bottom-color: #ff6b35;
}

/* ============ FAQ 块（details/summary 折叠样式）============ */
.faq-section {
  background: #f8f9fa;
  padding: 28px;
  border-radius: 12px;
  margin: 40px 0;
}
.faq-section h2 {
  font-size: 22px;
  margin: 0 0 20px;
  color: #111827;
  border-bottom: none;
  padding-bottom: 0;
}
.faq-section details {
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 0;
}
.faq-section details:last-child {
  border-bottom: none;
}
.faq-section summary {
  cursor: pointer;
  font-size: 16px;
  color: #111827;
  font-weight: 500;
  list-style: none;
  position: relative;
  padding-right: 30px;
}
.faq-section summary::-webkit-details-marker {
  display: none;
}
.faq-section summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-size: 20px;
  color: #ff6b35;
  font-weight: 300;
  line-height: 1.2;
}
.faq-section details[open] summary::after {
  content: '−';
}
.faq-section details p {
  margin: 12px 0 0;
  color: #4b5563;
  line-height: 1.75;
}

/* ============ 关联文章 ============ */
.related-posts {
  background: #fffbeb;
  padding: 24px;
  border-radius: 12px;
  margin: 40px 0;
}
.related-posts h3 {
  font-size: 18px;
  margin: 0 0 16px;
  color: #111827;
  font-weight: 600;
}
.related-posts ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.related-posts li {
  padding: 8px 0;
  border-bottom: 1px solid #fde68a;
}
.related-posts li:last-child {
  border-bottom: none;
}
.related-posts a {
  color: #92400e;
  text-decoration: none;
  font-size: 15px;
}
.related-posts a:hover {
  text-decoration: underline;
  color: #b45309;
}

/* ============ 上下篇导航 ============ */
.post-footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 40px 0;
  padding: 24px 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}
.post-nav-card {
  padding: 16px 20px;
  background: #f9fafb;
  border-radius: 8px;
  text-decoration: none;
  color: #374151;
  font-size: 14px;
  transition: all .2s;
  display: block;
}
.post-nav-card:hover {
  background: #fff7ed;
  color: #ff6b35;
}
.post-nav-card.next {
  text-align: right;
}
.post-nav-card .label {
  display: block;
  color: #9ca3af;
  font-size: 12px;
  margin-bottom: 4px;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .post-header h1 { font-size: 28px; }
  .post-content h2 { font-size: 22px; }
  .post-content h3 { font-size: 18px; }
  .post-list { grid-template-columns: 1fr; }
  .post-footer-nav { grid-template-columns: 1fr; }
  .post-nav-card.next { text-align: left; }
  .faq-section, .related-posts { padding: 20px; }
}
