/**
 * 新星云 (novahl) - 公告中心样式
 * 遵循现代简约、无感交互、极简质感的扁平大厂设计风格
 */

.announcement-body {
    background-color: #f7f9fa;
    min-height: 100vh;
}

/* ================= 页面头部和面包屑 ================= */
.announcement-page-header {
    background-color: #ffffff;
    padding: 30px 0;
    border-bottom: 1px solid #edf1f4;
    margin-top: 80px;
    /* 留出顶部导航栏空间 */
}

.announcement-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #8c8c8c;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: #595959;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #0066ff;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #bfbfbf;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #1f1f1f;
    margin: 0;
}

/* ================= 主体布局：左侧导航 + 右侧列表 ================= */
.announcement-main {
    padding: 40px 0 80px 0;
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

/* 左侧分类菜单 */
.announcement-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 12px;
    padding: 10px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    padding: 0 15px;
    margin-bottom: 5px;
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-radius: 8px;
    color: #595959;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-link:hover {
    background-color: #f2f7ff;
    color: #0066ff;
}

.category-link.active {
    background-color: #0066ff;
    color: #ffffff;
    font-weight: 500;
}

.category-count {
    background-color: #f0f0f0;
    color: #8c8c8c;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
}

.category-link.active .category-count {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* 右侧内容区 */
.announcement-content {
    flex-grow: 1;
    min-width: 0;
}

/* 顶部操作区：搜索框 */
.content-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.toolbar-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f1f1f;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: #0066ff;
    box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.1);
}

.search-box i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #bfbfbf;
    cursor: pointer;
    transition: color 0.3s;
}

.search-box i:hover {
    color: #0066ff;
}

/* ================= 列表卡片样式 ================= */
.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.announcement-card {
    display: flex;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
    border: 1px solid #f0f0f0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.announcement-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
    border-color: #e6f0ff;
}

/* 动态缩略图展示 */
.card-img-wrapper {
    width: 160px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 24px;
    flex-shrink: 0;
    background-color: #f7f9fa;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.announcement-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: 18px;
    font-weight: 500;
    color: #1f1f1f;
    margin-bottom: 12px;
    line-height: 1.4;
    transition: color 0.3s;

    /* 两行截断 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.announcement-card:hover .card-title {
    color: #0066ff;
}

.card-meta {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #8c8c8c;
    gap: 15px;
}

.card-meta span {
    display: flex;
    align-items: center;
}

.card-meta i {
    margin-right: 6px;
    font-size: 12px;
}

/* ================= 分页器样式 ================= */
.pagination-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #d9d9d9;
    color: #595959;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
}

.page-item .page-link:hover {
    color: #0066ff;
    border-color: #0066ff;
}

.page-item.active .page-link {
    background: #0066ff;
    color: #ffffff;
    border-color: #0066ff;
}

.page-item.disabled .page-link {
    background: #f5f5f5;
    color: #bfbfbf;
    border-color: #d9d9d9;
    cursor: not-allowed;
}

/* 骨架屏加载动画效果 */
.skeleton-box {
    display: inline-block;
    height: 1em;
    position: relative;
    overflow: hidden;
    background-color: #f0f0f0;
    border-radius: 4px;
}

.skeleton-box::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.4) 20%,
            rgba(255, 255, 255, 0.6) 60%,
            rgba(255, 255, 255, 0));
    animation: shimmer 2s infinite;
    content: '';
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* 数据为空时 */
.empty-state {
    text-align: center;
    padding: 60px 0;
    background: #ffffff;
    border-radius: 12px;
}

.empty-state i {
    font-size: 48px;
    color: #d9d9d9;
    margin-bottom: 16px;
}

.empty-state p {
    color: #8c8c8c;
    font-size: 14px;
}

/* ================= 响应式适配 ================= */
@media (max-width: 768px) {
    .announcement-main {
        flex-direction: column;
        padding-top: 20px;
    }

    .announcement-sidebar {
        width: 100%;
        margin-bottom: 20px;
    }

    .category-list {
        display: flex;
        overflow-x: auto;
        padding: 5px 10px;
        -webkit-overflow-scrolling: touch;
    }

    .category-item {
        margin-bottom: 0;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .category-link {
        padding: 8px 16px;
    }

    .category-count {
        margin-left: 8px;
    }

    .content-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .search-box {
        width: 100%;
    }

    .announcement-card {
        flex-direction: column;
        padding: 16px;
    }

    .card-img-wrapper {
        width: 100%;
        height: 160px;
        margin-right: 0;
        margin-bottom: 16px;
    }

    .card-title {
        font-size: 16px;
    }
}