/* Overall Style */
:root {
    --primary-color: #1a73e8;
    --secondary-color: #4285f4;
    --accent-color: #fbbc04;
    --text-color: #202124;
    --light-gray: #f8f9fa;
    --gray: #dadce0;
    --dark-gray: #5f6368;
}

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

body {
    font-family: 'Segoe UI', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 60px 0;
}

h1, h2, h3, h4 {
    margin-bottom: 20px;
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

h2:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 20px;
}

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

a:hover {
    color: var(--secondary-color);
}

/* Navigation Bar */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

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

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* Hero Banner with Background Image */
.hero {
    position: relative;
    padding: 100px 0;
    text-align: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/lab-background.png');
    background-size: cover;
    background-position: center;
    opacity: 0.15; /* Adjust transparency level here */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--text-color);
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    margin-bottom: 20px;
    font-size: 2.8rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    line-height: 1.8;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
}

.btn:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* About Section */
.about {
    background-color: white;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

/* 关于部分图片修改 */
/* 用以下代码替换当前的about-image-container和about-image相关样式 */

.about-image-container {
    flex: 0 0 auto;
    width: 240px; /* 与红框宽度匹配 */
    margin: 0 50px; /* 添加左右边距 */
    display: flex;
    flex-direction: column;
}

.about-image {
    width: 100%;
    height: 800px; /* 与红框高度匹配 */
    object-fit: cover;
    object-position: center;
    border-radius: 5px;
}

.image-caption {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    padding: 5px 0;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .about-image-container {
        width: 220px;
    }
    
    .about-image {
        height: 330px;
    }
}

@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
        align-items: center;
    }
    
    .about-text {
        text-align: center;
    }
    
    .about-image-container {
        width: 240px;
        margin: 20px auto;
    }
}

.about-image svg {
    max-width: 100%;
    height: auto;
}

/* News Section */
.news-container {
    flex: 1;
    min-width: 250px;
    background-color: var(--light-gray);
    border-radius: 8px;
    padding: 5px; /* 减少内边距，原为20px */
    box-shadow: var(--box-shadow);
}

.news-header {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray);
}

.news-scroll {
    height: 350px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--light-gray);
}

.news-scroll::-webkit-scrollbar {
    width: 8px;
}

.news-scroll::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 4px;
}

.news-scroll::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
}

.news-item {
    margin-bottom: 0;
    padding-bottom: 6px; /* 进一步减少 */
    padding-top: 6px; /* 进一步减少 */
    border-bottom: 1px solid rgba(204, 204, 204, 0.5); /* 使分隔线更淡 */
    /* 或者完全移除分隔线：border-bottom: none; */
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background-color: var(--light-gray);
}

.news-item h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.news-date {
    font-size: 0.8rem;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

/* Research Areas */
.research {
    background-color: var(--light-gray);
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.research-item {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.research-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.research-icon {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    font-size: 2rem;
}

.research-content {
    padding: 20px;
}

/* Research Achievements */
.achievements {
    background-color: white;
    padding: 60px 0;
}

.achievements-container {
    max-height: 500px;
    overflow-y: hidden;
    border: 1px solid var(--gray);
    border-radius: 8px;
    padding: 5px;
    background-color: var(--light-gray);
    transition: box-shadow 0.3s;
}

.achievements-container:hover {
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Customize scrollbar */
.achievements-container::-webkit-scrollbar {
    width: 8px;
}

.achievements-container::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 4px;
}

.achievements-container::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
}

.achievement-item {
    display: flex;
    margin-bottom: 15px;
    padding: 10px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.achievement-item:last-child {
    margin-bottom: 5px;
}

.achievement-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.achievement-image {
    flex: 0 0 120px;
    margin-right: 20px;
}

.placeholder-image {
    width: 100%;
    height: 120px;
    background-color: var(--gray);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    background-color: var(--primary-color);
}

.achievement-info {
    margin: 5px 0; /* 将默认的段落上下外边距从约15px减少到5px */
    line-height: 1.4; /* 适当减小行高也有助于紧凑显示 */
}

.achievement-title {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.achievement-date {
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-bottom: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .achievement-item {
        flex-direction: column;
    }
    
    .achievement-image {
        flex: 0 0 auto;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .placeholder-image {
        height: 100px;
    }
}

/* Carousel Controls */
.carousel-arrow {
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--gray);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background-color 0.3s, transform 0.2s;
}

.carousel-arrow:hover {
    background-color: white;
    transform: scale(1.1);
}

.carousel-arrow:active {
    transform: scale(0.95);
}

.prev-arrow {
    left: -20px;
}

.next-arrow {
    right: -20px;
}

.carousel-arrow.hidden {
    display: none;
}

/* Carousel Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--gray);
    cursor: pointer;
    transition: background-color 0.3s;
}

.indicator.active {
    background-color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .achievement-item {
        flex: 0 0 calc(50% - 15px);
    }
}

@media (max-width: 768px) {
    .achievement-item {
        flex: 0 0 calc(100% - 10px);
    }
    
    .prev-arrow {
        left: -10px;
    }
    
    .next-arrow {
        right: -10px;
    }
}

/* Team Members */
.team {
    background-color: var(--light-gray);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.team-member {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* 基本样式 - 适用于所有成员照片 */
.member-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 15px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* 有图片的成员照片 */
.member-photo.has-image {
    padding: 0;
    overflow: hidden;
    display: block;
    background-color: var(--light-gray);
}

.member-photo.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.member-info {
    padding: 0 20px 30px;
}

.member-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.member-role {
/*    color: var(--primary-color);*/
    font-weight: 500;
    margin-bottom: 15px;
}

/* Lab Life Gallery */
.more {
    background-color: white;
    padding: 60px 0;
}

.section-header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    position: relative;
}

.toggle-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 20px;
    transition: background-color 0.3s, transform 0.2s;
}

.toggle-gallery:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.toggle-gallery:active {
    transform: translateY(0);
}

.toggle-icon {
    margin-left: 8px;
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.hide-text {
    display: none;
}

.gallery-container {
    overflow: hidden;
    transition: max-height 0.6s ease;
    max-height: 0;
}

.gallery-container.expanded {
    max-height: 1500px; /* Adjust based on your gallery height */
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
}

.gallery.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: relative;
    aspect-ratio: 1/1;
    background-color: var(--light-gray);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.gallery-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 2rem;
    color: var(--dark-gray);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 10px;
    font-size: 0.9rem;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Expanded gallery styles */
.toggle-gallery.expanded .show-text {
    display: none;
}

.toggle-gallery.expanded .hide-text {
    display: inline;
}

.toggle-gallery.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .gallery-caption {
        font-size: 0.8rem;
        padding: 8px;
    }
}

/* Contact Section */
.contact {
    background-color: var(--light-gray);
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.contact-item {
    flex: 1;
    min-width: 250px;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.contact-icon {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    padding: 40px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-links {
    display: flex;
    list-style: none;
    margin: 20px 0;
}

.footer-links li {
    margin: 0 15px;
}

.footer-links a {
    color: white;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.copyright {
    font-size: 0.9rem;
    color: #aaa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background-color: white;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        transform: translateY(-150%);
        transition: transform 0.3s;
    }
    
    .nav-links.active {
        transform: translateY(0);
    }
    
    .nav-links li {
        margin: 15px 0;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .news-container {
        margin-top: 30px;
        max-width: 100%;
    }
    
    .research-grid,
    .achievements-grid,
    .team-grid,
    .gallery,
    .contact-info {
        grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
    }
}

/* About Section with Custom Image */
.about {
    background-color: white;
    padding: 60px 0;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-image {
    flex: 0 0 auto;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px;
}

/* 调整关于部分图片的尺寸 */
.about-custom-image {
    width: 200px; /* 设置您想要的宽度 */
    height: auto; /* 保持宽高比 */
    max-width: 100%; /* 确保在小屏幕上不会溢出 */
}

/* News Container (keeping this for reference) */
.news-container {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    position: relative;
    max-height: 450px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
        align-items: center;
    }
    
    .about-image {
        order: 1;
        width: 250px;
        height: 250px;
    }
    
    .about-text {
        order: 2;
    }
    
    .news-container {
        order: 3;
        max-width: 100%;
        margin-top: 30px;
    }
}

@media (max-width: 576px) {
    .about-image {
        width: 200px;
        height: 200px;
    }
}