/* 通用样式和重置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Lato', 'Segoe UI', Arial, sans-serif;
    background-image: url('images/bg.jpg');
    background-size: 50% 50%;
    background-color: #f0f2f5; /* 浅灰色背景 */
    color: #333;
    line-height: 1.7;
}

a {
    color: #1E3A8A; /* 链接蓝色 */
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: #3B82F6; /* 悬停时颜色稍微加深 */
}

ul {
    list-style: none;
    padding: 0;
}

ol {
    padding-left: 20px;
}

/* 页眉样式 */
.main-header {
    background-color: rgba(255, 255, 255, 0.7);
    color: #333;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
}

.site-title a {
    color: #555;
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin-left: 30px;
}

.main-nav a {
    color: #555;
    font-weight: 500;
    font-size: 1.1em;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    text-decoration: none;
    color: #3B82F6;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #3B82F6;
    transition: width .3s ease-in-out;
}

.main-nav a:hover::after {
    width: 100%;
}

/* 左边栏样式 */
.left-column {
    flex: 0 0 280px; 
    background-color: #f8f9fa; 
    padding: 30px 20px; 
    border-right: 1px solid #eee; 
    text-align: center;
    overflow-y: auto;
    position: sticky; 
    top: 50px; 
    z-index: 10; 
    /* 让左侧栏在Flex容器中垂直拉伸，以匹配右侧栏的高度 */
    align-self: stretch; 
    /* 限制左侧栏的最大高度，防止它拉伸超出屏幕高度，同时保持粘性 */
    max-height: calc(100vh - 45px); 
}

/* 主要容器 */
.container {
    display: flex;
    max-width: 1200px;
    margin: 30px auto;
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 2px solid #3B82F6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.left-column h2 {
    font-size: 1.8em;
    color: #4B5563;
    margin-bottom: 5px;
}

.left-column .title {
    font-size: 1em;
    color: #555;
    margin-bottom: 25px;
}

.contact-info ul {
    margin-top: 20px;
}

.contact-info li {
    margin-bottom: 15px;
    font-size: 0.95em;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
}

.contact-info li i {
    margin-right: 10px;
    color: #6B7280;
    min-width: 20px;
    text-align: center;
}

/* 右边栏样式 */
.right-column {
    flex: 1;
    padding: 30px;
    min-width: 0; 
}

.section-block {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.section-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.right-column h2 {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 5px;
    border-bottom: 2px solid #3B82F6;
    padding-bottom: 5px;
    display: inline-block;
}

.right-column p,
.right-column li {
    font-size: 1em;
    line-height: 1.7;
    margin-bottom: 10px;
}

.right-column ul li {
    margin-bottom: 15px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .main-header {
        padding: 10px 0;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
    .header-content {
        flex-direction: column;
        align-items: center;
    }
    .site-title {
        margin-bottom: 10px;
    }
    .site-title a {
        color: #333;
    }
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    .main-nav li {
        margin: 5px 15px;
    }
    .main-nav a {
        color: #555;
    }

    .container {
        flex-direction: column;
        margin: 0 18px;
        border-radius: 0;
        box-shadow: none;
        min-height: auto;
    }

    .left-column {
        flex: none;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid #eee;
        position: static;
        height: auto;
    }

    .profile-photo {
        width: 130px;
        height: 130px;
    }

    .left-column h2 {
        font-size: 1.5em;
    }

    .contact-info li {
        justify-content: center;
    }

    .right-column {
        padding: 20px;
    }

    .right-column h2 {
        font-size: 1.5em;
    }

        .right-column h3 {
        font-size: 1em;
    }
}

/* Container to hold both images */
.image-container {
    display: flex; /* Use flexbox to display images side by side */
    justify-content: space-between; /* Ensure images are spaced out */
    gap: 20px; /* Optional: adds space between columns */
    margin-top: 20px; /* Adds spacing above the image container */
}

/* Style for each image column */
.image-column {
    flex: 1; /* Makes each column take up equal space */
    text-align: center; /* Centers the title and image */
}

/* Style for the word cloud images */
.wordcloud-image {
    width: 100%; /* Ensures images take up full width of their container */
    max-width: 500px; /* Sets a max width to prevent images from becoming too large */
    height: auto; /* Maintains aspect ratio */
    border-radius: 8px; /* Optional: adds rounded corners to the images */
}

/* Title for each word cloud */
h3 {
    font-size: 1.2em;
    margin-bottom: 10px; /* Adds space below the title */
}

/* 定义淡入并位移的 CSS 动画 */
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 应用到需要动画效果的元素 */
.section-block {
    opacity: 0; /* 初始时不可见 */
    animation: fadeUp 1s ease-out forwards; /* 动画效果：1秒，渐变并向上移动 */
}

/* 增加延迟时间，使元素顺序依次动画 */
.section-block:nth-child(1) {
    animation-delay: 0.2s;
}

.section-block:nth-child(2) {
    animation-delay: 0.4s;
}

.section-block:nth-child(3) {
    animation-delay: 0.6s;
}

/* 针对每个 section 设置不同的延迟效果 */
.section-block:nth-child(4) {
    animation-delay: 0.8s;
}

/* 图片水平滚动容器样式 */
.project-images-scroll-container {
    display: flex; 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; /* 针对 iOS 设备优化滚动体验 */
    white-space: nowrap; /* 防止图片换行 */
    padding-bottom: 10px; 
    gap: 15px;
    margin-top: 10px; 

    /* 样式化滚动条 (针对 Firefox) */
    scrollbar-width: thin; /* “薄”的滚动条 */
    scrollbar-color: #ccc #f1f1f1;
}

/* 样式化滚动条 (针对 Webkit 浏览器，如 Chrome, Safari) */
.project-images-scroll-container::-webkit-scrollbar {
    height: 8px; /* 水平滚动条的高度 */
}

.project-images-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px; 
}

.project-images-scroll-container::-webkit-scrollbar-thumb {
    background: #ccc; 
    border-radius: 10px; 
}

.project-images-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #888; 
}

/* 滚动容器内单个图片样式 */
.project-images-scroll-container img {
    flex-shrink: 0; /* 阻止图片缩小 */

    max-height: 200px; 
    width: auto; 
    object-fit: contain; 
    border-radius: 8px; /* 图片圆角 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* 添加阴影，可选 */
}

/* 响应式调整：在小屏幕上，图片可以有不同的最大高度 */
@media (max-width: 768px) {
    .project-images-scroll-container img {
        max-height: 150px; /* 移动设备上图片的最大高度，根据需要调整 */
        width: auto; /* 宽度自适应 */
    }
}

/* --- CV页面样式 --- */
.cv-page-container {
    padding: 40px 40px; 
    max-width: 1200px;
    margin: 30px auto; 
    background-color: #fff; 
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.cv-readers-wrapper {
    display: flex;
    gap: 40px; 
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}

.cv-reader {
    flex: 1;
    min-width: 526px;
    background-color: #fcfcfc;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
    text-align: center;
    border: 1px solid #eee; 
}

.cv-reader h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #34495e;
    font-size: 1.6em;
}

.cv-reader iframe {
    width: 100%;
    min-height: 700px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff; 
}

.download-link {
    margin-top: 20px;
    font-size: 1.1em; 
}

.download-link a {
    color: #007bff; /* 蓝色链接 */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.download-link a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 响应式调整：在小屏幕上，PDF阅读器垂直堆叠 */
@media (max-width: 1024px) { 
    .cv-readers-wrapper {
        flex-direction: column; 
        align-items: center; 
    }
    .cv-reader {
        min-width: 90%; 
    }
    .cv-reader iframe {
        min-height: 500px; 
    }
}

@media (max-width: 768px) {
    .cv-title {
        font-size: 2em;
    }
    .cv-page-container {
        padding: 20px 15px;
        margin: 20px auto;
    }
}

/* --- 针对单个阅读器可能需要的样式调整 --- */
.cv-readers-wrapper.single-reader .cv-reader {
    flex: 0 0 auto; /* 取消 flex: 1 的效果 */
    width: 80%; 
    min-width: 1145px; 
}
