/* --- 部落格全站通用：隱藏背景與基礎設定 --- */
#blogs_all, #blog, .all_blogs_title, .blogs_group, .blog {
    background-color: transparent !important;
    border: none !important;
}

/* --- 分類頁導覽區 (Category Nav) --- */
#all_blogs_title, .all_blogs_title {
    padding: 30px 0 10px 0 !important;
    text-align: center;
}

/* --- 主題連結（兩欄） --- */
.blogs_group .container {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
}

.blogs_group a {
    display: block;
    text-align: center;
    color: #2b2b2b !important;
    text-decoration: none;
    font-weight: 600;
    padding: 4px 0 !important; /* ✅ 關鍵：解決上方空白 */
    margin: 0 !important;
    line-height: 1.4;
}

.blogs_group a:hover {
    text-decoration: underline !important;
}

.section-heading, .blog_title h1 {
    color: #333 !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
}

/* 文章頁版面優化（核心） */
#article {
    padding: 0 !important;
}

#article .container {
    padding: 0 !important;
    margin-bottom: 2rem !important;
}

#article .row {
    margin: 0 !important;
}

#article .col-lg-9 {
    padding: 0 !important;
}

.article_title {
    margin-bottom: 10px !important;
}

.author_date {
    margin-bottom: 20px !important;
    font-size: 14px;
    color: #777;
}

#article_content h1,
#article_content h2,
#article_content h3 {
  color: #2B2B2B !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
}

#article_content h1 {
  font-size: 2rem !important;
  margin-top: 1.25rem !important;
  margin-bottom: 1.875rem !important;
}

#article_content h2 {
  font-size: 1.625rem !important;
  margin-top: 2.8rem !important;
  margin-bottom: 1.25rem !important;
}

#article_content h3 {
  font-size: 1.375rem !important;
  margin-top: 2.2rem !important;
  margin-bottom: 1rem !important;
}

#article_content p,
#article_content ul,
#article_content li {
  line-height: 1.85 !important;
  color: #2B2B2B !important;
  font-size: 1rem !important;
  margin-bottom: 0 !important;
}

#article_content p,
#article_content ul {
  margin-bottom: 1rem !important;
}

#article_content ul {
  padding-left: 1.5rem !important;
}

#article_content li {
  margin-bottom: 0.5rem !important;
  list-style-position: outside;
}

#article_content img {
  margin: 1rem 0 !important;
  border-radius: 0.5rem !important;
}

#article,
#article .container,
#article .row,
#article_content {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 文章重點摘要區塊 */
.article-highlight {
  background-color: #f9f9f9;
  border-left: 5px solid #406359;
  padding: 20px;
  margin: 2.5rem 0;
  border-radius: 4px;
}

.article-highlight .highlight-title {
  margin-top: 0;
  margin-bottom: 10px;
  font-weight: 700;
  color: #333;
  font-size: 1.1em;
}

.article-highlight .highlight-list {
  margin-bottom: 0;
  line-height: 1.8;
  color: #555;
  padding-left: 1.2rem;
}

.article-highlight a {
  color: #406359;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.article-highlight a:hover {
  border-bottom: 1px solid #406359;
}

#section1, #section2, #section3 {
  scroll-margin-top: 110px;
}

/* Sidebar 優化 */
.blog_info,
.blog_info .row,
.blog_info .col-12,
#all_blogs_title,
#recent_articles,
.tags_group,
.tags_group .tag,
.tags_group .tag a,
.recent_articles_group {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.recent_articles_group span.circle_number {
    display:none !important;
}

.recent_articles_group a {
    color: #2b2b2b !important;
    text-decoration: none;
    font-weight: 600;
}

.recent_articles_group a:hover {
    text-decoration: underline !important;
}

/* 完全隱藏分類區 */
.blog_info .col-12:has(#blog_tags),
.blog_info .col-12:has(#selected_blog) {
    display: none !important;
}

/* 壓縮間距 */
.blog_info .col-12,
.blog_info .row {
    margin-bottom: 0 !important;
}

/* 主題 vs 最新文章距離 */
#all_blogs_title {
    margin-bottom: 10px !important;
}

#recent_articles {
    margin-top: 0 !important;
}

@media (max-width: 768px) {
  #article_content h2 {
    scroll-margin-top: 90px;
  }
}


@media (max-width: 991px) {
  #article_content h1 {
    font-size: 1.5rem !important;
    margin-bottom: 1.5rem !important;
  }

  #article_content h2 {
    font-size: 1.31rem !important;
    margin-top: 2.2rem !important;
  }

  #article_content h3 {
    font-size: 1.1rem !important;
    margin-top: 1.75rem !important;
    margin-bottom: 0.75rem !important;
  }

  #article_content p,
  #article_content ul,
  #article_content li {
    line-height: 1.75 !important;
  }

}