/* ===== 博客页专属样式 ===== */
.hidden { display: none !important; }

/* 布局 */
.blog-layout { display: grid; grid-template-columns: 1fr 300px; gap: 48px; }
.blog-main { min-width: 0; }

/* 文章卡片网格 */
.blog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.blog-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px;
  overflow: hidden; transition: all 0.35s; display: flex; flex-direction: column;
}
.blog-card:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: 0 16px 48px rgba(0,0,0,0.25); }
.blog-card-img { width: 100%; background: rgba(255,255,255,0.02); max-height: 320px; overflow: hidden; }
.blog-card-img img { width: 100%; height: auto; object-fit: contain; transition: transform 0.5s; }
.blog-card:hover .blog-card-img img { transform: scale(1.05); }
.blog-card-body { padding: 20px 22px 18px; flex: 1; display: flex; flex-direction: column; }
.blog-card-cat {
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--accent);
  background: rgba(var(--primary-rgb),0.08); padding: 2px 10px; border-radius: 10px;
  margin-bottom: 10px; align-self: flex-start;
}
.blog-card-body h3 { font-size: 17px; font-weight: 600; color: var(--text-hi); margin-bottom: 8px; line-height: 1.4; }
.blog-card-body p { font-size: 13.5px; color: var(--text-2); line-height: 1.6; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card-body time { font-size: 12px; color: var(--text-3); margin-top: 12px; }

.blog-empty { text-align: center; padding: 80px 20px; color: var(--text-2); font-size: 16px; }

/* 分页 */
.blog-pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 40px; }
.blog-pager span { font-size: 13px; color: var(--text-2); }

/* 侧边栏 */
.blog-sidebar { position: sticky; top: 100px; align-self: start; }
.sidebar-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px;
  padding: 24px 20px; margin-bottom: 20px;
}
.sidebar-card h3 { font-size: 15px; font-weight: 600; color: var(--text-hi); margin-bottom: 14px; }
.cat-list { list-style: none; }
.cat-list li { margin-bottom: 4px; }
.cat-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: 10px; font-size: 14px; color: var(--text-2);
  transition: all 0.2s;
}
.cat-list a:hover, .cat-list a.active { background: rgba(var(--primary-rgb),0.08); color: var(--accent); }
.cat-list .cnt { font-size: 12px; color: var(--text-3); background: rgba(255,255,255,0.04); padding: 1px 8px; border-radius: 10px; }

/* 文章详情 */
.blog-article { }
.back-link { font-size: 14px; color: var(--text-2); display: inline-block; margin-bottom: 16px; transition: color 0.2s; }
.back-link:hover { color: var(--accent); }
.article-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; color: var(--text-2); margin-top: 12px; }
.article-meta .tag {
  display: inline-block; background: rgba(var(--primary-rgb),0.1); color: var(--accent);
  padding: 2px 12px; border-radius: 10px; font-size: 12px; font-weight: 500;
}
.article-meta .tag.outline { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.article-cover { margin: 24px 0 32px; border-radius: 20px; overflow: hidden; }
.article-cover img { width: 100%; display: block; }
.article-body { font-size: 15px; line-height: 1.9; color: var(--text); }
.article-body h1 { font-size: 24px; font-weight: 700; margin: 30px 0 14px; color: var(--text-hi); letter-spacing: -0.5px; }
.article-body h2 { font-size: 19px; font-weight: 600; margin: 26px 0 12px; color: var(--text-hi); }
.article-body h3 { font-size: 16px; font-weight: 600; margin: 20px 0 10px; color: var(--text-hi); }
.article-body p { margin-bottom: 16px; text-indent: 2em; /* 首行缩进 2 字符：正文用全角空格缩进会被浏览器折叠，统一用 CSS 实现 */ }
.article-body ul, .article-body ol { margin: 10px 0 16px 24px; }
.article-body li { margin-bottom: 6px; }
.article-body strong { color: var(--text-hi); font-weight: 600; }
.article-body code { background: rgba(var(--primary-rgb),0.1); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; font-family: Consolas, monospace; }
.article-body img { max-width: 100%; border-radius: 12px; margin: 16px 0; }
.article-body a { color: var(--accent); border-bottom: 1px solid rgba(var(--primary-rgb),0.3); }
.article-body a:hover { border-color: var(--accent); }
.article-body blockquote { border-left: 3px solid var(--primary); padding-left: 16px; margin: 16px 0; color: var(--text-2); font-style: italic; }

/* 响应式 */
@media (max-width: 900px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
  .blog-card-img { max-height: 320px; }
}