/* ==========================================
   公告列表頁樣式
   ========================================== */

[v-cloak] { display: none; }

/* 整體 layout：左側分類 + 右側列表 */
.announcements-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

/* ========== 左側分類選單 ========== */
.category-sidebar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    position: sticky;
    top: 90px;
}

.sidebar-title {
    padding: 16px 20px 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #003366;
    border-bottom: 1px solid #e5e7eb;
    margin: 0;
}

.category-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
}

.category-link:hover {
    background: #f3f4f6;
    color: #003366;
}

.category-link.active {
    background: #003366;
    color: #fff;
    font-weight: 600;
}

.category-link.active .category-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-count {
    margin-left: auto;
    font-size: 0.8rem;
    padding: 1px 8px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #9ca3af;
}

/* ========== 右側公告列表 ========== */
.news-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    text-decoration: none;
    transition: background 0.15s;
}

.news-row:hover {
    background: #f9fafb;
}

.news-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.news-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    transition: color 0.15s;
}

.news-row:hover .news-title {
    color: #003366;
}

.news-date {
    font-size: 0.88rem;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ========== 手機版分類（水平捲動） ========== */
.mobile-categories {
    display: none;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.mobile-cat-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 0.88rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
}

.mobile-cat-btn:hover {
    border-color: #003366;
    color: #003366;
}

.mobile-cat-btn.active {
    background: #003366;
    color: #fff;
    border-color: #003366;
}

/* ========== RWD ========== */
@media (max-width: 768px) {
    .announcements-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .category-sidebar {
        display: none;
    }

    .mobile-categories {
        display: flex;
    }

    .news-row {
        flex-wrap: wrap;
        padding: 14px 16px;
    }

    .news-title {
        flex-basis: 100%;
        order: 2;
    }

    .news-badge {
        order: 1;
    }

    .news-date {
        order: 1;
    }
}
