/* ========== INDEX.CSS - 优化版 ========== */

/* 1. 全局重置与变量定义 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 2. 中医药主题色系 */
:root {
    /* 主色调 - 中医药绿 */
    --herbal-green: #2e7d32;
    --herbal-dark-green: #1b5e20;
    --herbal-light-green: #4caf50;
    --herbal-pale-green: #e8f5e9;
    
    /* 辅助色 - 中医药棕 */
    --herbal-brown: #795548;
    --herbal-light-brown: #a1887f;
    --herbal-pale-brown: #efebe9;
    
    /* 点缀色 - 中医药金 */
    --herbal-gold: #d4a55e;
    --herbal-dark-gold: #b8860b;
    --herbal-light-gold: #ffd54f;
    
    /* 党建红 */
    --party-red: #d32f2f;
    --party-dark-red: #b71c1c;
    --party-light-red: #ff5252;
    
    /* 教育蓝 */
    --edu-blue: #1a4d9c;
    --edu-light-blue: #eef5ff;
    
    /* 产教融合棕 */
    --industry-brown: #795548;
    
    /* 学生风采紫 */
    --student-purple: #8e44ad;
    --student-light-purple: #f3e5f5;
    
    /* 中性色 */
    --neutral-light: #f5f5f5;
    --neutral-gray: #9e9e9e;
    --neutral-dark: #424242;
    --neutral-white: #ffffff;
}

/* 3. 主要内容区域 */
.main-content {
    padding: 20px 0 40px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-row {
    margin-bottom: 25px;
}

/* 4. 学院动态部分 */
.content-section {
    background: var(--neutral-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 5. 党建服务、教育教学、产教融合、学生风采 - 两列布局 */
.content-row.triple {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto;
    gap: 20px;
}

/* 确保四个栏目正确排列 */
.content-row.triple .content-column:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.content-row.triple .content-column:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.content-row.triple .content-column:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
}

.content-row.triple .content-column:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
}

/* 栏目卡片样式 */
.content-column {
    display: flex;
    flex-direction: column;
}

.section-card {
    background: var(--neutral-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* 6. 栏目头部样式 */
.section-header {
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--neutral-white);
}

.header-decoration {
    display: flex;
    align-items: center;
    gap: 8px;
}

.decoration-left,
.decoration-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.decoration-line {
    width: 18px;
    height: 1px;
    background: rgba(255, 255, 255, 0.6);
}

.decoration-icon {
    font-size: 10px;
    opacity: 0.6;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}

.title-icon {
    font-size: 13px;
}

.section-more {
    color: var(--neutral-white);
    font-size: 12px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.section-more:hover {
    background: rgba(255, 255, 255, 0.3);
}

.more-arrow {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.section-more:hover .more-arrow {
    transform: translateX(2px);
}

/* 头部背景色 */
.herbal-bg {
    background: linear-gradient(135deg, var(--herbal-green), var(--herbal-dark-green));
}

.red-bg {
    background: linear-gradient(135deg, var(--party-red), var(--party-dark-red));
}

.blue-bg {
    background: linear-gradient(135deg, var(--edu-blue), #2c7dc0);
}

.brown-bg {
    background: linear-gradient(135deg, var(--industry-brown), var(--herbal-light-brown));
}

/* 学生风采使用紫色背景 */
.content-row.triple .content-column:nth-child(4) .section-header {
    background: linear-gradient(135deg, var(--student-purple), #9b59b6);
}

/* 7. 栏目内容 - 添加默认高度和超出隐藏 */
.section-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 确保内容超出时隐藏 */
}

/* 为各栏目设置固定高度 */
.party-list,
.edu-list,
.industry-list,
.student-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 260px; /* 默认高度 */
    overflow: hidden; /* 超出隐藏 */
    position: relative;
}

/* 滚动条样式（可选，如果需要滚动查看） */
.party-list:hover,
.edu-list:hover,
.industry-list:hover,
.student-list:hover {
    overflow-y: auto; /* 鼠标悬停时显示滚动条 */
}

/* 自定义滚动条样式 */
.party-list::-webkit-scrollbar,
.edu-list::-webkit-scrollbar,
.industry-list::-webkit-scrollbar,
.student-list::-webkit-scrollbar {
    width: 4px;
}

.party-list::-webkit-scrollbar-thumb,
.edu-list::-webkit-scrollbar-thumb,
.industry-list::-webkit-scrollbar-thumb,
.student-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

/* 8. 学院动态布局 */
.news-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* 9. 轮播图区域 */
.news-banner {
    border-radius: 8px;
    overflow: hidden;
}

.banner-container {
    position: relative;
    height: 280px; /* 稍微调小一点 */
    border-radius: 8px;
    overflow: hidden;
}

.banner-slides {
    position: relative;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
}

.slide.active {
    display: block;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 87, 35, 0.9), rgba(45, 106, 79, 0.8));
    z-index: 1;
}

.slide-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 25px;
    color: var(--neutral-white);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slide-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
}

/* 轮播控制 */
.banner-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 3;
}

.control {
    background: rgba(255, 255, 255, 0.2);
    color: var(--neutral-white);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.control:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.banner-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--herbal-gold);
    transform: scale(1.2);
}

/* 10. 学院要闻滚动列表 */
.news-scroll {
    background: var(--herbal-pale-green);
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.scroll-header {
    background: var(--herbal-green);
    color: var(--neutral-white);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scroll-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.scroll-icon {
    font-size: 13px;
}

.scroll-more {
    font-size: 12px;
    color: var(--herbal-gold);
    text-decoration: none;
    transition: all 0.3s ease;
}

.scroll-more:hover {
    opacity: 0.8;
}

.scroll-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 240px; /* 调整高度 */
}

.scroll-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transition: transform 0.5s ease;
}

.scroll-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(46, 125, 50, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--neutral-white);
}

.scroll-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(5px);
}

.scroll-item:last-child {
    border-bottom: none;
}

/* 11. 列表样式 */
.list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--neutral-light);
    margin-bottom: 4px;
}

.list-item:hover {
    background: var(--herbal-pale-green);
    transform: translateX(3px);
}

.item-icon {
    font-size: 14px;
    color: var(--herbal-green);
    margin-top: 2px;
    flex-shrink: 0;
}

.item-content {
    flex: 1;
    min-width: 0; /* 防止内容溢出 */
}

.item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--neutral-dark);
    margin-bottom: 4px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; /* 单行显示，超出显示省略号 */
}

.item-date {
    font-size: 11px;
    color: var(--herbal-green);
}

/* 党建服务特殊颜色 */
.party-list .list-item {
    background: #ffebee;
}

.party-list .list-item:hover {
    background: #ffcdd2;
}

.party-list .item-icon {
    color: var(--party-red);
}

/* 教育教学特殊颜色 */
.edu-list .list-item {
    background: var(--edu-light-blue);
}

.edu-list .list-item:hover {
    background: #bbdefb;
}

.edu-list .item-icon {
    color: var(--edu-blue);
}

/* 产教融合特殊颜色 */
.industry-list .list-item {
    background: var(--herbal-pale-brown);
}

.industry-list .list-item:hover {
    background: #d7ccc8;
}

.industry-list .item-icon {
    color: var(--industry-brown);
}

/* 学生风采特殊颜色 */
.student-list .list-item {
    background: var(--student-light-purple);
}

.student-list .list-item:hover {
    background: #e1bee7;
}

.student-list .item-icon {
    color: var(--student-purple);
}

/* 12. 中医药文化装饰 */
.culture-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 25px 0;
    margin-top: 30px;
}

.culture-pattern {
    font-size: 18px;
    color: var(--herbal-gold);
}

.culture-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--herbal-dark-green);
    text-decoration: none;
    transition: all 0.3s ease;
}

.culture-text:hover {
    color: var(--herbal-green);
    transform: scale(1.05);
}

/* 13. 底部信息 - 新增完整样式 */
.page-footer {
    background: linear-gradient(135deg, var(--herbal-dark-green), var(--herbal-green));
    color: var(--neutral-white);
    padding: 40px 0 30px;
    margin-top: 40px;
    font-family: "Microsoft YaHei", sans-serif;
}

.page-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 底部链接样式 */
.page-footer a {
    color: var(--herbal-gold);
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-footer a:hover {
    color: var(--neutral-white);
    text-decoration: underline;
}

/* 底部分隔线 */
.page-footer::before {
    content: "";
    display: block;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, 
        var(--herbal-gold),
        transparent 20%,
        transparent 80%,
        var(--herbal-gold));
}

/* 14. 返回顶部 */
.back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 38px;
    height: 38px;
    background: var(--herbal-green);
    color: var(--neutral-white);
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--herbal-dark-green);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* 15. 响应式设计 */
@media (max-width: 992px) {
    .container {
        padding: 0 15px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* 在小屏幕上改为单列 */
    .content-row.triple {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 20px;
    }
    
    /* 重置网格位置 */
    .content-row.triple .content-column:nth-child(1),
    .content-row.triple .content-column:nth-child(2),
    .content-row.triple .content-column:nth-child(3),
    .content-row.triple .content-column:nth-child(4) {
        grid-column: 1;
    }
    
    .content-row.triple .content-column:nth-child(1) { grid-row: 1; }
    .content-row.triple .content-column:nth-child(2) { grid-row: 2; }
    .content-row.triple .content-column:nth-child(3) { grid-row: 3; }
    .content-row.triple .content-column:nth-child(4) { grid-row: 4; }
    
    .banner-container {
        height: 260px;
    }
    
    /* 响应式调整栏目高度 */
    .party-list,
    .edu-list,
    .industry-list,
    .student-list {
        height: 220px;
    }
}

@media (max-width: 768px) {
    .banner-container {
        height: 240px;
    }
    
    .slide-content {
        padding: 20px;
    }
    
    .section-header {
        padding: 10px 16px;
    }
    
    .section-title {
        font-size: 14px;
    }
    
    .header-decoration {
        gap: 6px;
    }
    
    .decoration-line {
        width: 15px;
    }
    
    .scroll-container {
        height: 220px;
    }
    
    .culture-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .culture-text {
        order: -1;
    }
    
    /* 响应式调整栏目高度 */
    .party-list,
    .edu-list,
    .industry-list,
    .student-list {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .banner-container {
        height: 200px;
    }
    
    .control {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .culture-text {
        font-size: 14px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 35px;
        height: 35px;
        font-size: 15px;
    }
    
    .page-footer {
        padding: 30px 0 20px;
        margin-top: 30px;
    }
    
    /* 响应式调整栏目高度 */
    .party-list,
    .edu-list,
    .industry-list,
    .student-list {
        height: 180px;
    }
}

/* 16. 轮播图动画 */
@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}