.portfolio-head {
    height: 518px;
    background: #444d54 url("/media/maxemblem/image/portfolio-head-bg.jpg") center center no-repeat;
    background-size: 100% 200%;
    position: relative;
    display: flex;
    justify-content: center;
    /* 垂直居中 */
    flex-direction: column;
    /* 纵向排列 */
    gap: 1rem;
    /* 子元素间距 */
    position: relative;
    overflow: hidden;
    /* 隐藏超出部分 */
}

/* 添加伪元素承载背景图 */
.portfolio-head::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #444d54 url("/media/maxemblem/image/portfolio-head-bg.jpg") center center no-repeat;
    background-size: 100% 200%;
    /* 保持原始背景设置 */
    transition: transform 0.5s ease-in-out;
    /* 平滑过渡 */
    transform-origin: center center;
    /* 缩放中心点 */
}

/* 鼠标悬停时水平放大 */
.portfolio-head:hover::before {
    transform: scaleX(1.2);
    /* 水平放大20% */
}

.portfolio-maskLayer {
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    position: absolute;
    z-index: 0;
    /* 确保遮罩在文本下层 */
}

/* 统一子元素样式，移除固定高度 + 移除外边距 */
.h1Title,
.h3Text,
.h5Text {
    font-size: 2.5rem;
    /* 按需调整 */
    color: white;
    text-align: center;
    z-index: 1;
    flex: none;
    /* 关闭弹性伸缩 */
    margin: 0;
    /* 清除默认外边距 */
}

.h3Text {
    font-size: 1.2rem;
    /* 次级标题字号 */
    font-weight: normal;
}

.h5Text {
    font-size: 1rem;
    background-color: rgba(22, 22, 22, 0.5);
    width: fit-content;
    /* 关键1：宽度自适应内容 */
    margin: 0 auto;
    /* 关键2：水平居中 */
    padding: 0.5rem 1rem;
    /* 添加内边距提升可读性 */
}

.portfolio-nav-container {
    display: flex;
    /* flex-wrap: wrap; 允许换行 */
    align-items: center;
    padding: 1rem;
    background-color: #fff;
    border-radius: 8px;
    justify-content: space-between;
    /* 移除gap属性改用margin控制 */
    gap: 1.5rem;
    /* 控制子项间距 */
}

.portfolio-button {
    padding: 0.75rem 1.5rem;
    background-color: #fff;
    color: black;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    /* 新增：右侧留白防止挤压 */
    margin-right: auto;
}

.portfolio-categories {
    display: flex;
    justify-content: space-around;
    /* 关键：平均分布 */
    flex-grow: 1;
    /* 关键：占据剩余空间 */
    gap: 1.3rem;
    padding: 0 1.5rem;
    /* 增加左右内边距 */
    overflow-x: auto;
}

/* 新增SVG图标样式 */
.icon-container {
    position: relative;
    display: inline-block;
    /* padding: 8px; */
    /* 控制边框间距 */
}

/* 圆角边框层 */
.icon-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #ccc;
    /* 边框颜色 */
    border-radius: 8px;
    /* 圆角大小 */
    transition: border-color 0.3s;
    z-index: -1;
    /* 确保边框在图标下方 */
}

/* 悬停变色 */
.icon-container:hover::before {
    border-color: #ff6b6b;
    /* 悬停边框色 */
}

.icon-container>.icon {
    fill: #333;
    transition: fill 0.3s;
}

/* 提升图标选择器权重 */
.icon-container>.icon {
    fill: #333;
    transition: fill 0.3s;
}

.icon-container>.icon:hover {
    fill: red;
    z-index: 1;
}

/* 固定尺寸 */
.icon-container .icon {
    width: 24px;
    height: 24px;
}

.category-link {
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    text-decoration: none;
    color: #000;
    transition: all 0.3s;
    white-space: nowrap;
    flex: 1;
    /* 关键：等宽分布 */
    text-align: center;
    /* 文字居中 */
    min-width: max-content;
    /* 防止内容挤压 */
}

/* 保持原有悬停和激活状态 */
.category-link:hover {
    background-color: #edf2f7;
}

.category-link.active {
    background-color: #ccc;
    font-weight: bold;
}

/* 容器样式 */
.portfolio-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    width: 100%;
    padding: 1em;
    box-sizing: border-box;
}

/* 单个作品项 */
.portfolio-item {
    flex: 0 0 calc(25% - 1.5em);
    /* 一行四个，考虑gap间距 */
    min-width: unset;
    /* 最小宽度 */
    display: flex;
    flex-direction: column;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    height: 400px;
    /* 固定高度 */
}

.portfolio-item:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* 图片区域 */
/* 图片容器 */
.image-container {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center; 
    justify-content: center;
    background: #f8f8f8;
    /* 关键修改：移除固定高度，改用比例控制 */
    width: 100%; /* 宽度自适应父容器 */
    aspect-ratio: 1/1; /* 1:1 比例 */
}

/* 图片样式 */
.image-container img {
    width: 100%; /* 继承容器宽度 */
    height: 100%; /* 继承容器高度 */
    max-width: none;
    object-fit: contain;
    transition: transform 0.5s ease;
    display: block;
}

.image-container.loading::before {
    content: "Loading...";
    position: absolute;
    color: #ccc;
}


.imageContainer img:hover {
    transform: scale(1.03);
}

/* 信息区域 */
.info-container {
    height: 20%;
    /* 占据20%高度 */
    display: flex;
    padding: 12px;
    background: #f8f9fa;
    box-sizing: border-box;
}

/* 左侧信息 */
.info-left {
    flex: 6;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author {
    font-size: 12px;
    color: #6c757d;
}

/* 右侧按钮 */
.info-right {
    flex: 4;
    display: flex;
    align-items: center;
}

.similar-btn {
    width: 100%;
    height: 100%;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    padding: 0 8px;
}

.similar-btn:hover {
    background: #333;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .portfolio-item {
        flex-basis: calc(33.33% - 2em);
    }
}

@media (max-width: 768px) {
    .portfolio-item {
        flex-basis: calc(50% - 2em);
    }
}

@media (max-width: 480px) {
    .portfolio-item {
        flex-basis: 100%;
    }
}

.blogs-pagination {
    height: auto;
    /* 高度自适应内容 */
    min-height: 50px;
    /* 避免内容过少时塌陷 */
    width: 100%;
    /* 确保父容器宽度占满 */
}

.blogs-pagination .pagination {
    display: flex;
    justify-content: flex-end;
    /* 主轴上靠右对齐 */
    flex-wrap: wrap;
    /* 允许换行 */
    gap: 0.5em;
    width: 50%;
    /* 控制分页宽度 */
    margin-left: auto;
    /* 关键：左侧自动填充，推至右侧 */
    padding: 10px 0;
}

.blogs-pagination .pagination>li:first-child {
    display: none;
}

.blogs-pagination .pagination>li:last-child {
    display: none;
}

.blogs-pagination .pagination>li>* {
    padding: .5em 1em;
    border: 1px solid #DBDBDB;
}

.blogs-pagination .pagination>li.active>* {
    background: #EC0F14;
    color: #fff;
}

.page_body {
    padding-right: 1vw;
}

.slick-box {
    padding-top: 5vh;
    padding-bottom: 5vh;
}

.slick-track {
    padding-top: 2vh;
    padding-bottom: 2vh;
}

/* 统一图片尺寸与横图样式 */
.testimonialsHome__item {
    display: flex;
    flex-direction: column;
    /* 垂直排列图片和文字 */
    align-items: flex-start;
    /* 名称左对齐 */
    width: 100px;
    /* 根据需求调整整体宽度 */
    margin: 0 10px;
    /* 项间距 */
}

.imageContainer {
    width: 100%;
    aspect-ratio: 4/3;
    /* 横图比例（4:3） */
    display: inline-block;
    overflow: visible;
    /* 允许伪元素超出容器 */
    position: relative;
    /* 定位基准 */

}

/* 图片容器（需定位以放置伪元素） */

.imageContainer img {
    display: block;
    /* 消除底部间隙 */
    object-fit: cover;
    /* 保持比例裁剪 */
    position: relative;
    z-index: 3;
    /* 确保图片在衬底上方 */
    border-radius: 10px;
    transition: transform 0.3s ease;
    /* 可选：图片联动动画 */
}

.imageContainer img:hover {
    cursor: pointer;
}

/* 纯色衬底伪元素 */
.imageContainer::after {
    content: "";
    position: absolute;
    width: 90%;
    height: 90%;
    background-color: #3498db;
    /* 衬底颜色（可自定义） */
    top: -.5vh;
    /* 初始上偏移 */
    right: .75vw;
    /* 初始右偏移 */
    z-index: 2;
    /* 位于图片下方 */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* 平滑动画 */
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.15);
    /* 增强立体感 */
    border-radius: 10px;
}

.imageContainer::before {
    content: "";
    position: absolute;
    width: 90%;
    height: 90%;
    background-color: #ffb7f9;
    /* 衬底颜色（可自定义） */
    top: -.75vh;
    /* 初始上偏移 */
    right: .5vw;
    /* 初始右偏移 */
    z-index: 1;
    /* 位于图片下方 */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* 平滑动画 */
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.15);
    /* 增强立体感 */
    border-radius: 10px;
}

/* 悬停时衬底扩展 */
.imageContainer:hover::after {
    top: -5px;
    /* 悬停时上偏移增大 */
    right: .5vw;
    /* 悬停时右偏移增大 */
    box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.25);
    /* 阴影加深 */
}

/* 悬停时衬底扩展 */
.imageContainer:hover::before {
    top: -10px;
    /* 悬停时上偏移增大 */
    right: .25vw;
    /* 悬停时右偏移增大 */
    box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.25);
    /* 阴影加深 */
}

/* 可选：悬停时图片轻微上浮
        .imageContainer:hover img {
            transform: translateY(-5px);
        } */

/* 名称样式 */
.name-label {
    width: 100%;
    padding: 8px 0 0;
    /* 上间距对齐图片边缘 */
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    /* 强制左对齐 */
    white-space: nowrap;
    /* 单行显示 */
    overflow: hidden;
    text-overflow: ellipsis;
    /* 超长省略号 */
}


.h1TitleBottom,
.h3TextBottom,
.h5TextBottom {
    font-size: 2.5rem;
    /* 按需调整 */
    color: black;
    text-align: center;
    z-index: 1;
    flex: none;
    /* 关闭弹性伸缩 */
    margin: 0;
    /* 清除默认外边距 */
    padding-top: 2vh;
    padding-bottom: 2vh;
}

.h5TextBottom {
    font-size: 2rem;
    font-weight: normal;
}


/* styles.css */
/* 基础重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 整体布局 */
.flex-container {
    display: flex;
    /* max-width: 900px; */
    margin: 1em;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: white;
}

/* 图片区域 */
.image-section {
    flex: 0 0 50%;
    position: relative;
    /* padding-bottom: 56.25%; 16:9比例 */
    background: #f5f7fa;
    overflow: hidden;
}

.image-section img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 表单区域 */
.form-section {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.description {
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* 输入框组 */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-field {
    width: 100%;
    height: 46px;
    padding: 0 15px 0 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-field:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.input-icon svg {
    width: 100%;
    height: 100%;
    fill: #999;
}

/* 上传按钮 */
.upload-btn {
    position: relative;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    height: 46px;
    padding: 0 15px 0 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background 0.3s;
}

.upload-btn:hover {
    background: #e9ecef;
}

#fileInput {
    display: none;
}

.upload-btn label {
    color: #495057;
    cursor: pointer;
    width: 100%;
}

.upload-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
}

.upload-icon svg {
    width: 100%;
    height: 100%;
    fill: #999;
}

/* 提交按钮 */
.submit-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.submit-btn:hover {
    background: #2980b9;
}

.icon-container {
    width: 20px;
    height: 20px;
}

.icon-container svg {
    width: 100%;
    height: 100%;
    fill: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .flex-container {
        flex-direction: column;
    }
    
    .image-section {
        flex: none;
        height: 200px;
        padding-bottom: 0;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: 20px;
    }
    
    .input-field,
    .upload-btn {
        height: 42px;
        font-size: 15px;
    }
    
    .submit-btn {
        padding: 10px;
        font-size: 15px;
    }
}

/* 错误提示样式 */
.error-message {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 4px;
}

/* 无效字段高亮 */
.upload-btn.invalid,
.input-group.invalid {
    border: 1px solid #ff4d4f;
    border-radius: 4px;
    animation: shake 0.5s;
}

/* 抖动动画效果 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.message-hidden { 
    display: none; 
    color: #52c41a; /* 成功绿色 */
    padding: 12px;
    border-radius: 4px;
    text-align: center;
}
.message-visible { 
    display: block; 
    animation: fadeIn 0.5s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.carousel-container {
    /* 添加以下样式确保容器宽度足够 */
    width: 100%;
    min-width: 100%;
    /* 隐藏原生滚动条 */
    overflow: hidden;
}

.carousel-track {
    display: flex;
    /* 使用transform实现平滑滚动 */
    transition: transform 0.5s ease-in-out;
    /* 确保轮播项不换行 */
    flex-wrap: nowrap;
    min-width: max-content;
    /* 确保内容不换行 */
    /* 移除间隙，使用项目内边距控制间距 */
    gap: 0;
}

.border {
    border: #ccc solid 1px;
}

.carousel-item {
    /* 使用固定宽度替代百分比 */
    flex: 0 0 160px;
    padding: 0 4px;
    /* 左右各4px形成8px间隙 */
    min-width: 160px;
    /* 确保最小宽度 */
    /* 移除原有内边距 */
    padding: 0;
}

.carousel-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    /* transform: scale(1.1); */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: all 0.3s;
}

.carousel-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 0;
    position: absolute;
    top: calc(50% + 20px);

}

.carousel-btn.next {
    right: 9px;
    position: absolute;
    top: calc(50% + 20px);;

}

.max-h-500 {
    max-height: 500px;
}

.carousel-indicators {
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.indicator.active {
    background: #4a6cf7;
    border-color: #4a6cf7;
}

.relative {
    position: relative;
}

.aboutus-section-box {
    padding: 1rem;
}

.text-center {
    text-align: center;
}