/* 优化招生专业显示样式 */
.MajorWrap {
    margin-top: 40px;
}

.MajorList {
    display: flex;
    flex-wrap: wrap;
    margin-top: 24px;
}

.MajorList a {
    width: 150px;  /* 固定宽度以确保对齐 */
    height: auto;
    min-height: 50px;  /* 增加最小高度以适应多行文本 */
    padding: 10px 8px;
    background-color: #ffffff;
    border-radius: 5px;
    font-size: 12px;  /* 统一字体大小 */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333333;
    margin-bottom: 15px;
    margin-right: 12px;
    text-align: center;
    word-break: break-word; /* 允许在单词内换行 */
    line-height: 1.3;        /* 设置行高以改善可读性 */
    transition: all 0.3s ease; /* 添加过渡效果 */
    box-sizing: border-box;   /* 确保padding和border包含在元素的总宽度内 */
    flex: 0 0 calc(25% - 12px); /* 每行固定显示4个项目 */
}

/* 优化响应式设计 */
.MajorList a:nth-child(4n+4) {
    margin-right: 0;
}

.MajorList a:hover {
    background-image: linear-gradient(-90deg,
    #76a1fa 0%,
    #0018fd 100%),
    linear-gradient(#ffffff,
            #ffffff);
    background-blend-mode: normal,
    normal;
    color: #ffffff;
    transform: translateY(-2px); /* 添加轻微的上移效果 */
}

/* 针对特别长的专业名称的样式 */
.MajorList a.long-name {
    font-size: 12px;  /* 统一字体大小 */
    padding: 10px 8px;
    width: 150px;  /* 与其他项目保持相同宽度 */
    min-height: 50px;  /* 保持最小高度 */
}

/* 响应式调整 */
@media screen and (max-width: 1200px) {
    .MajorList a {
        min-width: 120px;
        max-width: 140px;
        font-size: 12px;
        flex: 1 1 calc(25% - 10px);
    }
}

@media screen and (max-width: 992px) {
    .MajorList a {
        min-width: 100px;
        max-width: 130px;
        font-size: 11px;
        padding: 6px 8px;
        flex: 1 1 calc(25% - 10px);
    }
}

@media screen and (max-width: 768px) {
    .MajorList a {
        width: calc(50% - 10px);  /* 在小屏幕上每行显示2个 */
        min-width: auto;
        max-width: none;
        margin-right: 20px;
        margin-bottom: 15px;
        flex: none;
    }
    
    .MajorList a:nth-child(4n+4) {
        margin-right: 20px; /* 在小屏幕上取消特定位置的右边距重置 */
    }
    
    .MajorList a:nth-child(2n) {
        margin-right: 0;  /* 每行2个，第二个没有右边距 */
    }
}

@media screen and (max-width: 480px) {
    .MajorList a {
        width: 100%;  /* 在很小的屏幕上每行只显示1个 */
        margin-right: 0;
        flex: none;
    }
}