/*
 * ----------------------------------------------------
 * Project Name: Beiqiao Lab Homepage Redesign
 * Author: Your Name/Gemini AI
 * Description: Modernized CSS for a university lab homepage.
 * ----------------------------------------------------
 */

/* General Body & Typography */
html,
body {
    margin: 0;
    font-size: 100%;
    background: #f8f9fa; /* Light gray background for a clean look */
    font-family: 'Poppins', sans-serif; /* Modern, readable font */
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
    color: #343a40; /* Dark gray for primary text */
    line-height: 1.6;
}

body a {
    text-decoration: none;
    transition: 0.3s ease-in-out; /* Smoother transitions for hover effects */
    -webkit-transition: 0.3s ease-in-out;
    -moz-transition: 0.3s ease-in-out;
    -o-transition: 0.3s ease-in-out;
    -ms-transition: 0.3s ease-in-out;
}

a:hover {
    text-decoration: none;
}

input[type="button"],
input[type="submit"],
input[type="text"],
input[type="email"],
input[type="search"] {
    transition: 0.3s ease-in-out;
    -webkit-transition: 0.3s ease-in-out;
    -moz-transition: 0.3s ease-in-out;
    -o-transition: 0.3s ease-in-out;
    -ms-transition: 0.3s ease-in-out;
    font-family: 'Poppins', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    letter-spacing: 0.5px; /* Slightly tighter letter spacing for headings */
    font-weight: 600; /* Medium-bold for headings */
    color: #212529; /* Darker color for headings */
}

p {
    font-size: 1em; /* Slightly larger paragraph text for readability */
    color: #6c757d; /* Softer gray for paragraph text */
    line-height: 1.8em; /* Improved line height for better readability */
    margin-bottom: 1em; /* Default bottom margin for paragraphs */
}

ul {
    margin: 0;
    padding: 0;
    list-style: none; /* Remove default list bullets */
}

/* --- Section Titles --- */
.section-title {
    text-align: center;
    margin-bottom: 50px; /* Ample space below the title */
    position: relative;
}

h3.tittle {
    font-size: 2.8em; /* Larger main title */
    letter-spacing: 1px;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    display: inline-block; /* For the underline positioning */
    padding-bottom: 15px;
    color: #212529;
}

h3.tittle::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 70px; /* Underline width */
    height: 4px; /* Underline thickness */
    background-color: #007bff; /* Primary blue for underline */
    border-radius: 2px;
}

h3.tittle.two { /* For titles on dark backgrounds */
    color: #fff;
}
h3.tittle.two::after {
    background-color: #fff; /* White underline for dark backgrounds */
}

.sub-tittle {
    font-size: 1em; /* Larger subtitle */
    color: #007bff; /* Primary blue for subtitle */
    font-weight: 500;
    letter-spacing: 2px;
    display: block;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.sub-tittle.two {
    color: #fff;
}

/* --- Header & Navigation --- */
header {
    position: fixed; /* 更改为 fixed，使其固定在视口顶部 */
    top: 0;          /* 确保它从顶部开始 */
    left: 0;         /* 确保它从左侧开始 */
    z-index: 100;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.75); /* 可以稍微调深背景色，让文字更清晰 */
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); /* 稍微增强阴影效果 */
}

.navbar-brand {
    float: left;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 1.8em; /* Larger logo text */
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.logo-highlight {
    color: #007bff; /* Highlight color for 'beiqiao' */
}

.toggle,
[id^=drop] {
    display: none;
}

nav ul {
    float: right;
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
    display: flex; /* Use flexbox for menu items */
    align-items: center;
}

nav ul li {
    margin: 0 25px; /* Spacing between menu items */
}

nav a {
    color: #fff;
    font-weight: 400;
    font-size: 16px;
    letter-spacing: 0.8px;
    padding: 10px 0;
    position: relative;
    display: block; /* Ensures padding applies correctly */
}

nav a:hover {
    color: #007bff; /* Primary blue on hover */
}

.menu li.active a {
    color: #007bff; /* Active menu item color */
}

.menu li.active a::after,
nav a:hover::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px; /* Position below the text */
    width: 100%;
    height: 2px;
    background-color: #007bff;
    transform: scaleX(0); /* Hidden by default */
    transition: transform 0.3s ease-in-out;
}

.menu li.active a::after {
    transform: scaleX(1); /* Visible when active */
}

nav a:hover::after {
    transform: scaleX(1); /* Visible on hover */
}

/* Mobile Navigation */
@media all and (max-width: 768px) {
    header {
        background-color: rgba(0, 0, 0, 0.85); /* Darker background on mobile */
        padding: 10px 0;
    }
    .navbar-brand {
        float: none;
        text-align: center;
        width: 100%;
        justify-content: center; /* Center logo on mobile */
    }
    .toggle {
        display: block;
        padding: 12px 20px;
        font-size: 18px;
        color: #fff;
        cursor: pointer;
        float: right;
        order: 1; /* Place toggle button to the right */
    }
    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }
    .menu {
        flex-basis: 100%;
        margin-top: 0 !important; /* Override default margin */
    }
    /* Hide the navigation menu by default */
    .toggle + a,
    .menu {
        display: none;
    }

    /* Display Dropdown when clicked on Parent Label */
    [id^=drop]:checked + ul {
        display: block;
        background: rgba(0, 0, 0, 0.95);
        padding: 20px 0;
        text-align: center;
    }

    /* Change menu item's width to 100% */
    nav ul li {
        display: block;
        width: 100%;
        margin: 0;
        padding: 8px 0;
    }

    nav ul ul .toggle,
    nav ul ul a {
        padding: 0 40px;
    }

    nav ul ul ul a {
        padding: 0 80px;
    }

    nav a:hover,
    nav ul ul ul a {
        background-color: transparent;
    }

    nav ul li ul li .toggle,
    nav ul ul a,
    nav ul ul ul a {
        padding: 14px 20px;
        color: #FFF;
        font-size: 16px;
    }

    nav ul li ul li .toggle,
    nav ul ul a {
        background-color: #333;
    }

    /* Hide Dropdowns by Default */
    nav ul ul {
        float: none;
        position: static;
        color: #ffffff;
    }

    /* Hide menus on hover */
    nav ul ul li:hover > ul,
    nav ul li:hover > ul {
        display: none;
    }

    /* First Tier Dropdown */
    nav ul ul li {
        display: block;
        width: 100%;
        padding: 0;
    }

    nav ul ul ul li {
        position: static;
    }
    nav ul ul li a {
        color: #fff;
        font-size: 0.9em;
    }

    .menu li.active a::after,
    nav a:hover::after {
        display: none; /* Hide underlines on mobile */
    }
}


/* --- Banner Section --- */
.main-content {
    /* Dynamic background from Unsplash, ensures fresh and relevant images */
    background: url('https://blog.beiqiao.online/wp-content/uploads/2025/07/11.jpg') no-repeat center center / cover;
    min-height: 85vh; /* Larger hero section */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.layer {
    background: rgba(0, 0, 0, 0.5); /* Deeper overlay for text readability */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-info-wthree {
    padding: 0 30px;
    max-width: 900px;
    z-index: 1;
}

.banner-info-wthree h2 {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.3em;
    text-transform: uppercase;
    font-weight: 300;
    letter-spacing: 10px; /* Wider spacing for effect */
    margin-bottom: 15px;
    animation: fadeInDown 1.2s ease-out; /* Add animation */
}

.banner-info-wthree h3 {
    font-size: 4em; /* Very large and impactful company name */
    letter-spacing: 2px;
    color: #fff;
    margin: 0.3em 0 0.8em;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.2;
    animation: fadeInUp 1.2s ease-out; /* Add animation */
}

.learn-link-bnr1 {
    padding: 15px 50px;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.15em;
    font-size: 16px;
    background: #007bff; /* Primary blue button */
    border: 2px solid #007bff;
    text-transform: uppercase;
    border-radius: 5px;
    transition: all 0.3s ease-in-out;
    display: inline-block;
    animation: zoomIn 1s ease-out; /* Add animation */
}

.learn-link-bnr1:hover {
    background: transparent;
    color: #007bff;
    border-color: #007bff;
    transform: translateY(-3px); /* Subtle hover effect */
}

/* Scroll Indicator */
.icon-scroll {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%) scale(1.5);
    z-index: 1;
    opacity: 0.7;
}

.icon-arrows::after,
.icon-arrows::before {
    content: '';
}

.icon-arrows span,
.icon-arrows::after,
.icon-arrows::before {
    display: block;
    width: 0.315em;
    height: 0.315em;
    border-right: 1px solid rgba(255, 255, 255, .9);
    border-bottom: 1px solid rgba(255, 255, 255, .9);
    margin: 0 0 0.125em 0.315em;
    transform: rotate(45deg);
    animation: mouse-scroll 1.5s infinite; /* Adjusted animation speed */
    animation-direction: alternate;
}

.icon-arrows::before {
    margin-top: 0.315em;
    animation-delay: .1s;
}

.icon-scroll span {
    animation-delay: .2s;
}

.icon-arrows::after {
    animation-delay: .3s;
}

.icon-scroll .mouse {
    height: 1.375em;
    width: .875em;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 2em;
}

.icon-scroll .wheel {
    position: relative;
    display: block;
    height: 0.1875em;
    width: 0.1875em;
    margin: 0.1875em auto 0;
    background: rgba(255, 255, 255, .8);
    animation: mouse-wheel 1.2s ease infinite;
    border-radius: 50%;
}

@keyframes mouse-wheel {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(.375em); }
}

@keyframes mouse-scroll {
    0% { opacity: 0; }
    50% { opacity: .5; }
    100% { opacity: 1; }
}

/* Keyframe Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* --- About Section --- */
.about {
    background: #fff; /* Clean white background */
    padding: 80px 0; /* Consistent vertical padding */
}

.about-content p {
    font-size: 1.1em; /* Larger text for main about section */
    line-height: 1.9em;
    color: #495057; /* Slightly darker gray for main content */
    text-align: justify; /* Justify text for better readability */
    margin: 0 auto 30px;
    max-width: 90%;
}

.main_p4 {
    color: #495057;
    width: 75%;
    font-size: 1.1em;
    letter-spacing: 0.05em;
    line-height: 1.8em;
    margin: 30px auto;
}

.feature-grids {
    margin-top: 50px;
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap */
    justify-content: center; /* Center items */
}

.bottom-gd {
    padding: 30px;
    background: #fff;
    border-radius: 10px; /* More pronounced rounded corners */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); /* Soft, modern shadow */
    transition: all 0.4s ease-in-out;
    margin-bottom: 30px;
    height: 100%; /* Ensure all cards have same height */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align content to top */
    align-items: center; /* Center content horizontally */
    text-align: center;
}

.bottom-gd:hover {
    transform: translateY(-10px); /* Lift effect on hover */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.feature-grids span {
    font-size: 2.2em; /* Larger icons */
    width: 80px;
    height: 80px;
    line-height: 80px;
    margin: 0 auto 20px; /* Adjusted margin for better spacing */
    border-radius: 50%;
    background: #007bff; /* Primary blue background for icons */
    color: #fff;
    display: block;
    transition: all 0.3s ease-in-out;
}

.bottom-gd:hover span,
.bottom-gd2-active span {
    background: #0056b3; /* Darker blue on hover/active */
}

.feature-grids h3 {
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: 1px;
    color: #343a40;
    margin-bottom: 15px;
}

.feature-grids p {
    font-size: 0.95em;
    line-height: 1.7em;
    color: #6c757d;
}

.bottom-gd2-active { /* Active card style */
    background: #007bff;
    color: #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); /* More prominent shadow for active state */
}

.bottom-gd2-active h3,
.bottom-gd2-active p {
    color: #fff;
}

/* --- Counter Section --- */
.stats {
    background: #2b2f3a; /* Darker, sophisticated background */
    padding: 70px 0;
}

.counter {
    padding: 20px 0;
    color: #fff;
    text-align: center;
}

.count-title {
    font-size: 4em; /* Larger, bolder numbers */
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.count-text {
    font-size: 1.2em;
    margin-top: 10px;
    margin-bottom: 0;
    color: #6ee7ff; /* A lighter, more vibrant blue/cyan */
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* --- Gallery (Awards) Section --- */
section#gallery {
    background: #f0f2f5; /* Light gray background */
    padding: 80px 0;
}

.gal-item {
    margin-bottom: 30px;
    text-align: center;
    overflow: hidden; /* Ensure image transitions stay within bounds */
}

.gal-img-link {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.gal-img-link img {
    width: 100%;
    height: 250px; /* Fixed height for consistency */
    object-fit: cover; /* Crop images to fit */
    display: block;
    transition: transform 0.3s ease-in-out;
}

.gal-img-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gal-img-link:hover img {
    transform: scale(1.05); /* Zoom effect on hover */
}

.gal-title {
    font-size: 1.15em;
    color: #343a40;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-top: 0; /* Adjust margin */
}

.pop-overlay {
    position: fixed;
    top: 0px;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75); /* Darker overlay */
    transition: opacity 0.3s ease-in-out; /* Smooth transition */
    visibility: hidden;
    opacity: 0;
    z-index: 999; /* Ensure it's on top */
    display: flex;
    align-items: center;
    justify-content: center;
}

.pop-overlay:target {
    visibility: visible;
    opacity: 1;
}

.popup {
    background: #fff;
    border-radius: 10px;
    width: 70%; /* Wider popup */
    max-width: 900px; /* Max width for large screens */
    position: relative;
    padding: 40px; /* More padding */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    transform: scale(0.95); /* Slightly smaller initially */
    transition: transform 0.3s ease-in-out;
}
.pop-overlay:target .popup {
    transform: scale(1); /* Scale to full size on show */
}

.popup .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 38px; /* Larger close button */
    font-weight: normal; /* Normal weight for 'x' */
    text-decoration: none;
    color: #6c757d; /* Softer color */
    transition: color 0.2s;
}

.popup .close:hover {
    color: #dc3545; /* Red on hover for close */
}

.popup-content p {
    font-size: 1.05em;
    color: #495057;
    line-height: 1.8em;
    text-align: left; /* Align text left within popup */
}

center a.scroll {
    color: #007bff;
    font-weight: 600;
    transition: color 0.2s;
}
center a.scroll:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* --- Contact & Footer Section --- */
section.contact {
    background: #2b2f3a; /* Dark background, consistent with stats */
    padding: 80px 0 20px; /* Adjusted padding */
    color: #e9ecef; /* Lighter text for dark background */
}

.join-us-content p {
    font-size: 1.1em;
    line-height: 1.8em;
    color: #ced4da; /* Slightly muted text */
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.footer-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Subtle white divider */
    margin-top: 50px;
    margin-bottom: 20px;
}

.cpy-right-w3layouts-pvt {
    padding: 20px 0;
    font-size: 0.95em;
    color: #adb5bd;
    line-height: 1.8em;
}

.cpy-right-w3layouts-pvt a {
    color: #007bff; /* Primary blue for footer links */
    margin: 0 8px;
    font-weight: 500;
}

.cpy-right-w3layouts-pvt a:hover {
    color: #fff; /* White on hover */
    text-decoration: underline;
}

/* --- Responsive Adjustments --- */
@media(max-width:1200px) {
    .banner-info-wthree h3 { font-size: 3.5em; }
    h3.tittle { font-size: 2.5em; }
}

@media(max-width:991px) {
    .main-content { min-height: 70vh; }
    .banner-info-wthree h3 { font-size: 3em; }
    .banner-info-wthree h2 { font-size: 1.1em; letter-spacing: 6px; }
    .learn-link-bnr1 { padding: 12px 40px; font-size: 15px; }
    .icon-scroll { bottom: 3%; transform: translateX(-50%) scale(1.2); }

    .about, section#gallery, section.contact, .stats { padding: 60px 0; }
    .section-title { margin-bottom: 40px; }
    h3.tittle { font-size: 2.2em; }
    .main_p4 { width: 90%; font-size: 1em; }

    .feature-grids .col-lg-3 {
        flex: 0 0 50%; /* Two columns on tablets */
        max-width: 50%;
    }
    .gal-item {
        flex: 0 0 50%; /* Two columns on tablets */
        max-width: 50%;
    }
    .popup { width: 85%; padding: 30px; }
}

@media(max-width:767px) {
    .main-content { min-height: 60vh; }
    .banner-info-wthree h3 { font-size: 2.5em; }
    .banner-info-wthree h2 { font-size: 1em; letter-spacing: 4px; }
    .learn-link-bnr1 { padding: 10px 30px; font-size: 14px; }
    .icon-scroll { display: none; } /* Hide scroll icon on very small screens */

    h3.tittle { font-size: 2em; padding-bottom: 10px; }
    h3.tittle::after { width: 50px; height: 3px; }
    .sub-tittle { font-size: 0.9em; letter-spacing: 1.5px; }

    .feature-grids .col-lg-3 {
        flex: 0 0 100%; /* Single column on mobile */
        max-width: 100%;
    }
    .bottom-gd { margin-bottom: 25px; padding: 25px; }
    .feature-grids span { width: 70px; height: 70px; line-height: 70px; margin-bottom: 15px; }
    .feature-grids h3 { font-size: 1.3em; }
    .feature-grids p { font-size: 0.9em; }

    .counter .count-title { font-size: 3.5em; }
    .counter .count-text { font-size: 1em; }

    .gal-item {
        flex: 0 0 100%; /* Single column on mobile */
        max-width: 100%;
    }
    .gal-img-link img { height: 200px; } /* Adjust image height for mobile */

    .popup { width: 95%; margin: 3em auto; padding: 25px; }
    .popup .close { font-size: 30px; top: 10px; right: 15px; }
    .popup-content p { font-size: 0.95em; }

    .cpy-right-w3layouts-pvt { font-size: 0.85em; }
}

@media(max-width:480px) {
    .main-content { min-height: 50vh; }
    .banner-info-wthree h3 { font-size: 2em; letter-spacing: 1px; }
    .banner-info-wthree h2 { font-size: 0.9em; letter-spacing: 2px; }
    .learn-link-bnr1 { padding: 8px 25px; font-size: 13px; }

    h3.tittle { font-size: 1.8em; }
    .main_p4 { font-size: 0.9em; }
    .about-content p { font-size: 1em; }

    .counter .count-title { font-size: 3em; }
    .counter .count-text { font-size: 0.9em; }
}

@media(max-width:375px) {
    .banner-info-wthree h3 { font-size: 1.8em; }
    h3.tittle { font-size: 1.6em; }
    .sub-tittle { font-size: 0.8em; letter-spacing: 1px; }
}