/* 部落格主要樣式 */
:root {
    --blog-background: #f7f9fc;
    --card-background: #ffffff;
    --card-hover-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    --blog-text-primary: #333333;
    --blog-text-secondary: #666666;
    --blog-accent: #3a7bd5;
    --blog-category-tech: #3a7bd5;
    --blog-category-growth: #6d5cae;
    --blog-category-startup: #ff7676;
    --blog-category-digital: #2cc990;
    --blog-border-light: #e6e9ed;
    --blog-border-radius: 8px;
}

/* 部落格容器 */
.blog-container {
    max-width: 1200px;
    width: 92%;
    margin: 0 auto;
    padding: 0 15px;
}

/* 部落格英雄區域 */
.blog-hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    padding: 120px 0 80px;
    color: white;
    text-align: center;
}

.blog-hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.blog-hero h1 {
    font-size: 3rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.blog-hero-description {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 40px;
    line-height: 1.5;
}

/* 搜尋列 */
.blog-search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

#blog-search {
    width: 100%;
    padding: 16px 24px;
    border-radius: 30px;
    border: none;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#blog-search:focus {
    outline: none;
    background: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.search-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: var(--primary-dark);
}

/* 類別按鈕 */
.blog-categories {
    background-color: var(--blog-background);
    padding: 20px 0;
    border-bottom: 1px solid var(--blog-border-light);
}

.categories-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.category-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid var(--blog-border-light);
    background: white;
    color: var(--blog-text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background: #f0f2f5;
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 特色文章卡片 */
.featured-article {
    padding: 60px 0;
    background-color: var(--blog-background);
}

.featured-article-card {
    display: flex;
    background: var(--card-background);
    border-radius: var(--blog-border-radius);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.featured-article-image {
    flex: 0 0 50%;
    position: relative;
    overflow: hidden;
}

.featured-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-article-card:hover .featured-article-image img {
    transform: scale(1.05);
}

.featured-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.featured-article-content {
    flex: 0 0 50%;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.article-meta {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
}

.article-category {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    margin-right: 12px;
}

.article-category.tech {
    background: var(--blog-category-tech);
}

.article-category.growth {
    background: var(--blog-category-growth);
}

.article-category.startup {
    background: var(--blog-category-startup);
}

.article-category.digital {
    background: var(--blog-category-digital);
}

.article-date {
    color: var(--blog-text-secondary);
}

.featured-article-content h2 {
    font-size: 1.8rem;
    margin-bottom: 16px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--blog-text-primary);
}

.article-excerpt {
    color: var(--blog-text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.read-more-btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: auto;
    text-align: center;
}

.read-more-btn:hover {
    background-color: var(--primary-dark);
}

/* 最新文章區塊 */
.latest-articles {
    padding: 60px 0;
    background-color: var(--blog-background);
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
    color: var(--blog-text-primary);
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    margin: 12px auto 0;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.article-card {
    background: var(--card-background);
    border-radius: var(--blog-border-radius);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.article-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-image {
    height: 200px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-card-content {
    padding: 24px;
}

.article-card-content h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--blog-text-primary);
}

/* 分頁導航 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 60px;
    gap: 8px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a {
    background: white;
    color: var(--blog-text-secondary);
    border: 1px solid var(--blog-border-light);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .current-page {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.pagination .next-page, .pagination .prev-page {
    width: auto;
    padding: 0 16px;
    border-radius: 20px;
}

/* 訂閱區塊 */
.blog-newsletter {
    background: var(--primary-gradient);
    padding: 80px 0;
    color: white;
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-content h2 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.newsletter-content p {
    margin-bottom: 30px;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: 16px 24px;
    border: none;
    font-size: 16px;
}

.newsletter-form input[type="email"]:focus {
    outline: none;
}

.newsletter-form button {
    background: var(--primary-dark);
    color: white;
    border: none;
    padding: 0 30px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.newsletter-form button:hover {
    background: #2a5da0;
}

.privacy-note {
    font-size: 12px;
    margin-top: 16px;
    opacity: 0.7;
}

/* 文章頁 */
.article-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
}

.article-content {
    background: white;
    border-radius: var(--blog-border-radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.article-header {
    padding: 40px 40px 20px;
}

.article-header h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--blog-text-primary);
}

.article-author {
    display: flex;
    align-items: center;
    margin-top: 24px;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 16px;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--blog-text-primary);
}

.author-title {
    font-size: 14px;
    color: var(--blog-text-secondary);
}

.article-featured-image {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    position: relative;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.article-toc {
    padding: 30px 40px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--blog-border-light);
}

.article-toc h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--blog-text-primary);
}

.article-toc ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.article-toc li {
    margin-bottom: 10px;
}

.article-toc a {
    text-decoration: none;
    color: var(--blog-text-secondary);
    transition: color 0.3s ease;
}

.article-toc a:hover {
    color: var(--blog-accent);
}

.article-body {
    padding: 40px;
    font-size: 18px;
    line-height: 1.8;
    color: var(--blog-text-primary);
}

.article-body h2 {
    font-size: 1.8rem;
    margin: 40px 0 20px;
    color: var(--blog-text-primary);
}

.article-body h3 {
    font-size: 1.4rem;
    margin: 30px 0 20px;
    color: var(--blog-text-primary);
}

.article-body p {
    margin-bottom: 24px;
}

.article-body blockquote {
    margin: 30px 0;
    padding: 20px 30px;
    border-left: 4px solid var(--primary-color);
    background: #f8f9fa;
    font-style: italic;
}

.article-body blockquote cite {
    display: block;
    margin-top: 12px;
    font-size: 0.9em;
    font-style: normal;
    color: var(--blog-text-secondary);
}

.article-image {
    margin: 30px 0;
    text-align: center;
}

.article-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.article-image figcaption {
    margin-top: 10px;
    font-size: 0.9em;
    color: var(--blog-text-secondary);
    text-align: center;
}

.code-block {
    margin: 30px 0;
    background: #272822;
    border-radius: 8px;
    overflow: auto;
}

.code-block pre {
    padding: 20px;
    margin: 0;
}

.code-block code {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: #f8f8f2;
    line-height: 1.5;
}

.highlight-box {
    margin: 30px 0;
    padding: 24px;
    background: #f0f7ff;
    border-left: 4px solid var(--blog-accent);
    border-radius: 0 8px 8px 0;
}

.highlight-box h4 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--blog-accent);
}

.article-tags {
    padding: 20px 40px;
    border-top: 1px solid var(--blog-border-light);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.tag-label {
    margin-right: 10px;
    color: var(--blog-text-secondary);
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f2f5;
    border-radius: 30px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    text-decoration: none;
    color: var(--blog-text-secondary);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
}

.article-author-bio {
    padding: 40px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    border-top: 1px solid var(--blog-border-light);
}

.author-bio-content {
    margin-left: 20px;
}

.author-bio-content h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--blog-text-primary);
}

.author-bio-content p {
    font-size: 0.9em;
    color: var(--blog-text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.author-social {
    display: flex;
    gap: 12px;
}

.author-social .social-link {
    text-decoration: none;
    color: var(--blog-accent);
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.author-social .social-link:hover {
    color: var(--primary-dark);
}

.related-articles {
    padding: 40px;
    border-top: 1px solid var(--blog-border-light);
}

.related-articles h3 {
    font-size: 1.4rem;
    margin-bottom: 24px;
    color: var(--blog-text-primary);
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-article-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.related-article-card:hover {
    transform: translateY(-5px);
}

.related-article-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.related-article-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--blog-text-primary);
    line-height: 1.4;
}

.related-article-date {
    font-size: 0.8em;
    color: var(--blog-text-secondary);
}

.article-comments {
    padding: 40px;
    border-top: 1px solid var(--blog-border-light);
}

.article-comments h3 {
    font-size: 1.4rem;
    margin-bottom: 24px;
    color: var(--blog-text-primary);
}

.article-sidebar {
    position: relative;
}

.sidebar-toc {
    position: sticky;
    top: 100px;
    background: white;
    border-radius: var(--blog-border-radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 24px;
    margin-bottom: 30px;
}

.sidebar-toc h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--blog-text-primary);
}

.sidebar-toc-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar-toc-list li {
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

.sidebar-toc-list li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blog-accent);
}

.sidebar-toc-list a {
    text-decoration: none;
    color: var(--blog-text-secondary);
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.sidebar-toc-list a:hover {
    color: var(--blog-accent);
}

.sidebar-toc-list li.active a {
    color: var(--blog-accent);
    font-weight: 600;
}

.share-buttons {
    background: white;
    border-radius: var(--blog-border-radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 24px;
    margin-bottom: 30px;
}

.share-buttons h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--blog-text-primary);
}

.share-buttons-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 4px;
    border: none;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.share-button svg {
    width: 16px;
    height: 16px;
}

.share-button.facebook {
    background: #3b5998;
    color: white;
}

.share-button.twitter {
    background: #1da1f2;
    color: white;
}

.share-button.linkedin {
    background: #0077b5;
    color: white;
}

.share-button.copy-link {
    background: #f0f2f5;
    color: var(--blog-text-primary);
}

.share-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.sidebar-newsletter {
    background: white;
    border-radius: var(--blog-border-radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 24px;
    margin-bottom: 30px;
}

.sidebar-newsletter h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--blog-text-primary);
}

.sidebar-newsletter p {
    font-size: 0.9em;
    color: var(--blog-text-secondary);
    margin-bottom: 16px;
}

.sidebar-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-newsletter-form input {
    padding: 12px;
    border: 1px solid var(--blog-border-light);
    border-radius: 4px;
    font-size: 14px;
}

.sidebar-newsletter-form input:focus {
    outline: none;
    border-color: var(--blog-accent);
}

.sidebar-newsletter-form button {
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.sidebar-newsletter-form button:hover {
    background: var(--primary-dark);
}

.popular-articles {
    background: white;
    border-radius: var(--blog-border-radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 24px;
}

.popular-articles h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--blog-text-primary);
}

.popular-articles-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.popular-articles-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--blog-border-light);
}

.popular-articles-list li:last-child {
    border-bottom: none;
}

.popular-articles-list a {
    text-decoration: none;
    color: var(--blog-text-primary);
    font-size: 0.9em;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.popular-articles-list a:hover {
    color: var(--blog-accent);
}

.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 100;
    background: transparent;
}

.reading-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0;
}

#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 90;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

#back-to-top:hover {
    background: var(--primary-dark);
}

/* RWD 響應式設計 */
@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .article-main {
        grid-template-columns: 1fr;
    }
    
    .featured-article-card {
        flex-direction: column;
    }
    
    .featured-article-image, .featured-article-content {
        flex: 0 0 100%;
    }
    
    .featured-article-image img {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2.2rem;
    }
    
    .blog-hero-description {
        font-size: 1.1rem;
    }
    
    .related-articles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .related-article-card {
        display: flex;
        align-items: center;
    }
    
    .related-article-card img {
        width: 80px;
        height: 80px;
        margin-right: 16px;
        margin-bottom: 0;
    }
    
    .article-author-bio {
        flex-direction: column;
        text-align: center;
    }
    
    .author-avatar {
        margin-right: 0;
        margin-bottom: 16px;
    }
    
    .author-social {
        justify-content: center;
    }
}

@media (max-width: 567px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .share-buttons-container {
        grid-template-columns: 1fr;
    }
    
    .article-header h1 {
        font-size: 1.8rem;
    }
    
    .article-body {
        font-size: 16px;
        padding: 20px;
    }
    
    .article-header, .article-tags, .article-author-bio, .related-articles, .article-comments {
        padding: 20px;
    }
}