body {
    background-color: rgb(30, 30, 30);
    margin: 0;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

h2 {
    color: #ececec;
    text-align: center;
    margin-bottom: 20px;
    font-size: 35px;
}
@media (max-width: 768px) {
    h2 {
        font-size: 28px;
    }
}

/* ===== 页面标题 ===== */
.page-head {
    text-align: center;
    margin-bottom: 35px;
}

.page-head h2 {
    margin: 0;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.page-head .page-sub {
    margin: 10px 0 0;
    font-size: 14px;
    color: #9a9a9a;
    letter-spacing: 0.5px;
}

/* ===== 主容器 ===== */
.homepage-main {
    width: 90%;
    max-width: 1000px;
    margin: 30px auto;
    flex: 1;
}

/* ===== 筛选栏 ===== */
.homepage-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.homepage-filter select,
.homepage-filter input {
    padding: 11px 16px;
    border: 2px solid #3f6d88;
    border-radius: 10px;
    background: rgba(51, 51, 51, 0.99);
    color: #ececec;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.homepage-filter select {
    cursor: pointer;
}

.homepage-filter input::placeholder {
    color: #7a7a7a;
}

.homepage-filter select:focus,
.homepage-filter input:focus {
    border-color: #007BFF;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.18);
    outline: none;
}

.homepage-filter input {
    min-width: 200px;
}

.homepage-filter .btn-search {
    padding: 11px 24px;
    background: #007BFF;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: background 0.2s ease, transform 0.2s ease;
}

.homepage-filter .btn-search:hover {
    background: #0069d9;
    transform: translateY(-1px);
}

.homepage-filter .btn-search:active {
    transform: translateY(0);
}

/* ===== 公告区域 ===== */
.announcement-section {
    margin-bottom: 34px;
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-left: 12px;
    border-left: 3px solid #ffc107;
}

.announcement-header h3 {
    margin: 0;
    font-size: 17px;
    color: #ffc107;
    font-weight: 600;
    letter-spacing: 1px;
}

.announcement-header .ann-count {
    font-size: 12px;
    color: #888;
    padding: 2px 9px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
}

/* --- 公告卡片（可折叠） --- */
.announcement-card {
    position: relative;
    background: rgba(45, 45, 45, 0.92);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 12px;
    padding: 18px 22px 18px 26px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

/* 左侧琥珀色竖条 */
.announcement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #ffc107, #ff9800);
}

.announcement-card:hover {
    border-color: rgba(255, 193, 7, 0.38);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.announcement-card .ann-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.announcement-card .ann-badge {
    flex: none;
    display: inline-block;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #241c00;
    background: linear-gradient(135deg, #ffd24a, #ffb300);
    border-radius: 4px;
}

.announcement-card .ann-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

.announcement-card .ann-title a {
    color: #f5dd8a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.announcement-card .ann-title a:hover {
    color: #ffc107;
}

.announcement-card .ann-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    align-items: center;
    margin-top: 9px;
    font-size: 12px;
    color: #8a8a8a;
}

.announcement-card .ann-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.announcement-card .ann-meta .meta-item + .meta-item::before {
    content: '';
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #5a5a5a;
    margin-right: 10px;
}

.announcement-card .ann-meta a {
    color: #6db3f2;
    text-decoration: none;
}

.announcement-card .ann-meta a:hover {
    color: #007BFF;
    text-decoration: underline;
}

/* --- 正文折叠区 --- */
.announcement-card .ann-body {
    position: relative;
    max-height: 132px;
    overflow: hidden;
    margin-top: 12px;
    transition: max-height 0.35s ease;
}

.announcement-card.is-short .ann-body {
    max-height: none;
}

.announcement-card.is-expanded .ann-body {
    max-height: 1600px;
}

/* 收起时的渐隐遮罩 */
.announcement-card .ann-body::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 52px;
    background: linear-gradient(transparent, rgba(45, 45, 45, 0.96));
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.announcement-card.is-expanded .ann-body::after,
.announcement-card.is-short .ann-body::after {
    opacity: 0;
}

.announcement-card .ann-content {
    font-size: 14px;
    color: #c3c3c3;
    line-height: 1.75;
}

.announcement-card .ann-content p {
    margin: 0 0 10px;
}

.announcement-card .ann-content p:last-child {
    margin-bottom: 0;
}

.announcement-card .ann-content a {
    color: #6db3f2;
    text-decoration: none;
}

.announcement-card .ann-content a:hover {
    text-decoration: underline;
}

.announcement-card .ann-content ul,
.announcement-card .ann-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.announcement-card .ann-content li {
    margin: 4px 0;
}

.announcement-card .ann-content strong {
    color: #f5dd8a;
}

.announcement-card .ann-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* --- 展开/收起按钮 --- */
.announcement-card .ann-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 5px 12px;
    font-size: 12.5px;
    font-family: inherit;
    color: #ffc107;
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.25);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.announcement-card .ann-toggle:hover {
    background: rgba(255, 193, 7, 0.18);
    border-color: rgba(255, 193, 7, 0.5);
}

.announcement-card .ann-toggle:focus-visible {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}

.announcement-card .ann-toggle-arrow {
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-1px, -1px);
    transition: transform 0.25s ease;
}

.announcement-card.is-expanded .ann-toggle-arrow {
    transform: rotate(225deg) translate(-1px, -1px);
}

/* ===== 普通文章与公告的分隔线 ===== */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 30px 0 22px;
    color: #8a8a8a;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
}

/* ===== 文章卡片 ===== */
.post-card {
    position: relative;
    background: rgba(51, 51, 51, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* 顶部主色渐变条，hover 时显现 */
.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007BFF, #4aa3ff);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 123, 255, 0.25);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}

.post-card:hover::before {
    transform: scaleX(1);
}

.post-card .post-title {
    margin: 0 0 12px;
    font-size: 22px;
    line-height: 1.4;
}

.post-card .post-title a {
    color: #ececec;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-card .post-title a:hover {
    color: #007BFF;
}

.post-card .post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    align-items: center;
    margin-bottom: 14px;
    font-size: 13px;
    color: #888;
}

.post-card .post-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-card .post-meta .meta-item + .meta-item::before {
    content: '';
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #5a5a5a;
    margin-right: 10px;
}

.post-card .post-meta a {
    color: #6db3f2;
    text-decoration: none;
}

.post-card .post-meta a:hover {
    color: #007BFF;
    text-decoration: underline;
}

.post-card .post-excerpt {
    color: #bbb;
    font-size: 14px;
    line-height: 1.75;
    margin: 0;
}

.post-card .post-tags {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.post-card .post-tags .tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(0, 123, 255, 0.12);
    color: #6db3f2;
    border: 1px solid rgba(0, 123, 255, 0.18);
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.post-card .post-tags .tag:hover {
    background: rgba(0, 123, 255, 0.25);
    color: #007BFF;
}

.post-card .post-category {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.25);
    color: #4cae6a;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.post-card .post-category:hover {
    background: rgba(40, 167, 69, 0.28);
    color: #28a745;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 34px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 9px 14px;
    background: rgba(51, 51, 51, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #ececec;
    border-radius: 9px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pagination a:hover {
    background: rgba(0, 123, 255, 0.18);
    border-color: rgba(0, 123, 255, 0.4);
    color: #4aa3ff;
}

.pagination .current {
    background: #007BFF;
    border-color: #007BFF;
    color: white;
    font-weight: 600;
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state p {
    font-size: 17px;
    margin: 0 0 8px;
    color: #b5b5b5;
}

.empty-state .empty-hint {
    display: block;
    font-size: 13px;
    color: #7a7a7a;
    margin-bottom: 22px;
}

.empty-state .btn {
    display: inline-block;
    padding: 12px 26px;
    background: #007BFF;
    color: white;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.empty-state .btn:hover {
    background: #0069d9;
    transform: translateY(-1px);
}

/* ===== 加载动画 ===== */
.loading {
    text-align: center;
    padding: 60px;
    color: #888;
}

.loading .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #007BFF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .homepage-main {
        width: 95%;
        margin: 15px auto;
    }

    .page-head {
        margin-bottom: 26px;
    }

    .post-card {
        padding: 18px;
    }

    .post-card .post-title {
        font-size: 18px;
    }

    .post-card .post-meta {
        gap: 5px 12px;
    }

    .homepage-filter {
        justify-content: stretch;
    }

    .homepage-filter select,
    .homepage-filter .btn-search {
        flex: 1;
    }

    .homepage-filter input {
        min-width: 0;
        flex: 1 0 100%;
    }

    .announcement-card {
        padding: 15px 16px 15px 20px;
    }

    .announcement-card .ann-title {
        font-size: 15.5px;
    }

    .announcement-card .ann-body {
        max-height: 112px;
    }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #6d6d6d;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}