/* --- 1. 基础设置 --- */
:root {
    --primary-blue: #0056b3;
    --primary-accent: #0066cc;
    --text-main: #222;
    --text-light: #555;
    --text-date: #888;
    --bg-color: #ffffff;
    --sidebar-width: 260px;
    --nav-height: 54px;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: 1px solid rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
    scroll-behavior: smooth; /* 平滑滚动 */
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--glass-bg);
    backdrop-filter: blur(20px); /* 核心：Apple磨砂效果 */
    -webkit-backdrop-filter: blur(20px);
    border-bottom: var(--glass-border);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-inner {
    display: flex;
    gap: 40px;
    font-size: 13px;
    font-weight: 500;
}

.nav-link {
    color: var(--text-main);
    opacity: 0.8;
}

.nav-link:hover {
    opacity: 1;
    color: var(--primary-accent);
}

.nav-link.active {
    opacity: 1;
    color: var(--primary-accent);
    font-weight: 600;
}

/* --- 2. 布局结构 --- */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 60px) 24px 60px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
}

/* --- 3. 左侧边栏 (Sidebar) --- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

.sidebar-sticky {
    position: sticky;
    top: 40px;
}

.profile-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 25px;
    border: 1px solid #f0f0f0;
}

.name {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #000;
    letter-spacing: -0.5px;
}

.role {
    font-size: 15px;
    color: #444;
    margin-bottom: 5px;
    font-weight: 500;
}

.affiliation {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.4;
}

.contact-list {
    font-size: 13px;
    color: #555;
    margin-bottom: 30px;
}

.contact-list p {
    margin: 6px 0;
    display: flex;
    align-items: center;
    word-break: break-all;
}

.contact-list i {
    width: 20px;
    color: #999;
    margin-right: 5px;
    flex-shrink: 0;
}

.social-icons {
    margin-bottom: 40px;
}

.social-icons a {
    font-size: 18px;
    color: #555;
    margin-right: 15px;
}

.social-icons a:hover {
    color: var(--primary-blue);
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 2px solid #f0f0f0;
}

.nav-item {
    padding: 4px 0 4px 20px;
    color: #777;
    font-weight: 500;
    font-size: 14px;
    border-left: 3px solid transparent;
    margin-left: -2.5px;
}

.nav-item:hover {
    color: var(--primary-blue);
}

/* 简单的高亮效果，实际滚动监听需要JS，这里仅做样式 */
.nav-item.active {
    color: var(--primary-blue);
    border-left-color: var(--primary-blue);
}

/* --- 4. 右侧主内容 --- */
.main-content {
    flex: 1;
    max-width: 780px;
}

.contact-list p {
    font-size: 14px;
}

section {
    margin-bottom: 60px;
}

h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #111;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* 内容通用 */
p {
    text-align: justify;
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 15px;
}

ul {
    padding-left: 18px;
    margin-bottom: 15px;
}

li {
    margin-bottom: 8px;
    font-size: 15px;
    color: #333;
}

/* News 样式 */
.news-row {
    display: flex;
    margin-bottom: 15px;
    align-items: baseline;
}

.news-date {
    width: 110px;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--text-date);
    font-family: 'Inter', monospace;
    font-weight: 500;
}

.news-text {
    font-size: 14px;
    color: #333;
}

/* News 滑动条容器 */
.news-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
}

.news-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.news-scroll-container::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.news-scroll-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.news-scroll-item {
    flex-shrink: 0;
    width: 280px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--primary-blue);
}

.news-scroll-date {
    font-size: 13px;
    color: var(--text-date);
    font-family: monospace;
    margin-bottom: 6px;
}

.news-scroll-text {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

/* Publications 样式 */

.pub-header {
  display: flex;
  justify-content: space-between; /* 左右分开 */
  align-items: center;            /* 垂直对齐 */
}

.view-all {
  font-size: 14px;
  color: #666;
}

.pub-item {
    display: flex;
    gap: 20px;
    margin-bottom: 35px;
    align-items: stretch;
}

.pub-img {
    position: relative;
    width: 200px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.pub-img:hover {
    transform: scale(1.05);
}

.pub-img img {
    width: 100%;
    display: block;
    border-radius: 6px;
    border: 1px solid #eee;
}

.pub-img-badge {
    position: absolute;
    top: 8px;
    left: -8px;
    background: linear-gradient(135deg, #2158b1 0%, #0a57e6 100%);
    color: #fff;
    padding: 3.5px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 4px 4px 4px 0;
    box-shadow: 0 4px 12px rgba(43, 82, 152, 0.3);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pub-img-badge::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    border-top: 6px solid #0d1e40;
    border-left: 8px solid transparent;
}

.pub-details {
    flex: 1;
}

.pub-title {
    font-size: 17px;
    font-weight: 700;
    color: #000;
    margin-bottom: 6px;
    line-height: 1.4;
}

.pub-authors {
    font-size: 15px;
    color: #444;
    margin-bottom: 6px;
}

.pub-venue {
    font-size: 14px;
    font-style: italic;
    color: #666;
    margin-bottom: 6px;
}

.pub-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pub-btn {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary-blue);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

.pub-btn:hover {
    text-decoration: underline;
}

/* 这种样式模拟 [PDF] */
.pub-btn::before {
    content: "[";
    color: #999;
}

.pub-btn::after {
    content: "]";
    color: #999;
}

/* Experience 样式 */
.exp-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.exp-logo {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exp-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.exp-content {
    flex: 1;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

.exp-org {
    font-weight: 700;
    font-size: 15px;
    color: #000;
}

.exp-time {
    font-size: 13px;
    color: #888;
    font-family: monospace;
}

.exp-role {
    font-size: 14px;
    color: var(--primary-blue);
    font-weight: 500;
    margin-bottom: 8px;
}

.exp-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* Teaching 样式 */
.teach-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.teach-title {
    font-size: 15px;
    color: #000;
    flex: 1;
}

.teach-time {
    font-size: 14px;
    color: #888;
    font-family: monospace;
    white-space: nowrap;
    margin-left: 20px;
}

/* Awards 样式 */
.award-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 15px;
}

.award-name {
    color: #333;
}

.award-date {
    color: #888;
    font-family: monospace;
    font-size: 14px;
    min-width: 80px;
    text-align: right;
}

/* Modal 样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.modal-content h3 {
    margin: 5px 0;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.citation-text {
    background: #f8f9fa;
    padding: 15px;
    margin: 10px 0;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.copy-btn {
    background: var(--primary-blue);
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    float: right;
}

/* 语言切换按钮 */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.section-title h2 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
    margin-bottom: 3px;
}

.lang-switch a {
    color: var(--primary-blue);
    text-decoration: none;
}

.lang-switch a:hover {
    text-decoration: underline;
}

.lang-switch span {
    color: #ccc;
}

@media (max-width: 850px) {
    .container {
        display: block;
        padding: calc(var(--nav-height) + 20px) 20px 40px;
    }

    /* Sidebar 移到顶部 */
    .sidebar {
        display: block;
        width: 100%;
        margin-bottom: 30px;
    }

    .sidebar-sticky {
        position: static;
        text-align: center;
    }

    .profile-photo {
        width: 100px;
        height: 100px;
        margin: 0 auto 12px auto;
    }

    .name {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .role {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .affiliation {
        font-size: 13px;
        margin-bottom: 15px;
    }

    .contact-list {
        font-size: 12px;
        margin-bottom: 15px;
    }

    .contact-list p {
        justify-content: center;
    }

    .social-icons {
        margin-bottom: 20px;
        padding-left: 25px;
    }

    .nav-menu {
        display: none; /* 隐藏侧边导航，用顶部导航 */
    }

    .main-content {
        max-width: 100%;
        width: 100%;
    }

    section {
        margin-bottom: 35px;
    }

    h2 {
        font-size: 20px;
    }

    .news-row {
        flex-direction: column;
        gap: 4px;
    }

    .news-date {
        width: auto;
    }

    /* News 移动端保持滚动 */
    .news-scroll-item {
        width: 220px;
    }

    .exp-item {
        flex-direction: row;
        gap: 12px;
    }

    .exp-logo {
        width: 40px;
        height: 40px;
    }

    .exp-header {
        flex-direction: column;
        gap: 4px;
    }

    .exp-time {
        font-size: 12px;
    }

    .exp-desc {
        margin-left: 0;
    }

    .teach-item {
        flex-direction: column;
        gap: 4px;
    }

    .teach-time {
        margin-left: 0;
        font-size: 12px;
    }

    .award-row {
        flex-direction: column;
        gap: 4px;
    }

    .award-date {
        text-align: left;
    }

    .pub-item {
        flex-direction: column;
    }

    .pub-img {
        width: 100%;
        max-width: 250px;
        margin: 0 auto 15px;
    }
}

/* 更小屏幕的优化 */
@media (max-width: 480px) {
    .container {
        padding: calc(var(--nav-height) + 20px) 16px 30px;
    }

    h2 {
        font-size: 18px;
        padding-bottom: 8px;
    }

    p {
        font-size: 14px;
    }

    li {
        font-size: 14px;
    }

    .pub-title {
        font-size: 15px;
    }

    .pub-authors {
        font-size: 13px;
    }

    .pub-venue {
        font-size: 12px;
    }

    .pub-links {
        gap: 8px;
    }
}