﻿.text-purple {
    color: #9B59B6 !important;
}

.news-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef !important;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .news-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(155, 89, 182, 0.15);
        border-color: #9B59B6 !important;
    }

.news-image {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

    .news-image img {
        width: 100%;
        height: auto;
        object-fit: contain;
        transition: transform .3s ease;
        display: block;
    }

.news-card:hover .news-image img {
    transform: scale(1.02);
}

.news-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(142, 68, 173, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}
.news-category-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8E44AD;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    overflow: hidden;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-footer {
    background: transparent;
    border-top: 1px solid #e9ecef;
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    margin-top: auto;
}

/* 導覽樣式 */
.nav-pills .nav-link {
    color: #6c757d;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    margin: 0 0.25rem 0.5rem 0.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .nav-pills .nav-link:hover {
        color: #9B59B6;
        background: rgba(155, 89, 182, 0.1);
        border-color: rgba(155, 89, 182, 0.3);
        transform: translateY(-2px);
    }

    .nav-pills .nav-link.active {
        color: white;
        background: linear-gradient(135deg, #8E44AD 0%, #9B59B6 100%);
        border-color: #9B59B6;
        box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
    }

.news-count {
    background: rgba(142, 68, 173, 0.8);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link.active .news-count {
    background: white;
    color: #8E44AD;
    box-shadow: 0 2px 6px rgba(142, 68, 173, 0.3);
    border: 1px solid #8E44AD;
}

.nav-link:hover .news-count {
    background: rgba(142, 68, 173, 0.9);
    color: white;
    transform: scale(1.05);
}

.nav-link.active:hover .news-count {
    background: white;
    color: #8E44AD;
    transform: scale(1.05);
}

/* Masonry（RWD）：使用 column-width 讓欄數自適應 */
.masonry {
    column-gap: 16px;
    column-width: 320px; /* 目標欄寬，瀏覽器自動決定欄數 */
}

@media (max-width: 1200px) {
    .masonry {
        column-width: 300px;
    }
}

@media (max-width: 992px) {
    .masonry {
        column-width: 280px;
    }
}

@media (max-width: 576px) {
    .masonry {
        column-width: 100%;
    }
}

.masonry .news-item {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 16px;
}

/* 響應式細節：導覽在窄螢幕縮小 padding/font */
@media (max-width: 768px) {
    .nav-pills .nav-link {
        padding: 0.5rem 1rem;
        margin: 0 0.1rem 0.5rem 0.1rem;
        font-size: 0.9rem;
    }

    .card-title {
        font-size: 0.95rem;
    }
}

.no-news {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

    .no-news i {
        font-size: 4rem;
        margin-bottom: 1rem;
        color: #dee2e6;
    }

    .no-news h3 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
