* {
    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: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    padding: 20px 0;
    margin: 0;
}

/* 导航栏样式 */
.navbar {
    background-color: transparent;
    border-bottom: none;
}

/* 菜单按钮样式 */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 101;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-list {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
}

.nav-item {
    padding: 15px 20px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.nav-item:hover {
    background-color: #f5f5f5;
    color: #2c3e50;
}

.nav-item.active {
    background-color: #f5f5f5;
    color: #3498db;
    font-weight: bold;
    border-bottom: 2px solid #3498db;
}

/* 主要内容样式 */
.main {
    padding: 30px 0;
}

/* 搜索框样式 */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease;
    background-color: #fff;
}

.search-box input:focus {
    border-color: #3498db;
}

.search-count {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.search-empty {
    text-align: center;
    color: #999;
    padding: 40px 0;
    font-size: 16px;
}

/* 分类模块样式 */
.category-section {
    margin-bottom: 40px;
}

.category-title {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* 扁平列表样式 */
.article-list {
    list-style: none;
}

.article-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.article-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.article-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    font-size: 12px;
    color: #999;
    text-align: right;
}

.article-date {
    font-style: italic;
    font-size: 14px;
}

/* ========== 政府网站树形样式 ========== */

.gov-tree {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tree-item {
    border-bottom: 1px solid #f0f0f0;
}

.tree-item:last-child {
    border-bottom: none;
}

.tree-children .tree-item {
    border-bottom: 1px solid #f5f5f5;
}

.tree-item-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 8px;
}

.tree-item-header:hover {
    background-color: #f8f9fa;
}

.tree-toggle {
    display: inline-block;
    width: 16px;
    font-size: 12px;
    color: #999;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.tree-toggle.no-children {
    visibility: hidden;
}

.tree-name {
    flex: 1;
    font-size: 15px;
    color: #333;
    word-break: break-all;
}

.tree-children .tree-name {
    font-size: 14px;
}

.tree-children .tree-children .tree-name {
    font-size: 13px;
    color: #555;
}

.tree-link {
    font-size: 13px;
    color: #3498db;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.tree-link:hover {
    background-color: #ebf5fb;
}

/* 树形缩进 */
.tree-children {
    padding-left: 24px;
    background-color: #fafbfc;
}

.tree-children .tree-children {
    padding-left: 24px;
    background-color: #f5f7fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .navbar {
        position: fixed;
        right: -50%;
        top: 0;
        height: 100%;
        width: 50%;
        background-color: rgba(255, 255, 255, 0.95);
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 100;
        overflow-y: auto;
    }

    .navbar.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        flex-wrap: nowrap;
        width: 100%;
        padding: 80px 20px 20px;
        background-color: transparent;
    }

    .nav-item {
        padding: 15px 20px;
        font-size: 16px;
        white-space: nowrap;
        border-bottom: 1px solid #e0e0e0;
        text-align: left;
        background-color: transparent;
        margin: 0;
        border-radius: 0;
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-item.active {
        border-bottom: 1px solid #e0e0e0;
    }

    .logo {
        font-size: 20px;
        padding: 15px 0;
    }

    .main {
        padding: 20px 0;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .container {
        padding: 0 12px;
    }

    .category-title {
        font-size: 20px;
    }

    .article-item {
        padding: 16px;
    }

    /* 移动端树形样式 */
    .tree-item-header {
        padding: 14px 12px;
    }

    .tree-name {
        font-size: 14px;
    }

    .tree-link {
        font-size: 12px;
        padding: 6px 10px;
    }

    .tree-children {
        padding-left: 16px;
    }

    .tree-children .tree-children {
        padding-left: 16px;
    }
}

@media (max-width: 480px) {
    .navbar {
        width: 60%;
        right: -60%;
    }

    .nav-list {
        flex-direction: column;
        padding: 70px 15px 15px;
    }

    .nav-item {
        padding: 12px 15px;
        font-size: 14px;
        margin: 0;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .search-box input {
        font-size: 14px;
        padding: 10px 12px;
    }
}
