/* 基础变量：集中保留设计稿中的蓝色、橙色和常用文字色。 */
:root {
  --blue: #165c91;
  --orange: #ef9b11;
  --text: #333;
  --muted: #999;
  --line: #ddd;
  --page-width: 1620px;
}

/* 页面基础样式：统一盒模型并消除浏览器默认间距。 */
* { box-sizing: border-box; }
html { overflow-x: hidden; scroll-behavior: smooth; }
body { position: relative; width: 100%; margin: 0; overflow-x: hidden; color: var(--text); font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif; background: #fff; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.page-width { width: min(var(--page-width), calc(100% - 80px)); margin: 0 auto; }

/* 固定设计画布：PC 使用 Figma 的 1920 像素宽度，移动端使用 390 像素宽度。 */
.site-canvas { position: absolute; top: 0; left: 0; width: 1920px; transform-origin: left top; }
html.is-mobile .site-canvas { width: 390px; }

/* 首屏：横幅改用 HTML 图片，便于后续 FreeMarker 直接替换图片地址。 */
.hero { position: relative; height: 960px; overflow: hidden; background: none; }
.hero-banner-image { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center; }
/* 仅首页横幅叠放淡入淡出，图片尺寸分别遵循桌面和手机端布局。 */
.home-page .hero-banner-image { opacity: 0; transition: opacity .6s ease; }
.home-page .hero-banner-image.active { opacity: 1; }
/* 圆点与一级导航共用水平中心，位于导航顶部上方；44px 点击区域方便触屏操作。 */
.banner-dots { position: absolute; z-index: 10; left: 50%; bottom: calc(60px + 100px + 16px); display: flex; color: #fff; transform: translateX(-50%); }
/* 单张或没有图片时不生成按钮，隐藏空容器及其选中圆点。 */
.banner-dots:empty { display: none; }
.banner-dots button { position: relative; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.banner-dots button::before { position: absolute; top: 16px; left: 16px; width: 12px; height: 12px; border-radius: 50%; background: currentColor; opacity: .45; content: ""; }
.banner-dots button:focus-visible { outline: 2px solid currentColor; outline-offset: -5px; }
/* 选中圆点的前后边缘以不同速度移动，形成先拉伸粘连、再收拢为圆点的效果。 */
.banner-dots::after { position: absolute; top: 16px; left: calc(16px + var(--dot-index, 0) * 44px); right: calc(100% - 28px - var(--dot-index, 0) * 44px); height: 12px; border-radius: 999px; background: currentColor; pointer-events: none; content: ""; transition: left .6s cubic-bezier(.65, 0, .35, 1), right .6s cubic-bezier(.2, .8, .2, 1); }
/* 向左切换时交换前后边缘的速度，保持粘连动画方向与图片切换一致。 */
.banner-dots.is-reversing::after { transition-timing-function: cubic-bezier(.2, .8, .2, 1), cubic-bezier(.65, 0, .35, 1); }
/* 系统要求减少动画时，圆点直接切换到目标位置。 */
@media (prefers-reduced-motion: reduce) { .banner-dots::after { transition: none; } }
.header-bar { position: relative; z-index: 20; height: 120px; padding: 25px 60px; display: flex; align-items: flex-start; justify-content: space-between; background: linear-gradient(180deg, rgba(0, 0, 0, .52), rgba(0, 0, 0, 0)); border-bottom: 1px solid rgba(255, 255, 255, .35); }
.brand { display: flex; align-items: center; height: 70px; }
/* 两个品牌链接分别承载图片，保持原有宽度与垂直位置。 */
.brand > a { display: block; line-height: 0; }
.brand img:first-child { width: 260px; }
.brand img:last-child { width: 304px; }
.brand > a:first-child img { width: 260px; }
.brand > a:last-child img { width: 304px; }
.brand-divider { width: 1px; height: 70px; margin: 0 24px 0 20px; background: rgba(255, 255, 255, .72); }
.header-tools { display: flex; align-items: center; gap: 60px; padding-top: 10px; color: #fff; }
.quick-links { display: flex; align-items: center; gap: 8px; font-size: 16px; white-space: nowrap; }
.quick-links a { transition: opacity .2s ease; }
.quick-links a:hover { opacity: .72; }
.search-box { width: 300px; height: 50px; padding: 0 18px; display: flex; align-items: center; border: 1px solid rgba(255, 255, 255, .75); border-radius: 6px; background: rgba(255, 255, 255, .08); backdrop-filter: blur(10px); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: #fff; background: transparent; }
/* 搜索图标使用提交按钮承载，去除浏览器默认边框并保持原图标尺寸。 */
.search-box button { width: 22px; height: 22px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.search-box img { width: 22px; height: 22px; }

/* 通用标题和更多按钮：复刻设计稿的中英文层级及蓝橙配色。 */
.section-heading { flex: 0 0 auto; }
.section-heading h2 { margin: 0; font-size: 24px; font-weight: 400; line-height: 34px; }
.section-heading h2::after { display: block; width: 60px; height: 1px; margin-top: 5px; content: ""; background: var(--blue); }
.section-heading p { margin: 0; color: var(--line); font-size: 20px; line-height: 34px; }
.more-link { width: 126px; height: 30px; margin-top: 34px; display: flex; align-items: center; border-right: 4px solid var(--orange); color: #fff; background: var(--blue); transition: transform .2s ease, box-shadow .2s ease; }
.more-link span { padding-left: 10px; font-size: 14px; }
.more-link img { width: 12px; height: 12px; margin-left: auto; margin-right: 10px; }
.more-link:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(22, 92, 145, .2); }

/* 学院新闻：首条新闻左右分栏，次要新闻四列排列。 */
.news { padding: 30px 0 40px; background: #f5f5f5; }
.news-feature-row { display: grid; grid-template-columns: 206px 1fr; gap: 40px; }
.featured-news { min-width: 0; display: grid; grid-template-columns: 514px 1fr; height: 480px; }
.featured-copy { position: relative; padding: 0 40px; border-left: 1px solid var(--line); }
.featured-copy time, .news-card-copy time, .notice-item time { display: flex; flex-direction: column; color: var(--muted); }
.featured-copy time strong, .news-card-copy time strong, .notice-item time strong { font-size: 48px; font-weight: 400; line-height: 59px; }
.featured-copy time span, .news-card-copy time span, .notice-item time span { font-size: 14px; }
/* 新闻轮播标题最多显示两行，超出内容使用省略号隐藏。 */
.featured-copy h3 { margin: 75px 0 18px; display: -webkit-box; overflow: hidden; font-size: 24px; font-weight: 400; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* 新闻轮播简介最多显示五行，超出内容使用省略号隐藏。 */
.featured-copy p { margin: 0; display: -webkit-box; overflow: hidden; color: #777; font-size: 16px; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.featured-slide, .featured-images img { display: none; }
.featured-slide.active, .featured-images img.active { display: block; }
.featured-images { height: 480px; overflow: hidden; }
.featured-images img { width: 100%; height: 100%; object-fit: cover; }
.news-pager { position: absolute; bottom: 34px; display: flex; align-items: center; gap: 14px; color: var(--muted); }
.news-pager button { padding: 0; color: var(--muted); font-size: 28px; line-height: 1; border: 0; background: transparent; cursor: pointer; }
.news-pager .news-page { min-width: 18px; font-size: 18px; }
.news-pager .active { color: var(--blue); }
.news-grid { margin-top: 100px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 86px; }
.news-card-link { position: relative; min-width: 0; display: block; }
.news-card-link + .news-card-link::before { position: absolute; top: 0; bottom: 89px; left: -43px; width: 1px; content: ""; background: var(--line); }
.news-card { min-width: 0; transition: transform .25s ease; }
.news-card > img { width: 100%; aspect-ratio: 1.7; object-fit: cover; transition: transform .3s ease, box-shadow .3s ease; }
.news-card-copy { display: grid; grid-template-columns: 76px 1fr; gap: 24px; padding-top: 10px; }
/* 新闻卡片标题最多显示两行；取消网格纵向拉伸并将高度限制为两倍行高，避免 Safari 露出第三行文字。 */
.news-card-copy h3 { margin: 11px 0 0; align-self: start; display: -webkit-box; max-height: 60px; overflow: hidden; font-size: 18px; font-weight: 400; line-height: 30px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; transition: color .25s ease, transform .25s ease; }
/* 新闻卡片：整卡上浮，但阴影仅作用于图片，文字区域始终保持透明。 */
.news-card-link:hover .news-card, .news-card-link:focus-visible .news-card { transform: translateY(-8px); }
.news-card-link:hover .news-card > img, .news-card-link:focus-visible .news-card > img { transform: scale(1.04); box-shadow: 0 12px 24px rgba(22, 92, 145, .16); }
.news-card-link:hover .news-card-copy h3, .news-card-link:focus-visible .news-card-copy h3 { color: var(--blue); transform: translateX(6px); }
.news-card-link:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.featured-news h3 a, .academic h3 a { transition: color .2s ease; }
.featured-news h3 a:hover, .academic h3 a:hover { color: var(--blue); }

/* 设计稿在 1920 像素画布中将新闻区向右延展，单独还原其 1620 像素内容宽度。 */
html.is-pc .news .page-width { width: 1620px; margin-left: 240px; margin-right: 0; }
html.is-pc .featured-news { grid-template-columns: 554px 820px; }

/* 通知公告：首次直接显示，不播放渐显动画；默认橙色竖线，悬停或键盘聚焦时切换为蓝色激活态。 */
.notice { padding: 30px 0 0; }
.notice-grid { margin-top: 40px; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 60px; row-gap: 40px; }
.notice-item { position: relative; min-height: 120px; padding: 14px 0 14px 14px; display: grid; grid-template-columns: 90px 1fr; gap: 24px; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: border-color .2s ease; }
.notice-item::before { position: absolute; top: 30px; bottom: 30px; left: 0; width: 4px; content: ""; background: var(--orange); transition: background-color .2s ease; }
.notice-item:hover, .notice-item:focus-within { border-color: #165c91; }
.notice-item:hover::before, .notice-item:focus-within::before { background: var(--blue); }
/* 通知公告标题最多显示两行，超出内容使用省略号隐藏。 */
.notice-item h3 { margin: 0; display: -webkit-box; overflow: hidden; font-size: 18px; font-weight: 400; line-height: 30px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

/* 学术动态：顶部左右分栏，底部三张图片保持设计稿比例。 */
.academic { padding-top: 60px; }
.academic-top { display: grid; grid-template-columns: 720px 1fr; height: 640px; }
.academic-featured-image { width: 720px; height: 640px; object-fit: cover; }
.academic-intro { position: relative; padding: 0 40px; overflow: hidden; }
.academic-decoration { position: absolute; z-index: -1; top: -100px; right: -240px; width: 644px; opacity: .72; }
.academic-intro article { margin-top: 235px; }
/* 学术动态主标题最多显示两行，超出内容使用省略号隐藏。 */
.academic-intro article h3 { margin: 0 0 30px; display: -webkit-box; max-width: 550px; overflow: hidden; font-size: 18px; font-weight: 400; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.academic-intro article p { margin: 0; color: #777; font-size: 16px; line-height: 1.9; }
.academic-grid { display: grid; grid-template-columns: 360px 360px 1fr; height: 640px; }
.academic-card { position: relative; overflow: hidden; }
.academic-card img { width: 100%; height: 100%; object-fit: cover; }
.academic-card::after { position: absolute; inset: 42% 0 0; content: ""; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .82)); }
/* 学术动态卡片标题最多显示两行，超出内容使用省略号隐藏。 */
.academic-card h3 { position: absolute; z-index: 1; right: 50px; bottom: 54px; left: 50px; margin: 0; display: -webkit-box; overflow: hidden; color: #fff; font-size: 18px; font-weight: 400; line-height: 30px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.academic-card.wide h3 { left: 80px; }

/* 实验平台：背景图内部已包含遮罩，文字直接叠加以保持清晰。 */
.laboratories { margin-top: 100px; display: grid; grid-template-columns: repeat(2, 1fr); }
.laboratory-card { min-width: 0; height: 400px; color: #fff; background-position: center; background-size: cover; }
.teaching-lab { background-image: url("../images/teaching-laboratory.png"); }
.key-lab { background-image: url("../images/key-laboratory.png"); }
.laboratory-inner { padding: 60px; }
.laboratory-card h2 { margin: 0; font-size: 24px; font-weight: 400; line-height: 34px; }
.laboratory-card .more-link { margin-top: 20px; }
.laboratory-stats { margin-top: 95px; display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.laboratory-stats div { display: flex; flex-direction: column; gap: 4px; }
.laboratory-stats strong { font-size: 48px; font-weight: 400; line-height: 60px; }
.laboratory-stats small { font-size: 20px; font-weight: 400; }
.laboratory-stats span { font-size: 18px; }

/* 教学系入口：桌面四等分，悬停时采用设计稿蓝色选中状态。 */
.departments { margin-top: 60px; display: grid; grid-template-columns: repeat(4, 1fr); }
.departments > a { min-width: 0; height: 80px; padding: 0 60px; display: flex; align-items: center; gap: 20px; border-right: 1px solid var(--line); transition: color .2s ease, background .2s ease; }
.departments > a:last-child { border-right: 0; }
.departments > a > img:first-child { width: 34px; height: 34px; }
.departments span { min-width: 0; display: flex; flex-direction: column; }
.departments strong { font-size: 24px; font-weight: 400; line-height: 34px; white-space: nowrap; }
.departments small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.departments .department-plus { width: 24px; height: 24px; margin-left: auto; }
.departments > a:hover { color: #fff; background: var(--blue); }
.departments > a:hover small { color: rgba(255, 255, 255, .72); }
.departments > a:hover img { filter: brightness(0) invert(1); }
/* 禁用入口沿用机构设置页状态，禁止点击并保持默认视觉。 */
.departments > a.is-disabled { color: #999; cursor: default; opacity: .62; pointer-events: none; }
.departments > a.is-disabled:hover { color: #999; background: transparent; }
.departments > a.is-disabled:hover small { color: var(--muted); }
.departments > a.is-disabled:hover img { filter: none; }

/* 关于我们：背景图已有暗色处理，统计数据以四列两行显示。 */
.about { height: 600px; margin-top: 60px; padding-top: 80px; color: #fff; background: url("../images/about-background.png") center / cover no-repeat; }
.about .section-heading { width: max-content; margin: 0 auto; }
.about .section-heading h2::after { background: var(--orange); }
.about .section-heading p { color: rgba(255, 255, 255, .6); }
.about-stats { margin-top: 58px; display: grid; grid-template-columns: repeat(4, 1fr); row-gap: 38px; text-align: center; }
.about-stats div { display: flex; flex-direction: column; gap: 4px; }
.about-stats strong { min-height: 70px; font-size: 48px; font-weight: 400; line-height: 70px; }
.about-stats small { font-size: 20px; font-weight: 400; }
.about-stats span { font-size: 18px; }

/* 手机端固定布局：仅由公共脚本判断设备，不随分辨率和浏览器缩放重新排版。 */
html.is-mobile .page-width { width: calc(100% - 32px); }
/* 手机端将品牌栏与横幅分行，图片按原始比例展示，避免 cover 裁切两侧内容。
   轮播图片占用同一网格，按最高图片预留空间，切换不同比例的图片时页面不会跳动。 */
html.is-mobile body .hero,
html.is-mobile body .hero.inner-hero { height: auto; display: grid; grid-template-columns: minmax(0, 1fr); }
html.is-mobile .hero-banner-image { position: relative; inset: auto; grid-area: 2 / 1; align-self: center; width: 100%; height: auto; object-fit: contain; object-position: center; }
/* 手机端导航收进汉堡菜单，轮播圆点仍居中显示在横幅底部。 */
html.is-mobile .banner-dots { bottom: 0; }
html.is-mobile body .hero .header-bar { grid-area: 1 / 1; height: 76px; padding: 15px 16px; align-items: center; background: var(--blue); backdrop-filter: none; }
html.is-mobile .brand { height: 46px; }
/* 手机端分别保持校徽与院徽原有尺寸。 */
html.is-mobile .brand img:first-child { width: 104px; }
html.is-mobile .brand img:last-child { width: 119px; }
html.is-mobile .brand > a:first-child img { width: 104px; }
html.is-mobile .brand > a:last-child img { width: 119px; }
html.is-mobile .brand-divider { height: 38px; margin: 0 7px; }
html.is-mobile .header-tools { display: none; }
html.is-mobile .section-heading h2 { font-size: 22px; }
html.is-mobile .section-heading p { font-size: 14px; line-height: 26px; }
html.is-mobile .more-link { margin-top: 22px; }

html.is-mobile .news { padding: 56px 0; }
html.is-mobile .news-feature-row { display: block; }
html.is-mobile .featured-news { height: auto; margin-top: 36px; display: flex; flex-direction: column-reverse; }
html.is-mobile .featured-images { height: auto; aspect-ratio: 1.7; }
html.is-mobile .featured-copy { padding: 24px 0 48px; border-left: 0; }
html.is-mobile .featured-copy h3 { margin: 18px 0 12px; font-size: 20px; }
html.is-mobile .featured-copy p { -webkit-line-clamp: 5; }
html.is-mobile .news-pager { bottom: 4px; }
html.is-mobile .news-grid { margin-top: 42px; display: block; }
html.is-mobile .news-card { padding: 24px 0; border-top: 1px solid var(--line); }
html.is-mobile .news-card-link + .news-card-link::before { display: none; }
html.is-mobile .news-card-copy { grid-template-columns: 70px 1fr; gap: 16px; }

html.is-mobile .notice { padding-top: 56px; }
html.is-mobile .notice-grid { margin-top: 36px; display: block; }
html.is-mobile .notice-item { grid-template-columns: 72px 1fr; gap: 14px; margin-bottom: 18px; }
html.is-mobile .notice-item h3 { font-size: 16px; line-height: 26px; }
html.is-mobile .notice-item time strong { font-size: 38px; }

html.is-mobile .academic { padding-top: 56px; }
html.is-mobile .academic-top { height: auto; display: flex; flex-direction: column; }
html.is-mobile .academic-featured-image { width: 100%; height: auto; aspect-ratio: 1.1; }
html.is-mobile .academic-intro { padding: 34px 0 40px; }
html.is-mobile .academic-decoration { top: -40px; right: -250px; }
html.is-mobile .academic-intro article { margin-top: 52px; }
html.is-mobile .academic-intro article h3 { line-height: 28px; }
html.is-mobile .academic-grid { height: auto; display: block; }
html.is-mobile .academic-card { height: 360px; }
html.is-mobile .academic-card h3, html.is-mobile .academic-card.wide h3 { right: 24px; bottom: 28px; left: 24px; }

html.is-mobile .laboratories { margin-top: 56px; display: block; }
html.is-mobile .laboratory-card { height: auto; min-height: 430px; }
html.is-mobile .laboratory-inner { padding: 42px 20px; }
html.is-mobile .laboratory-card h2 { min-height: 68px; font-size: 20px; }
html.is-mobile .laboratory-stats { margin-top: 80px; grid-template-columns: repeat(2, 1fr); row-gap: 30px; }
html.is-mobile .laboratory-stats strong { font-size: 38px; }
html.is-mobile .laboratory-stats span { font-size: 16px; }

html.is-mobile .departments { margin-top: 30px; display: block; }
html.is-mobile .departments > a { height: 90px; padding: 0 24px; border-right: 0; border-bottom: 1px solid var(--line); }
html.is-mobile .departments strong { font-size: 20px; }

html.is-mobile .about { height: auto; min-height: 760px; margin-top: 30px; padding: 56px 0; }
html.is-mobile .about-stats { margin-top: 42px; grid-template-columns: repeat(2, 1fr); gap: 28px 12px; }
html.is-mobile .about-stats strong { min-height: 52px; font-size: 30px; line-height: 52px; }
html.is-mobile .about-stats span { font-size: 14px; line-height: 22px; }
