/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo i {
    font-size: 2rem;
    color: #2ecc71;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.header-actions {
    display: flex;
    align-items: center;
}

.admin-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: background-color 0.3s;
}

.admin-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 主横幅 */
.hero {
    background: linear-gradient(135deg, #3498db 0%, #2ecc71 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.stat-item span {
    font-size: 2rem;
    font-weight: bold;
}

.stat-item label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 搜索区域 */
.search-section {
    padding: 2rem 0;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    border: 2px solid #3498db;
    border-radius: 50px;
    overflow: hidden;
}

.search-box i {
    padding: 15px;
    color: #3498db;
    display: flex;
    align-items: center;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 15px 0;
    font-size: 1rem;
    outline: none;
}

.search-box button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0 30px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: #2980b9;
}

/* 公告列表 */
.announcements-section {
    padding: 3rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
}

.view-options {
    display: flex;
    gap: 10px;
}

.view-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    color: #666;
    transition: all 0.3s;
}

.view-btn.active, .view-btn:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.announcements-list {
    min-height: 300px;
}

/* 列表视图 */
.announcements-list.view-list .announcement-item {
    display: flex;
    background: white;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.announcements-list.view-list .announcement-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.announcement-image {
    width: 200px;
    min-height: 150px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.announcement-info {
    padding: 1.5rem;
    flex: 1;
}

.announcement-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-badge {
    background-color: #e74c3c;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

.category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-right: 10px;
}

.category-badge.policy {
    background-color: #3498db;
    color: white;
}

.category-badge.notice {
    background-color: #2ecc71;
    color: white;
}

.category-badge.news {
    background-color: #f39c12;
    color: white;
}

.announcement-meta {
    display: flex;
    gap: 15px;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.announcement-meta i {
    margin-right: 5px;
}

.announcement-summary {
    color: #666;
    line-height: 1.6;
}

/* 网格视图 */
.announcements-list.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.announcements-list.view-grid .announcement-item {
    flex-direction: column;
}

.announcements-list.view-grid .announcement-image {
    width: 100%;
    height: 180px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
}

.page-btn {
    padding: 8px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.page-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 底部 */
.footer {
    background-color: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #2ecc71;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li i {
    margin-right: 8px;
    color: #2ecc71;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #2ecc71;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 2rem auto;
    max-width: 800px;
    border-radius: 8px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    color: #2c3e50;
    flex: 1;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 2rem;
}

.modal-body .announcement-meta {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.modal-body .announcement-image {
    width: 100%;
    height: 300px;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

.modal-body .announcement-content {
    line-height: 1.8;
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .announcements-list.view-list .announcement-item {
        flex-direction: column;
    }
    
    .announcement-image {
        width: 100%;
        height: 180px;
    }
    
    .announcements-list.view-grid {
        grid-template-columns: 1fr;
    }
}
