/* v0.3 现代化样式 - 保持红色+灰色主题 */
/* 基于v0.2优化，添加现代视觉效果 */

/* Google Fonts 已移除（国内加载缓慢，使用本地 fallback）
   fallback: 'Microsoft Yahei', 'PingFang SC', Arial, sans-serif
   如需恢复，取消下行注释：
   @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');
*/

/* CSS变量定义 */
:root {
    --primary-red: #ba2a17;
    --dark-red: #9a2312;
    --light-red: #d44433;
    --bg-gray: #f5f5f5;
    --card-bg: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', 'Microsoft Yahei', 'PingFang SC', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-gray);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 头部样式 ==================== */
#header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(186, 42, 23, 0.3);
}

#header .container {
    display: flex;
    align-items: center;
    gap: 20px;
}

#logo img {
    height: 60px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: var(--transition);
}

#logo:hover img {
    transform: scale(1.05);
}

#labname img {
    height: 50px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* 头部右侧工具栏 */
.header-tools {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

/* 搜索框 */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 200px;
    padding: 8px 15px 8px 35px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box input:focus {
    width: 250px;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.search-box::before {
    content: "🔍";
    position: absolute;
    left: 10px;
    font-size: 14px;
    opacity: 0.7;
}

/* 语言切换 */
.lang-switch {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.15);
    padding: 5px;
    border-radius: 20px;
}

.lang-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    cursor: pointer;
    border-radius: 15px;
    transition: var(--transition);
}

.lang-btn.active {
    background: white;
    color: var(--primary-red);
    font-weight: 500;
}

.lang-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ==================== 导航样式 ==================== */
#nav {
    background: var(--text-dark);
    padding: 0;
    position: sticky;
    top: 90px;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#nav .container {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    gap: 0;
    flex: 1;
}

.nav-item {
    position: relative;
}

.nav-item a {
    display: block;
    padding: 15px 25px;
    color: white;
    font-size: 16px;
    font-weight: 400;
    transition: var(--transition);
    position: relative;
}

.nav-item a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary-red);
    transition: var(--transition);
}

.nav-item a:hover::after,
.nav-item.active a::after {
    width: 80%;
}

.nav-item a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active a {
    background: rgba(186, 42, 23, 0.2);
}

/* 汉堡菜单（移动端） */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
    position: relative;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    transition: var(--transition);
    border-radius: 2px;
}

/* ==================== Banner样式 ==================== */
#banner {
    height: 500px;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.banner-slide.active {
    opacity: 1;
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
}

.banner-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.banner-desc {
    font-size: 18px;
    opacity: 0.9;
}

/* Banner指示器 */
.banner-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.banner-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.banner-indicator.active {
    background: white;
    transform: scale(1.2);
}

/* ==================== 内容区域 ==================== */
#content {
    padding: 40px 0 0;
    min-height: 60vh;
}


/* ==================== 卡片样式 ==================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.card:hover .card-image {
    transform: scale(1.05);
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
    line-height: 1.4;
}

.card-meta {
    font-size: 14px;
    color: var(--text-lighter);
    margin-bottom: 10px;
}

.card-text {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
}

.news-card .card-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 简介页段落缩进 */
.brief-intro .card-text p {
    text-indent: 2em;
    margin-bottom: 12px;
}

.brief-intro .card-text p:last-child {
    margin-bottom: 0;
}

/* 简介页布局 */
.intro-content {
    max-width: 900px;
    margin: 0 auto;
}

.intro-card {
    padding: 40px;
    margin-bottom: 30px;
}

.intro-card .card-text {
    font-size: 16px;
    line-height: 2;
    text-align: justify;
}

/* ==================== 新闻列表 ==================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.news-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card .card-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.news-card .card-date {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-red);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* ==================== 成员列表 ==================== */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.member-card {
    text-align: center;
    padding: 30px 20px;
}

.member-card .member-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
    border: 4px solid var(--primary-red);
    transition: var(--transition);
}

.member-card:hover .member-photo {
    border-color: var(--light-red);
    transform: scale(1.05);
}

.member-card .member-name {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.member-card .member-title {
    font-size: 15px;
    color: var(--primary-red);
    margin-bottom: 10px;
    font-weight: 500;
}

.member-card .member-info {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

/* ==================== 全局标签按钮（统一 member/equipment/publication 的 tab-btn） ==================== */
.tabs-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: #f0f0f0;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-btn.active {
    background: #ba2a17;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #e0e0e0;
}

/* ==================== 研究成果 ==================== */
.publication-list {
    margin-top: 30px;
    min-height: 200px;
}

.publication-year {
    margin-bottom: 40px;
}

.publication-year h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-red);
    display: inline-block;
}

.publication-item {
    background: var(--card-bg);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-red);
    transition: var(--transition);
}

.publication-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(5px);
}

.publication-item .pub-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.publication-item .pub-authors {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.publication-item .pub-journal {
    font-size: 14px;
    color: var(--primary-red);
    font-style: italic;
}

/* ==================== 模态框（新闻详情） ==================== */
/* 模态框样式已移除 — newsModal 从未被 JS 激活使用 */

/* ==================== 搜索结果 ==================== */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--bg-gray);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.search-result-type {
    font-size: 12px;
    color: var(--primary-red);
    font-weight: 500;
}

/* ==================== 页脚 ==================== */
#footer {
    background: var(--text-dark);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

.footer-info h3 {
    font-size: 15px;
    font-weight: 400;
    margin-bottom: 5px;
    opacity: 0.8;
}

.footer-info p {
    font-size: 15px;
    line-height: 1.4;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    transition: var(--transition);
    white-space: nowrap;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    opacity: 0.6;
}

/* ==================== 全局无障碍与滚动条 ==================== */
/* 焦点样式（无障碍） */
:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* 滚动条样式（Webkit浏览器） */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-red);
}

/* ==================== 动画 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 滚动显示动画 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-red { color: var(--primary-red); }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 设备页特有样式 */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.equipment-card {
    height: 100%;
}

.equipment-category {
    margin-top: 40px;
}

.equipment-category:first-child {
    margin-top: 10px;
}

.equipment-cat-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-red);
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-red);
    display: inline-block;
    margin-bottom: 20px;
}

/* ==================== 联系我们 ==================== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.contact-card-text {
    font-size: 16px;
    line-height: 1.8;
}

/* ==================== 校友列表 ==================== */
.alumni-list-container {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.alumni-card {
    flex: 1;
    min-width: 280px;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.alumni-card h3 {
    color: var(--primary-red);
    margin-bottom: 16px;
    font-size: 18px;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 8px;
}

.alumni-card p {
    margin-bottom: 8px;
    line-height: 1.7;
    color: #333;
    font-size: 14px;
}

/* 成员邮箱样式 */
.member-email {
    margin-top: 10px;
    font-size: 13px;
    color: #999;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-lighter);
}

.empty-state p {
    font-size: 18px;
}

/* ==================== 新闻详情页 ==================== */
.news-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--primary-red);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.back-link:hover {
    text-decoration: underline;
}

.news-detail-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-dark);
}

.news-detail-date {
    font-size: 14px;
    color: #999;
    margin-bottom: 30px;
}

.news-detail-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-light);
}

.news-detail-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: var(--radius-md);
}

.news-detail-author {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: #999;
    text-align: right;
}

/* v0.2 正文内容样式（content_zh 内部 HTML）*/
.news-detail-body .news-content-text {
    margin-bottom: 15px;
    text-indent: 2em;
    line-height: 1.8;
}

.news-detail-body .news-content-pic {
    text-align: center;
    margin: 20px 0;
}

.news-detail-body .news-content-pic img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

/* ==================== 首页研究方向区域 - 2x2网格 ==================== */
#researchGrid {
    grid-template-columns: repeat(2, 1fr);
}

/* 首页最新动态区域 */
#latestNews {
    padding: 10px 0 60px;
    background: white;
}

/* 首页移除最小高度 */
#content.no-min-height {
    min-height: auto;
    padding-bottom: 40px;
}

/* ============ 页面标题区统一 ============ */
.content-header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.content-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-red);
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.content-header h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-red);
    border-radius: 2px;
}

/* 搜索定位高亮动画 */
@keyframes highlightPulse {
    0% {
        background: #fff3cd;
        box-shadow: 0 0 0 3px var(--primary-red);
    }
    100% {
        background: transparent;
        box-shadow: 0 0 0 0 transparent;
    }
}

.highlight {
    animation: highlightPulse 3s ease-out forwards;
    border-radius: var(--radius-sm);
}
