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

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background-color: #3192D8;
    background-image: url('../pic/bg左.png'), url('../pic/bg右.png');
    background-position: left top 260px, right top 260px;
    background-size: 30% auto, 30% auto;
    background-repeat: no-repeat, no-repeat;
    background-attachment: fixed;
    color: #333;
}

/* 左右背景装饰图片 - 备用方案 */
.bg-decor {
    display: none;
}

/* 顶部横幅 */
.top-bar {
    background: transparent;
    padding: 15px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 300; /* 保持在一般内容之上，但低于抽屉侧栏 */
}

.header-logo {
    height: 50px;
    vertical-align: middle;
}

.logo-container {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
}

.logo-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    padding-bottom: 3px;
}

.header-title {
    font-size: 16px;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    text-decoration: none;
}

.header-title:hover {
    color: white;
    opacity: 1;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

/* 个人信息区域 */
.profile-section {
    display: flex;
    gap: 30px;
    padding: 25px;
    background: transparent;
    border-radius: 15px;
    box-shadow: none;
}

.profile-photo img {
    width: 180px;
    height: 240px;
    object-fit: cover;
    border-radius: 10px;
    border: 4px solid rgba(255,255,255,0.3);
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-name {
    font-size: 40px;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.profile-dept {
    font-size: 22px;
    color: rgba(255,255,255,0.95);
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.profile-title {
    font-size: 20px;
    color: rgba(255,255,255,0.95);
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.profile-email {
    font-size: 18px;
    color: rgba(255,255,255,0.9);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* 内容区域容器 */
.content-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
}

/* 左侧栏 */
.sidebar {
    background: rgba(255,255,255,1); /* 改为不透明，避免透出 logo */
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    height: fit-content;
}

/* 侧边导航样式 */
.side-nav ul {
    list-style: none;
}

.side-nav li {
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    color: #444;
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px solid transparent;
}

.side-nav li:hover {
    background: linear-gradient(135deg, #3498db 0%, #2989d8 100%);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(41, 137, 216, 0.4);
}

.side-nav li.active {
    background: linear-gradient(135deg, #1e5799 0%, #2989d8 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(30, 87, 153, 0.4);
}

/* 主内容区 */
.main-content {
    background: rgba(255,255,255,0.97);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section h2 {
    color: #1e5799;
    font-size: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid #1e5799;
    margin-bottom: 20px;
}

/* 科学研究容器 */
.research-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.research-sub-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    border-left: 4px solid #17a2b8;
}

.research-sub-section h3 {
    font-size: 17px;
    color: #17a2b8;
    padding-bottom: 12px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.research-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.research-item {
    background: rgba(23, 162, 184, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 15px;
    color: #333;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

.project-list,
.patent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-item,
.patent-item {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    padding: 10px 14px;
    background: rgba(255,255,255,0.7);
    border-radius: 0 8px 8px 0;
    border-left: 3px solid #17a2b8;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.patent-item {
    border-left-color: #00897b;
}

.project-item.more-item,
.patent-item.more-item {
    display: none;
}

.project-list[datacollapsed="false"] .project-item.more-item,
.patent-list[datacollapsed="false"] .patent-item.more-item {
    display: block;
}

.show-more-btn {
    text-align: center;
    padding: 10px;
    margin-top: 12px;
    color: #17a2b8;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    background: rgba(23, 162, 184, 0.1);
    transition: background 0.3s ease;
}

.show-more-btn:hover {
    background: rgba(23, 162, 184, 0.2);
}

/* 学术兼职样式 */
.teaching-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.teaching-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    border-left: 4px solid #00796b;
}

.teaching-section h3 {
    font-size: 17px;
    color: #00796b;
    padding-bottom: 12px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.teaching-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.teaching-item {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    padding: 10px 14px;
    background: rgba(255,255,255,0.7);
    border-radius: 0 8px 8px 0;
    border-left: 3px solid #00796b;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 论文列表样式 */
.papers-text {
    line-height: 1.8;
    color: #444;
}

.papers-text p {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.papers-text p.more-item {
    display: none;
}

.papers-text[datacollapsed="false"] p.more-item {
    display: block;
}

.papers-text strong {
    font-weight: 700;
}

.papers-text .level-tag {
    color: #dc3545;
    font-weight: 700;
}

.papers-show-more {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.papers-show-more:hover {
    background: rgba(40, 167, 69, 0.2);
}

/* 基本信息三块布局 */
.basic-info-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    border-left: 4px solid #1e5799;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.info-card h3 {
    font-size: 17px;
    color: #1e5799;
    padding-bottom: 12px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.info-card.personal-intro {
    background: linear-gradient(135deg, #e8f4fc 0%, #d4e8f7 100%);
    border-left-color: #2989d8;
}

.info-card.personal-intro h3 {
    color: #2989d8;
}

.intro-text {
    font-size: 15px;
    line-height: 2;
    color: #444;
    margin: 0;
}

.intro-text strong {
    color: #2989d8;
    font-weight: 700;
    background: linear-gradient(transparent 60%, rgba(41, 137, 216, 0.15) 60%);
    padding: 0 2px;
}

.info-card.work-exp {
    background: linear-gradient(135deg, #e8faf8 0%, #d4f0f7 100%);
    border-left-color: #17a2b8;
}

.info-card.work-exp h3 {
    color: #17a2b8;
}

.info-row {
    display: flex;
    padding: 9px 0;
    border-bottom: 1px dashed #ddd;
    font-size: 15px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    width: 130px;
    color: #555;
    font-weight: 600;
    flex-shrink: 0;
}

.info-row .value {
    color: #333;
    flex: 1;
}

.intro-text {
    font-size: 15px;
    line-height: 1.9;
    color: #444;
    text-align: justify;
}

.work-exp-item {
    padding: 14px 0;
    border-bottom: 1px dashed #ccc;
}

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

.work-exp-time {
    color: #17a2b8;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 6px;
}

.work-exp-detail {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
}

/* 招生计划卡片样式 */
.info-card.recruit-info {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left-color: #4caf50;
}

.info-card.recruit-info h3 {
    color: #2e7d32;
}

.info-card.recruit-info .info-row .label {
    color: #2e7d32;
    font-weight: 600;
}

.info-card.recruit-info .info-row .value {
    color: #333;
}

.recruit-wish-block {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 8px;
    padding: 12px 20px;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    color: #e65100;
    margin-top: 15px;
}

/* 科研项目样式 */
.project-item, .paper-item, .award-item {
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin-bottom: 15px;
    border-left: 5px solid #1e5799;
    border-radius: 0 10px 10px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-item:hover, .paper-item:hover, .patent-item:hover, .teaching-item:hover, .honors-text p:hover, .recruit-section:hover, .competition-text p:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(30, 87, 153, 0.2);
}

.project-title, .paper-title {
    font-size: 17px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.project-info, .paper-info {
    color: #666;
    font-size: 14px;
}

/* 教育教学样式 */
.course-item {
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin-bottom: 15px;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
}

.course-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.course-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    font-size: 16px;
}

.course-info {
    color: #666;
    font-size: 14px;
}

/* 荣誉称号样式 */
.honors-text {
    line-height: 1.8;
    color: #444;
}

.honors-text p {
    margin: 0 0 12px 0;
    font-size: 14px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.8);
    border-radius: 0 8px 8px 0;
    border-left: 3px solid #ffc107;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 招生计划样式 */
.recruit-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recruit-section {
    padding: 16px 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 0 8px 8px 0;
    border-left: 4px solid #4caf50;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recruit-section h3 {
    font-size: 16px;
    color: #2e7d32;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(46, 125, 50, 0.3);
}

.recruit-section p {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    margin: 0;
}

.recruit-wish {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left-color: #ff9800;
    text-align: center;
}

.recruit-wish p {
    font-size: 15px;
    font-weight: bold;
    color: #e65100;
}

/* 指导竞赛样式 */
.competition-text {
    line-height: 1.8;
    color: #444;
}

.competition-text p {
    margin: 0 0 12px 0;
    font-size: 14px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.8);
    border-radius: 0 8px 8px 0;
    border-left: 3px solid #007bff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 学生风采样式 */
.students-intro {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border-radius: 10px;
    border-left: 4px solid #fbc02d;
}

.students-intro p {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    margin: 0;
    text-align: center;
}

.students-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    align-items: start; /* 保证网格项从顶部对齐，避免因内容高度不同导致的多余留白 */
}

.students-gallery img {
    width: 100%;
    height: 220px; /* 统一高度，消除不同纵横比带来的不对称 */
    object-fit: cover; /* 裁切而不是留空白，保证图片填满容器 */
    display: block; /* 去掉默认 inline 间隙 */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.students-gallery img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    cursor: pointer;
}

/* 图片放大弹窗样式 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
}

.modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 20px 0;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
}

/* 页脚 */
.footer {
    background: linear-gradient(135deg, #1e5799 0%, #2989d8 100%);
    color: white;
    text-align: center;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
}

/* 响应式 */
@media (max-width: 900px) {
    /* 在窄屏上仍保留侧边栏 + 主内容的双栏布局，但收窄侧栏宽度并保证顶部对齐
       这样可以在手机端保持与桌面相同的布局结构，避免导航与内容垂直堆叠 */
    .content-wrapper {
        grid-template-columns: 180px 1fr; /* 收窄侧栏以适应小屏 */
        gap: 12px;
        align-items: start;
    }

    /* 使侧边栏在小屏上可粘性显示并独立滚动，提升可用性 */
    .sidebar {
        position: sticky;
        top: 12px;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }

    .student-card {
        grid-template-columns: repeat(2, 1fr);
    }
    /* 移动端优化：避免固定背景与重阴影导致的重绘/回流开销 */
    body {
        background-attachment: scroll; /* 避免 fixed 在移动端触发额外重绘 */
        background-size: 40% auto, 40% auto; /* 减小背景尺寸以降低渲染压力 */
    }

    .main-content, .sidebar, .students-gallery img {
        box-shadow: none; /* 去掉大面积阴影，减少渲染成本 */
    }
}

/* 抽屉式侧栏：在更窄屏幕上（<=600px）使用覆盖式侧栏，提升主内容宽度与可读性 */
@media (max-width: 600px) {
    /* 隐藏收窄的常规侧栏布局，改为抽屉式 */
    .content-wrapper {
        grid-template-columns: 1fr; /* 主内容占满全宽 */
        gap: 0;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 78vw; /* 抽屉宽度，留出部分内容可见作为提示 */
        max-width: 320px;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 99999; /* 大幅提高侧栏 z-index，确保覆盖所有其他元素 */
        box-shadow: 0 8px 24px rgba(0,0,0,0.25);
        margin: 0; /* 取消原有的 padding/margin 在抽屉时的影响 */
        border-radius: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        pointer-events: auto; /* 确保能接收点击 */
        background: rgba(255,255,255,1); /* 明确设置不透明背景，防止背景图片透过 */
    }

    /* 当侧栏打开时，给 body 加类 .sidebar-open 以控制显示 */
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    /* 遮罩层，点击可关闭侧栏 */
    .mobile-backdrop {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0; /* 默认覆盖全屏（收起状态下不可见） */
        background: rgba(0,0,0,0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease, left 0.28s ease;
        z-index: 99998; /* 低于侧栏但高于其他内容 */
        pointer-events: none; /* 默认不阻挡交互，visible 时会启用 */
    }

    body.sidebar-open .mobile-backdrop {
        /* 当侧栏打开时，将遮罩限制在侧栏右侧，避免覆盖侧栏本身。
           left 使用 min(78vw, 320px) 以兼容不同屏幕与 max-width 设置 */
        left: min(78vw, 320px);
        opacity: 1;
        visibility: visible;
        pointer-events: auto; /* 启用点击关闭 */
    }

    /* 汉堡按钮样式 */
    .menu-toggle {
        position: fixed; /* 固定在屏幕边缘，避免遮挡内容 */
        left: 8px;       /* 距离左边缘 */
        top: 10px;       /* 距离顶部 */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        font-size: 20px;
        background: rgba(255,255,255,0.95);
        color: #1e5799;
        border: none;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        cursor: pointer;
        z-index: 99997; /* 置于遮罩之上，但低于侧栏（侧栏优先显示） */
        margin: 0;
        padding: 0;
    }

    /* 打开侧栏时隐藏汉堡，防止遮挡侧栏顶部内容 */
    body.sidebar-open .menu-toggle {
        display: none;
    }

    /* 当侧栏打开时，把顶部栏（含 logo）降到侧栏之下，并禁止其拦截事件，
       以确保侧栏在视觉和交互上完全覆盖 header 区域 */
    body.sidebar-open .top-bar {
        z-index: 50; /* 远低于侧栏的 14000 */
        pointer-events: none; /* 防止 header 在侧栏打开时拦截点击 */
    }

    /* 在桌面保持隐藏汉堡 */
    .menu-toggle { display: inline-flex; }

    /* 让主内容有适当侧边内边距，防止被顶部覆盖 */
    .main-content {
        padding-top: 10px;
    }
}

/* 在较大屏幕上隐藏汉堡按钮 */
@media (min-width: 601px) {
    .menu-toggle { display: none; }
    .mobile-backdrop { display: none; }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    .profile-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .profile-photo img {
        width: 150px;
        height: 200px;
    }
}
