@charset "UTF-8";
/* =========================================================================
   theme.css — 全站统一蓝色"水利"主题 + 移动端适配
   说明：本文件在各页面 <head> 中最后引入，用于覆盖 bootstrap / index.css /
   style1.css / responsive.css 等遗留样式。仅做着色与响应式增强，不改 markup。
   ========================================================================= */

/* ---------------- 设计令牌 ---------------- */
:root {
    --primary-blue: #2E86AB;
    --primary-dark: #1f6c8c;
    --secondary: #A23B72;
    --accent: #F18F01;
    --water-gradient: linear-gradient(135deg, #2E86AB 0%, #1f6c8c 60%, #16526b 100%);
    --hero-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --section-bg: #f8fafb;
    --ink: #2c3e50;
    --muted: #6b7c8c;
    --line: #e7eef3;
    --radius: 14px;
    --shadow-sm: 0 2px 8px rgba(20, 60, 90, .06);
    --shadow: 0 8px 26px rgba(20, 60, 90, .10);
    --shadow-lg: 0 14px 40px rgba(20, 60, 90, .16);
}

/* ---------------- 全局基线 ---------------- */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}
body {
    font-family: "Microsoft YaHei", "微软雅黑", -apple-system, "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: linear-gradient(to bottom, #f8fafb 0%, #ffffff 240px);
    line-height: 1.7;
    -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; }
* { box-sizing: border-box; }
a { transition: color .25s ease; }

/* ============================================================
   1. 统一头部 + 导航
   ============================================================ */
.header {
    height: auto !important;
    border-top: 3px solid var(--primary-blue);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(8px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1200;
}
.header > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    position: relative;
}
.header .logo-main {
    margin-top: 0 !important;
    float: none !important;
    display: flex;
    align-items: center;
}
.header .logo-main img {
    height: 50px;
    width: auto;
    display: block;
}

/* 桌面横向菜单 */
.header-menu {
    float: none !important;
}
.header-menu .menu {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}
.header-menu .menu > li {
    float: none !important;
    border-left: none !important;
    border-bottom: 3px solid transparent !important;
    background: transparent !important;
    position: relative;
}
.header-menu .menu > li > a {
    padding: 26px 18px 22px !important;
    font-size: 15px !important;
    font-weight: 600;
    color: var(--ink) !important;
    letter-spacing: .3px;
}
.header-menu .menu > li > a span {
    font-size: 11px !important;
    color: var(--muted);
    font-weight: 400;
    letter-spacing: 1px;
}
.header-menu .menu > li:hover,
.header-menu .menu > li.hover {
    background: linear-gradient(to bottom, rgba(46,134,171,.06), transparent) !important;
    border-bottom: 3px solid var(--primary-blue) !important;
}
.header-menu .menu > li:hover > a,
.header-menu .menu > li.hover > a { color: var(--primary-blue) !important; }

/* 桌面下拉子菜单 */
.header-menu .sub-menu {
    top: 100% !important;
    left: 0;
    background: #fff;
    box-shadow: var(--shadow);
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}
.header-menu .menu > li:hover .sub-menu { max-height: 400px; }
.sub-menu li a { padding: 12px 22px !important; font-size: 14px !important; }
.sub-menu li a:hover { background: var(--primary-blue) !important; color: #fff !important; }
.sub-menu li:last-child { border-bottom: none !important; }

/* 隐藏遗留的 <select> 移动导航 */
#responsive-nav,
.header-menu select { display: none !important; }

/* ---------------- 汉堡按钮（site.js 注入） ---------------- */
.nav-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 11px 9px;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1300;
}
.nav-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    border-radius: 3px;
    background: var(--primary-blue);
    transition: transform .3s ease, opacity .25s ease;
}
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }

/* ---------------- 移动抽屉（site.js 注入） ---------------- */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 40, 60, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease;
    z-index: 1250;
}
body.nav-open .nav-overlay { opacity: 1; visibility: visible; }
.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 78%;
    max-width: 320px;
    height: 100%;
    background: #fff;
    box-shadow: -6px 0 30px rgba(0, 0, 0, .2);
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.4, 0, .2, 1);
    z-index: 1280;
    overflow-y: auto;
    padding: 78px 0 30px;
}
body.nav-open .mobile-nav { transform: translateX(0); }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav > ul > li > a,
.mobile-nav .mnav-parent {
    display: block;
    padding: 16px 26px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
}
.mobile-nav a { color: var(--ink); }
.mobile-nav a:active { background: var(--section-bg); }
.mobile-nav .sub-links a {
    padding: 13px 26px 13px 42px;
    font-size: 14px;
    font-weight: 400;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    position: relative;
}
.mobile-nav .sub-links a::before { content: "—"; margin-right: 8px; color: var(--accent); }

/* ============================================================
   2. 横幅自适应（防溢出）
   ============================================================ */
.fullwidthbanner-container { max-height: 460px !important; }
.fullwidthbanner img, .home-device img { object-fit: cover; }

/* ============================================================
   3. 统一页脚（深灰 -> 水利蓝渐变）
   ============================================================ */
footer,
.water-footer {
    background: var(--water-gradient) !important;
    margin-top: 48px;
    color: #eaf4fa;
}
footer .footer_l, .water-footer .footer_l { width: 100%; float: none; font-size: 14px; }
footer .footer_l, footer .footer_l a,
.water-footer .footer_l, .water-footer .footer_l a { color: #eaf4fa; }
footer .links { height: auto; line-height: 1.8; padding: 6px 0; }
footer .footer_l a:hover, .water-footer a:hover { color: var(--accent) !important; }
footer .copy, .water-footer .copy { color: rgba(255, 255, 255, .8); line-height: 1.8; }
footer .footer_r { display: none; }

/* ============================================================
   4. 区块标题统一（n_top）
   ============================================================ */
.n_top h2 {
    color: var(--primary-blue) !important;
    font-weight: 700 !important;
    font-size: 1.7em !important;
}
.n_top h2 small { color: var(--muted); display: block; font-size: .5em; margin-top: 4px; }
.n_line { border-top-color: var(--line) !important; }
.tt_top h1, .in_toptt h1 { color: var(--primary-blue) !important; }
.tt_top .line, .con_line { border-top-color: var(--primary-blue) !important; }

/* ============================================================
   5. 新闻 / 学术活动卡片（绿色 -> 蓝色主题，卡片化）
   ============================================================ */
.academic-section { border: none !important; background: transparent; }
.academic-nav { background: transparent !important; border: none !important; margin-bottom: 8px; }
.academic-nav ul { gap: 6px; flex-wrap: wrap; }
.academic-nav li {
    padding: 10px 18px !important;
    border-radius: 999px;
    border-bottom: none !important;
    background: #eef5f9;
}
.academic-nav li.active, .academic-nav li:hover {
    background: var(--primary-blue) !important;
    border-bottom: none !important;
}
.academic-nav li.active a, .academic-nav li:hover a { color: #fff !important; }

.academic-content { padding: 0 !important; }
.academic-event {
    background: #fff;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius);
    padding: 22px !important;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease;
    align-items: center;
}
.academic-event:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.academic-event.featured { border-left: 4px solid var(--accent) !important; }
.event-date {
    background: var(--water-gradient) !important;
    border-radius: 12px !important;
    min-width: 86px !important;
    padding: 14px 8px !important;
    box-shadow: var(--shadow-sm);
}
.event-date .day { font-size: 26px !important; }
.details-btn {
    display: inline-block;
    background: var(--primary-blue) !important;
    color: #fff !important;
    padding: 9px 22px !important;
    border-radius: 999px;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    transition: background .25s ease, transform .2s ease;
}
.details-btn:hover { background: var(--primary-dark) !important; transform: translateY(-2px); }
.event-info h3 { color: var(--ink) !important; font-size: 1.12em; }

/* ============================================================
   6. 产品 isotope 网格 -> 响应式 CSS Grid（取消绝对定位）
   ============================================================ */
#container.isotope,
.grid.isotope {
    width: auto !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 22px;
    margin: 28px auto !important;
    position: static !important;
}
#container .element,
.grid .isotope-item {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    -webkit-transform: none !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    float: none !important;
    border: 1px solid var(--line) !important;
    background: #fff !important;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease;
}
#container .element:hover, .grid .isotope-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}
.grid figure { margin: 0; }
.grid figure img {
    position: static !important;
    transform: none !important;
    -webkit-transform: none !important;
    width: 100% !important;
    height: 190px;
    object-fit: cover;
    display: block;
}
/* 标题常驻显示（替代仅 hover 显示的绿色遮罩，移动端可读） */
.grid figcaption {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    -webkit-transform: none !important;
    background: #fff !important;
    color: var(--ink) !important;
    padding: 14px 16px 18px;
    height: auto !important;
    width: auto !important;
}
.grid figcaption h3, .grid figcaption h3 a {
    color: var(--ink) !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    margin: 0 0 10px !important;
    min-height: 44px;
}
.grid figcaption footer { position: static !important; background: transparent !important; margin: 0; padding: 0; }
#nivo-lightbox-demo { background: transparent !important; }
#nivo-lightbox-demo span {
    border-color: var(--primary-blue) !important;
    color: var(--primary-blue) !important;
    padding: 5px 16px !important;
}
.portfolio-bg { position: static !important; border: none !important; top: auto !important; }

/* ============================================================
   7. 联系页：表单 / 合作伙伴 / 地图 响应式
   ============================================================ */
.form-control, .con_cont textarea { border: 1px solid var(--line) !important; border-radius: 8px; }
.btn-warning {
    background: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
    border-radius: 8px;
    max-width: 240px;
    margin: 0 auto;
}
.partners { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; align-items: center; }
.partner { margin: 0 !important; }
.partner img { width: auto !important; max-height: 70px; }
.baidu_map { height: auto !important; }
.baidu_map .div1 { position: static !important; margin-left: 0 !important; left: auto !important; }
.baidu_map img { max-width: 100% !important; height: auto; }

/* 表格横向可滚动（窄屏防溢出） */
.award-table { display: table; width: 100%; }
.n_newslist { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ============================================================
   8. 响应式断点
   ============================================================ */
@media (max-width: 992px) {
    .header-menu .menu > li > a { padding: 24px 12px 20px !important; }
    .grid figure img { height: 170px; }
}

@media (max-width: 768px) {
    /* 头部：显示汉堡，隐藏桌面菜单 */
    .header { position: sticky; }
    .header > .container { min-height: 62px; }
    .header .logo-main img { height: 42px; }
    .header .header-menu nav, .header .header-menu > div, .header-menu .menu { display: none !important; }
    .header-menu {
        background: transparent !important;
        width: auto !important;
        padding: 0 !important;
        border: none !important;
        margin: 0 !important;
    }
    .nav-toggle { display: flex; }

    /* 横幅压缩：图片按宽度完整铺满，避免只露出局部 */
    .fullwidthbanner-container { max-height: 200px !important; }
    .fullwidthbanner-container img,
    .fullwidthbanner img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .home-device { display: none; }

    /* 卡片堆叠 */
    .academic-event { flex-direction: column; align-items: stretch; text-align: left; }
    .event-date {
        display: flex;
        align-items: baseline;
        gap: 8px;
        min-width: 0 !important;
        width: 100%;
        margin: 0 0 14px !important;
        justify-content: center;
    }
    .event-date .day, .event-date .month, .event-date .year { display: inline-block !important; }

    /* 产品网格 2 列 */
    #container.isotope, .grid.isotope { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .grid figure img { height: 140px; }
    .grid figcaption h3 { min-height: 0; }

    /* 通用：标题宽度、内边距（字号由下方流式 clamp 统一控制） */
    .n_top h2 { width: auto !important; }
    .container { padding-left: 15px; padding-right: 15px; }

    footer { text-align: center; }
    footer .links a { display: inline-block; padding: 5px 8px; }

    /* 详情页（chanpin）特性块在窄屏堆叠 */
    .feature { flex-direction: column; text-align: center; }
    .feature-image { flex: 0 0 auto !important; margin: 0 auto 14px !important; max-width: 60%; }
}

@media (max-width: 480px) {
    #container.isotope, .grid.isotope { grid-template-columns: 1fr; }
    .grid figure img { height: 180px; }
    .header .logo-main img { height: 38px; }
}

/* ============================================================
   9. 响应式字体（流式 clamp，PC 与移动端平滑缩放）
   clamp(最小, 随视口宽度变化的首选值, 最大)：移动端取最小、桌面端取最大。
   置于文件末尾，统一覆盖各页 px / em 旧字号。
   ============================================================ */
:root {
    --fs-xs:   clamp(11px,   0.35vw + 9.8px,  12.5px);  /* 角标 / 英文小字 */
    --fs-sm:   clamp(12.5px, 0.40vw + 11px,   14px);    /* 次要文字 / 元信息 */
    --fs-base: clamp(14px,   0.45vw + 12.4px, 16px);    /* 正文 */
    --fs-md:   clamp(15px,   0.55vw + 13px,   17px);    /* 导航 / 副标题 */
    --fs-lg:   clamp(16.5px, 0.90vw + 13.5px, 20px);    /* 强调 / 姓名 */
    --fs-h3:   clamp(16px,   1.00vw + 13px,   19px);    /* 卡片标题 */
    --fs-h2:   clamp(20px,   1.80vw + 15px,   27px);    /* 区块标题 */
    --fs-h1:   clamp(23px,   2.60vw + 16px,   36px);    /* 主标题 */
}

/* 根字号随视口流动，带动所有 em/rem 旧字号一起缩放 */
html { font-size: clamp(14px, 0.35vw + 12.7px, 16.5px); }
body { font-size: var(--fs-base) !important; }

/* 正文与段落 */
.bio-content p,
.event-description,
.n_about p, .n_about,
.wz, .wz p,
.article-content p,
.profile-container p,
.highlights-content p { font-size: var(--fs-base) !important; line-height: 1.8; }

/* 标题层级 */
h1, .main-title, .tt_top h1, .in_toptt h1, .n_about h1,
.view-title { font-size: var(--fs-h1) !important; }
h2, .n_top h2 { font-size: var(--fs-h2) !important; }
.n_top h2 small { font-size: 0.5em !important; }
h3, .event-info h3, .academic-event h3,
.news_title, .professor-title { font-size: var(--fs-h3) !important; }
h4, .sub-title, .in_toptt h4 { font-size: var(--fs-md) !important; font-weight: 400; }
.english-title, .in_toptt small { font-size: var(--fs-sm) !important; }
.professor-name { font-size: var(--fs-lg) !important; }
.contact-email { font-size: var(--fs-sm) !important; }

/* 顶部导航 */
.header-menu .menu > li > a { font-size: var(--fs-md) !important; }
.header-menu .menu > li > a span { font-size: var(--fs-xs) !important; }
.sub-menu li a { font-size: var(--fs-sm) !important; }
.mobile-nav > ul > li > a, .mobile-nav .mnav-parent { font-size: var(--fs-md) !important; }
.mobile-nav .sub-links a { font-size: var(--fs-sm) !important; }

/* 新闻 / 学术活动卡片 */
.event-date .day { font-size: clamp(20px, 1.4vw + 14px, 26px) !important; }
.event-date .month, .event-date .year { font-size: var(--fs-xs) !important; }
.event-meta, .event-meta span { font-size: var(--fs-sm) !important; }
.details-btn, .more-btn { font-size: var(--fs-sm) !important; }
.academic-nav li a { font-size: var(--fs-sm) !important; }

/* 首页成果三栏列表 */
.news_list li a { font-size: var(--fs-sm) !important; }
.news_list li span { font-size: var(--fs-xs) !important; }
.award-table th { font-size: var(--fs-sm) !important; }
.award-table td { font-size: var(--fs-sm) !important; }
.pagination-btn, .page-select, .pagination-info { font-size: var(--fs-xs) !important; }

/* 产品卡片 */
.tt_top p { font-size: var(--fs-md) !important; }
.grid figcaption h3, .grid figcaption h3 a { font-size: var(--fs-sm) !important; }
#nivo-lightbox-demo span { font-size: var(--fs-sm) !important; }

/* 联系页表单 / 段落 */
.n_about p, .con_cont textarea, .form-control { font-size: var(--fs-base) !important; }
.btn-warning { font-size: var(--fs-md) !important; }

/* 页脚 */
footer .footer_l, footer .footer_l a,
.water-footer .footer_l, .water-footer .footer_l a { font-size: var(--fs-sm) !important; }
footer .copy, .water-footer .copy, .visitor-status { font-size: var(--fs-xs) !important; }
