/* CSS Variables for theming */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --heading-color: #111111;
    --accent-color: #0056b3;
    --secondary-bg-color: #f8f9fa;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    margin: 0;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

h1, h2 {
    font-family: 'Merriweather', serif;
    color: var(--heading-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #007bff;
}

/* Controls */
.controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: var(--secondary-bg-color);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 1000;
}

.lang-switcher a {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-color);
    opacity: 0.7;
    text-decoration: none;
}

.lang-switcher a:hover {
    opacity: 1;
}

.lang-switcher a.active {
    opacity: 1;
    color: var(--accent-color);
}

.lang-switcher span {
    color: var(--border-color);
}

.theme-switcher {
    display: flex;
    gap: 10px;
}

.theme-button {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: transform 0.2s;
}
.theme-button:hover {
    transform: scale(1.1);
}
.theme-button.active {
    border-color: var(--accent-color);
}


/* Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-top: 60px;
}

.profile-pic {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--secondary-bg-color);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.profile-info h1 {
    margin: 0;
    border: none;
    font-size: 2.5em;
}

.profile-info .title {
    font-size: 1.1em;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

.profile-info .bio {
    margin-top: 15px;
    font-size: 1em;
}

.social-links {
    margin-top: 20px;
}

/* 为所有社交链接和地址项设置通用样式 */
.social-links > * {
    display: inline-flex; /* 使用Flex布局，方便对齐内部的图标和文字 */
    align-items: center; /* 垂直居中对齐 */
    font-size: 1.8em; /* 控制图标的大小 */
    margin-right: 20px;
    color: var(--text-color);
    opacity: 0.8;
    text-decoration: none; /* 确保链接也没有下划线 */
}

/* 仅为可点击的链接 a 标签设置悬停效果 */
.social-links a:hover {
    color: var(--accent-color);
    opacity: 1;
}

/* 专门为地址项里的文字设置样式 */
.location-item span {
    font-size: 0.6em; /* 文字大小是图标大小的一半 */
    margin-left: 8px; /* 在图标和文字之间增加一点间距 */
    font-family: 'Lato', sans-serif; /* 确保它使用正文字体 */
    font-weight: normal;
}

/* Lab Section */
.lab-section {
    margin-top: 20px;
    padding: 12px; /* 内边距 */
    background-color: var(--secondary-bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.lab-content {
    display: flex; /* 开启 Flexbox 布局 */
    align-items: center; /* 垂直居中对齐 */
    gap: 20px; /* 在文字和 Logo 之间创建一些间距 */
    flex-direction: row-reverse; /* 新增这一行，即可左右互换 */
}

.lab-text {
    flex: 4; 
    text-align: center;
}

.lab-text h2 {
    margin-top: 0; /* 移除标题的默认上边距 */
    border-bottom: none; /* 在这里我们不需要标题下划线 */
    padding-bottom: 5px;
    font-size: 1.5em;
}

.lab-text p {
    margin-bottom: 0;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.9;
}

.lab-logo-container {
    flex: 1.3;
    text-align: center; 
}

.lab-logo {
    max-width: 100%; /* Logo 最大宽度为其容器宽度 */
    height: auto; /* 高度自动缩放以保持比例 */
    max-height: 250px; /* 限制一个最大高度 */
    object-fit: contain;
    opacity: 1;
}


/* Publications */
#publications-list {
    list-style: none;
    padding-left: 0;
}

#publications-list li {
    margin-bottom: 25px;
    padding-left: 25px;
    position: relative;
    border-left: 3px solid var(--border-color);
}

#publications-list li::before {
    content: '■';
    position: absolute;
    left: -1px;
    top: 0px;
    color: var(--accent-color);
    font-size: 12px;
    transform: translateX(-50%);
    background-color: var(--bg-color);
    padding: 0 5px;
}

.pub-title {
    font-weight: bold;
    font-family: 'Merriweather', serif;
    font-size: 1.1em;
    color: var(--heading-color);
}

.pub-authors {
    margin: 5px 0;
    font-size: 0.95em;
}

.pub-authors strong {
    color: var(--accent-color);
}

.pub-venue {
    font-style: italic;
    color: #6c757d;
    font-size: 0.95em;
}

.pub-links {
    margin-top: 8px;
}

.pub-links a {
    margin-right: 15px;
    font-size: 0.9em;
    font-weight: bold;
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 5px;
    background-color: var(--secondary-bg-color);
}

.pub-links a:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-info h1 {
        font-size: 2em;
    }

    .controls {
        top: 10px;
        right: 10px;
    }
}

/* ==========================================================================
   Responsive Design - Media Queries
   ========================================================================== */

/* 当屏幕宽度小于等于 768px 时 (典型的平板电脑和手机) */
@media (max-width: 768px) {

    /* --- 调整实验室板块布局 --- */
    .lab-content {
        /* 核心改动：将主轴方向从横向 (row) 变为纵向 (column) */
        flex-direction: column;
        gap: 20px; /* 调整垂直方向的间距 */
    }

    .lab-text,
    .lab-logo-container {
        /* 在垂直布局下，让文字和Logo都居中显示，更美观 */
        text-align: center;
    }

    .lab-text {
        /* 确保文字和Logo之间有明确的间距 */
        margin-bottom: 20px;
    }

    /* --- 也可以顺便优化一下顶部的个人信息区 --- */
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .social-links {
        justify-content: center; /* 让社交图标也居中 */
        margin-top: 15px;
    }

    .location-item span {
        font-size: 0.6em; /* 在手机上可以稍微调大一点点地址文字 */
    }
}
