/* 基礎變數 */
:root {
    --primary-color: #0b92db;
    --secondary-color: #f8f9fa;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow-md: 0 .5rem 1rem rgba(0,0,0,.1);
    --border-radius: 0.5rem;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --gradient-primary: linear-gradient(135deg, #0b92db 0%, #0a7bb9 100%);
    --code-bg: #f8f9fa;
    --code-color: #d63384;
    
    /* 預設動畫 */
    --transition-speed: 0.3s;
}

/* 優化渲染性能的通用設置 */
.blog-post-card, .related-post-card, .category-card, .share-btn {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* 全局樣式 */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 部落格主要樣式 */
.blog-post {
    margin-bottom: 3.5rem;
}

.blog-post:hover {
    transform: none;
}

/* 文章內容區塊樣式 */
.blog-post-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin: 1.5rem 0;
    line-height: 1.8;
    font-size: 1.2rem;
}

/* 文章內容排版樣式 */
.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4,
.blog-post-content h5,
.blog-post-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-color);
    scroll-margin-top: 80px;
    padding-top: 1rem;
    position: relative;
}

.blog-post-content h1:first-child,
.blog-post-content h2:first-child,
.blog-post-content h3:first-child,
.blog-post-content h4:first-child,
.blog-post-content h5:first-child,
.blog-post-content h6:first-child {
    margin-top: 0;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}
.blog-post-content ul p:first-child,
.blog-post-content ol p:first-child {
    margin-bottom: 0.5rem;
}

/* 文章內容圖片樣式優化 */
.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #f8f9fa;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.blog-post-content pre {
    background-color: var(--code-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.blog-post-content code {
    background-color: var(--code-bg);
    color: var(--code-color);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

.blog-post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.blog-post-content ul,
.blog-post-content ol {
    margin: 0.75rem 0;
    padding-left: 2rem;
}

.blog-post-content li {
    margin-bottom: 0.4rem;
}

/* 優化巢狀列表間距 - 調整li底下的ul/ol元素的上方邊距 */
.blog-post-content li ul,
.blog-post-content li ol {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem;
}

/* 調整段落後的列表間距 - 減少上方邊距 */
.blog-post-content p + ul,
.blog-post-content p + ol {
    margin-top: -0.5rem;
}

/* 調整標題後的列表間距 - 減少上方邊距 */
.blog-post-content h1 + ul,
.blog-post-content h2 + ul,
.blog-post-content h3 + ul,
.blog-post-content h4 + ul,
.blog-post-content h5 + ul,
.blog-post-content h6 + ul,
.blog-post-content h1 + ol,
.blog-post-content h2 + ol,
.blog-post-content h3 + ol,
.blog-post-content h4 + ol,
.blog-post-content h5 + ol,
.blog-post-content h6 + ol {
    margin-top: 0.25rem;
}

/* 調整列表項目的間距 */
.blog-post-content li:last-child {
    margin-bottom: 0;
}

/* 改進的部落格卡片樣式 */
.blog-post-card, .card.h-100.fade-in {
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    position: relative;
}

.blog-post-card:hover, .card.h-100.fade-in:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
    border-color: rgba(11, 146, 219, 0.2);
}

.blog-post-image {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    width: 100%;
}

.blog-post-card-body, .card-body {
    padding: 1.75rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    border-bottom: none;
}

.blog-post-title {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.4;
}

.blog-post-title a, .card-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.blog-post-title a:hover, .card-title a:hover {
    color: var(--primary-color);
}

.blog-post-meta {
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.blog-post-meta span {
    display: flex;
    align-items: center;
}

.blog-post-meta i {
    margin-right: 0.35rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    opacity: 0.8;
}

.blog-post-meta a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-post-meta a:hover {
    text-decoration: none;
    color: var(--primary-color);
    opacity: 0.8;
}

.blog-post-excerpt, .card-text {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.6;
    flex-grow: 1;
    font-size: 0.95rem;
}

/* 優化摘要顯示樣式 */
.card-text {
    color: #4a4a4a;
    line-height: 1.7;
    font-size: 1rem;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis;
    max-height: 5.1rem; /* 3行的最大高度 (1.7 * 3) */
    word-wrap: break-word;
}

/* 摘要區塊樣式優化 */
.blog-post-summary {
    background-color: #f9f9f9;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.blog-post-summary:hover {
    background-color: #f5f5f5;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.summary-content p {
    color: #555;
    line-height: 1.7;
    letter-spacing: 0.01em;
}

.blog-post-footer, .card-footer {
    margin-top: auto;
    padding: 0.75rem 1.5rem;
    background-color: rgba(248, 249, 250, 0.6);
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    min-height: 48px;
}

/* 圖片連結樣式 */
.card-img-link {
    display: block;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.card-img-link:hover {
    transform: scale(1.02);
}

/* 改進的標籤樣式 - 直接在footer中顯示 */
.post-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    height: 32px;
    min-height: 32px;
}

.post-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    background-color: rgba(11, 146, 219, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(11, 146, 219, 0.15);
    white-space: nowrap;
    font-weight: 500;
    line-height: 1.2;
}

.post-tag:hover {
    background-color: rgba(11, 146, 219, 0.2);
    color: var(--primary-color);
    text-decoration: none;
    border-color: rgba(11, 146, 219, 0.3);
    transform: translateY(-1px);
}

.post-tag-more {
    font-size: 0.75rem;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.15);
    white-space: nowrap;
    font-weight: 500;
    line-height: 1.2;
}

/* 改進的按鈕樣式 */
.btn-primary, .btn-sm.btn-primary {
    background: var(--gradient-primary);
    border: none;
    padding: 0.45rem 1.2rem;
    font-size: 0.85rem;
    border-radius: 50px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(11, 146, 219, 0.2);
    transition: all 0.3s ease;
}

.btn-sm.btn-primary {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    white-space: nowrap;
    min-width: fit-content;
}

.btn-primary:hover, .btn-sm.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(11, 146, 219, 0.3);
    background-position: right center;
}

.btn-primary:active, .btn-sm.btn-primary:active {
    transform: translateY(0);
}

/* 改進的精選文章卡片 */
.featured-post-card {
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    border: none;
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    margin-bottom: 2rem;
}

.featured-badge {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--gradient-primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(11, 146, 219, 0.3);
}

.featured-post-card .card-body {
    padding: 2rem;
}

.featured-post-card .card-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.featured-post-card .card-text {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* 部落格列表標題 */
.blog-post-list h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    position: relative;
}

.blog-post-list h1:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100px;
    height: 2px;
    background: var(--gradient-primary);
}

/* 容器間距和動畫優化 */
.blog-post-list {
    margin-bottom: 3rem;
}

.blog-post-list .row {
    margin-bottom: 0.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

/* 無文章提示美化 */
.alert-info {
    background-color: rgba(11, 146, 219, 0.1);
    border: 1px solid rgba(11, 146, 219, 0.2);
    color: var(--primary-color);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
}

/* 移除不需要的大螢幕優化，因為現在只有標籤 */

/* 響應式調整 */
@media (max-width: 768px) {
    .blog-post-title, .card-title {
        font-size: 1.2rem;
    }
    
    .blog-post-card-body, .card-body {
        padding: 1.25rem;
    }
    
    .blog-post-footer, .card-footer {
        padding: 0.6rem 1rem;
    }
    
    .post-tags {
        gap: 0.3rem;
        height: 28px;
        min-height: 28px;
    }
    
    .post-tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .post-tag-more {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .featured-post-card .card-title {
        font-size: 1.5rem;
    }
    
    .featured-badge {
        top: 1rem;
        right: 1rem;
    }
}

/* 文章內容樣式 */
.blog-post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-color);
}

.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.blog-post-content img:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    filter: brightness(1.05) contrast(1.02);
}

/* 小圖片樣式（寬度小於400px） */
.blog-post-content img[width]:not([width*="1"]):not([width*="2"]):not([width*="3"]):not([width*="4"]):not([width*="5"]):not([width*="6"]):not([width*="7"]):not([width*="8"]):not([width*="9"]) {
    max-width: 300px;
    margin: 1.5rem auto;
}

/* 圖片容器優化 */
.blog-post-content p:has(img) {
    text-align: center;
    margin: 2.5rem 0;
}

/* 圖片清晰度優化 */
.blog-post-content img,
.blog-post-featured-image img {
    /* 防止圖片模糊 */
    transform: translateZ(0);
    will-change: transform, filter;
    /* 優化圖片渲染 */
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
    /* 硬體加速 */
    -webkit-transform: translate3d(0, 0, 0);
    -moz-transform: translate3d(0, 0, 0);
    -ms-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* 圖片加載效果 */
.blog-post-content img {
    opacity: 1;
    animation: fadeInImage 0.6s ease forwards;
}

@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 圖片標題/說明文字 */
.blog-post-content img + em,
.blog-post-content figure figcaption {
    display: block;
    text-align: center;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
}

/* 高解析度顯示器優化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .blog-post-content img,
    .blog-post-featured-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: high-quality;
        image-rendering: optimizeQuality;
        -ms-interpolation-mode: bicubic;
    }
}

/* 超高解析度顯示器優化 */
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
    .blog-post-content img,
    .blog-post-featured-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: high-quality;
        image-rendering: optimizeQuality;
        image-rendering: auto;
    }
}

.blog-post-content ul,
.blog-post-content ol {
    margin: 0.75rem 0;
    padding-left: 2rem;
}

.blog-post-content li {
    margin-bottom: 0.4rem;
}

/* 內聯程式碼 */
.blog-post-content code {
    background-color: var(--code-bg);
    border-radius: 3px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    padding: 0.2em 0.4em;
    color: var(--code-color);
    font-size: 0.9em;
}

/* 程式碼塊 */
.blog-post-content pre {
    background-color: var(--code-bg);
    border-radius: 3px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.blog-post-content pre code {
    padding: 0;
    background-color: transparent;
    color: inherit;
    font-size: 0.9em;
    border: none;
}

/* 水平線 */
.blog-post-content hr {
    height: 1px;
    background-color: var(--border-color);
    border: none;
    margin: 2rem 0;
}

/* 引用區塊 */
.blog-post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background-color: var(--secondary-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
}

.blog-post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* 表格樣式 */
.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.blog-post-content th,
.blog-post-content td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
}

.blog-post-content th {
    background-color: var(--secondary-color);
    font-weight: 600;
}

.blog-post-content tr:nth-child(even) {
    background-color: var(--secondary-color);
}

/* 標題錨點 */
.blog-post-content .header-anchor {
    opacity: 0;
    font-size: 0.85em;
    margin-left: 0.5em;
    color: var(--primary-color);
    transition: opacity 0.3s ease;
    text-decoration: none;
}

.blog-post-content h1:hover .header-anchor,
.blog-post-content h2:hover .header-anchor,
.blog-post-content h3:hover .header-anchor,
.blog-post-content h4:hover .header-anchor,
.blog-post-content h5:hover .header-anchor,
.blog-post-content h6:hover .header-anchor {
    opacity: 1;
    text-decoration: none;
}

.blog-post-content .header-anchor:hover {
    opacity: 1;
    color: var(--primary-hover-color);
}

/* 側邊欄樣式 */
.blog-sidebar {
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* 自訂側邊欄滾輪樣式 */
.blog-sidebar::-webkit-scrollbar {
    width: 6px;
}

.blog-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.blog-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.blog-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

.sidebar-module {
    margin-bottom: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.sidebar-module:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sidebar-header {
    padding: 0.8rem 1rem;
    background-color: #f0f0f0;
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
    color: #444;
    border-bottom: 1px solid #e5e5e5;
}

.sidebar-body {
    padding: 1rem;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li {
    padding: 0.3rem 0;
    border-bottom: 1px solid #eee;
}

.sidebar-list li:last-child {
    border-bottom: none;
}

.sidebar-list a {
    color: #444;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-list a:hover {
    color: #0d6efd;
}

/* 標籤雲樣式 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #444;
    text-decoration: none;
    border: 1px solid #eaeaea;
    transition: all 0.2s ease;
}

.tag-item:hover {
    background-color: #e9ecef;
    color: #0d6efd;
    text-decoration: none;
}

.tag-item .badge {
    margin-left: 0.3rem;
    background-color: #0d6efd;
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
}

.tag-item.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.tag-item.active .badge {
    background-color: white;
    color: #0d6efd;
}

/* 分頁樣式 */
.blog-pagination {
    margin: 3rem 0;
    display: flex;
    justify-content: center;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link {
    color: var(--primary-color);
}

/* 相關文章樣式 */
.related-posts-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.related-post-card {
    height: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    border: 1px solid var(--border-color);
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* 社交分享樣式 */
.social-sharing {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    border-radius: 30px;
    color: white;
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    text-align: center;
    min-width: 120px;
}

@media (max-width: 768px) {
    .share-btn {
        flex: 1 1 auto;
    }
}

.share-btn i {
    margin-right: 0.5rem;
}

.share-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.share-btn.facebook {
    background-color: #3b5998;
}

.share-btn.instagram {
    background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D);
}

.share-btn.threads {
    background-color: #000000;
}

.share-btn.copy-link {
    background-color: #29a745;
}

/* 複製成功的提示樣式 */
.copy-success {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 9999;
    animation: fadeInOut 2s ease-in-out;
    text-align: center;
}

/* Instagram分享提示特殊樣式 */
.copy-success.instagram-share {
    background: linear-gradient(135deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
    animation: fadeInOut 3s ease-in-out;
    font-size: 14px;
    line-height: 1.4;
    max-width: 300px;
    padding: 15px 20px;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* 文章詳細頁面標籤樣式優化 */
.blog-post-meta .badge {
    font-size: 0.85rem !important;
    padding: 0.4rem 0.8rem !important;
    margin-right: 0.4rem;
    margin-bottom: 0.2rem;
    display: inline-block;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.blog-post-meta .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 文章內容強調樣式 */
.blog-post-content strong {
    color: var(--text-color);
    font-weight: 700;
}

/* 設置動畫效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* 卡片式分類樣式 */
.category-card {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.category-card-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
}

.category-card-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-count {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* 特色文章樣式 */
.featured-post {
    position: relative;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
}

.featured-post-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
}

.featured-post-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    color: white;
}

.featured-post-content h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.featured-post-content a {
    color: white;
    text-decoration: none;
}

.featured-post-content a:hover {
    text-decoration: underline;
}

.featured-post-meta {
    opacity: 0.8;
    margin-bottom: 1rem;
}

.featured-post-btn {
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 30px;
    padding: 0.5rem 1.5rem;
    display: inline-block;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
}

.featured-post-btn:hover {
    background-color: #0a7bb9;
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

/* 文章作者資訊 */
.author-card {
    display: flex;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
    align-items: center;
}

.author-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-right: 1rem;
    object-fit: cover;
}

.author-info h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.author-info p {
    margin-bottom: 0;
    color: #666;
}

/* 相關文章 */
.related-posts {
    margin-top: 2rem;
}

.related-posts .card {
    margin-bottom: 1rem;
}

/* 分類導航 */
.category-navigation {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
}

.category-navigation span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.category-navigation a {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    background-color: white;
    color: var(--text-color);
    border-radius: 50px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.category-navigation a:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    color: var(--primary-color);
}

.category-navigation a.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 分頁導航 */
.pagination {
    margin-top: 3rem;
    gap: 0.25rem;
}

.page-item .page-link {
    border: none;
    color: var(--text-color);
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.page-item .page-link:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: 0 2px 5px rgba(11, 146, 219, 0.2);
}

.page-item.disabled .page-link {
    background-color: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
}

.page-item.active .page-link:hover {
    transform: none;
}

.page-item:first-child .page-link,
.page-item:last-child .page-link {
    padding: 0.6rem 0.8rem;
}

/* 頁面加載動畫 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* 響應式調整 */
@media (max-width: 767.98px) {
    .featured-post-img {
        height: 250px;
    }
    
    .blog-post-list .card-img-top {
        height: 220px;
    }
}

/* 閱讀進度條 */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: #0d6efd;
    width: 0%;
    z-index: 1000;
    transition: width 0.1s ease;
}

/* 文章列表樣式 */
.blog-post-list .card-img-top {
    height: 250px;
    object-fit: cover;
}

/* 文章特色圖片樣式 */
.blog-post-featured-image {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    background-color: #f8f9fa;
}

.blog-post-featured-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    transition: all 0.5s ease;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
}

.blog-post-featured-image:hover img {
    filter: brightness(1.05) contrast(1.02) saturate(1.1);
}

/* 基本設置 */
body {
    font-family: "Microsoft JhengHei", "微軟正黑體", Arial, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* 文章卡片樣式 */
.card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* 新增樣式 - 部落格頁面標題 */
.blog-header {
    text-align: left;
    margin-bottom: 2.5rem;
}

.blog-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: inline-block;
    position: relative;
}

.border-gradient {
    position: relative;
    padding-bottom: 0.5rem;
}

.border-gradient:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100px;
    height: 3px;
    background: var(--gradient-primary);
}

/* 分類標籤 */
.category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gradient-primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(11, 146, 219, 0.3);
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 2;
}

.category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(11, 146, 219, 0.4);
    color: white;
    text-decoration: none;
}

/* 卡片圖片容器 */
.card-img-container {
    position: relative;
    overflow: hidden;
    height: 250px; /* 固定容器高度 */
}

.card-img-top {
    height: 250px !important;
    min-height: 250px;
    max-height: 250px;
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

/* 預設圖片樣式 */
.blog-placeholder-img {
    height: 250px !important;
    min-height: 250px;
    max-height: 250px;
    width: 100%;
    transition: background-color 0.3s ease, transform 0.5s ease;
    border-radius: 0;
}

.blog-placeholder-img:hover {
    background-color: rgba(240, 244, 248, 0.8) !important;
}

.card-img-link:hover .blog-placeholder-img {
    background-color: rgba(240, 244, 248, 0.8) !important;
    transform: scale(1.05);
}

/* 改進部落格列表標題 */
.blog-post-list h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* 改進無文章提示 */
.alert-info {
    display: flex;
    align-items: center;
    background-color: rgba(11, 146, 219, 0.1);
    border: 1px solid rgba(11, 146, 219, 0.2);
    color: var(--primary-color);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
}

.alert-info i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

/* 專業過渡效果 */
.blog-post-list .row {
    transition: opacity 0.3s ease;
}

/* 優化熱門標籤樣式 */
.popular-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.popular-tags li {
    margin: 0;
}

.popular-tags a {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    background-color: rgba(11, 146, 219, 0.1);
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.popular-tags a:hover {
    background-color: rgba(11, 146, 219, 0.2);
    transform: translateY(-2px);
}

.popular-tags a.active {
    background-color: var(--primary-color);
    color: white;
}

.popular-tags .badge {
    background-color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    margin-left: 0.4rem;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
}

.post-tag.active {
    background-color: var(--primary-color);
    color: white;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .blog-header h1 {
        font-size: 2rem;
    }

    .blog-header p {
        font-size: 0.9rem;
    }

    .card-img-container {
        height: 220px; /* 小螢幕容器高度 */
    }

    .card-img-top {
        height: 220px !important;
        min-height: 220px;
        max-height: 220px;
    }
    
    .blog-placeholder-img {
        height: 220px !important;
        min-height: 220px;
        max-height: 220px;
    }
    
    .category-badge {
        padding: 0.25rem 0.6rem;
        font-size: 0.7rem;
    }
    
    /* 手機版圖片優化 */
    .blog-post-featured-image {
        border-radius: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .blog-post-featured-image img {
        max-height: 300px;
    }
    
    .blog-post-content img {
        margin: 1.5rem auto;
        border-radius: 0.5rem;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    }
    
    .blog-post-content img:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
        filter: brightness(1.03) contrast(1.01);
    }
    
    .blog-post-content p:has(img) {
        margin: 2rem 0;
    }

    /* 手機版側邊欄優化 */
    .blog-sidebar {
        position: static !important;
        max-height: none !important;
        overflow-y: visible !important;
        margin-top: 2rem;
    }

    /* 手機版文章標籤優化 */
    .blog-post-meta .badge {
        font-size: 0.8rem !important;
        padding: 0.35rem 0.7rem !important;
        margin-right: 0.3rem;
    }
}

/* 麵包屑導航樣式 */
.breadcrumb {
    padding: 0;
    margin: 0;
    background: none;
    font-size: 0.9rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.5rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
    opacity: 0.8;
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* 卡片標題樣式 */
.card-title {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.4;
}

/* 相關文章卡片樣式 */
.related-post-card {
    height: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    border: 1px solid var(--border-color);
}

.related-post-card .card-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* 滾動平滑效果 */
html {
    scroll-behavior: smooth;
}

/* 確保標題有跳轉的空間 */
:target {
    scroll-margin-top: 70px;
} 