/* 全局重置与基础样式 */
:root {
    --primary-color: #15803d; /* 绿色主色调 */
    --primary-dark: #14532d;
    --text-main: #1f2937;
    --text-secondary: #6b7280;
    --bg-body: #f3f4f6;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --spacing-unit: 1rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Microsoft YaHei", serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

/* 布局容器 */
.container {
    max-width: 1200px;
    width: 100%; /* 确保在flex容器中能占满可用空间 */
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* 头部区域 */
.site-header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    width: 100%; /* 确保占满容器宽度 */
}



/* 头部品牌区域背景 */
.header-branding-area {
    background-image: url('../images/headerbg.png');
    background-size: cover;
    background-position: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

/* 移除旧的容器背景设置，避免冲突 */
.site-header .container:first-child {
    background: none;
    min-height: auto;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 3rem;
    width: auto;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.search-box {
    display: flex;
    align-items: center;
}

.search-input {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    padding: 0.5rem 1rem;
    outline: none;
    font-size: 0.9rem;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    font-size: 0.9rem;
}

.search-btn:hover {
    background-color: var(--primary-dark);
}

/* 导航栏 */
.main-nav {
    background-color: var(--primary-dark);
    color: white;
}

.nav-toggle {
    display: none;
}

.nav-list {
    display: flex;
    width: 100%;
}

.nav-list li {
    flex: 1;
    text-align: center;
    position: relative; /* 为下拉菜单定位 */
}

.nav-link {
    display: block;
    padding: 0 1rem; /* 调整内边距 */
    height: 45px; /* 固定高度 */
    line-height: 45px; /* 垂直居中 */
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* Nav icons */
.nav-link .fa-chevron-down {
    font-size: 0.8em;
    margin-left: 4px;
}

/* 下拉菜单样式 */
.dropdown-menu, .dropdown-submenu {
    position: absolute;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 200px;
    display: none; /* 默认隐藏 */
    z-index: 1000;
    border-radius: 0 0 4px 4px;
    text-align: left;
}

/* 二级菜单定位 */
.dropdown-menu {
    top: 100%;
    left: 0;
    border-top: 2px solid var(--primary-color);
}

/* 三级菜单定位 */
.dropdown-submenu {
    top: 0;
    left: 100%;
    border-radius: 4px;
    border-left: 2px solid var(--primary-color);
}

/* 显示逻辑 */
.nav-list li:hover > .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    position: relative;
    display: block;
    width: 100%;
}

.dropdown-menu li:hover > .dropdown-submenu {
    display: block;
}

/* 下拉菜单项样式 */
.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 0.9rem;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s;
}

.dropdown-item .fa-chevron-right {
    float: right;
    margin-top: 4px;
    font-size: 0.8em;
}

.dropdown-item:hover {
    background-color: #f9fafb;
    color: var(--primary-color);
    padding-left: 1.25rem; /* 悬停时轻微右移效果 */
}

.dropdown-menu li:last-child .dropdown-item {
    border-bottom: none;
}

/* 主要内容区域 */
.main-content {
    padding: 2rem 0;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.section-grid-bottom {
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .section-grid {
        grid-template-columns: 1fr;
    }
}

/* 卡片组件 */
.card {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header-sub {
    margin-top: 2rem;
    border-bottom: 1px dashed var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    border-left: 4px solid var(--primary-color);
    padding-left: 0.75rem;
}

.card-title-sub {
    font-size: 1.1rem;
    border-left-color: var(--text-secondary);
}

.card-title-icon {
    margin-right: 0.5rem;
    color: var(--primary-color);
    font-size: 0.8em;
}

.more-link {
    font-size: 0.875rem;
    color: var(--primary-color);
}

.more-link:hover {
    text-decoration: underline;
}

/* 列表样式 */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    padding-left: 0.5rem; /* 减少缩进，因为加了点 */
}

.info-item::before {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    background-color: #006436;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.info-link {
    color: var(--text-main);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 1rem;
    transition: color 0.2s;
}

.info-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.info-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* 目录网格 */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.catalog-group {
    margin-bottom: 1rem;
}

.group-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.group-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin-right: 0.5rem;
}

.sub-list {
    padding-left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sub-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sub-link:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

/* 联系我们样式 */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem 0;
}

.contact-info p {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

.contact-info i {
    color: var(--primary-color);
    margin-top: 0.3rem;
}

.contact-time-block {
    padding-left: 0;
}

/* 友情链接样式 */
.friend-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.friend-links li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.friend-links li a:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

.friend-links li a i {
    font-size: 0.8em;
    color: var(--text-secondary);
}

/* 页脚 */
.site-footer {
    background-color: #1f2937;
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
    font-size: 0.875rem;
    color: #9ca3af;
}

/* --- 新增：文章页样式 (Article Page Styles) --- */

/* 页面横幅 */
.page-banner {
    width: 100%;
    height: 350px; /* 固定高度以确保视觉一致性 */
    background-color: #eee;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例填充 */
    display: block;
}

/* 带有重叠效果的主内容区域 */
.main-content.with-overlap {
    padding-top: 0;
    margin-top: -100px; /* 向上移动，覆盖Banner约1/3 (100px/350px) */
    position: relative;
    z-index: 10;
}

/* 页面双栏布局 */
.page-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* 左侧边栏 */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.sidebar-header {
    background-color: var(--primary-color);
    padding: 1rem;
}

.sidebar-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
}

.sidebar-menu {
    padding: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-menu li:last-child {
    border-bottom: none;
}

.sidebar-menu a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-main);
    transition: all 0.2s;
    font-size: 0.95rem;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: #f9fafb;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    padding-left: calc(1.5rem - 4px);
    font-weight: 500;
}

/* 
   .sidebar-image-link styles removed as per request
*/

/* 右侧文章内容 */
.article-content {
    flex: 1;
    background-color: var(--bg-white);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    min-height: 600px; /* 最小高度 */
}

/* 面包屑导航 */
.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 文章头部 */
.article-header {
    text-align: center;
    margin-bottom: 2rem;
}

.article-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.article-meta {
    font-size: 0.85rem;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

/* 文章正文 */
.article-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 3rem;
}

.article-body p {
    margin-bottom: 1.5rem;
    text-align: justify;
    text-indent: 2em; /* 首行缩进 */
}

.article-body iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    border: 0;
}

.article-image {
    margin: 2rem 0;
    text-align: center;
    text-indent: 0; /* 图片容器不缩进 */
}

.article-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.image-caption {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-align: center;
    text-indent: 0;
}

/* 文章底部导航 */
.article-footer-nav {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prev-next-link {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.prev-next-link .label {
    color: #666;
}

.prev-next-link a {
    color: var(--text-main);
}

.prev-next-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 响应式调整 */


.footer-logos {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* --- 新增：文章列表页样式 (Article List Page Styles) --- */

.content-header {
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

.content-title {
    font-size: 1.5rem;
    color: var(--primary-dark);
    font-weight: 700;
    margin: 0;
    display: inline-block;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.article-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0.5rem;
    border-bottom: 1px dashed var(--border-color);
    transition: background-color 0.2s;
}

.article-list-item:hover {
    background-color: #f9fafb;
}

.article-list-link {
    flex: 1;
    color: var(--text-main);
    font-size: 1rem;
    margin-right: 2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-list-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.article-list-link::before {
    content: "•";
    color: var(--primary-color);
    margin-right: 0.5rem;
    font-weight: bold;
}

.article-list-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: monospace; /* 等宽字体对齐更好 */
    flex-shrink: 0;
}

/* 分页导航样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.page-link {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.2s;
    background-color: #fff;
}

.page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #f0fdf4; /* 极淡的绿色背景 */
}

.page-link.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.page-link.prev, .page-link.next {
    font-weight: bold;
}

/* =========================================
   移动端适配增强 (Mobile Responsiveness)
   ========================================= */
@media (max-width: 768px) {
    /* 头部区域调整 */
    .header-top {
        flex-direction: column;
        gap: 1rem;
    }

    .header-branding-area {
        min-height: auto;
        padding: 1rem 0;
    }
    
    .logo-area {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .site-title {
        font-size: 1.2rem;
        text-align: center;
    }
    
    .search-box {
        width: 100%;
        justify-content: center;
    }
    
    .search-input {
        flex: 1; /* 使用flex:1自适应宽度 */
        width: auto;
    }

    /* 导航栏：垂直堆叠 (Vertical Stack for Mobile) */
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 45px;
        padding: 0 1rem;
        background: transparent;
        color: #fff;
        border: 0;
        font-weight: 600;
        cursor: pointer;
    }

    .nav-list {
        display: none;
        flex-direction: column;
        height: auto;
    }

    .main-nav.is-open .nav-list {
        display: flex;
    }
    
    .nav-list li {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-link {
        padding: 0 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* 移动端下拉菜单改为折叠式 (Accordion Style) */
    .nav-list li > .dropdown-menu {
        display: none; /* 默认隐藏 */
        position: static;
        width: 100%;
        box-shadow: none;
        border-top: none;
        background-color: #f9fafb;
    }

    /* 通过JS添加active类来控制显示 */
    .nav-list li.active > .dropdown-menu {
        display: block;
    }
    
    /* 移除hover触发 */
    .nav-list li:hover > .dropdown-menu {
        display: none; /* 移动端禁用hover */
    }
    
    /* 只要有active类就显示，优先级需覆盖上面的hover禁用（如果JS逻辑正确，其实hover禁用不需要，但为了保险）*/
    .nav-list li.active:hover > .dropdown-menu {
        display: block;
    }
    
    .dropdown-item {
        padding-left: 2rem;
        color: var(--text-main);
        border-bottom: 1px solid #eee;
    }
    
    /* 二级菜单处理 */
    .dropdown-submenu {
        display: none; /* 默认隐藏 */
        position: static;
        width: 100%;
        box-shadow: none;
        border-left: none;
        background-color: #f3f4f6;
    }
    
    .dropdown-menu li.active > .dropdown-submenu {
        display: block;
    }

    /* 移除二级菜单hover触发 */
    .dropdown-menu li:hover > .dropdown-submenu {
        display: none;
    }
    
    .dropdown-menu li.active:hover > .dropdown-submenu {
        display: block;
    }
    
    .dropdown-submenu .dropdown-item {
        padding-left: 3rem;
    }
    
    /* 隐藏不需要的元素 */
    .page-banner,
    .sidebar,
    .school-name {
        display: none;
    }

    /* 页面布局调整 */
    .page-container {
        flex-direction: column;
        align-items: stretch;
    }

    .section-grid {
        grid-template-columns: 1fr;
    }

    /* 页面横幅高度调整 */
    .page-banner {
        height: 150px;
    }

    /* 内容重叠取消 */
    .main-content.with-overlap {
        margin-top: 0;
        padding-top: 1rem;
    }

    /* 侧边栏和内容堆叠 */
    .sidebar {
        width: 100%;
        margin-bottom: 2rem;
    }
    
    /* 通用卡片内边距调整 */
    .card {
        padding: 1rem;
        margin: 0 0.5rem;
    }

    /* 文章内容区域内边距 */
    .article-content {
        padding: 1rem;
        margin: 0 0.5rem;
        min-height: auto;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-body {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    /* 列表项单行展示（标题可换行，日期固定） */
    .article-list-item {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    .article-list-link {
        flex: 1;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        margin-right: 0;
        white-space: normal;
        overflow: hidden;
        font-size: 0.95rem;
        position: relative;
        padding-left: 0.9rem;
    }

    .article-list-link::before {
        position: absolute;
        left: 0;
        top: 0.8em;
        transform: translateY(-50%);
        margin-right: 0;
    }
    
    .article-list-date {
        font-size: 0.85rem;
        color: #999;
        white-space: nowrap;
        flex: 0 0 auto;
        min-width: 5.8rem;
        text-align: right;
    }

    /* 首页信息列表 */
    .info-item {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.5rem;
        padding-left: 1rem;
        position: relative;
    }

    .info-item::before {
        position: absolute;
        left: 0;
        top: 0.85em;
        transform: translateY(-50%);
        margin-right: 0;
    }
    
    .info-link {
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        margin-right: 0;
    }
    
    .info-date {
        align-self: flex-start;
        white-space: nowrap;
        flex: 0 0 auto;
        min-width: 5.8rem;
        text-align: right;
        font-size: 0.8rem;
    }

    /* 分页导航 */
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .page-link {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
    }
}