/* 教师列表样式 - Grid布局 */
.teacher-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 默认6列 */
    gap: 20px;

    width: 100%;
    justify-content: center;
    align-items: start;
}

.teacher-item {
    text-align: center;
    transition: transform 0.3s ease;
    box-sizing: border-box;
    justify-self: center;
    width: 100%;
    max-width: 140px;
}

.teacherbox {
    width: 100%;
    max-width: 150px;
    padding:10px;
    height: 216px;
    border: solid 1px #dfdfdf;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
}

.teacher-item:hover {
    transform: translateY(-5px);
}

.teacher-img {
    width: 118px;
    height: 165px;
    object-fit: cover;
    margin: 0 auto 10px;
    border-radius: 4px;
    display: block;
}

.teacher-name {
    font-size: 16px;

    color: #333;
    margin-top: 10px;
    font-family: "Microsoft YaHei", sans-serif;
    line-height: 1.3;
}

/* 响应式设计 */
@media screen and (max-width: 1200px) {
    .teacher-list {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
    
    .teacherbox {
        max-width: 200px;
        height: 300px;
    }
    
    .teacher-img {
        width: 170px;
        height: 238px;
    }
}

@media screen and (max-width: 900px) {
    .teacher-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .teacher-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .teacher-list {
        margin-right: 0 !important;
    }
    
    .teacherbox {
        max-width: 180px;
        height: 280px;
        padding: 12px 8px 8px;
    }
    
    .teacher-img {
        width: 150px;
        height: 210px;
    }
    
    .teacher-name {
        font-size: 16px;
    }
}

/* 760px以下显示2列 - 手机端整体居中 */
@media screen and (max-width: 760px) {
    .teacher-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        justify-content: center; /* 整体居中 */
    }
    
    .teacher-item {
        max-width: 180px;
        justify-self: center; /* 每个项目居中 */
    }
    
    .teacherbox {
        width: 160px;
        height: 250px;
        padding: 12px 6px 8px;
        margin: 0 auto; /* 自动外边距居中 */
    }

    .teacher-img {
        width: 140px;
        height: 196px;
    }
    
    .teacher-name {
        font-size: 15px;
    }
    
    /* 手机端最后一个元素居中 */
    .teacher-item:last-child {
        justify-self: center;
    }
}

@media screen and (max-width: 600px) {
    .teacher-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        justify-content: center; /* 整体居中 */
    }
    
    .teacher-list {
        margin-right: 0 !important;
    }
    
    .teacher-item {
        max-width: 160px;
        justify-self: center; /* 每个项目居中 */
    }
    
    .teacherbox {
        width: 144px;
        height: 230px;
        padding: 10px 5px 8px;
        margin: 0 auto; /* 自动外边距居中 */
    }

    .teacher-img {
        width: 120px;
        height: 168px;
    }
    
    .teacher-name {
        font-size: 14px;
    }
    
    /* 手机端最后一个元素居中 */
    .teacher-item:last-child {
        justify-self: center;
    }
}

/* 小屏幕手机适配 */
@media screen and (max-width: 480px) {
    .teacher-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px 5px;
        justify-content: center; /* 整体居中 */
    }
    
    .teacher-item {
        max-width: 140px;
        justify-self: center; /* 每个项目居中 */
    }
    
    .teacherbox {
        width: 130px;
        height: 210px;
        padding: 8px 4px 6px;
        margin: 0 auto; /* 自动外边距居中 */
    }

    .teacher-img {
        width: 110px;
        height: 154px;
    }
    
    .teacher-name {
        font-size: 13px;
        margin-top: 8px;
    }
    
    /* 手机端最后一个元素居中 */
    .teacher-item:last-child {
        justify-self: center;
    }
}

/* 超小屏幕 - 单列居中 */
@media screen and (max-width: 360px) {
    .teacher-list {
        grid-template-columns: 1fr;
        justify-items: center; /* 整体居中 */
    }
    
    .teacher-item {
        max-width: 200px;
        justify-self: center; /* 每个项目居中 */
    }
    
    .teacherbox {
        width: 180px;
        height: 260px;
        margin: 0 auto; /* 自动外边距居中 */
    }

    .teacher-img {
        width: 150px;
        height: 210px;
    }
    
    .teacher-name {
        font-size: 15px;
    }
    
    /* 手机端最后一个元素居中 */
    .teacher-item:last-child {
        justify-self: center;
    }
}

/* 确保桌面端正常居中 */
@media screen and (min-width: 761px) {
    .teacher-item {
        justify-self: center;
    }
    
    .teacherbox {
        margin: 0 auto;
    }
    
    .teacher-item:last-child {
        justify-self: center;
    }
}