/**
 * boda-compat.css
 * 博达站群兼容保护样式
 * 
 * 作用：防止博达系统默认样式（simplenews.css / 289.css / newindex.vsb.css）
 *       覆盖首页三处核心交互区域的布局与展示效果。
 * 
 * 策略：
 *   - 使用 body.main + ID + 精确后代选择器，提高特异性
 *   - 在布局关键属性上使用 !important 做“硬保护”
 *   - 保留所有视觉效果（阴影、圆角、hover动效）
 */

/* =============================================================
   1. 学院新闻焦点图 - 确保 active 状态切换不受干扰
   ============================================================= */
body.main #container-1 .news-carousel {
    position: relative;
    width: 52%;
    overflow: hidden;
}
body.main #container-1 .carousel-slides {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
body.main #container-1 .carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    z-index: 0;
}
body.main #container-1 .carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}
body.main #container-1 .carousel-slide a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    overflow: hidden;
}
body.main #container-1 .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
body.main #container-1 .carousel-slide a:hover img {
    transform: scale(1.05);
}
body.main #container-1 .carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    pointer-events: none;
    z-index: 2;
    border-radius: 0 0 12px 12px;
}
body.main #container-1 .carousel-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 10;
}
body.main #container-1 .carousel-date {
    display: inline-block;
    background: #004ea2;
    color: #fff;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}
body.main #container-1 .carousel-title {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 140px);
}
body.main #container-1 .carousel-nav {
    position: absolute;
    bottom: 25px;
    right: 25px;
    display: flex;
    gap: 8px;
    z-index: 10;
}
body.main #container-1 .carousel-nav .nav-dot {
    width: 10px;
    height: 10px;
    background: transparent;
    border: 2px solid rgba(255,255,255,0.6);
    transform: rotate(45deg);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 rgba(255,255,255,0.4);
    display: block;
}
body.main #container-1 .carousel-nav .nav-dot.active {
    background: #fff;
    border-color: #fff;
    transform: rotate(45deg) scale(1.2);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.2);
}
body.main #container-1 .carousel-nav .nav-dot:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.3);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}

@media screen and (max-width: 1024px) {
    body.main #container-1 .news-carousel {
        width: 100%;
    }
}
@media screen and (max-width: 768px) {
    body.main #container-1 {
        margin-bottom: 25px;
    }
    body.main #container-1 .carousel-title {
        font-size: 15px;
        max-width: calc(100% - 100px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    body.main #container-1 .carousel-date {
        font-size: 12px;
        padding: 4px 10px;
    }
    body.main #container-1 .carousel-slide img,
    body.main #container-1 .carousel-slide a {
        border-radius: 10px;
    }
    body.main #container-1 .carousel-overlay {
        border-radius: 0 0 10px 10px;
    }
    body.main .main1 {
        padding-bottom: 35px;
    }
}

/* =============================================================
   2. 学术活动横向轮播 - 硬保护 flex 布局不被覆盖
   ============================================================= */
body.main #container-4 .post-40 > .con {
    position: relative;
    overflow: hidden;
    padding: 0;
    margin: 0;
}
body.main #container-4 .post-40 > .con > ul.news_list {
    display: flex !important;
    flex-wrap: nowrap !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
body.main #container-4 .post-40 > .con > ul.news_list > li.news {
    overflow: hidden;
    flex: 0 0 auto !important;
    width: calc(33.333% - 20px) !important;
    margin: 0 10px !important;
    min-width: calc(33.333% - 20px) !important;
    max-width: calc(33.333% - 20px) !important;
    box-sizing: border-box;
    padding: 25px 0 !important;
    position: relative !important;
    box-sizing: border-box !important;
    list-style: none !important;
    float: none !important;
    clear: none !important;
    display: block !important;
}

/* 卡片样式保持 */
body.main #container-4 .post-40 > .con > ul.news_list > li.news .news_box {
    margin: 0 15px;
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(0,0,0,0.04);
}
body.main #container-4 .post-40 > .con > ul.news_list > li.news:hover .news_box {
    box-shadow: 0 12px 32px rgba(0,78,162,0.18), 0 4px 8px rgba(0,0,0,0.08);
    transform: translateY(-4px);
    border-color: rgba(0,78,162,0.1);
}
body.main #container-4 .post-40 > .con > ul.news_list > li.news .news_box .news_wz {
    padding: 15px;
    overflow: hidden;
}
body.main #container-4 .post-40 > .con > ul.news_list > li.news .news_con {
    height: auto;
    margin-left: 0;
    padding: 0;
}
body.main #container-4 .post-40 > .con > ul.news_list > li.news .news_title {
    margin-bottom: 12px;
    font-weight: bold;
    line-height: 28px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    height: 56px;
    transition: all .6s ease-out;
    font-size: 18px;
    color: #1759a3;
}
body.main #container-4 .post-40 > .con > ul.news_list > li.news:hover .news_title {
    color: #004ea2;
}
body.main #container-4 .post-40 > .con > ul.news_list > li.news .news_date {
    line-height: 20px;
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}
body.main #container-4 .post-40 > .con > ul.news_list > li.news .news_ftitle {
    width: 100%;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
    color: #666;
    height: 78px;
}
body.main #container-4 .post-40 > .con > ul.news_list > li.news .news_imgs {
    width: 100%;
    height: 229px;
    float: none;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    position: relative;
}
body.main #container-4 .post-40 > .con > ul.news_list > li.news .news_imgs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.4s ease;
    display: block;
    border: none;
}
body.main #container-4 .post-40 > .con > ul.news_list > li.news:hover .news_imgs img {
    transform: scale(1.08);
    filter: brightness(1.05);
}

body.main #container-4 .post-40 {
    position: relative;
    overflow: visible !important;
    padding: 0 70px;
    box-sizing: border-box;
}
/* 左右切换箭头 - 原版黑色方形（由 boda-compat.js 动态生成） */
body.main #container-4 .post-40 .boda-compat-arrow {
    position: absolute;
    top: 55%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background-color: #323232;
    background-repeat: no-repeat;
    background-position: center;
    background-size: auto;
    border: none;
    border-radius: 0;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s;
}
body.main #container-4 .post-40 .boda-compat-arrow:hover {
    background-color: #004ea2;
}
body.main #container-4 .post-40 .boda-compat-arrow.ac-prev {
    left: 0;
    background-image: url(../images/left.png);
}
body.main #container-4 .post-40 .boda-compat-arrow.ac-next {
    right: 0;
    background-image: url(../images/right.png);
}

@media screen and (max-width: 1200px) {
    body.main #container-4 .post-40 > .con > ul.news_list > li.news {
        width: calc(50% - 20px) !important;
        min-width: calc(50% - 20px) !important;
        max-width: calc(50% - 20px) !important;
    }
}
@media screen and (max-width: 768px) {
    body.main #container-4 .post-40 > .con > ul.news_list > li.news {
        width: calc(100% - 20px) !important;
        min-width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
    }
    body.main #container-4 .post-40 {
        padding: 0;
    }
    body.main #container-4 .post-40 .boda-compat-arrow {
        display: none !important;
    }
}

/* =============================================================
   3. 移动端侧边导航 - 回退样式（防止博达缺失或覆盖）
   ============================================================= */
body.main .wp-navi-aside {
    position: fixed;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    z-index: 9998;
    overflow: hidden;
}
body.main .wp-navi-aside.wp-navi-aside-active {
    width: 100%;
}
body.main .wp-navi-aside .aside-inner {
    position: absolute;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100%;
    background: rgba(37,37,37,0.95);
    overflow-y: auto;
    z-index: 10000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}
body.main .wp-navi-aside.wp-navi-aside-active .aside-inner {
    left: 0;
}
/* 导航文字改为白色适配深色背景 */
body.main .navi-aside-wrap .menu-link,
body.main .navi-aside-wrap .sub-link {
    color: #ccc;
}
body.main .navi-aside-wrap .menu-link:hover,
body.main .navi-aside-wrap .sub-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
body.main .navi-aside-wrap .menu-item,
body.main .navi-aside-wrap .sub-item {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
body.main .navi-aside-wrap .sub-menu {
    background: rgba(255,255,255,0.04);
}
body.main .navi-aside-wrap .menu-switch-arrow {
    color: rgba(255,255,255,0.5);
}
body.main .navi-aside-wrap .menu-switch-arrow.menu-open-arrow {
    color: #fff;
}
body.main .wp-navi-aside .navi-aside-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
body.main .wp-navi-aside.wp-navi-aside-active .navi-aside-mask {
    opacity: 1;
    visibility: visible;
}
body.main .navi-aside-head {
    padding: 16px;
    background: #004ea2;
    color: #fff;
}
body.main .navi-aside-head .navi-aside-title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #fff !important;
}
body.main .navi-aside-wrap .wp-menu,
body.main .navi-aside-wrap .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
body.main .navi-aside-wrap .menu-item,
body.main .navi-aside-wrap .sub-item {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
body.main .navi-aside-wrap .menu-link,
body.main .navi-aside-wrap .sub-link {
    display: block;
    padding: 11px 16px;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    transition: background 0.2s;
}
body.main .navi-aside-wrap .menu-link:hover,
body.main .navi-aside-wrap .sub-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
body.main .navi-aside-wrap .sub-menu {
    display: none;
    background: rgba(255,255,255,0.04);
}
body.main .navi-aside-wrap .sub-menu .sub-link {
    padding: 9px 16px 9px 28px;
    font-size: 13px;
}
body.main .navi-aside-wrap .menu-item {
    position: relative;
}
body.main .navi-aside-wrap .menu-switch-arrow {
    position: absolute;
    right: 0;
    top: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.25s;
    z-index: 1;
}
body.main .navi-aside-wrap .menu-switch-arrow::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid rgba(255,255,255,0.5);
    transition: border-color 0.25s;
}
body.main .navi-aside-wrap .menu-switch-arrow.menu-open-arrow {
    transform: rotate(90deg);
}
body.main .navi-aside-wrap .menu-switch-arrow.menu-open-arrow::after {
    border-left-color: #fff;
}

/* =============================================================
   移动端搜索框与导航按钮间距
   768px 以下：统一搜索框 70% 宽度 + 右侧 margin
   400px 以下：额外缩小汉堡和搜索框间距
   ============================================================= */
@media screen and (max-width: 767px) {
    body.main .header .head-right .wp-search,
    body.main .header .head-right .searchbox {
        width: 70% !important;
        margin-right: 14px !important;
    }
}
@media screen and (max-width: 400px) {
    body.main .navi-aside-toggle {
        margin-left: 4px !important;
    }
    body.main .header .head-right .wp-search,
    body.main .header .head-right .searchbox {
        margin-right: 6px !important;
        margin-left: 4px !important;
    }
}

/* =============================================================
   移动端分隔：学院新闻与通知公告之间间隙
   已由 media.css 中 .main1 .inner { padding-bottom: 45px } 实现
   此处不再额外添加 margin-top，避免产生白色透明间隙
   ============================================================= */
