/* --- 全局样式 --- */
body {
    /* ✒️ 修改：在字体列表中优先加入楷体，并微调了行高和字间距 */
    font-family:  "Georgia","KaiTi", "STKaiti", "SimSun", "STSong", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    line-height: 1.2; /* 📏 调整：增加了行高 */
    letter-spacing: 0.5px; /* 📏 调整：增加了字间距 */
    margin: 0;
    font-size: 16px;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

/* ✨ 新增：为段落增加下边距，让段落感更清晰 */
p {
    margin-bottom: 0.5em;
}

/* --- 容器样式 --- */
.container {
    max-width: 1440px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,.1);
    border-radius: 8px;
}

/* --- 头部样式 --- */
header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
header h1 {
    margin: 0;
    font-size: 3.5em;
    color: #2c3e50;
}
header .affiliation {
    font-size: 1.5em;
    color: #555;
    margin-top: 5px;
}

/* --- 导航栏样式 --- */
.main-nav {
    margin-top: 20px;
}
.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 0;
    background-color: #f8f9fa;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.main-nav li {
    flex: 1;
}
.main-nav a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: all 0.3s ease;
    border-right: 1px solid #e9ecef;
}
.main-nav li:last-child a {
    border-right: none;
}
.main-nav a:hover {
    background-color: #3498db;
    color: white;
    transform: translateY(-2px);
}
.main-nav a:active {
    transform: translateY(0);
}

/* --- 主体布局 --- */
.main-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}
.sidebar {
    flex: 1;
    min-width: 200px;
    text-align: center;
}
.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin-bottom: 20px;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-height: 240px; /* 设置最大高度，确保切换时侧边栏宽度不变 */
}
.profile-pic:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}
.sidebar h3 {
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
    color: #2c3e50;
}
.contact-info ul, .links ul {
    list-style-type: none;
    padding: 0;
    text-align: center;
}
.contact-info li, .links li {
    margin-bottom: 8px;
    display: block;
    text-align: center;
}
.contact-info a, .links a {
    text-decoration: none;
    color: #3498db;
}
.contact-info a:hover, .links a:hover {
    text-decoration: underline;
}

/* 邮箱列表样式 */
.email-list {
    margin: 6px 0 0 0;
    padding-left: 18px; /* 让邮箱列表相对于父项缩进 */
}
.email-list li {
    margin: 4px 0;
    list-style: none; /* 去掉默认圆点 */
}
.email-list a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}
.email-list a:hover {
    text-decoration: underline;
}

/* 链接图标已内置在HTML中，这里只需要调整样式 */
.links a {
    display: block;
    text-align: center;
    padding: 4px 0;
    font-weight: 500;
}

.links a:hover {
    color: #2980b9;
    transform: translateX(2px);
    transition: all 0.2s ease;
}

/* 照片注释样式 */
.photo-caption {
    text-align: center;
    margin-top: 5px;
    margin-bottom: 15px;
}

.photo-caption small {
    color: #666;
    font-size: 0.8em;
    font-style: italic;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    /* 新增样式 */
    max-width: 180px; /* 设置最大宽度为240像素 */
    width: 100%; /* 确保它能自适应父容器，同时不超过240px */
    display: block; /* 确保它能独占一行，从而实现换行效果 */
}

.photo-caption small .lang-cn,
.photo-caption small .lang-en {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    display: inline;
}

.main-content {
    flex: 3;
}
section {
    margin-bottom: 30px;
}
h2 {
    font-size: 1.8em;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-top: 0;
}
.publications-list {
    list-style-type: decimal;
    padding-left: 20px;
}
.publications-list li {
    margin-bottom: 15px;
}
.publications-list li strong {
    color: #333;
}
.publications-list li em {
    color: #555;
}

/* --- 研究方向列表样式 --- */
.research-list {
    list-style: none;
    padding: 0;
}

.research-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.research-list li:hover {
    background-color: #f8f9fa;
    padding-left: 10px;
    border-radius: 5px;
}

.research-list li:last-child {
    border-bottom: none;
}

/* --- 教育和工作经历样式 --- */
.subsection {
    margin-bottom: 25px;
}

.subsection h3 {
    font-size: 1.7em;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid #3498db;
}

/* 时间线样式 */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #3498db, #2980b9);
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
    padding-left: 25px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 8px;
    width: 12px;
    height: 12px;
    background: #3498db;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #3498db;
}

.timeline-date {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
    margin-bottom: 5px;
}

.timeline-content h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.timeline-content p {
    margin: 5px 0;
    color: #555;
}

.timeline-content .description {
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
}

/* 获奖荣誉样式 */
.awards-list {
    list-style: none;
    padding: 0;
}

.awards-list li {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.awards-list li:last-child {
    border-bottom: none;
}

.award-year {
    font-weight: 600;
    color: #3498db;
    min-width: 60px;
    margin-right: 15px;
}

.award-name {
    font-weight: 500;
    color: #2c3e50;
    flex: 1;
}

.award-org {
    color: #666;
    font-size: 0.9em;
}

/* --- 论文部分样式 --- */
.no-publications {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    margin: 20px 0;
    border: 2px dashed #dee2e6;
}

.no-papers-text {
    font-size: 1.2em;
    color: #6c757d;
    margin-bottom: 20px;
    font-weight: 500;
}

.crying-emojis {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.emoji {
    font-size: 2.5em;
    animation: cry 2s ease-in-out infinite;
}

.emoji:nth-child(1) { animation-delay: 0s; }
.emoji:nth-child(2) { animation-delay: 0.5s; }
.emoji:nth-child(3) { animation-delay: 1s; }
.emoji:nth-child(4) { animation-delay: 1.5s; }

@keyframes cry {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* --- 教学部分样式 --- */
.no-teaching {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 15px;
    margin: 20px 0;
    border: 2px dashed #f39c12;
}

.no-teaching-text {
    font-size: 1.2em;
    color: #8b4513;
    margin-bottom: 20px;
    font-weight: 500;
}

.awkward-emojis {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.awkward-emojis .emoji {
    font-size: 2.5em;
    animation: shrug 2.5s ease-in-out infinite;
}

.awkward-emojis .emoji:nth-child(1) { animation-delay: 0s; }
.awkward-emojis .emoji:nth-child(2) { animation-delay: 0.7s; }
.awkward-emojis .emoji:nth-child(3) { animation-delay: 1.4s; }
.awkward-emojis .emoji:nth-child(4) { animation-delay: 2.1s; }

@keyframes shrug {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-5deg) scale(1.05); }
    50% { transform: rotate(5deg) scale(1.1); }
    75% { transform: rotate(-3deg) scale(1.05); }
}

.future-text {
    font-size: 1em;
    color: #27ae60;
    margin-top: 15px;
    font-weight: 600;
}

/* --- MathJax 样式 --- */
mjx-container {
    font-size: 1.1em !important;
    display: inline-block !important;
    vertical-align: baseline !important;
}

mjx-chtml {
    font-size: inherit !important;
    display: inline !important;
}

/* 确保数学公式在列表中的对齐 */
.research-list li mjx-container {
    vertical-align: middle;
    margin-left: 5px;
}

/* MathJax 容器样式 */
mjx-container[jax="SVG"] {
    display: inline-block;
    vertical-align: baseline;
}

mjx-container[jax="CHTML"] {
    display: inline;
    font-size: inherit;
}

/* 确保MathJax在所有元素中正确显示 */
* mjx-container {
    display: inline-block !important;
}

* mjx-chtml {
    display: inline !important;
}

/* --- 页脚 --- */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #eee;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

/* 页面统计样式 */
.page-stats {
    margin-bottom: 15px;
}

.stats-text {
    font-size: 1.1em;
    color: #495057;
    margin: 0;
    font-weight: 500;
}

.stats-text span {
    display: inline-block;
    transition: color 0.3s ease;
}

.stats-text:hover span {
    color: #007bff;
}

/* 版权信息样式 */
footer p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9em;
}

/* 统计说明样式 */
.stats-note {
    margin-top: 8px;
}

.stats-note small {
    color: #868e96;
    font-style: italic;
}

/* 计数器容器样式 */
.counter-container {
    margin: 10px 0;
    text-align: center;
}

.counter-display {
    display: inline-block;
    margin: 5px 15px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    border: 1px solid #dee2e6;
    font-size: 0.9em;
    color: #495057;
}

.counter-number {
    font-weight: bold;
    color: #007bff;
    font-size: 1.1em;
}

/* HitWebCounter样式 */
.hit-counter {
    margin: 10px 0;
    text-align: center;
}

.hit-counter img {
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 计数器占位符样式 */
.counter-placeholder {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 2px dashed #dee2e6;
    margin: 10px 0;
}

.counter-number-display {
    font-size: 1.1em;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.counter-setup-note {
    font-size: 0.85em;
    color: #868e96;
}

.counter-setup-note small {
    font-style: italic;
}

/* GitHub计数器样式 */
.ga-counter-display {
    text-align: center;
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border-radius: 10px;
    border: 2px solid #28a745;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 计数器网格布局 */
.counter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

/* 计数器行布局 */
.counter-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: stretch;
}

/* 单个计数器项目 */
.counter-item {
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(40, 167, 69, 0.3);
    flex: 1;
    min-width: 120px;
}

.counter-label {
    display: block;
    font-size: 0.9em;
    color: #155724;
    font-weight: 600;
    margin-bottom: 5px;
}

.counter-item .counter-number {
    color: #28a745;
    font-size: 1.4em;
    font-weight: bold;
    display: block;
}

/* 操作按钮区域 */
.counter-actions {
    text-align: center;
    margin-bottom: 10px;
}

/* --- 报告和演讲部分样式 --- */
.no-talks {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border-radius: 15px;
    margin: 20px 0;
    border: 2px dashed #28a745;
}

.no-talks-text {
    font-size: 1.2em;
    color: #155724;
    margin-bottom: 20px;
    font-weight: 500;
}

.talking-emojis {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.talking-emojis .emoji {
    font-size: 2.5em;
    animation: talk 2.5s ease-in-out infinite;
}

.talking-emojis .emoji:nth-child(1) { animation-delay: 0s; }
.talking-emojis .emoji:nth-child(2) { animation-delay: 0.7s; }
.talking-emojis .emoji:nth-child(3) { animation-delay: 1.4s; }
.talking-emojis .emoji:nth-child(4) { animation-delay: 2.1s; }

@keyframes talk {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(2deg); }
    50% { transform: scale(1.15) rotate(0deg); }
    75% { transform: scale(1.1) rotate(-2deg); }
}

.talks-list {
    list-style-type: decimal;
    padding-left: 20px;
    margin: 20px 0;
    max-height: 400px; /* 限制最大高度，大约能显示4个演讲 */
    overflow-y: auto; /* 添加垂直滚动条 */
    overflow-x: hidden;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #3498db #f1f1f1; /* Firefox */
}

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

.talks-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.talks-list::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.talks-list::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

.talks-list li {
    margin-bottom: 15px;
    line-height: 1.6;
}

.talks-list li strong {
    color: #2c3e50;
    font-weight: 600;
}

.talks-list li em {
    color: #7f8c8d;
    font-style: italic;
}

/* --- 演讲类别分组样式 --- */
.talks-category {
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background: #fafbfc;
}

.talks-category h3 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.4em;
}

/* 隐藏的演讲样式 */
.talks-hidden {
    display: none;
}

/* 切换按钮样式 */
.toggle-talks-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    margin-top: 15px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-talks-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.toggle-talks-btn .arrow {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.toggle-talks-btn.expanded .arrow {
    transform: rotate(180deg);
}

/* --- 响应式设计 */
@media (max-width: 768px) {
    .counter-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .counter-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .counter-item {
        padding: 8px;
        min-width: auto;
    }
    
    .counter-label {
        font-size: 0.85em;
    }
    
    .counter-item .counter-number {
        font-size: 1.2em;
    }
    
    /* 导航栏响应式 */
    .main-nav ul {
        flex-direction: column;
        border-radius: 10px;
    }
    .main-nav a {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding: 15px 20px;
    }
    .main-nav li:last-child a {
        border-bottom: none;
    }
    
    /* 头像响应式 */
    .profile-pic {
        width: 120px;
        height: 120px;
        max-height: 160px; /* 移动端最大高度 */
    }
}

/* --- 项目与创造模块样式 --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.project-card {
    background: #fafbfc;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.project-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2em;
    flex: 1;
}

.project-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tag {
    background: #3498db;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

.project-description {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.project-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.project-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: #21618c;
    text-decoration: underline;
}

.more-projects {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.more-projects-text {
    color: #6c757d;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.project-emojis {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.emoji {
    font-size: 1.5em;
    animation: bounce 2s infinite;
}

.emoji:nth-child(2) { animation-delay: 0.2s; }
.emoji:nth-child(3) { animation-delay: 0.4s; }
.emoji:nth-child(4) { animation-delay: 0.6s; }

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 项目模块响应式设计 */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .project-card {
        padding: 15px;
    }
    
    .project-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .project-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .project-link {
        padding: 5px 0;
    }
}