/* 新聞列表卡片樣式 */
.news-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.news-card a {
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.news-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 4rem;
}

.news-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-meta {
    margin-bottom: 0.75rem;
}

.news-card-date {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.news-card-date i {
    font-size: 1rem;
}

.news-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-summary {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.news-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #667eea;
    font-weight: 500;
    font-size: 0.95rem;
    transition: gap 0.3s ease;
}

.news-card:hover .news-card-link {
    gap: 0.75rem;
}

.news-card-link i {
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-link i {
    transform: translateX(4px);
}

/* 新聞詳細頁面樣式 */
.news-detail-container {
    max-width: 800px;
    margin: 0 auto;
}

.news-detail-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.news-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.news-detail-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    color: #6c757d;
    font-size: 0.95rem;
}

.news-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-detail-thumbnail {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.news-detail-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #343a40;
    overflow-x: auto;
}

.news-detail-content table {
    max-width: 100%;
    width: 100% !important;
    height: auto !important;
    table-layout: fixed;
}

.news-detail-content td,
.news-detail-content th {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-detail-content td img,
.news-detail-content th img {
    max-width: 100%;
    height: auto !important;
    width: auto !important;
}

.news-detail-content h1,
.news-detail-content h2,
.news-detail-content h3,
.news-detail-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.news-detail-content p {
    margin-bottom: 1.5rem;
}

.news-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.news-detail-content ul,
.news-detail-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.news-detail-content li {
    margin-bottom: 0.5rem;
}

.news-detail-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #6c757d;
    font-style: italic;
}

.news-detail-content code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e83e8c;
}

.news-detail-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.news-detail-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.news-detail-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.news-detail-back-btn:hover {
    background: #e9ecef;
    color: #212529;
    transform: translateX(-4px);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .news-card-title {
        font-size: 1.1rem;
    }

    .news-detail-title {
        font-size: 1.75rem;
    }

    .news-detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .news-detail-content {
        font-size: 1rem;
    }
}

/* 載入動畫 */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.news-card-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}
