/* 子导航区域样式 */
.subnav-wrapper {
    display: flex;
    width: 100%;
    margin: 10px 0;
    overflow: hidden;
    height: 550px;
    position: relative;
}

.subnav-item {
    flex: 1;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    border-right: 1px solid #f0f0f0;
}

.subnav-item:last-child {
    border-right: none;
}

.subnav-item a {
    display: block;
    color: #333;
    text-decoration: none;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.subnav-icon {
    position: absolute;
    left: 50%; /* 居中图标 */
    top: 40px;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

.subnav-icon img {
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
    filter: invert(31%) sepia(93%) saturate(1352%) hue-rotate(190deg) brightness(91%) contrast(101%); /* 蓝色图标 */
}

.subnav-content {
    position: absolute;
    left: 0; /* 调整内容位置 */
    top: auto;
    bottom: 60px;
    width: 100%;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.subnav-content h3 {
    color: #0066cc; /* 蓝色标题 */
    font-size: 16px;
    margin-bottom: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.subnav-content p {
    display: none; /* 隐藏描述文字 */
}

/* 特定类型的样式 */
.subnav-item[data-type="xxgk"] {
    background-color: #ffffff; /* 修改为浅灰色背景 */
    border: 1px solid #e0e0e0; /* 添加浅色边框 */
}

.subnav-item[data-type="kxyj"] {
    background-color: #ffffff; /* 统一背景色 */
    border: 1px solid #e0e0e0;
}

.subnav-item[data-type="cyfz"] {
    background-color: #ffffff; /* 统一背景色 */
    border: 1px solid #e0e0e0;
}

/* 悬停效果 */
.subnav-item:hover:not(.active) {
    background-color: #e8f4ff; /* 悬停时的背景色 */
    border-color: #0066cc;
}

/* 激活状态内容 */
.subnav-active-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: none;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
    z-index: 10;
    border: 1px solid #0066cc; /* 减小边框粗细 */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 添加标题区域 */
.active-header {
    background-color: #0066cc;
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.active-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}
.active-header h3 a {
    color: #fff;
    text-decoration: none;
}

.active-header h3 a:hover {
    color: #fff;
    /* text-decoration: underline; */
}

.active-top {
    flex: 1;
    overflow: hidden;
    padding: 15px 15px 5px; /* 减小底部内边距 */
}

/* 修改子导航内容列表样式，参考党群工作部分 */
.active-news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.active-news-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed #e0e0e0;
    position: relative;
    padding-left: 15px;
}

.active-news-list li:before {
    content: "";
    position: absolute;
    left: 0;
    top: 20px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #0066cc;
}

.active-news-list li:last-child {
    border-bottom: none;
}

.active-news-list li a {
    color: #333;
    text-decoration: none;
    font-size: 16px; /* 增大字体 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.active-news-list li a:hover {
    color: #0066cc;
}

.active-news-list li span {
    color: #999;
    font-size: 14px; /* 增大日期字体 */
}

.active-bottom {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0; /* 减小上下内边距 */
    height: 80px;
    background-color: #fff;
    margin-top: 0; /* 确保没有顶部外边距 */
}

.active-nav-item {
    text-align: center;
    flex: 1;
    border-right: none; /* 移除内部边框 */
}

.active-nav-item:last-child {
    border-right: none;
}

.active-nav-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #0066cc; /* 蓝色文字 */
    text-decoration: none;
    height: auto;
    padding: 5px 0;
}

.active-nav-item img {
    width: 35px; /* 增大图标尺寸 */
    height: 35px;
    margin-bottom: 8px;
    filter: none; /* 移除图标滤镜 */
}

.active-nav-item span {
    font-size: 15px;
    font-weight: 500;
}

/* 悬停状态 */
.subnav-item.active {
    flex: 3;
}

.subnav-item.active .subnav-content,
.subnav-item.active .subnav-icon {
    display: none;
}

.subnav-item.active .subnav-active-content {
    display: flex;
}



/* 非激活状态下的子菜单 */
.subnav-submenu {
    position: absolute;
    top: 100px; /* 从顶部开始计算位置 */
    left: 0;
    width: 100%;
    height: calc(100% - 150px); /* 占据剩余空间 */
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 垂直居中 */
}


.subnav-submenu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 均匀分布 */
    height: 100%;
}

/* 统一所有子菜单的间距 */
.subnav-submenu ul {
    gap: 0; /* 重置间距 */
}

.subnav-submenu li {
    text-align: center;
    padding: 10px 0; /* 统一内边距 */
    margin: 0; 
    border-bottom: 1px solid #e0e0e0; /* 添加底部分割线 */
}

.subnav-submenu li:last-child {
    border-bottom: none; /* 最后一项不需要分割线 */
}

.subnav-submenu li a {
    display: flex;
    align-items: center;
    justify-content: center;
   /*  color: #333; 修改为默认黑色 */
    font-size: 18px; /* 增大字体大小 */
    text-decoration: none;
    height: auto;
    font-weight: 500;
}

.subnav-item[data-type="kxyj"] .subnav-submenu li a {
    font-size: 18px; /* 与其他菜单项保持一致 */
    /* color: #333; 确保科研项目也使用黑色 */
}

.subnav-submenu li a img {
    width: 24px; /* 统一图标大小 */
    height: 24px;
    margin-right: 10px;
    filter: brightness(0.4); /* 修改图标颜色为深灰色/黑色 */
}

/* 当激活时隐藏子菜单 */
.subnav-item.active .subnav-submenu {
    display: none;
}


/* 产业发展卡片的方块模式样式 */
.active-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
    padding: 15px;
    height: calc(100% - 10px); /* 减去标题区域的高度 */
    overflow: auto; /* 添加滚动条以防内容溢出 */
}

.grid-item {
    background-color: #ffffff; /* 修改为白色背景 */
    border-radius: 5px;
    padding: 20px 15px; /* 增加上下内边距 */
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid #e0e0e0;
    height: auto; /* 自适应高度 */
    min-height: 120px; /* 设置最小高度 */
}

.grid-item:hover {
    background-color: #e8f4ff;
    border-color: #0066cc;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.grid-icon {
    margin-bottom: 10px;
}

.grid-icon img {
    width: 40px;
    height: 40px;
    filter: invert(31%) sepia(93%) saturate(1352%) hue-rotate(190deg) brightness(91%) contrast(101%);
}

.grid-title {
    font-size: 16px;
    font-weight: 600;
    color: #0066cc;
    margin-bottom: 8px;
}

.grid-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    /* 确保描述文字不会被截断 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 60px; /* 限制最大高度 */
}

.grid-item a {
    display: block;
    height: 100%;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

/* 调整激活状态内容区域的样式 */
.subnav-item[data-type="cyfz"] .subnav-active-content .active-top {
    padding: 0; /* 移除内边距以充分利用空间 */
    overflow: hidden; /* 防止内容溢出 */
    display: flex;
    flex-direction: column;
    height: calc(600 - 50px); /* 减去标题区域的高度 */
}


/* 子菜单内容上下布局 */
.submenu-content {
    display: flex;
    flex-direction: column; /* 改为纵向排列 */
    padding: 15px;
    align-items: center; /* 水平居中 */
}

.submenu-image {
    margin-bottom: 30px; /* 添加下边距 */
    text-align: center; /* 图片居中 */
}

.submenu-image img {
    max-width: 100px;
    height: auto;
    display: block;
    margin: 0 auto; /* 图片居中 */
}

.submenu-description {
    width: 100%; /* 占满宽度 */
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    text-align: center; /* 文字居中 */
}

/* 子菜单链接列表 */
.submenu-links {
    list-style: none;
    padding: 0 15px 15px;
    margin: 0;
    border-top: 1px solid #eee;
}

.submenu-links li {
    margin: 10px 0;
}

.submenu-links a {
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 16px; /* 增大链接字体 */
}

.submenu-links a:hover {
    color: #0066cc;
}

.submenu-links img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}





/* 移动端点击激活功能 */
@media (max-width: 768px) {

    .subnav-wrapper {
        flex-direction: column;
        height: auto;
    }
    
    .subnav-item {
        margin-bottom: 1px;
        border-right: none;
        height: 220px;
        position: relative;
        cursor: pointer;
    }
    
    .subnav-item.active {
        flex: 1;
        height: 600px;
    }

    .submenu-content {
        padding: 10px;
    }
    
    .submenu-image img {
        max-width: 60px; /* 移动设备上图片稍小 */
    }
    
    .submenu-description {
        font-size: 12px; /* 移动设备上字体稍小 */
    }

    /* 调整子导航项的样式，使其更适合点击 */
    .subnav-item {
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    /* 隐藏子菜单，直到点击激活 */
    .subnav-submenu {
        display: none;
        position: static;
        height: auto;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    /* 点击后显示子菜单 */
    .subnav-item.mobile-active .subnav-submenu {
        display: block;
        max-height: 800px; /* 设置一个足够大的高度 */
        background-color: #f5f5f5;
        border-top: 1px solid #e0e0e0;
        border-bottom: 1px solid #e0e0e0;
        margin-top: 10px;
    }
    
    /* 调整激活状态的样式 */
    .subnav-item.mobile-active {
        background-color: #e8f4ff;
    }
    
    /* 确保子菜单内容在移动端上正确显示 */
    .subnav-item.mobile-active .submenu-content {
        padding: 15px;
    }
}