/* ===============================
   分頁：所有分類文章 美化 CSS
   =============================== */

/* 1. 主要佈局 */
.page-main {
    display: flex;
    gap: 40px;
    padding: 60px 0;
  }
  
  /* 2. 側邊欄 */
  .sidebar {
    flex: 0 0 240px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 24px;
    position: sticky;
    top: 120px;
  }
  .sidebar h3 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: #333;
    border-bottom: 2px solid #4CB28B;
    padding-bottom: 8px;
  }
  .category-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .category-list li + li {
    margin-top: 12px;
  }
  .category-list a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    color: #555;
    transition: background 0.25s, color 0.25s, transform 0.2s;
  }
  .category-list a:hover {
    background: rgba(240,192,64,0.15);
    transform: translateX(4px);
  }
  .category-list a.active {
    background: #4CB28B;
    color: #fff;
    box-shadow: 0 2px 8px rgba(240,192,64,0.4);
  }
  
  /* 3. 文章主區 */
  .all-articles {
    flex: 1;
    margin-top: 70px;
  }
  .all-articles h2 {
    font-size: 2rem;
    margin-bottom: 24px;
    color: #222;
    position: relative;
  }
  .all-articles h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #4CB28B;
    border-radius: 2px;
    margin-top: 8px;
  }
  .articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 32px;
  }
  
  /* 4. 單張文章卡片 */
  .post-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
  }
  .post-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.4s;
  }
  .post-card:hover img {
    transform: scale(1.05);
  }
  .post-card h3 {
    margin: 16px 16px 8px;
    font-size: 1.15rem;
    color: #333;
  }
  .post-card .article-desc {
    flex: 1;
    margin: 0 16px 16px;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
  }
  .post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  }
  
  /* 5. 回到頂部按鈕（可選） */
  .back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: #4CB28B;
    color: #fff;
    padding: 12px;
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s;
  }
  .back-to-top:hover {
    transform: scale(1.1);
  }
  
  /* 6. 響應式 */
  @media (max-width: 1024px) {
    .page-main {
      flex-direction: column-reverse;
      gap: 24px;
    }
    .sidebar {
      position: relative;
      top: auto;
      width: 100%;
    }
  }
  @media (max-width: 600px) {
    .articles-grid {
      grid-template-columns: 1fr;
    }
    .post-card img {
      height: 200px;
    }
  }
  