/* --- CSS VARIABLES --- */
:root {
    --sidebar-width: 240px;
    --primary-color: #007aff; 
    --bg-main: #ffffff;
    --bg-sidebar: #1c1c1e;
    --text-dark: #1d1d1f;
    --text-muted: #86868b;
    --border-color: #d2d2d7;
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; }
html { 
    /* scroll-behavior: smooth;  */
    scroll-behavior: auto !important;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
}

/* --- SIDEBAR --- */
/* 1. Target the top container to center all header text */
.llm-sidebar-top {
    text-align: center;
    margin-bottom: 20px;
}

.llm-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    color: white;
    position: fixed;
    padding: 20px 20px;
    display: flex;
    flex-direction: column;
}
.llm-avatar {
    width: 180px;  /* Increased from 120px */
    height: 180px; /* Increased from 120px */
    border-radius: 15%; 
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.llm-name { font-size: 1.4rem; font-weight: 700; margin: 0; }
.llm-sidebar-title { font-size: 0.9rem; color: var(--text-muted); margin: 5px 0 30px; }

/* NAV LINKS: BOLD & FIXED COLOR */
.llm-nav { list-style: none; padding: 0; margin-bottom: 40px; }
.llm-nav-label { font-size: 0.7rem; letter-spacing: 1.5px; color: #48484a; margin-bottom: 10px; font-weight: 700; }
.llm-nav-link:link, .llm-nav-link:visited {
    color: #aeaeb2;
    text-decoration: none;
    font-weight: 700;
    display: block;
    padding: 10px 0;
    transition: var(--transition);
}
.llm-nav-link i { margin-right: 12px; width: 18px; text-align: center; }
.llm-nav-link:hover, .llm-nav-link.active { color: white !important; transform: translateX(5px); }

.llm-sidebar-bottom { margin-top: auto; display: flex; gap: 10px; }
/* .llm-sidebar-bottom a { color: #aeaeb2; font-size: 2.0rem; transition: var(--transition);} */

/* 1. The base state must have the transition defined */
.llm-sidebar-bottom a {
    color: #aeaeb2;
    font-size: 2.0rem;
    transition: all 0.3s ease; /* Using 'all' ensures color and transform both animate */
    display: inline-block;     /* Required for transform/scaling to work */
}

/* 2. The hover state defines the destination values */
.llm-sidebar-bottom a:hover {
    color: white;
    transform: translateY(-3px); /* Adds a subtle lift to make the transition obvious */
}


/* --- MAIN CONTENT --- */
.llm-main {
    margin-left: var(--sidebar-width);
    /* padding: 10px 8%; */
    padding: 0px 5% 80px 30px;
    max-width: 1200px;
    flex: 1;
}

/* CONTENT LINKS: BOLD & FIXED COLOR */
.llm-main a:link, .llm-main a:visited {
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}
.llm-main a:hover { text-decoration: underline; }

.llm-content-section:first-of-type .llm-section-header {
    margin-top: 0px !important;
    padding-top: 12px; /* Optional: adds a tiny bit of breathing room to align with the avatar */
}
.llm-content-section {
    scroll-margin-top: 20px;
}


.llm-section-header {
    font-size: 1.8rem;
    font-weight: 800;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 40px;
}
.llm-section-header i { margin-right: 15px; color: var(--primary-color); }
.llm-bio { font-size: 1.15rem; margin-bottom: 20px; }

/* LOGO CARD EFFECTS: COLORFUL & ZOOM */
.llm-logo-section {
    margin: 50px 0;
    width: 100%; /* Ensures it takes full width of the main content */
}

/* ROW 1: BOX-1 (SQUARES - STRETCHING IN ONE LINE) */
.llm-logo-row-square {
    display: grid;
    /* repeat(6, 1fr) ensures all 6 logos stay in one line and stretch equally */
    grid-template-columns: repeat(6, 1fr); 
    gap: 10px;
    margin-bottom: 10px;
}

.llm-box-1 {
    width: 100%;
    aspect-ratio: 1 / 1; /* Forces a perfect square regardless of width */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10%; /* Responsive padding */
    overflow: hidden;
    transition: var(--transition);
}

/* ROW 2 & 3: BOX-2 (RECTANGLES - 3 PER LINE) */
.llm-logo-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Exactly 3 per line */
    gap: 10px;
}

.llm-box-2 {
    width: 100%;
    aspect-ratio: 4 / 2; /* Professional rectangular proportion */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10%;
    overflow: hidden;
    transition: var(--transition);
}

/* --- SHARED INTERNALS --- */

/* Ensures the hyperlink covers the entire box area */
.llm-box-1 a, .llm-box-2 a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.llm-box-1 img, .llm-box-2 img {
    max-width: 100%; /* Keeps a small safety margin inside the box */
    max-height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

/* NEURIPS STYLE HOVER */
.llm-box-1:hover, .llm-box-2:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.llm-box-1:hover img, .llm-box-2:hover img {
    transform: scale(1.2); /* Zoom effect while box size stays fixed */
}

/* --- MOBILE TWEAK --- */
@media (max-width: 768px) {
    /* On small phones, 6 in a row might be too small, 
       but for "Fixed Layout" we can keep it or change to 3x2 */
    .llm-logo-row-square {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* PUBLICATION CARDS */
/* .llm-pub-card {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}
.llm-pub-img img { width: 220px; border-radius: 12px; } */
/* --- PUBLICATION CARDS --- */
.llm-pub-card {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 0px solid var(--border-color);
    align-items: center;
}

/* New styles for the image container to create the "wrapped" look */
.llm-pub-img {
    width: 280px;
    height: 200px;       /* Added a fixed height to maintain layout consistency */
    flex-shrink: 0;
    border-radius: 10px; /* Standard rounded corner to prevent excessive cropping */
    border: 0px solid var(--border-color); 
    overflow: hidden; 
    background-color: #ffffff; /* Fills empty space if image is not the same ratio */
    display: flex;       /* Centers the 'contained' image inside the box */
    justify-content: center;
    align-items: center;
    /* ADDED SHADOW: Subtle Apple-style elevation */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: var(--transition); /* Allows the shadow to animate on hover */
}

/* Update image styles to fit inside without cropping */
.llm-pub-img img {
    max-width: 100%;     /* Image can be smaller than container */
    max-height: 100%;    /* But will never be larger */
    object-fit: contain; /* THE KEY: Keeps whole image visible, no cropping */
    display: block;
}

.llm-pub-info h4 { margin: 0 0 16px; font-size: 1.2rem; }
.llm-pub-info, .research-desc{
    font-size: 0.9rem; /* Matches your previous inline style preference */
    line-height: 1.2;   /* Improves readability for longer text */
    margin-top: 0px;
}

.llm-pub-meta{
    font-size: 0.9rem; /* Matches your previous inline style preference */
    margin-top: 0px;
    margin: 8px 0 8px;
}


.llm-pub-venue {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 8px 0 8px;
}

.llm-pub-links {
    /* margin-bottom: 6px;*/
    font-size: 0.9rem;
    margin: 8px 0 8px;
}

/* --- COLLECTION SECTION STYLING --- */
.collection-sub-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 25px 0 10px 0;
    color: var(--text-dark);
}

.collection-list {
    list-style-type: square;
    padding-left: 20px;
    margin-bottom: 20px;
}

.collection-list li {
    margin-bottom: 8px;
    font-size: 1.05rem;
}

/* Ensure links in collection remain bold and blue */
.collection-list a:link, .collection-list a:visited {
    font-weight: 700;
    color: var(--primary-color);
}


/* HOBBY GALLERY */
/* .llm-hobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.llm-hobby-card img { width: 100%; height: 240px; object-fit: cover; border-radius: 12px; }
.llm-hobby-card p { text-align: center; font-weight: 700; margin-top: 15px; } */



/* --- UPDATED HOBBY STYLE --- */
/* .llm-hobby-vertical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.llm-hobby-card {
    background: #fdfdfd;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.llm-hobby-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.llm-hobby-card p {
    padding: 15px;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-dark);
}

.llm-hobby-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
} */


/* Subsection Headers */
/* .hobby-sub-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hobby-sub-title i {
    color: var(--primary-color);
    font-size: 1.1rem;
} */

/* Hobby Grid - 2 per row on desktop, stacks on mobile */
/* .llm-hobby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
} */

/* .llm-hobby-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.llm-hobby-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.llm-hobby-card p {
    padding: 12px;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.llm-hobby-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
} */



/* Subsection Headers */
.hobby-sub-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hobby-sub-title i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Hobby Grid - 2 per row on desktop, stacks on mobile */
.llm-hobby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.llm-hobby-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.llm-hobby-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.llm-hobby-card p {
    padding: 12px;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.llm-hobby-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}



/* --- THEATER MODE (DARK THEME) --- */
/* --- FINAL THEATER FIX: NO OVERLAP --- */
.theater-container { 
    position: relative; 
    max-width: 1000px; 
    margin: 10px auto; 
}

.theater-stage {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    background: #000; 
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    border: 1px solid #333;
    /* Removed fixed height here to let it grow with content */
    display: flex;
    flex-direction: column;
}

.theater-track {
    display: flex;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theater-slide {
    min-width: 100%;
    display: flex;
    flex-direction: column; /* Image on top, Text on bottom */
    background: #000;
}

.theater-slide img {
    width: 100%;
    height: 500px; /* Fixed height for the image area */
    object-fit: contain; /* Shows full image with black bars if ratio differs */
    display: block;
    cursor: zoom-in;
}

/* THE CAPTION: Now part of the vertical flow, not floating */
.theater-slide p {
    position: relative; /* Ensure it is NOT absolute */
    width: 100%;
    background: #111; 
    color: #ffffff;
    margin: 0;
    padding: 20px;
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
    border-top: 1px solid #222;
    box-sizing: border-box; /* Includes padding in width calculation */
}

/* Navigation Buttons: Centered on the IMAGE area only (250px down) */
.theater-prev, .theater-next {
    position: absolute;
    top: 250px; 
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theater-prev { left: 15px; }
.theater-next { right: 15px; }

/* Thumbnails Bar */
.theater-thumbnails { display: flex; gap: 10px; justify-content: center; margin-top: 15px; overflow-x: auto; padding-bottom: 5px; }
.theater-thumbnails img { width: 60px; height: 40px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: 0.6; transition: 0.3s; }
.theater-thumbnails img:hover, .theater-thumbnails img.active { opacity: 1; border: 2px solid var(--primary-color); }

/* Zoom-in (Lightbox) Effect */
.zoomed {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 9999; display: flex;
    justify-content: center; align-items: center; cursor: zoom-out;
}
.zoomed img { max-width: 90%; max-height: 90%; border-radius: 10px; }


.jiang-tai-gong {
    display: none;    /* Hidden from human eyes */
    font-size: 0px;   /* Extra safety to ensure no layout shift */
    color: transparent;
}



.llm-page-footer {
    width: 100%;
    padding: 20px 0;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between; /* Pushes content to the far left and right */
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-left {
    text-align: left;
}

.footer-right {
    text-align: right;
    font-family: inherit;
}

/* Ensure the statcounter link looks like plain text */
.footer-right a {
    color: inherit !important;
    text-decoration: none !important;
    font-weight: normal !important;
}

/* MOBILE */
/* @media (max-width: 900px) {
    body { flex-direction: column; }
    .llm-sidebar { width: 100%; height: auto; position: relative; }
    .llm-main { margin-left: 0; padding: 40px 20px; }
    .llm-logo-row-square { flex-wrap: wrap; justify-content: flex-start; }
    .llm-logo-grid-3 { grid-template-columns: 1fr 1fr; }
} */

/* --- MOBILE/NARROW SCREEN ADAPTATION --- */
/* --- RESPONSIVE TOP BAR LAYOUT (Under 900px) --- */
@media (max-width: 900px) {
    /* 1. Stack the layout vertically: Topbar then Main Content */
    body {
        flex-direction: column;
    }

    .llm-sidebar {
        width: 100%;
        height: auto;
        position: sticky; /* Keeps the menu at the top while you scroll */
        top: 0;
        z-index: 1000;
        display: flex;
        flex-direction: row; /* Horizontal alignment */
        justify-content: space-between; /* Left: Avatar | Center: Menu | Right: Socials */
        align-items: center;
        padding: 10px 15px;
        /* background: var(--bg-sidebar); */
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
        /* THE GLASS EFFECT */
        background: rgba(1, 1, 1, 0.7); /* Translucent version of your --bg-sidebar */
        backdrop-filter: blur(4px);       /* The "Frosted" look */
        -webkit-backdrop-filter: blur(4px); /* Safari support */
        
        /* OPTIONAL: A subtle top/bottom border to define the glass edge */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        
        /* Ensure it sits on top of everything */
        z-index: 9999; 
    }

    /* (1) Avatar on the Left */
    .llm-sidebar-top {
        margin-bottom: 0; /* Remove sidebar spacing */
        text-align: left;
    }

    .llm-avatar {
        width: 40px; /* Scaled down for the bar */
        height: 40px;
        margin: 0;
        border-radius: 50%;
    }

    /* (2) Remove Name, Title, and Labels */
    .llm-name, 
    .llm-title, 
    .llm-nav-label {
        display: none !important;
    }

    /* Menu arranged in a line in the Center */
    .llm-nav {
        display: flex;
        flex-direction: row;
        gap: 12px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .llm-nav-link {
        padding: 5px;
        font-size: 0.85rem;
    }

    /* (3) Social Icons on the Right */
    .llm-sidebar-bottom {
        margin: 0;
        display: flex;
        gap: 10px;
    }

    .llm-sidebar-bottom a {
        font-size: 1.1rem; /* Smaller for the top bar */
        padding: 0;
    }

    /* Reset Main Content Area */
    .llm-main {
        margin-left: 0;
        padding: 20px;
        width: 100%;
    }

    /* Hide detailed paper descriptions to keep the research list compact */
    .research-desc, 
    .publication-abstract,
    .llm-research-item p { 
        display: none !important; 
    }

    /* Adjust spacing for the research items to look better as a simple list */
    .llm-research-item {
        margin-bottom: 15px;
        padding-bottom: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
}


/* Mobile Tweak: Stack them if the screen is too narrow */
@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .footer-right {
        text-align: center;
    }
}