/* ============================================================
   博客布局模板样式（v2）
   仅在博客页面加载：view/partials/blog_head.php 引入
   作用域基于 body 上的模板类：
     .tpl-classic / .tpl-magazine / .tpl-grid / .tpl-minimal / .tpl-timeline
     .tpl-post-classic / .tpl-post-magazine / .tpl-post-minimal / .tpl-post-card
   配色变量（--blog-bg/--blog-card/--blog-text/--blog-muted/--blog-primary/--blog-border）
   由 BlogTheme::css() 输出，这里只关心布局。
   ============================================================ */

/* ── 公共：分类/标签 chip 行（杂志、网格、极简模板底部用） ── */
.bh-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 8px;
}
.bh-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 13px;
  background: var(--blog-card);
  color: var(--blog-muted);
  border: 1px solid var(--blog-border);
  text-decoration: none;
  transition: .15s;
}
.bh-chip:hover,
.bh-chip.on {
  color: #fff;
  background: var(--blog-primary);
  border-color: var(--blog-primary);
}

/* ── 公共：条目里的元信息（日期 · 浏览 · 评论） ── */
.bh-mag-meta,
.bh-card-meta,
.bh-tl-meta {
  display: block;
  font-size: 12px;
  color: var(--blog-muted);
  margin-top: 6px;
  line-height: 1.6;
}
.bh-tl-meta a { color: var(--blog-muted); text-decoration: none; }
.bh-tl-meta a:hover { color: var(--blog-primary); }

/* ============================================================
   ① 杂志头条
   ============================================================ */
.bh-mag { margin-top: 16px; }
body.tpl-magazine .blog-banner { min-height: 220px; }

/* 头条大图 */
.bh-mag-hero {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--blog-card);
  border: 1px solid var(--blog-border);
  text-decoration: none;
  color: inherit;
  margin-top: 16px;
  transition: .2s;
}
.bh-mag-hero:hover { box-shadow: 0 6px 24px rgba(0, 0, 0, .1); }
.bh-mag-hero-img {
  display: block;
  height: 320px;
  background-size: cover;
  background-position: center;
}
.bh-mag-hero-img + .bh-mag-hero-body { border-top: 1px solid var(--blog-border); }
.bh-mag-hero-body { display: block; padding: 20px 24px 22px; }
.bh-mag-label {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 2px 10px;
  border-radius: 4px;
  color: #fff;
  background: var(--blog-primary);
  margin-bottom: 10px;
}
.bh-mag-hero-title {
  display: block;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}
.bh-mag-hero-sum {
  display: block;
  font-size: 14px;
  line-height: 1.75;
  color: var(--blog-muted);
}

/* 其余博文双列 */
.bh-mag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.bh-mag-card {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  border-radius: 10px;
  background: var(--blog-card);
  border: 1px solid var(--blog-border);
  text-decoration: none;
  color: inherit;
  min-height: 118px;
  transition: .2s;
}
.bh-mag-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .09); }
.bh-mag-card-img {
  flex: 0 0 130px;
  background-size: cover;
  background-position: center;
}
.bh-mag-card-body {
  display: block;
  padding: 14px 16px;
  min-width: 0;
}
.bh-mag-card-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   ② 卡片网格
   ============================================================ */
.bh-cards-wrap { margin-top: 16px; }
.bh-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.bh-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px;
  background: var(--blog-card);
  border: 1px solid var(--blog-border);
  text-decoration: none;
  color: inherit;
  transition: .2s;
}
.bh-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0, 0, 0, .1); }
.bh-card-thumb {
  display: block;
  height: 150px;
  background: linear-gradient(135deg, var(--blog-border), var(--blog-card));
  overflow: hidden;
}
.bh-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bh-card-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 44px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--blog-primary), var(--blog-muted));
  opacity: .85;
}
.bh-card-body { display: block; padding: 14px 16px 16px; }
.bh-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}
.bh-card-sum {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.7;
  color: var(--blog-muted);
  margin-top: 8px;
}

/* ============================================================
   ③ 极简清单（头部改纯色块）
   ============================================================ */
body.tpl-minimal .blog-banner {
  background-image: none !important;
  background: linear-gradient(135deg, var(--blog-primary), #26334a);
  min-height: 170px;
}
.bh-min { margin-top: 16px; }
.bh-min-list {
  margin-top: 14px;
  background: var(--blog-card);
  border: 1px solid var(--blog-border);
  border-radius: 10px;
  overflow: hidden;
}
.bh-min-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--blog-border);
  text-decoration: none;
  color: inherit;
  transition: .15s;
}
.bh-min-item:last-child { border-bottom: 0; }
.bh-min-item:hover { background: rgba(127, 127, 127, .06); }
.bh-min-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bh-min-item:hover .bh-min-title { color: var(--blog-primary); }
.bh-min-meta {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--blog-muted);
  white-space: nowrap;
}
.bh-min-meta i { font-style: normal; opacity: .5; margin: 0 2px; }

/* ============================================================
   ④ 时间轴
   ============================================================ */
.bh-tl-wrap { margin-top: 16px; }
.bh-tl {
  position: relative;
  margin: 18px 0 8px;
  padding-left: 78px;
}
.bh-tl::before {
  content: '';
  position: absolute;
  left: 62px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--blog-border);
}
.bh-tl-year {
  position: relative;
  font-size: 20px;
  font-weight: 700;
  color: var(--blog-primary);
  margin: 22px 0 14px -78px;
  padding-left: 0;
}
.bh-tl-item {
  position: relative;
  padding: 14px 18px;
  margin-bottom: 14px;
  background: var(--blog-card);
  border: 1px solid var(--blog-border);
  border-radius: 10px;
}
.bh-tl-dot {
  position: absolute;
  left: -22px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blog-primary);
  box-shadow: 0 0 0 3px var(--blog-bg);
}
.bh-tl-date {
  position: absolute;
  left: -78px;
  top: 14px;
  width: 44px;
  text-align: center;
  line-height: 1.15;
}
.bh-tl-date b { display: block; font-size: 17px; }
.bh-tl-date i { display: block; font-size: 11px; font-style: normal; color: var(--blog-muted); }
.bh-tl-body { display: block; }
.bh-tl-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: inherit;
  text-decoration: none;
}
.bh-tl-title:hover { color: var(--blog-primary); }
.bh-tl-sum {
  display: block;
  font-size: 13px;
  line-height: 1.75;
  color: var(--blog-muted);
  margin-top: 6px;
}

/* ============================================================
   博文详情 ①：杂志封面
   ============================================================ */
.bp-mag-cover {
  position: relative;
  margin: 14px 0 0;
  min-height: 300px;
  background-color: #1f2833;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}
.bp-mag-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 16, 24, .25), rgba(12, 16, 24, .78));
}
.bp-mag-cover-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 46px 24px 34px;
  color: #fff;
  text-align: center;
}
.bp-mag-cat {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 3px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  text-decoration: none;
  margin-bottom: 14px;
}
.bp-mag-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 14px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
.bp-mag-meta { font-size: 13px; opacity: .88; }
.bp-mag-meta a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .4); }
.bp-mag-meta span { margin: 0 5px; }

.bp-mag-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 26px 24px 40px;
}
.bp-mag-article {
  background: var(--blog-card);
  border: 1px solid var(--blog-border);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 20px;
  font-size: 16px;
}
.bp-mag-article .blog-article-content { font-size: 16px; line-height: 1.95; }
.bp-mag-foot {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px dashed var(--blog-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.bp-edit { margin-left: auto; font-size: 13px; color: var(--blog-muted); text-decoration: none; }
.bp-edit:hover { color: var(--blog-primary); }

/* ============================================================
   博文详情 ②：宽屏卡片
   ============================================================ */
.bp-cardwrap { margin-top: 14px; }
.bp-card {
  background: var(--blog-card);
  border: 1px solid var(--blog-border);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(16, 24, 40, .06);
  max-width: 880px;
  margin: 0 auto 20px;
  padding: 40px 56px 46px;
}
.bp-card-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 18px;
}
.bp-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 20px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--blog-border);
}
.bp-chip {
  display: inline-block;
  font-size: 12.5px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(127, 127, 127, .09);
  color: var(--blog-muted);
  text-decoration: none;
  white-space: nowrap;
}
a.bp-chip:hover { background: var(--blog-primary); color: #fff; }
.bp-chip.warn { background: #fdf0e4; color: #c0701c; }
.bp-card .blog-article-content { font-size: 16px; line-height: 1.95; }
.bp-card-tags {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px dashed var(--blog-border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bp-cardwrap > .blog-card { max-width: 880px; margin-left: auto; margin-right: auto; }

/* ── 悬浮目录（杂志 / 宽屏卡片 / 经典模板用） ── */
.blog-toc-float {
  position: fixed;
  right: 18px;
  top: 96px;
  width: 190px;
  max-height: 68vh;
  overflow: auto;
  z-index: 30;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
  .bh-mag-grid { grid-template-columns: 1fr; }
  .bp-card { padding: 30px 26px 34px; }
  .bp-mag-title { font-size: 25px; }
  .bp-mag-article { padding: 22px 20px; }
  .blog-toc-float { display: none !important; }
}

@media (max-width: 640px) {
  .bh-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .bh-card-thumb { height: 112px; }
  .bh-mag-hero-img { height: 190px; }
  .bh-mag-hero-title { font-size: 20px; }
  .bh-mag-hero-body { padding: 16px 18px 18px; }
  .bh-mag-card-img { flex-basis: 96px; }
  .bh-mag-card-body { padding: 12px 14px; }
  .bh-min-item { padding: 13px 14px; gap: 10px; }
  .bh-min-meta { display: none; }
  .bh-tl { padding-left: 16px; }
  .bh-tl::before { left: 0; }
  .bh-tl-year { margin-left: 0; }
  .bh-tl-item { padding: 13px 14px; }
  .bh-tl-dot { left: -20px; top: 20px; }
  .bh-tl-date { display: none; }
  .bp-card-title { font-size: 22px; }
  .bp-mag-cover-inner { padding: 34px 16px 24px; }
  .bp-mag-title { font-size: 21px; }
  .tpl-minimal .blog-banner { min-height: 140px; }
}