/* ================= 全局重置 ================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Microsoft YaHei", sans-serif;
    background-color: #f4f6f9;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #333;
}

a:hover {
    color: #1976d2;
    /* 悬停颜色 */
}

ul {
    list-style: none;
}

/* ================= 容器工具类 ================= */
.container {
    width: 100%;
    max-width: 1200px;
    /* PC端最大宽度 */
    margin: 0 auto;
    padding: 0 15px;
}

/* ================= 头部样式 (Header) ================= */
.header {
    background-color: #fff;
    padding: 20px 0;
    border-bottom: 4px solid #1976d2;
    /* 学院蓝 */
}

/* 核心修复：头部布局容器，左右对齐 */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background-color: #1976d2;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 60px;
    font-weight: bold;
    font-size: 24px;
    margin-right: 15px;
    flex-shrink: 0;
    /* 防止logo被挤压 */
}

.logo-text h1 {
    font-size: 28px;
    color: #1976d2;
}

.logo-text p {
    font-size: 14px;
    color: #666;
    letter-spacing: 1px;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    border: 2px solid #1976d2;
    border-radius: 4px;
    overflow: hidden;
    height: 36px;
}

.search-box input {
    border: none;
    outline: none;
    padding: 0 10px;
    font-size: 14px;
    width: 200px;
    color: #333;
}

.search-box button {
    border: none;
    background-color: #1976d2;
    color: #fff;
    padding: 0 15px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    white-space: nowrap;
    /* 防止按钮文字换行 */
}

.search-box button:hover {
    background-color: #0d47a1;
}

/* ================= 导航栏样式 ================= */
.nav-bar {
    background-color: #1565c0;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-list {
    display: flex;
    flex-wrap: wrap;
    /* 移动端自动换行 */
}

.nav-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
}

.nav-item:hover,
.nav-item.active {
    background-color: #0d47a1;
}

/* ================= 主内容区 ================= */
.main-content {
    margin-top: 20px;
    margin-bottom: 40px;
}

/* 通用模块标题样式 */
.section-header,
.card-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.section-header h2,
.card-header h3 {
    font-size: 18px;
    color: #1976d2;
    padding-left: 10px;
    border-left: 4px solid #1976d2;
}

.more {
    font-size: 12px;
    color: #999;
    cursor: pointer;
}

/* --- 第一部分：通知公告 (复杂布局) --- */
.notice-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.notice-content {
    display: flex;
    gap: 20px;
    height: 300px;
    /* 固定高度确保对齐 */
}

/* 轮播图区域容器 */
.carousel-wrapper {
    flex: 4;
    /* 占比 40% */
    background-color: #eee;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

/* 纯CSS滚动轮播容器 */
.carousel-container {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    /* 核心：滚动捕捉 */
    scroll-behavior: smooth;

    /* 隐藏滚动条 (兼容主流浏览器) */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.carousel-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari */
}

/* 单张幻灯片样式 */
.slide {
    flex: 0 0 100%;
    /* 核心：每个slide占满100%宽度 */
    height: 100%;
    scroll-snap-align: start;
    position: relative;
    /* 为内部文字绝对定位做参考 */
    overflow: hidden;
}

/* 新增：图片样式 */
.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 核心：保持比例填满容器，裁剪多余部分 */
    display: block;
    transition: transform 0.5s ease;
    /* 可选：增加微小动画效果 */
}

.slide:hover img {
    transform: scale(1.05);
    /* 鼠标悬停时图片微放大 */
}

/* 轮播空状态处理 (仅当没有内容时显示) */
.carousel-container:empty::after {
    content: "暂无图片";
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* 轮播文字样式 (覆盖在图片底部) */
.slide-text {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* 半透明黑色背景 */
    color: #fff;
    padding: 10px 15px;
    font-size: 15px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 列表区域 */
.article-list-wrapper {
    flex: 6;
    /* 占比 60% */
    overflow-y: auto;
    /* 内容超出滚动 */
    padding-right: 5px;
    /* 给滚动条留点位置 */
}

/* 自定义滚动条样式 (Webkit浏览器) */
.article-list-wrapper::-webkit-scrollbar,
.card-body::-webkit-scrollbar {
    width: 6px;
}

.article-list-wrapper::-webkit-scrollbar-thumb,
.card-body::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.article-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
}

.article-list li a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 文字超长省略号 */
    max-width: 75%;
}

.article-list li .date {
    color: #999;
    font-size: 12px;
    min-width: 80px;
    text-align: right;
}

/* --- 第二部分：其他栏目网格 (Grid布局) --- */
.grid-layout {
    display: grid;
    /* PC端默认3列，间距20px */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.card-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 20px;
    height: 300px;
    /* 固定高度，强制对齐 */
    display: flex;
    flex-direction: column;
}

.card-body {
    flex: 1;
    /* 占满剩余空间 */
    overflow-y: auto;
    /* 核心：超出滚动 */
}

.simple-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 15px;
}

.simple-list li::before {
    content: "•";
    color: #1976d2;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.text-content p {
    text-indent: 2em;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
    text-align: justify;
}

/* 师资队伍 - 内部小网格 */
.teacher-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.teacher-item {
    background-color: #f5f5f5;
    text-align: center;
    padding: 15px 0;
    border-radius: 4px;
    font-size: 14px;
}

/* ================= 底部 ================= */
.footer {
    background-color: #333;
    color: #aaa;
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    font-size: 14px;
}

/* ================= 响应式适配 ================= */

/* 平板设备 (小于 1024px) */
@media screen and (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: repeat(2, 1fr);
        /* 变为2列 */
    }
}

/* 手机设备 (小于 768px) */
@media screen and (max-width: 768px) {

    /* 头部适配：改为垂直排列 */
    .header-flex {
        flex-direction: column;
        gap: 15px;
    }

    /* 搜索框适配：占满宽度 */
    .search-box {
        width: 100%;
        max-width: 300px;
    }

    .search-box input {
        width: 100%;
    }

    /* 导航菜单：一行两个 */
    .nav-item {
        flex: 1 1 50%;
        text-align: center;
    }

    /* 通知公告：上下结构 */
    .notice-content {
        flex-direction: column;
        height: auto;
    }

    .carousel-wrapper,
    .article-list-wrapper {
        height: 200px;
    }

    /* 网格布局：变为1列 */
    .grid-layout {
        grid-template-columns: 1fr;
    }

    /* 卡片高度：手机端自适应或保持最小高度 */
    .card-box {
        height: auto;
        min-height: 250px;
    }
}