/* ========== 博客栏目样式 ========== */
/* 复用 style.css 里的 CSS 变量（--navy / --red / --radius 等） */

.blog-hero {
  background: linear-gradient(135deg, #0d1f3c 0%, #1b2f52 100%);
  color: #fff;
  padding: 120px 0 56px;
  text-align: center;
}
.blog-hero h1 { font-size: 38px; font-weight: 800; letter-spacing: -0.5px; }
.blog-hero p  { color: rgba(255,255,255,.72); margin-top: 12px; font-size: 16px; }

/* ---------- 分类筛选 ---------- */
.cat-bar { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 32px 0 8px; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 22px; border: 1px solid #e2e6ee;
  background: #fff; color: #4a5568; font-size: 14px; text-decoration: none;
  transition: .18s;
}
.cat-chip:hover { border-color: var(--red); color: var(--red); }
.cat-chip.active { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.cat-chip .n { opacity: .65; font-size: 12px; }

/* ---------- 文章列表 ---------- */
.post-list { display: grid; gap: 20px; margin: 36px 0 48px; }
.post-card {
  display: block; background: #fff; border: 1px solid #eef1f6;
  border-radius: var(--radius); padding: 26px 28px; text-decoration: none;
  color: inherit; transition: .2s; box-shadow: var(--shadow-sm);
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #dfe4ee; }
.post-card .meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cat-tag {
  display: inline-block; padding: 3px 12px; border-radius: 12px;
  font-size: 12px; font-weight: 600; color: #fff;
}
.post-card .date { color: #9aa4b5; font-size: 13px; }
.post-card h2 { font-size: 21px; font-weight: 700; color: var(--navy); line-height: 1.45; }
.post-card:hover h2 { color: var(--red); }
.post-card .excerpt { color: #64748b; font-size: 14.5px; line-height: 1.75; margin-top: 10px; }
.post-card .more { color: var(--red); font-size: 14px; font-weight: 600; margin-top: 14px; display: inline-block; }

.empty-state { text-align: center; padding: 80px 20px; color: #9aa4b5; }
.empty-state .icon { font-size: 46px; margin-bottom: 14px; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 8px; justify-content: center; margin: 12px 0 64px; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 8px 15px; border-radius: 8px; border: 1px solid #e2e6ee;
  background: #fff; color: #4a5568; text-decoration: none; font-size: 14px;
}
.pager a:hover { border-color: var(--red); color: var(--red); }
.pager .cur { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }

/* ---------- 文章详情 ---------- */
.post-wrap { max-width: 820px; margin: 0 auto; padding: 110px 24px 64px; }
.crumb { font-size: 13.5px; color: #9aa4b5; margin-bottom: 22px; }
.crumb a { color: #64748b; text-decoration: none; }
.crumb a:hover { color: var(--red); }

.post-head { border-bottom: 1px solid #eef1f6; padding-bottom: 26px; margin-bottom: 32px; }
.post-head .meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.post-head h1 { font-size: 32px; font-weight: 800; color: var(--navy); line-height: 1.35; letter-spacing: -0.3px; }
.post-head .sub { color: #94a3b8; font-size: 13.5px; margin-top: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.post-head .lead {
  margin-top: 18px; padding: 16px 20px; background: #f8fafc;
  border-left: 3px solid var(--red); border-radius: 0 8px 8px 0;
  color: #475569; font-size: 15px; line-height: 1.8;
}

/* ---------- Markdown 正文排版 ---------- */
.post-body { color: #2d3748; font-size: 16px; line-height: 1.95; }
.post-body .md-h {
  color: var(--navy); font-weight: 700; line-height: 1.45;
  margin: 38px 0 16px; padding-left: 14px; border-left: 4px solid var(--red);
}
.post-body h2.md-h { font-size: 22px; }
.post-body h3.md-h { font-size: 18.5px; border-left-color: #f0a6b0; }
.post-body h4.md-h, .post-body h5.md-h, .post-body h6.md-h { font-size: 16.5px; border-left-color: #dde2ea; }
.post-body .md-p { margin: 16px 0; }
.post-body .md-ul, .post-body .md-ol { margin: 16px 0 16px 24px; }
.post-body .md-ul li, .post-body .md-ol li { margin: 9px 0; padding-left: 4px; }
.post-body .md-ul { list-style: disc; }
.post-body .md-ol { list-style: decimal; }
.post-body strong { color: var(--navy); font-weight: 700; }
.post-body a { color: var(--red); text-decoration: none; border-bottom: 1px solid rgba(200,16,46,.3); }
.post-body a:hover { border-bottom-color: var(--red); }
.post-body .md-hr { border: none; border-top: 1px solid #eef1f6; margin: 34px 0; }
.post-body .md-quote {
  margin: 22px 0; padding: 16px 22px; background: #f8fafc;
  border-left: 4px solid #cbd5e1; border-radius: 0 8px 8px 0;
  color: #475569; font-size: 15px;
}
.post-body .md-inline-code {
  background: #f1f5f9; padding: 2px 7px; border-radius: 4px;
  font-family: Consolas, "Courier New", monospace; font-size: 14px; color: #be123c;
}
.post-body .md-code {
  background: #0f172a; color: #e2e8f0; padding: 18px 20px; border-radius: 10px;
  overflow-x: auto; margin: 22px 0; font-size: 13.5px; line-height: 1.7;
}
.post-body .md-code code { font-family: Consolas, "Courier New", monospace; }

/* 表格：窄屏可横向滚动，页面本身不横向滚动 */
.post-body .md-table-wrap { overflow-x: auto; margin: 24px 0; -webkit-overflow-scrolling: touch; }
.post-body .md-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 380px; }
.post-body .md-table th {
  background: #f8fafc; color: var(--navy); font-weight: 600;
  padding: 11px 14px; text-align: left; border: 1px solid #e8edf4; white-space: nowrap;
}
.post-body .md-table td { padding: 11px 14px; border: 1px solid #eef1f6; }
.post-body .md-table tr:nth-child(even) td { background: #fcfdfe; }

/* 涨跌着色 */
.post-body .md-up   { color: #0f8a5f; font-weight: 700; }
.post-body .md-down { color: var(--red); font-weight: 700; }

/* ---------- 文章页脚 ---------- */
.post-foot { margin-top: 48px; padding-top: 28px; border-top: 1px solid #eef1f6; }
.disclaimer {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  padding: 14px 18px; color: #92400e; font-size: 13.5px; line-height: 1.8;
}
.post-cta {
  margin-top: 26px; background: linear-gradient(135deg, #0d1f3c 0%, #1b2f52 100%);
  border-radius: var(--radius); padding: 28px 30px; color: #fff; text-align: center;
}
.post-cta h3 { font-size: 20px; margin-bottom: 8px; }
.post-cta p { color: rgba(255,255,255,.7); font-size: 14.5px; margin-bottom: 18px; }

.post-nav { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.post-nav a {
  flex: 1; min-width: 240px; background: #fff; border: 1px solid #eef1f6;
  border-radius: 10px; padding: 16px 18px; text-decoration: none; color: inherit; transition: .18s;
}
.post-nav a:hover { border-color: var(--red); box-shadow: var(--shadow-sm); }
.post-nav .lbl { font-size: 12px; color: #9aa4b5; margin-bottom: 5px; }
.post-nav .ttl { font-size: 14.5px; color: var(--navy); font-weight: 600; line-height: 1.5; }

/* ---------- 首页「最新博客」区块 ---------- */
.blog-section { padding: 84px 0; background: #f7f9fc; }
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px; }
.blog-grid .post-card { height: 100%; }
.blog-more { text-align: center; margin-top: 36px; }
.blog-loading { text-align: center; color: #9aa4b5; padding: 30px; }

@media (max-width: 900px) {
  .blog-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .blog-hero { padding: 96px 0 40px; }
  .blog-hero h1 { font-size: 27px; }
  .post-wrap { padding: 92px 18px 48px; }
  .post-head h1 { font-size: 25px; }
  .post-body { font-size: 15.5px; }
  .post-body h2.md-h { font-size: 20px; }
  .post-card { padding: 20px 20px; }
  .post-card h2 { font-size: 18px; }
}
