:root {
    --bg-color: #ffffff;
    --text-main: #4b5563;
    /* gray-600 */
    --text-sub: #9ca3af;
    /* gray-400 */
    --accent: #3F83F8;
    --card-bg: #fdfdfd;
    --loader-bg: #000000;
    --loader-text: #ffffff;
    --transition: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
    background-color: #ffffff;
    background-image: radial-gradient(rgba(63, 131, 248, 0.5) 1.5px, transparent 1.5px);
    background-size: 100px 100px;
    animation: speed-panning 40s linear infinite;
    color: var(--text-main);
}

@keyframes speed-panning {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 -500px;
    }
}

/* 全局加粗控制 */
strong,
b {
    color: #374151;
    font-weight: 600;
}

/* 开场动画 */
#welcome-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--loader-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease;
}

.signature-svg {
    width: 350px;
    height: 120px;
}

.signature-svg text {
    font-family: 'Dancing Script', cursive;
    font-size: 5rem;
    fill: transparent;
    stroke: var(--loader-text);
    stroke-width: 1.2px;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawOutline 2.5s cubic-bezier(0.2, 0.6, 0.2, 1) forwards, fillColor 0.8s ease forwards;
    animation-delay: 0.3s, 2.3s;
}

@keyframes drawOutline {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes fillColor {
    to {
        fill: var(--loader-text);
        stroke: transparent;
    }
}

/* 导航栏 */
nav {
    position: fixed;
    top: 40px;
    left: 0;
    width: 100%;
    padding: 0 50px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lang-switcher {
    position: relative;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 15px;
    /* ✨ 隐形的桥：把感应区域往下延伸，覆盖缝隙 */
    margin-bottom: -15px;
    /* 抵消 padding 带来的排版变化 */
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 0;
    /* ✨ 删掉 margin，缝隙彻底消失 */
}

.lang-item {
    font-size: 14px;
    color: var(--text-main);
    transition: 0.2s;
    white-space: nowrap;
    /* 防止文字换行 */
}

.lang-item:hover {
    color: var(--accent);
}

.lang-switcher:hover .lang-dropdown {
    display: flex;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

nav a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 15px;
    transition: 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--accent);
    font-weight: 600;
}

/* 容器布局 */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 120px 40px 60px;
    opacity: 0;
    transition: var(--transition);
}

.container.visible {
    opacity: 1;
}

.home-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
    align-items: start;
}

/* 左侧栏 */
.profile-side {
    text-align: left;
    position: sticky;
    top: 120px;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 15px;
    padding-left: 5px;
}

.profile-img {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 25px;
    border: 1px solid #eaeaea;
}

.social-icons {
    display: flex;
    gap: 22px;
    margin-bottom: 25px;
    padding-left: 5px;
}

.social-icons a {
    color: var(--text-main);
    font-size: 22px;
    transition: 0.3s;
}

.social-icons a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.contact-info {
    font-size: 15px;
}

.contact-info b {
    display: block;
    margin-top: 15px;
    color: #4b5563;
}

.contact-info a {
    color: var(--accent);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* 右侧卡片 */
.card-stack {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.content-card {
    background: rgba(253, 253, 253, 0.85);
    backdrop-filter: blur(10px);
    padding: 45px;
    border-radius: 20px;
    border: 1px solid #f2f2f2;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.03);
}

.content-card h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 20px;
}

.content-card p {
    margin-bottom: 15px;
}

.content-card a {
    color: var(--accent);
    text-decoration: none;
}

.content-card a:hover {
    text-decoration: underline;
}

/* --- 🌟 更新：卡片内的小标题样式 --- */
.news-title {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 15px;
}

.sub-heading {
    display: block;
    font-size: 0.95rem;
    /* 缩小到和参考文献一样大 */
    font-weight: 700;
    /* 加粗 */
    color: #374151;
    /* 保持蓝色 */
    margin-top: 25px;
    margin-bottom: 10px;
}

/* --- 🌟 更新：列表与参考文献样式优化 --- */
.pub-item {
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.experience-list,
.skills-list {
    list-style: none;
    padding-left: 0;
    margin-top: 5px;
}

.experience-list li,
.skills-list li {
    position: relative;
    padding-left: 16px;
    /* 给黑点留出位置 */
    margin-bottom: 4px;
    /* 缩小行距，变得更紧凑正常 */
    font-size: 0.95rem;
    /* 字号和参考文献保持一致 */
    line-height: 1.6;
}

/* 统一修改圆点颜色为黑色（深灰），并同时应用到两个列表 */
.experience-list li::before,
.skills-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-main);
    /* 变成了和正文一样的深色 */
    font-weight: bold;
}

/* --- 🌟 Education 页面：时光轴样式 --- */
.timeline {
    position: relative;
    padding-left: 30px;
    /* 给左侧的线留出空间 */
    margin-top: 10px;
}

/* 画出左侧的那条竖线 */
.timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: #e5e7eb;
    /* 浅灰色竖线 */
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 45px;
}

/* 最后一个条目不需要底边距 */
.timeline-item:last-child {
    margin-bottom: 0;
}

/* 画出轴上的节点（圆点） */
.timeline-dot {
    position: absolute;
    left: -31px;
    /* 移到竖线正中央 */
    top: 6px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border: 3px solid var(--accent);
    /* 用你的专属蓝色做外圈 */
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 4px rgba(63, 131, 248, 0.1);
    /* 加一点淡淡的蓝色光晕，非常有科技感 */
}

/* 年份日期样式 */
.timeline-date {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    background: rgba(63, 131, 248, 0.08);
    /* 极浅的蓝色底色 */
    padding: 4px 10px;
    border-radius: 20px;
}

/* 学位标题样式 */
.timeline-degree {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    /* 统一的深灰色，不刺眼 */
    margin-bottom: 5px;
    line-height: 1.4;
}

/* 学校名称样式 */
.timeline-uni {
    font-size: 1rem;
    color: var(--text-sub);
    /* 浅灰色副文本 */
    font-weight: 600;
}












/* 手机适配 */
@media (max-width: 900px) {
    nav {
        position: relative;
        top: 0;
        padding: 20px;
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }

    .home-grid {
        grid-template-columns: 1fr;
    }

    .profile-side {
        text-align: center;
        position: static;
        margin-bottom: 40px;
    }

    .social-icons {
        justify-content: center;
    }

    .container {
        padding-top: 20px;
    }

    .content-card {
        padding: 30px;
    }
}

section {
    display: none;
}

section.active {
    display: block;
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 🌐 语言切换核心控制逻辑 --- */
/* 默认状态下（英文版），隐藏所有带有 lang="zh" 的元素 */
[lang="zh"] {
    display: none !important;
}

/* 当 body 被加上 .show-zh 类名时（中文版），隐藏英文，显示中文 */
body.show-zh [lang="en"] {
    display: none !important;
}

body.show-zh [lang="zh"] {
    display: block !important;
}

/* 针对在同行内显示的小文字（如 span, a），防止强行变成 block 导致换行 */
body.show-zh span[lang="zh"],
body.show-zh a[lang="zh"],
body.show-zh b[lang="zh"] {
    display: inline-block !important;
}