:root {
    --primary-color: #32D3C3;
    --text-dark: #2D3436;
    --text-light: #636E72;
    --bg-color: #F9FBFC;
    --card-bg: #FFFFFF;
    --radius: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: "PingFang TC", sans-serif; }

body { background-color: var(--bg-color); color: var(--text-dark); }

/* 導覽列 */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 5%; background: white; position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.logo { display: flex; align-items: center; font-weight: 800; font-size: 1.4rem; gap: 10px; }
.logo img {
            height: 40px;
        }
.logo-icon { background: var(--primary-color); color: white; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.nav-links { display: flex; list-style: none; gap: 30px; font-weight: 500; }
.nav-links li.active { color: var(--primary-color); }
.btn-primary { background: var(--primary-color); color: white; border: none; padding: 10px 24px; border-radius: 50px; cursor: pointer; font-weight: 600; }
.btn-text { background: none; border: none; font-weight: 600; color: var(--text-light); margin-right: 15px; cursor: pointer; }

/* 佈局切分 */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 300px; /* 左側彈性，右側固定 300px */
    max-width: 1250px;
    margin: 40px auto;
    gap: 40px;
    padding: 0 20px;
}

/* 文章列表 */
.blog-header { margin-bottom: 40px; }
.badge { background: #E0F7F5; color: var(--primary-color); padding: 5px 15px; border-radius: 8px; font-size: 0.8rem; font-weight: bold; }
.blog-header h1 { font-size: 2.2rem; margin: 15px 0; }

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 雙欄排版 */
    gap: 30px;
}

/* 文章卡片 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #F0F0F0;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }

.card-image {
    width: 100%;
    height: 200px; /* 固定高度 */
}
.card-image img {
    width: 100%; height: 100%; object-fit: cover;
}

.card-content { padding: 25px; }
.card-content .category { color: var(--primary-color); font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; display: block; }
.card-content h3 { margin-bottom: 12px; font-size: 1.25rem; line-height: 1.4; }
.card-content p { color: var(--text-light); font-size: 0.95rem; line-height: 1.6; height: 75px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; margin-bottom: 15px;}

/* 側邊欄 */
.sidebar-widget {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    border: 1px solid #F0F0F0;
}
.sidebar-widget h3 { margin-bottom: 20px; font-size: 1.1rem; border-left: 4px solid var(--primary-color); padding-left: 10px; }
.category-list { list-style: none; }
.category-list li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #F9F9F9; cursor: pointer; color: var(--text-light); }
.category-list li:hover { color: var(--primary-color); }
.ad-box { background: linear-gradient(135deg, #32D3C3 0%, #20AFA1 100%); color: white; text-align: center; }
.search-box input { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid #EEE; background: #F9F9F9; }

/* 響應式 */
@media (max-width: 1000px) {
    .main-layout { grid-template-columns: 1fr; }
    .sidebar { order: -1; } /* 手機版側欄到上方 */
}
@media (max-width: 650px) {
    .blog-grid { grid-template-columns: 1fr; }
}




/* 第一篇文章：左圖右文 */
.card.featured {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    width: 100%;
    margin-bottom: 40px;
    height: 350px;
}
.card.featured .card-image { height: 100%; }

/* Tag 樣式 */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: #F0F2F5;
    color: #636E72;
    border-radius: 6px;
    font-size: 0.85rem;
    margin: 0 5px 8px 0;
    font-weight: 500;
}
.card .category-tag {
    background: #E0F7F5;
    color: var(--primary-color);
    font-weight: bold;
}

/* 側邊欄固定效果 */
.sticky-sidebar {
    position: sticky;
    top: 100px; /* 距離頂部 100px 時固定 */
}

/* 分頁器 */
.pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.page-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #EEE;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}
.page-btn.active, .page-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 文章卡片圖片高度固定 */
.card-image {
    width: 100%;
    height: 220px; /* 統一高度 */
    overflow: hidden;
}

/* 側邊欄熱門文章縮圖 */
.popular-item {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    align-items: center;
    cursor: pointer;
}
.popular-item img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}
.popular-item p {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}
.popular-item small { color: #999; }

/* 繼續閱讀 (精準對齊圖片風格) */
.read-more {
    text-decoration: none;
    color: #1A365D; /* 深藍色 */
    font-weight: 800;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
    transition: 0.2s;
}
.read-more:hover { gap: 10px; opacity: 0.8; }

/* 分頁器按鈕樣式 */
.page-btn {
    padding: 8px 16px;
    border: 1px solid #EEE;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.page-btn.active {
    background: #32D3C3;
    color: white;
    border-color: #32D3C3;
}

/* 文章頁面佈局微調 */
.post-page { margin-top: 40px; }

.post-container {
    background: white;
    padding: 60px;
    border-radius: 32px; /* 延續 NutriLog 大圓角風格 */
    border: 1px solid #F0F0F0;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 20px;
}

.post-header h1 {
    font-size: 2.8rem;
    margin: 20px 0;
    line-height: 1.2;
    color: #1A1A1A;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 40px;
}

.author-avatar {
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.post-featured-image {
    width: 100%;
    height: 450px;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 50px;
}

.post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 文章內容排版 */
.post-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #333;
}

.post-content .lead {
    font-size: 1.3rem;
    color: #555;
    font-weight: 500;
    margin-bottom: 30px;
}

.post-content h2 {
    font-size: 1.8rem;
    margin: 40px 0 20px;
    color: #1A1A1A;
}

.post-content p { margin-bottom: 25px; }

blockquote {
    border-left: 5px solid var(--primary-color);
    padding: 20px 30px;
    background: #F4FDFC;
    font-style: italic;
    font-size: 1.25rem;
    margin: 40px 0;
    border-radius: 0 16px 16px 0;
}

.content-img {
    width: 100%;
    border-radius: 20px;
    margin: 30px 0;
}

/* 響應式優化 */
@media (max-width: 768px) {
    .post-container { padding: 30px 20px; }
    .post-header h1 { font-size: 2rem; }
}