﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.header-container {
    background: white;
}

.main-container {
    margin: 0 5%;
    padding: 15px 50px;
}

/* 內容包裝器 */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* 文章主體 */
.news-article {
    background: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 新聞首圖 */
.article-hero-image {
    width: 100%;
    max-height: 500px;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

.article-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 文章標題 */
.article-title {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1.4;
    margin-bottom: 20px;
}

/* 元信息欄 */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    padding: 15px 0;
    color: #6c757d;
    font-size: 14px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-icon {
    font-size: 16px;
}

.meta-divider {
    color: #dee2e6;
}

/* 標籤區域 */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background-color: #e3f2fd;
    color: #1976d2;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

/* 互動工具欄 */
.article-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.like-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
}

.like-btn:hover:not(:disabled) {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    transform: scale(1.05);
}

.like-btn.liked {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.like-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.like-icon {
    font-size: 18px;
}

.font-size-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.font-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.font-btn {
    padding: 8px 16px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.font-btn:hover {
    background-color: #e9ecef;
}

.font-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* 分隔線 */
.article-divider {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 30px 0;
}

/* 文章內容 */
.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #2c3e50;
    transition: font-size 0.3s ease;
}

.article-content.font-small {
    font-size: 14px;
}

.article-content.font-medium {
    font-size: 16px;
}

.article-content.font-large {
    font-size: 18px;
}

/* 文章內容樣式 */
.article-content h1 {
    font-size: 28px;
    font-weight: bold;
    margin: 25px 0 15px 0;
    color: #2c3e50;
}

.article-content h2 {
    font-size: 24px;
    font-weight: bold;
    margin: 22px 0 12px 0;
    color: #2c3e50;
}

.article-content h3 {
    font-size: 20px;
    font-weight: bold;
    margin: 20px 0 10px 0;
    color: #2c3e50;
}

.article-content h4 {
    font-size: 18px;
    font-weight: bold;
    margin: 18px 0 8px 0;
    color: #2c3e50;
}

.article-content p,
.article-content div {
    margin: 15px 0;
}

.article-content ul,
.article-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.article-content li {
    margin: 8px 0;
}

.article-content a {
    color: #007bff;
    text-decoration: underline;
}

.article-content a:hover {
    color: #0056b3;
}

.article-content strong,
.article-content b {
    font-weight: bold;
}

.article-content em,
.article-content i {
    font-style: italic;
}

.article-content u {
    text-decoration: underline;
}

.article-content s,
.article-content strike {
    text-decoration: line-through;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* 相關圖片畫廊 */
.article-gallery {
    margin-top: 40px;
}

.gallery-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    padding-top: 75%;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 圖片燈箱 */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* 側邊欄 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.sidebar-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-item:hover {
    background-color: #f8f9fa;
}

.sidebar-thumbnail {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.sidebar-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-date,
.sidebar-views {
    font-size: 12px;
    color: #6c757d;
}

.no-data {
    text-align: center;
    color: #6c757d;
    padding: 20px;
}

/* 底部容器 */
.footer-container {
    margin-top: 40px;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #999;
    padding-bottom: 30px;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .news-article {
        order: 1;
    }
}

@media (max-width: 768px) {
    .main-container {
        margin: 15px;
        padding: 0;
    }
    
    .news-article {
        padding: 20px;
    }

    .article-title {
        font-size: 24px;
    }

    .article-meta {
        font-size: 13px;
    }

    .article-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .like-btn {
        justify-content: center;
    }

    .font-size-control {
        justify-content: center;
    }

    .article-content {
        font-size: 15px;
    }

    .article-content.font-small {
        font-size: 13px;
    }

    .article-content.font-medium {
        font-size: 15px;
    }

    .article-content.font-large {
        font-size: 17px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 20px;
    }

    .article-meta {
        font-size: 12px;
        gap: 10px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


