/* 新增学科分类样式 */
.subject-section {
    width: 100%;
    margin-bottom: 30px;
}

.subject-title {
    background-color:#594236;   /* 灰色背景 */
    padding: 10px 15px;
    margin-bottom: 20px;
    text-align: left;
    font-weight: bold;
    border-radius: 4px;
    font-size: 1.2rem;
    color: #ffffff;
}

.journals-container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    padding: 0; /* 父容器无内边距 */
    background-color: #e1e2e2;
}
.journal {
    width: calc((100% - 6 * 40px) / 6);
    height: 280px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s;
    cursor: pointer;
    box-sizing: border-box;
    margin-left: 20px;
    margin-right: 20px;
    margin-top: 1rem;
    margin-bottom: 1rem;
}


.journal:hover {
    transform: rotateY(180deg);
}

.journal-front, .journal-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
    /*box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);*/
}

.journal-front {
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: rotateY(0deg);
    width: 100%;
    height: 100%;

}

.journal-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /*margin-bottom: 15px;*/
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.jb-text{
    width: 100%;
    height: 100%;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.jb-text p {
    flex: 1;                 /* 均分剩余高度 */
    margin: 0;               /* 去除默认 margin */
}

.journal-back {
    /*背景颜色换成背景图片，路径参考  <img src="../../templates/images/static/ioa-text.jpg" alt="no"/>*/
    background-image: url("../../../templates/images/static/ioa-jou-back.jpg");
    background-size: cover;      /* 图片填充整个区域 */
    background-position: center; /* 图片居中显示 */
    background-repeat: no-repeat; /* 禁止重复平铺 */
    color: white;
    padding: 10px;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 关键改动：使元素分散对齐 */
    height: 100%; /* 确保填充整个卡片 */
}

.journal-back h3 {
    font-size: 16px;
    margin-bottom: 15px;
    text-align: center;
    flex-shrink: 0; /* 防止标题被压缩 */
}

.journal-back p {
    font-size: 14px;
    overflow: hidden;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制显示2行 */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    flex-grow: 1; /* 占据剩余空间 */
    display: -webkit-box;     /* 旧版浏览器兼容 */
    -webkit-box-orient: vertical; /* 文本垂直排列 */
    overflow: hidden;         /* 隐藏超出部分 */
    text-overflow: ellipsis;  /* 超出显示省略号 */
    line-height: 1.5em;       /* 行高（可选） */
    max-height: 3em;          /* 两倍行高（确保两行） */
}

.journal-button {
    display: inline-block;
    padding: 8px 20px;
    background: white;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    transition: all 0.3s;
    flex-shrink: 0; /* 防止按钮被压缩 */
    margin-top: auto; /* 确保按钮始终在底部 */
}

.journal-button:hover {
    background: #f1f1f1;
    transform: translateY(-2px);
}