
/* =========================
   ✅ 与 articleDetail 同款：页面底部留白 + 不影响头尾
   ========================= */
.article-page{
  --page-bottom-gap: 24px;
  padding-bottom: var(--page-bottom-gap);
  overflow: visible !important;
}
.article-inner{ width:100%; }

/* ✅ 移动端：中间区域左右缩进 5px（只作用于正文区域） */
@media (max-width: 991px){
  .article-inner{
    padding-left: 5px !important;
    padding-right: 5px !important;
    box-sizing:border-box;
  }
}

/* =========================
   顶部分类行
   ========================= */
.breadcrumb-line{
  display:flex;
  align-items:center;
  gap:8px;
  color:#8a8a8a;
  font-size:13px;
  margin:0 0 12px 0;
  flex-wrap:wrap;
}
.breadcrumb-line a{ color:#FFFFFF; text-decoration:none; }
.breadcrumb-line a:hover{ color:#0d6efd; }
.breadcrumb-sep{ color:#b6b6b6; }

.bc-cat{
  display:inline-flex;
  align-items:center;
  padding:6px 12px;
  border-radius:999px;
  background:#404553;
  color:#eaeaea;
  font-size:13px;
  text-decoration:none;
}
.bc-cat.active{ font-weight:900; color:#fff; background:#0d6efd; }

/* =========================
   两栏布局（结构必须和 detail 一样）
   ========================= */
.article-row{
  display:flex !important;
  gap:16px !important;
  align-items:flex-start !important;
}
.article-main{
  flex:1 !important;
  min-width:0 !important;
}
.article-side{
  width:330px;
  flex:0 0 330px;
  position:relative; /* ✅ 必须：is-abs 的参照物 */
}

/* ✅ 桌面端：让右侧列拉伸到整行高度（否则左右底部不齐） */
@media (min-width: 992px){
  .article-side{ align-self:stretch; }
}

/* 小屏：上下结构 */
@media (max-width: 991px){
  .article-row{ flex-direction:column !important; }
  .article-side{
    width:auto;
    flex:1 1 auto;
    position: static;
    align-self:auto;
  }
}

/* =========================
   ✅ 右侧“见底才固定”的状态样式（同 articleDetail）
   ========================= */
@media (min-width: 992px){
  #rightSidebarInner{ width:100%; }

  /* 见底后：固定在视窗底部 */
  #rightSidebarInner.is-fixed{
    position:fixed;
    top:auto;
    bottom: var(--page-bottom-gap);
    z-index: 20;
  }

  /* 页面接近底部：解除 fixed，吸在右侧列底部 */
  #rightSidebarInner.is-abs{
    position:absolute;
    top:auto;
    bottom:0;
    left:0;
    width:100%;
  }
}

/* =========================
   幻灯片（支持 controller 传 $featured）
   ========================= */
.featured-wrap{
  border-radius:5px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
  margin:0;
  position:relative;
}
.featured-ratio{
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  overflow:hidden;
}
@supports not (aspect-ratio: 3 / 1){
  .featured-ratio{ height:0; padding-top:33.333%; }
}
.featured-img{
  position:absolute !important;
  left:0; top:0;
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  display:block !important;
}
#featuredCarousel .carousel-inner{ position:relative; }
#featuredCarousel .carousel-item{ display:none !important; position:relative; }
#featuredCarousel .carousel-item.active{ display:block !important; }

.featured-caption{
  position:absolute;
  left:0; right:0; bottom:0;
  pointer-events:none;
  z-index:3;
}
.featured-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  background:rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.featured-text{ min-width:0; text-shadow:0 2px 10px rgba(0,0,0,.55); }
.featured-text .title{
  font-size:16px;
  line-height:1.25;
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.featured-text .title a{
  color:#fff;
  text-decoration:none;
  pointer-events:auto;
}
.featured-text .title a:hover{ text-decoration:underline; }

#featuredCarousel .carousel-indicators{
  position:absolute !important;
  right:14px !important;
  bottom:12px !important;
  left:auto !important;
  margin:0 !important;
  padding:0 !important;
  display:flex !important;
  gap:8px !important;
  justify-content:flex-end !important;
  z-index:50 !important;
  pointer-events:auto !important;
}
#featuredCarousel .carousel-indicators button{
  width:8px !important;
  height:8px !important;
  border-radius:50% !important;
  border:0 !important;
  padding:0 !important;
  background:rgba(255,255,255,.45) !important;
  opacity:1 !important;
  margin:0 !important;
  cursor:pointer;
}
#featuredCarousel .carousel-indicators button.active{
  background:rgba(255,255,255,.95) !important;
}

/* 广告图 */

.ad-imges{
  display:block !important;

  box-shadow:0 8px 24px rgba(0,0,0,.08);
  width:100%;
  height:auto;
}

/* =========================
   文章卡片网格
   ========================= */
.post-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
@media (max-width: 767px){
  .post-grid{ grid-template-columns:1fr; }
}

.post-card{
  background:#fff;
  border-radius:5px;
  overflow:hidden;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
}
.post-card a{ display:block; }

/* 图片外层：按比例铺满 */
.post-thumb-wrap{
  width:100%;
  aspect-ratio: 533 / 300;
  overflow:hidden;
  background:#f3f4f6;
}
@supports not (aspect-ratio: 533 / 300){
  .post-thumb-wrap{ position:relative; height:0; padding-top:56.29%; }
  .post-thumb{ position:absolute; left:0; top:0; }
}
.post-thumb{
  width:100% !important;
  height:100% !important;
  object-fit: cover !important;
  display:block !important;
}

.post-body{ padding:10px 12px; }
.post-title{ margin:0; font-size:14px; line-height:1.35; font-weight:900; }
.post-title a{ color:#111; text-decoration:none; }
.post-title a:hover{ color:#0d6efd; }

.post-excerpt{
  margin-top:8px;
  font-size:13px;
  color:#8a8a8a;
  line-height:1.55;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.post-meta{
  margin-top:8px;
  font-size:12px;
  color:#8a8a8a;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.post-meta a{ color:#8a8a8a; text-decoration:none; }
.post-meta a:hover{ text-decoration:underline; }
.meta-item{ display:inline-flex; align-items:center; gap:6px; }
.meta-icon{ width:14px; height:14px; opacity:.9; display:inline-block; }

/* =========================
   ✅ 分页背景框：和左侧同宽（放在 article-main 内天然一致）
   上下间距一致
   ========================= */
.pager-wrap{
  margin-top: 14px;
  margin-bottom: 0 !important;
  background:#fff;
  border-radius:5px;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
  padding: 16px 12px;
  display:flex;
  justify-content:center;
  align-items:center;
}
.pager-wrap .pagination{ margin:0 !important; }



/* 搜索框（不影响你原来的 article.css） */
.article-search{ margin: 12px 0 10px 0; }
.article-search-form{
  display:flex; gap:10px; align-items:center;
  background:#fff; border-radius:5px;
  padding:10px; box-shadow:0 8px 24px rgba(0,0,0,.06);
}
.article-search-input{
  flex:1; height:40px; border:1px solid rgba(17,24,39,.12);
  border-radius:5px; padding:0 12px; outline:none;
}
.article-search-input:focus{ border-color:#0d6efd; }
.article-search-btn{
  height:40px; padding:0 14px; border:none;
  border-radius:5px; background:#0d6efd; color:#fff; font-weight:700;
}
.article-search-clear{
  height:40px; display:inline-flex; align-items:center;
  padding:0 10px; border-radius:5px; color:#6b7280; text-decoration:none;
}
.article-search-clear:hover{ background:rgba(0,0,0,.04); }
.article-search-tip{ margin-top:8px; font-size:13px; color:#d1523c; }
.article-empty{
  background:#fff; border-radius:5px;
  padding:18px; margin-top:12px;
  box-shadow:0 8px 24px rgba(0,0,0,.06);
  color:#6b7280; font-size:14px;
}



/* ===== article detail ===== */
.article-page,.article-inner,.article-row,.article-main,.article-body{ overflow-x:hidden; }

.article-body *{ max-width:100% !important; box-sizing:border-box; }
.article-body img,.article-body video,.article-body iframe{ max-width:100% !important; height:auto !important; display:block; }

.article-body table{
  width:100%;
  max-width:100% !important;
  display:block;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.article-body{
  padding:18px;
  font-size:15px;
  line-height:1.9;
  color:#222;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",Arial,sans-serif !important;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.article-body, .article-body *{ font-family:inherit !important; }

.article-body p{ margin:0 0 14px 0; }
.article-body h1,.article-body h2,.article-body h3{ margin:18px 0 10px 0; line-height:1.35; color:#111; font-weight:900; }
.article-body h2{ font-size:18px; }
.article-body h3{ font-size:16px; }
.article-body ul,.article-body ol{ margin:0 0 14px 20px; }
.article-body li{ margin:6px 0; }
.article-body blockquote{
  margin:14px 0;
  padding:10px 12px;
  border-left:4px solid rgba(13,110,253,.35);
  background:rgba(13,110,253,.06);
  border-radius:5px;
}
.article-body hr{ margin:18px 0; opacity:.25; }
.article-body a{ color:#0d6efd; text-decoration:none; }
.article-body a:hover{ text-decoration:underline; }

/* =========================
   ✅ 示例代码：背景框（自动换行版）
   ========================= */

/* 代码块容器（pre 或 pre>code） */
.article-body pre{
  margin:14px 0;
  padding:14px 16px;
  border-radius:5px;
  border:1px solid rgba(0,0,0,.08);
  background:#f6f8fa;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);

  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace !important;
  font-size:13px;
  line-height:1.7;

  /* ✅ 自动换行 */
  white-space:pre-wrap;
  word-break:break-word;
  overflow-wrap:anywhere;

  /* 仍允许横向滚动（极端长串时兜底） */
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

/* pre 内部 code */
.article-body pre code{
  display:block;
  padding:0;
  margin:0;
  background:transparent !important;
  border:0 !important;

  /* 跟随 pre 的自动换行规则 */
  white-space:inherit;
  word-break:inherit;
  overflow-wrap:inherit;

  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace !important;
}

/* 行内代码（不在 pre 里的 code） */
.article-body :not(pre) > code{
  padding:2px 6px;
  border-radius:5px;
  background:rgba(27,31,35,.06);
  border:1px solid rgba(0,0,0,.06);

  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace !important;
  font-size:.92em;

  word-break:break-word;
  overflow-wrap:anywhere;
}

/*（可选）滚动条更细 */
.article-body pre::-webkit-scrollbar{ height:8px; width:8px; }
.article-body pre::-webkit-scrollbar-thumb{ background:rgba(0,0,0,.18); border-radius:20px; }
.article-body pre::-webkit-scrollbar-track{ background:rgba(0,0,0,.06); border-radius:20px; }


.breadcrumb-line{
  display:flex; align-items:center; gap:8px;
  color:#8a8a8a; font-size:13px; margin:0 0 12px 0;
  flex-wrap:wrap;
}
.breadcrumb-line a{ color:#FFFFFF; text-decoration:none; }
.breadcrumb-line a:hover{ color:#0d6efd; }
.breadcrumb-sep{ color:#b6b6b6; }

.article-row{ display:flex !important; gap:16px !important; align-items:flex-start !important; }
.article-main{ flex:1 !important; min-width:0 !important; }
.article-side{ width:330px; flex:0 0 330px; position:relative; }

@media (min-width: 992px){ .article-side{ align-self:stretch; } }
@media (max-width: 991px){
  .article-row{ flex-direction:column !important; }
  .article-side{ width:auto; flex:1 1 auto; position:static; align-self:auto; }
}

@media (min-width: 992px){
  #rightSidebarInner{ width:100%; }
  #rightSidebarInner.is-fixed{ position:fixed; top:auto; bottom:var(--page-bottom-gap); z-index:20; }
  #rightSidebarInner.is-abs{ position:absolute; top:auto; bottom:0; left:0; width:100%; }
}

.article-card{
  background:#fff;
  border-radius:5px;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
  overflow:hidden;
}
.article-head{ padding:18px 18px 12px 18px; border-bottom:1px solid rgba(0,0,0,.06); }
.article-title{ font-size:20px; font-weight:900; margin:0; color:#111; line-height:1.35; text-align:center; }
.article-meta{
  margin-top:12px; color:#8a8a8a; font-size:13px;
  display:flex; flex-wrap:wrap; gap:14px; justify-content:center; text-align:center;
}
.article-meta .meta-item{ display:inline-flex; align-items:center; justify-content:center; gap:6px; }

/* =========================
   ✅ 相关文章（只图片+标题）
   ========================= */
.related-wrap{
  margin-top:14px;
  background:#fff;
  border-radius:5px;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
  overflow:hidden;
}
.related-head{
  padding:14px 16px;
  border-bottom:1px solid rgba(0,0,0,.06);
  font-size:15px; font-weight:900; color:#111;
}
.related-grid{
  padding:12px;
  display:flex;
  gap:10px;
  flex-wrap:nowrap;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  align-items:stretch;
}

/* 桌面端：4 个平均铺满一行 */
@media (min-width: 992px){
  .related-card{ flex:0 0 calc((100% - 30px) / 4); }
}
@media (min-width: 576px) and (max-width: 991px){
  .related-card{ flex:0 0 40%; }
}
@media (max-width: 575px){
  .related-card{ flex:0 0 78%; }
}

.related-card{
  background:#fff;
  border-radius:5px;
  overflow:hidden;
  box-shadow:0 8px 18px rgba(0,0,0,.08);
  border:1px solid rgba(0,0,0,.06);
}
.related-card a{
  display:flex !important;
  flex-direction:column !important;
  text-decoration:none !important;
  color:#111 !important;
}

/* 图片：533:300 比例铺满 */
.related-thumb{
  width:100%;
  aspect-ratio:533 / 300;
  overflow:hidden;
  background:#f3f4f6;
}
@supports not (aspect-ratio: 533 / 300){
  .related-thumb{ position:relative; height:0; padding-top:56.29%; }
  .related-thumb img{ position:absolute; left:0; top:0; }
}
.related-thumb img{
  width:100% !important;
  height:100% !important;
  object-fit:cover;
  display:block;
}

/* 标题：外层只做 padding；内层做 clamp，避免三行 */
.related-title{
  padding:10px 12px !important;
  box-sizing:border-box !important;
  min-height: calc(1.35em * 2 + 20px) !important;
}
.related-title-text{
  font-size:13px !important;
  font-weight:900 !important;
  line-height:1.35 !important;
  color:#111 !important;

  display:-webkit-box !important;
  -webkit-box-orient:vertical !important;
  -webkit-line-clamp:2 !important;

  overflow:hidden !important;
  text-overflow:ellipsis !important;
  word-break:break-word !important;
  white-space:normal !important;
}
.related-card a:hover .related-title-text{ color:#0d6efd !important; }

/* 广告图 */
.ad-wrap{ margin-top:10px; }

.ad-imges{
  display:block !important;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
  height:auto;
  margin: 0 auto;
}


.breadcrumb-current{ color:#FFFFFF; }
