/*
 * SoDesLab 官方网站样式表 - 最终整合版 (2025-12-04)
 * 包含功能：
 * 1. 响应式布局 (桌面端/移动端)
 * 2. 导航栏动态效果 (透明/深色切换)
 * 3. 移动端优化 (汉堡菜单、直显语言切换)
 * 4. Lab P-log 拍立得照片墙 (堆叠效果、加密文档入口)
 */

/* =========================================
   1. 通用基础与桌面端导航
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    /* 建议添加通用字体 */
}

/* 隐藏滚动条但保留功能 */
.demo::-webkit-scrollbar {
    display: none;
}

.demo {
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-x: hidden;
    overflow-y: auto;
}

html {
    scroll-behavior: smooth;
}

/* -------------------------------------
   Header & Navigation
   ------------------------------------- */

/* 导航栏容器 */
header#main-navbar {
    background-color: transparent;
    height: 14vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    color: #333333;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* 滚动后状态 */
header#main-navbar.scrolled,
.index-page header#main-navbar.scrolled {
    background-color: #333333;
    box-shadow: 0 0.2vw 0.5vw rgba(0, 0, 0, 0.2);
}

/* 首页特殊处理：初始无阴影 */
.index-page #main-navbar {
    background: transparent;
    box-shadow: none;
    z-index: 2;
}

/* 首页顶部渐变 (仅桌面显示，增强文字可读性) */
.index-page .gradient-extension {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 40vh;
    background: linear-gradient(to bottom, #e0e0e0 20%, transparent);
    z-index: 1;
}

/* Logo 样式 */
header#main-navbar .logo img {
    height: 9vh;
    position: absolute;
    left: 12vw;
    top: 2.5vh;
    transition: filter 0.3s ease, opacity 0.3s ease, height 0.3s ease, top 0.3s ease;
}

/* 滚动后 Logo 缩小 */
header#main-navbar.scrolled .logo img {
    height: 7.4vh;
    top: 3.3vh;
}

/* 桌面菜单链接 */
header#main-navbar ul {
    font-size: 1.5vw;
    position: absolute;
    right: 12vw;
    top: 6.2vh;
    line-height: 7.4vh;
    list-style: none;
    margin: 0;
    padding: 0;
}

header#main-navbar li {
    display: inline;
    margin-left: 2vw;
}

header#main-navbar a {
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

header#main-navbar a:hover {
    text-decoration: underline;
    color: #A4D336;
}

header#main-navbar a.current-page-active {
    color: #A4D336 !important;
    font-weight: bold;
    text-decoration: underline;
}

/* 滚动后文字变白 */
header#main-navbar.scrolled ul a {
    color: #ffffff;
}

header#main-navbar.scrolled ul a.current-page-active {
    color: #A4D336 !important;
}

/* Publications 页面特殊高亮 (保持黑色或白色背景下的可见性) */
.publications-page header#main-navbar a.current-page-active,
.publications-page header#main-navbar a.current-language-active {
    color: #333333;
}

.publications-page header#main-navbar.scrolled a.current-page-active,
.publications-page header#main-navbar.scrolled a.current-language-active {
    color: #ffffff;
}

/* 桌面端语言切换器 */
.language-switcher {
    position: absolute;
    right: 12vw;
    top: 2.5vh;
    font-size: 15.36px;
    color: #333333;
    z-index: 9999;
    opacity: 0.5;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.language-switcher:hover {
    opacity: 1;
}

.language-switcher a.current-language-active {
    font-weight: bold;
    color: #A4D336 !important;
    cursor: default;
    text-decoration: underline;
}

.language-switcher .separator {
    display: inline-block;
    width: 0.05vw;
    height: 1.2em;
    background-color: #333333;
    margin: 0 0.3vw;
    transform: rotate(15deg);
    vertical-align: middle;
    transition: background-color 0.3s ease;
}

header#main-navbar.scrolled .language-switcher,
header#main-navbar.scrolled .language-switcher a {
    color: #ffffff;
}

header#main-navbar.scrolled .language-switcher .separator {
    background-color: #ffffff;
}

/* =========================================
   2. 桌面端：各板块内容
   ========================================= */

/* Banner */
.banner {
    background-color: #E2E2E2;
    height: 100vh;
    width: 100vw;
    position: relative;
    background-size: 100vw auto;
    background-attachment: fixed;
    background-position: bottom center;
    z-index: -1;
    background-repeat: no-repeat;
}

.banner img {
    width: 100vw;
    height: auto;
    position: absolute;
    bottom: 0;
    left: 0;
}

.banner.p1 {
    background-image: url('../img/home/banner_back.png');
    width: 100vw;
    background-position: bottom center;
}

/* News */
.news {
    background-color: #333333;
    color: #E2E2E2;
    padding: 0 20vw 4.6vh 20vw;
}

.news h2 {
    font-size: 5vw;
    color: #A4D336;
    text-align: center;
    padding: 6vw 0;
}

.news_group {
    display: flex;
    align-items: center;
    gap: 2vw;
    width: 100%;
    margin-bottom: 3vh;
    text-align: left;
}

.image-container {
    width: 24vw;
    height: 13.5vw;
    flex-shrink: 0;
    overflow: hidden;
    margin-bottom: 2vw;
    border: 0.3vw solid #A4D336;
    box-sizing: border-box;
}

.image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.news-info {
    flex-grow: 1;
}

.news h3 {
    color: #A4D336;
    font-size: 1.6vw;
    margin: -2vw 0 0 0;
    line-height: 1.4;
}

.news p {
    color: #A4D336;
    font-size: 1vw;
    margin: 0.8vh 0;
    line-height: 1.6;
}

.news-link {
    text-decoration: none;
    color: #E2E2E2;
    transition: color 0.3s ease;
}

.news-link:hover {
    color: #A4D336;
}

/* Members */
.members {
    background-color: #E2E2E2;
    padding: 0 0 5vw 0;
}

.members h2 {
    text-align: left;
    font-size: 115.2px;
    padding: 10vw 0 3vw 12vw;
    color: #333333;
}

.members-group {
    list-style: none;
    display: flex;
    align-items: center;
    padding-left: 10vw;
    /* Core scaling variable for strict proportional lock */
    --w: 24vw; 
}

.members-group h2 {
    font-size: calc(var(--w) * 0.125);
    color: #333333;
    padding: 0 0 1.9vh 0;
}

.members-group h4 {
    font-size: calc(var(--w) * 0.0833);
    color: #333333;
    margin: -3vh 0 1vh 0;
}

.members-group h3 {
    font-size: calc(var(--w) * 0.0416);
    color: #333333;
    padding: 0.2vh 0;
}

.members-group p {
    font-size: calc(var(--w) * 0.029);
    color: #333333;
    padding: 1vh 0;
}

.members-img-L img,
.members-img-R img {
    width: var(--w);
    height: auto;
    margin: 0 5vw 1vw 2vw;
    transition: margin-left 0.4s ease, width 0.4s ease;
}

.members-img-R img {
    margin-left: 20vw;
}

.members-info-L,
.members-info-R {
    margin-bottom: 2vh;
    text-align: left;
    transition: width 0.4s ease;
}

.members-info-L {
    width: calc(var(--w) * 1.875);
}

.members-info-R {
    width: calc(var(--w) * 1.25);
}

/* 动态逐渐减弱的交差排版规则，且严格保持等比缩放 */
@media screen and (max-width: 1600px) {
    .members-group { --w: 26vw; }
    .members-img-R img { margin-left: 14vw; }
    .members-info-R { width: calc(var(--w) * 1.4); }
}

@media screen and (max-width: 1300px) {
    .members-group { --w: 28vw; }
    .members-img-R img { margin-left: 8vw; }
    .members-info-R { width: calc(var(--w) * 1.6); }
}

@media screen and (max-width: 1024px) {
    /* 极限视口下：奇偶行彻底向左对齐，消除交错 */
    .members-group { 
        --w: 32vw; 
        padding-left: 5vw; 
    }
    .members-img-R img { margin-left: 2vw; }
    .members-info-R { width: calc(var(--w) * 1.875); }
}

@media screen and (max-width: 768px) {
    /* 手机端维持左右但不溢出 */
    .members-group { 
        --w: 36vw; 
        padding-left: 3vw; 
    }
    .members-img-L img, .members-img-R img { margin-right: 3vw; }
    .members-info-L, .members-info-R { width: calc(var(--w) * 1.5); }
}

.members a {
    text-decoration: none;
    font-weight: bold;
    font-size: calc(var(--w) * 0.0541);
    color: #A4D336;
}

/* About */
.about {
    background-color: #D7FE7D;
}

.logo-video-container {
    padding: 10vw 0 0 10vw;
    height: 35vh;
    margin-bottom: 2vw;
}

.logo-video-container video {
    width: 70%;
    height: auto;
    display: block;
}

.about-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100vw;
}

.about-info-L {
    width: 50vw;
    text-align: left;
    margin: 17.5vw 0 10vw 17.5vw;
}

.about-info-R {
    align-self: flex-end;
    width: 40vw;
    text-align: right;
    margin: 0 17.5vw 10vw 0;
}

.about-info-R img {
    width: 384px;
    height: auto;
    margin: 5vw 0 -5vw 0;
    mix-blend-mode: multiply;
}

.about p,
.about h2 {
    font-size: 28.8px;
    padding: 1.4vh 0;
}

.fade-item {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-item.fade-in {
    opacity: 1;
}

/* Lablife */
.lablife {
    background-color: #E2E2E2;
}

.lablife h2 {
    text-align: left;
    font-size: 99.84px;
    padding: 10vw 0 2vw 12vw;
    color: #333333;
}

.lablife-group {
    list-style: none;
    display: flex;
    align-items: center;
    padding-left: 10vw;
}

.lablife-group h2 {
    font-size: 57.6px;
    padding: 0 0 1.9vh 0;
}

.lablife-group h4 {
    font-size: 38.4px;
    margin: -5vw 0 0.9vh 0;
}

.lablife-group h3,
.lablife-group p {
    font-size: 19.2px;
    padding: 0.9vh 0;
    color: #333333;
}

.lablife-info {
    width: 40vw;
    margin-bottom: 1.9vh;
    text-align: left;
}

.lablife a {
    text-decoration: none;
    font-weight: bold;
    font-size: 24.96px;
    color: #A4D336;
}

.carousel {
    position: relative;
    width: 30vw;
    height: auto;
    margin: 0 5vw 5vw 2vw;
    overflow: hidden;
}

.carousel-inner {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-image {
    min-width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: white;
    border: none;
    padding: 0.9vh;
    cursor: pointer;
    z-index: 10;
    font-size: 24.96px;
}

.carousel .prev-button {
    left: 0.5vw;
}

.carousel .next-button {
    right: 0.5vw;
}

.carousel button:hover {
    color: #A4D336;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2vw 0 5vw 0;
    gap: 1vw;
}

.pagination button {
    background-color: transparent;
    border: none;
    color: #333333;
    padding: 0.5vw 1vw;
    font-size: 1vw;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background-color: #A4D336;
    color: #fff;
}

.pagination button.active {
    background-color: #333333;
    color: #A4D336;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* LabP-log (照片墙) */
.labp-log-container {
    background-color: #333333;
    padding: 5vw 0;
    width: 100%;
    position: relative;
}

.labp-log-container h2 {
    text-align: left;
    font-size: 57.6px;
    color: #A4D336;
    padding: 2vw 0 2vw 10vw;
}

.labp-log-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /* Force equal width cols */
    gap: 4vw;
    padding: 2vw 10vw 5vw 10vw;
    /* Keep vertical padding, ensure horizontal matches container */
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    /* Prevent horizontal scroll from rotated items */
    align-items: start;
    /* Prevent items from stretching to match tallest in row */
}

.labp-log-item {
    background-color: #ffffff;
    padding: 0.6vw 0.6vw 3.5vw 0.6vw;
    box-shadow: 0 0.5vw 1.5vw rgba(0, 0, 0, 0.15);
    border: 1px solid #f2f2f2;
    position: relative;
    width: 100%;
    height: auto;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, z-index 0s;
    overflow: visible;
}

.labp-log-item:nth-child(odd) {
    transform: rotate(-1.5deg);
}

.labp-log-item:nth-child(even) {
    transform: rotate(1.2deg);
}

.labp-log-item:nth-child(3n) {
    transform: rotate(2deg);
}

.labp-log-item:nth-child(5n) {
    transform: rotate(-1deg);
}

.labp-log-item:hover {
    transform: scale(1.02) rotate(0deg) !important;
    z-index: 100;
    box-shadow: 0 2vw 4vw rgba(0, 0, 0, 0.25);
}

/* Stack Container Styling */
.labp-stack {
    display: grid;
    grid-template-areas: "stack";
    position: relative;
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    /* Strictly enforce width */
    aspect-ratio: 16 / 9;
    margin-bottom: 3.5vw;
    box-sizing: border-box;
}

.labp-stack>* {
    grid-area: stack;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure badge stays on top */
.stack-badge {
    z-index: 10;
    /* Consolidate badge styles here if needed */
    position: absolute;
    top: -10px;
    right: -10px;
    background: #A4D336;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* --- Stack Hover Effects --- */
/* When hovering the stack container, trigger effects on the top item (last-child) */

.labp-stack:hover .labp-log-item:last-child {
    transform: scale(1.02) rotate(0deg) !important;
    z-index: 100;
    box-shadow: 0 2vw 4vw rgba(0, 0, 0, 0.25);
}

.labp-stack:hover .labp-log-item:last-child .labp-log-overlay {
    background-color: rgba(255, 255, 255, 0.9);
}

.labp-stack:hover .labp-log-item:last-child .log-title {
    opacity: 1;
}

.labp-stack:hover .labp-log-item:last-child .log-body {
    opacity: 1;
}


.labp-log-item img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.labp-log-overlay {
    position: absolute;
    top: 0.6vw;
    left: 0.6vw;
    right: 0.6vw;
    bottom: 3.5vw;
    display: flex;
    flex-direction: column;
    background-color: transparent;
    transition: background-color 0.3s ease;
    overflow: visible;
}

.labp-log-item:hover .labp-log-overlay {
    background-color: rgba(255, 255, 255, 0.9);
}

.log-meta {
    position: absolute;
    bottom: -2.8vw;
    right: 0;
    width: 100%;
    text-align: right;
    color: #555555;
    font-size: 0.8vw;
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
    opacity: 1 !important;
    display: flex;
    justify-content: flex-end;
    gap: 1vw;
    pointer-events: none;
}

.log-header {
    opacity: 1;
    margin: 1vw;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.log-title {
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #A4D336;
    font-size: 2.2vw;
    font-weight: bold;
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
    max-width: 90%;
}

.labp-log-item:hover .log-title {
    opacity: 1;
}

.log-body {
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #333333;
    font-size: 0.9vw;
    line-height: 1.6;
    padding: 0 1vw 1vw 1vw;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.labp-log-item:hover .log-body {
    opacity: 1;
}

.log-body::-webkit-scrollbar {
    display: none;
}

/* Publish, Research, Footer 等 */
.publish {
    background-color: #A4D336;
    padding: 10vw 12vw 5vw 12vw;
}

.publish-group {
    display: flex;
    flex-direction: column;
    align-items: column;
    text-align: left;
    padding: 0 0 2vw 0;
}

.publish-group h2 {
    font-size: 48px;
    color: #333333;
    padding: 0 0 2vh 0;
}

.publish-group h4 {
    font-size: 38.4px;
    color: #333333;
    margin: 2.2vh 0;
}

.publish-group h3,
.publish-group p {
    font-size: 19.2px;
    color: #333333;
}

.publish a {
    text-decoration: none;
    font-weight: bold;
    font-size: 24.96px;
    color: #A4D336;
}

.research-page {
    display: flex;
    flex-direction: column;
    padding: 10vw 0 0 0;
    background-color: #E2E2E2;
}

.summary {
    display: flex;
    align-items: flex-end;
    gap: 2.6vw;
    padding: 0 12vw;
    font-size: 19.2px;
}

.research-image {
    width: 422.4px;
    height: auto;
    border: 0.2vw solid #A4D336;
}

.summary-text {
    display: flex;
    flex-direction: column;
    width: 60vw;
}

.details {
    padding: 0 12vw;
    max-height: 0;
    margin: 2vw 0;
    overflow: hidden;
    color: #A4D336;
    background-color: #333333;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out;
    font-size: 19.2px;
}

.details.expanded {
    max-height: 70vh;
    padding-top: 1.9vh;
    padding-bottom: 2vw;
}

.expand-button {
    position: relative;
    width: 2.6vw;
    height: 2.6vw;
    background: transparent;
    border: none;
    cursor: pointer;
}

.expand-button::after,
.expand-button::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 0.2vw;
    height: 2.2vh;
    background: #A4D336;
    transition: transform 0.3s ease;
}

.expand-button::after {
    left: 0.5vw;
    transform: translateY(-50%) rotate(-45deg);
}

.expand-button::before {
    left: 1.3vw;
    transform: translateY(-50%) rotate(45deg);
}

.research.expanded .expand-button::after {
    transform: translateY(-50%) rotate(45deg);
}

.research.expanded .expand-button::before {
    transform: translateY(-50%) rotate(-45deg);
}

.footer {
    background-color: #A4D336;
    color: #333333;
    text-align: center;
    padding: 1.9vh 12vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100vw;
}

.footer img {
    height: 3.7vh;
}

#protected-content {
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 15px;
    max-width: 900px;
    margin: 30px auto;
}

#protected-content iframe {
    width: 100%;
    height: 600px;
    display: block;
    border: none;
}

::-webkit-scrollbar {
    width: 0.4vw;
    height: 0.7vh;
}

::-webkit-scrollbar-track {
    background-color: #A4D336;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.5);
}


/* =========================================
   3. 移动端布局模式 (max-width: 768px)
   ========================================= */

/* 默认在桌面端隐藏移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
}

/* Home 页菜单展开时的背景控制 */
.index-page header#main-navbar.menu-open {
    background-color: #333333 !important;
    transition: background-color 0.3s ease;
}

.index-page header#main-navbar.menu-open .mobile-menu-toggle .icon,
.index-page header#main-navbar.menu-open .mobile-menu-toggle .icon::before,
.index-page header#main-navbar.menu-open .mobile-menu-toggle .icon::after {
    background-color: #ffffff !important;
}

@media screen and (max-width: 768px) {

    /* 隐藏桌面语言切换器 */
    .language-switcher {
        display: none;
    }

    /* 导航栏容器 */
    header#main-navbar {
        justify-content: space-between;
        padding: 0 5vw;
        height: 10vh;
        background-color: #333333;
        transform: translateY(-100%);
        transition: transform 0.3s ease, background-color 0.3s ease;
    }

    header#main-navbar.scrolled {
        transform: translateY(0);
    }

    .index-page header#main-navbar {
        transform: translateY(0) !important;
        background-color: transparent;
    }

    .index-page header#main-navbar.scrolled {
        background-color: #333333;
    }

    /* Logo 适配 */
    header#main-navbar .logo img,
    header#main-navbar.scrolled .logo img {
        height: 6vh !important;
        position: static;
        top: auto;
    }

    /* 汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: auto;
        height: auto;
        padding: 2vw;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1001;
        position: absolute;
        right: 2vw;
        bottom: 2.8vh;
    }

    .mobile-menu-toggle .icon,
    .mobile-menu-toggle .icon::before,
    .mobile-menu-toggle .icon::after {
        background-color: #ffffff;
    }

    /* Home 页初始黑色按钮 */
    .index-page header#main-navbar:not(.scrolled) .mobile-menu-toggle .icon,
    .index-page header#main-navbar:not(.scrolled) .mobile-menu-toggle .icon::before,
    .index-page header#main-navbar:not(.scrolled) .mobile-menu-toggle .icon::after {
        background-color: #000000 !important;
    }

    .mobile-menu-toggle .icon {
        position: relative;
        display: block;
        width: 7vw;
        height: 0.4vw;
        border-radius: 0;
        transition: background-color 0.3s ease;
        padding: 0;
        border: none;
    }

    .mobile-menu-toggle .icon::before,
    .mobile-menu-toggle .icon::after {
        content: '';
        position: absolute;
        left: 0;
        width: 100%;
        height: 0.4vw;
        border-radius: 0;
        transition: transform 0.3s ease, background-color 0.3s ease;
    }

    .mobile-menu-toggle .icon::before {
        transform: translateY(-2.2vw);
    }

    .mobile-menu-toggle .icon::after {
        transform: translateY(2.2vw);
    }

    /* 菜单下拉列表 (毛玻璃) */
    header#main-navbar ul {
        display: flex;
        flex-direction: column;
        width: 100%;
        text-align: left;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: rgba(51, 51, 51, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 1vw 2vw rgba(0, 0, 0, 0.3);
        max-height: 0;
        opacity: 0;
        padding: 0;
        overflow: hidden;
        transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease, padding 0.5s ease;
    }

    header#main-navbar ul.is-open {
        max-height: 80vh;
        opacity: 1;
    }

    header#main-navbar ul li {
        display: block;
        margin: 0;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    header#main-navbar ul li:last-child {
        border-bottom: none;
    }

    header#main-navbar ul a {
        display: block;
        color: #ffffff;
        font-size: 4.5vw;
        padding: 4vw 8vw;
        text-decoration: none !important;
        position: relative;
    }

    header#main-navbar ul a:active,
    header#main-navbar ul a:hover {
        background-color: rgba(255, 255, 255, 0.05);
        color: #A4D336;
    }

    header#main-navbar ul a.current-page-active {
        color: #A4D336 !important;
        background-color: rgba(164, 211, 54, 0.1);
        border-left: 1.5vw solid #A4D336;
        padding-left: 6.5vw;
    }

    /* 页面内容适配 */
    .index-page .gradient-extension {
        display: none;
    }

    .banner {
        width: 100vw;
        height: 217vw;
        background-attachment: scroll;
        background-size: 100% auto !important;
        background-position: center -10% !important;
        background-repeat: no-repeat;
    }

    .banner.p1 {
        background-image: url('../img/home/banner_phone.png') !important;
    }

    .banner img {
        display: none;
    }

    .news {
        padding: 10vw 5vw;
    }

    .news h2 {
        font-size: 8vw;
        padding: 5vw 0;
    }

    .news_group {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 8vw;
    }

    .image-container {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        margin-bottom: 3vw;
        border-width: 1vw;
    }

    .news h3 {
        font-size: 5vw;
        margin-top: 1vw;
    }

    .news p {
        font-size: 3.5vw;
    }

    .logo-video-container {
        padding: 40vh 0 40vh 0;
        height: auto;
        margin: 0 0 5vw -7vw;
        display: flex;
        justify-content: center;
    }

    .logo-video-container video {
        width: 90%;
    }

    .about-info-L,
    .about-info-R {
        width: 100%;
        margin: 0;
        padding: 5vw 8vw;
        text-align: left;
    }

    .about p,
    .about h2 {
        font-size: 4vw;
    }

    .about h2 {
        font-size: 5vw;
    }

    .about-info-R img {
        width: 50%;
        padding-top: 20vw;
        margin: 5vw auto;
        display: block;
    }

    .publish {
        padding: 20vw 5vw 10vw 5vw;
    }

    .publish-group {
        margin-bottom: 8vw;
    }

    .publish-group h2 {
        font-size: 8vw;
    }

    .publish-group h4 {
        font-size: 20vw;
        margin: 50vw 0 3vw 0;
    }

    .publish-group h3 {
        font-size: 4.5vw;
        margin-bottom: 1.5vw;
        line-height: 1.4;
    }

    .publish-group p {
        font-size: 3.5vw;
        line-height: 1.6;
        margin-bottom: 2vw;
    }

    .footer {
        flex-direction: column;
        padding: 5vw 0;
    }

    .footer img {
        height: 6vh;
        margin-bottom: 2vw;
    }

    .footer p {
        font-size: 3vw;
    }

    /* LabP-log Mobile */
    .labp-log-container h2 {
        font-size: 8vw;
        padding-left: 5vw;
    }

    .labp-log-grid {
        grid-template-columns: 1fr;
        gap: 8vw;
        padding: 0 10vw;
    }

    .labp-log-item {
        transform: rotate(0deg) !important;
        padding: 2vw 2vw 12vw 2vw;
        box-shadow: 0 1vw 3vw rgba(0, 0, 0, 0.15);
    }

    .labp-log-overlay {
        top: 2vw;
        left: 2vw;
        right: 2vw;
        bottom: 12vw;
        padding: 4vw;
    }

    .log-meta {
        bottom: -10vw;
        right: 2vw;
        font-size: 3.5vw;
    }

    .log-title {
        font-size: 8vw;
        margin: 0;
        max-width: 95%;
    }

    .labp-log-item:hover .log-title {
        opacity: 1;
    }

    .log-body {
        font-size: 3.5vw;
    }
}

/* =========================================
   11. Lab P-log 堆叠模式 (新增)
   ========================================= */

/* 堆叠容器：作为一个 Grid Item 存在 */
.labp-stack {
    display: grid;
    grid-template-areas: "stack";
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0s;
}

/* 堆叠容器内的卡片 */
.labp-stack .labp-log-item {
    grid-area: stack;
    margin: 0 !important;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
    background-color: #fff;
}

/* 悬停堆叠组时：整体轻微放大，提升层级 */
.labp-stack:hover {
    z-index: 100;
    transform: scale(1.02);
}

/* 视觉提示：照片数量 Badge */
.stack-badge {
    position: absolute;
    top: -0.8vw;
    right: -0.8vw;
    background-color: #A4D336;
    color: #333333;
    width: 2.2vw;
    height: 2.2vw;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2vw;
    z-index: 999;
    box-shadow: 0 0.2vw 0.5vw rgba(0, 0, 0, 0.3);
    pointer-events: none;
    border: 2px solid #fff;
}

@media screen and (max-width: 768px) {
    .stack-badge {
        width: 8vw;
        height: 8vw;
        font-size: 4vw;
        top: -3vw;
        right: -3vw;
    }
}

/* 切换动画类 */
.card-slide-out {
    transform: translateX(30%) rotate(15deg) !important;
    opacity: 0;
}

/* =========================================
   14. 移动端语言切换 (直显版样式 & 颜色修正)
   ========================================= */

/* 桌面端：隐藏 */
@media screen and (min-width: 769px) {
    .mobile-lang-direct {
        display: none;
    }
}

/* 移动端：显示并定位 */
@media screen and (max-width: 768px) {
    .mobile-lang-direct {
        display: flex;
        align-items: center;
        gap: 1.5vw;
        position: absolute;
        right: 15vw;
        bottom: 3vh;
        z-index: 1002;
        font-family: sans-serif;
        font-weight: bold;
        font-size: 4vw;
        line-height: 1;
    }

    .mobile-lang-direct a {
        text-decoration: none;
        transition: color 0.3s ease;
        opacity: 0.5;
    }

    .mobile-lang-direct a.active {
        opacity: 1;
        text-decoration: underline;
    }

    /* 颜色控制逻辑 */

    /* 1. 默认情况（非首页，或首页滚动后）：白色文字 */
    .mobile-lang-direct a,
    .mobile-lang-direct .sep {
        color: #ffffff;
    }

    /* 2. 首页特殊情况（透明背景时）：黑色文字 */
    .index-page header#main-navbar:not(.scrolled):not(.menu-open) .mobile-lang-direct a,
    .index-page header#main-navbar:not(.scrolled):not(.menu-open) .mobile-lang-direct .sep {
        color: #333333;
    }

    /* 3. 强制变白修正：滚动后或菜单打开时 */
    header#main-navbar.scrolled .mobile-lang-direct a,
    header#main-navbar.scrolled .mobile-lang-direct .sep {
        color: #ffffff !important;
    }

    header#main-navbar.menu-open .mobile-lang-direct a,
    header#main-navbar.menu-open .mobile-lang-direct .sep {
        color: #ffffff !important;
    }
}

/* =========================================
   15. Lab P-log Full-Screen Article Modal
   ========================================= */

/* The Modal Overlay (Background) */
.plog-modal-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 10000;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.85);
    /* Black w/ opacity */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.plog-modal-overlay.show {
    display: flex !important;
    opacity: 1;
    justify-content: center;
    align-items: center;
}

/* The Modal Content Container - Document Style */
.plog-modal-content {
    background-color: #fff;
    width: 90vw;
    height: 85vh;
    /* Slightly shorter to show it's a floating card */
    max-width: 680px;
    /* Narrower to fit text nicely */
    margin: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Scrollable content inside the white box */
    border-radius: 0;
    /* Square corners as requested */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10020;
    /* Ensure it's above side previews */

    /* Simple Scale + Fade Animation */
    animation: modalSimpleScale 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 1;
}

/* Custom Scrollbar for Modal content */
.plog-modal-content::-webkit-scrollbar {
    width: 6px;
}

.plog-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.plog-modal-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Modal Internal Wrapper to Center Content */
.plog-modal-internal-wrapper {
    width: 100%;
    margin: 0 auto;
    /* Close trigger is now the overlay, so no close button logic needed here */
    padding: 60px 40px;
    /* Content padding */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* --- Article List Navigation --- */
.plog-article-list {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.plog-list-title {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: bold;
}

.plog-list-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 1px solid #e0e0e0;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
}

.plog-list-item:hover {
    background-color: #fff;
    border-color: #A4D336;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.plog-list-item.active {
    background-color: #fff;
    border-left: 6px solid #A4D336;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.plog-list-item-date {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    color: #999;
    min-width: 100px;
    font-weight: bold;
}

.plog-list-item-title {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
    margin-left: 15px;
}


/* Article Styling inside Modal */
.plog-modal-header {
    border-bottom: 2px solid #A4D336;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.plog-modal-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
    line-height: 1.2;
}

.plog-modal-meta {
    font-size: 1rem;
    color: #666;
    display: flex;
    gap: 30px;
    font-family: "Courier New", Courier, monospace;
}

/* Image in Flow */
.plog-modal-image-container {
    width: 100%;
    margin-bottom: 40px;
    border-radius: 4px;
    /* Keep small radius for image inside */
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.plog-modal-image {
    width: 100%;
    height: auto;
    display: block;
}

.plog-modal-body {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #333;
}

.plog-modal-body p {
    margin-bottom: 1.5em;
}


/* Mobile Responsive for Modal */
@media screen and (max-width: 768px) {
    .plog-modal-content {
        width: 100vw;
        height: 100vh;
        max-width: none;
    }

    .plog-modal-internal-wrapper {
        padding: 40px 20px;
    }

    .plog-side-preview {
        display: none;
        /* Hide side previews on mobile, maybe use swipe? For now just hide */
    }
}

/* Fix for P-LOG Body Images */
.plog-modal-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* Expand Icon in P-LOG Card */
.plog-expand-icon {
    position: absolute;
    bottom: 15px;
    /* Adjust to align visually */
    left: 15px;
    color: #333;
    /* Default dark */
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 20;
    line-height: 0;
}

.labp-log-item:hover .plog-expand-icon {
    opacity: 1;
    color: #A4D336;
    /* Highlight color on hover */
    transform: scale(1.1);
}

/* On stack hover, verify the icon on the top card looks good */
.labp-stack:hover .labp-log-item:last-child .plog-expand-icon {
    opacity: 1;
    color: #A4D336;
}

/* =========================================
   A11y (无障碍) 辅助类
   ========================================= */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================
   无障碍切换按钮独特视觉样式
   ========================================= */
.language-switcher .a11y-toggle-btn {
    display: inline-flex;
    align-items: center;
    margin-left: 15px;
    padding: 2px 8px;
    color: inherit;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    text-transform: none;
    border: 1px solid rgba(51, 51, 51, 0.4);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.language-switcher .a11y-toggle-btn:hover {
    color: #A4D336 !important;
    border-color: #A4D336;
    background-color: rgba(164, 211, 54, 0.1);
    text-decoration: none;
}

header#main-navbar.scrolled .language-switcher .a11y-toggle-btn {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

header#main-navbar.scrolled .language-switcher .a11y-toggle-btn:hover {
    color: #A4D336 !important;
    border-color: #A4D336;
    background-color: rgba(164, 211, 54, 0.1);
}

body.a11y-mode .language-switcher .a11y-toggle-btn {
    color: #FFFF00 !important;
    border-color: #FFFF00 !important;
    font-weight: bold;
}

/* =========================================
   A11y (无障碍) 模式专属样式
   ========================================= */
body.a11y-mode {
    --bg-color: #000000;
    --text-color: #FFFF00;
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
}

/* =========================================
   A11y (无障碍) 现代滑动圆纹切换特效
   ========================================= */
#a11y-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100000;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    clip-path: circle(0% at 90vw 5vh);
    will-change: clip-path;
}

.a11y-overlay-brand {
    display: flex;
    align-items: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.a11y-overlay-icon {
    width: 70px;
    height: 70px;
}

.a11y-overlay-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.5;
}

.a11y-overlay-text {
    font-size: 55px;
    font-weight: 800;
    margin-left: 20px;
    display: flex;
    align-items: center;
    letter-spacing: 2px;
}

.a11y-word-collapse {
    display: inline-block;
    max-width: 100px;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.a11y-word-expand {
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
    opacity: 0;
}

#a11y-overlay.show-icon .a11y-overlay-brand {
    opacity: 1;
    transform: scale(1);
}

#a11y-overlay.expand-text .a11y-word-collapse {
    max-width: 0;
    opacity: 0;
}

#a11y-overlay.expand-text .a11y-word-expand {
    max-width: 420px;
    opacity: 1;
}

body.a11y-mode *:not(#a11y-overlay):not(#a11y-overlay *) {
    background-color: transparent !important;
    background-image: none !important;
    color: inherit !important;
    border-color: var(--text-color) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transition: none !important;
    transform: none !important;
}

/* 放大字号并增加行高 */
body.a11y-mode h1, body.a11y-mode h2, body.a11y-mode h3, body.a11y-mode h4, body.a11y-mode p, body.a11y-mode a, body.a11y-mode span, body.a11y-mode li {
    font-size: 150% !important;
    line-height: 1.6 !important;
}

body.a11y-mode a {
    text-decoration: underline !important;
}

/* 强制单列布局，避免复杂网格影响阅读 */
body.a11y-mode header#main-navbar {
    position: static !important;
    height: auto !important;
    padding: 2rem !important;
}

body.a11y-mode header#main-navbar ul {
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
}

body.a11y-mode header#main-navbar li {
    display: block !important;
    margin: 0.5rem 0 !important;
}

body.a11y-mode header#main-navbar,
body.a11y-mode .about-info,
body.a11y-mode .members-group,
body.a11y-mode .labp-log-grid,
body.a11y-mode .news_group,
body.a11y-mode .publish-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
}

body.a11y-mode .members-img-L,
body.a11y-mode .members-img-R,
body.a11y-mode .about-info-L,
body.a11y-mode .about-info-R,
body.a11y-mode .members-info-L,
body.a11y-mode .members-info-R {
    width: 100% !important;
    margin: 1rem 0 !important;
    text-align: left !important;
}

/* 隐藏纯装饰性背景、视频和首页非必要元素 */
body.a11y-mode header#main-navbar .logo,
body.a11y-mode .gradient-extension,
body.a11y-mode .banner,
body.a11y-mode .logo-video-container,
body.a11y-mode .about-info-R img,
body.a11y-mode .index-page .news .image-container,
body.a11y-mode .index-page .news .news-info p {
    display: none !important;
}

/* 首页 A11y 专属介绍模块 */
.a11y-intro-section {
    display: none;
}

body.a11y-mode .a11y-intro-section {
    display: flex !important;
    flex-direction: column !important;
    padding: 60px 4vw;
    max-width: 900px;
}
body.a11y-mode .a11y-intro-section h2 {
    font-size: 200%;
    margin-bottom: 20px;
    color: #FFFF00;
}
body.a11y-mode .a11y-intro-section p {
    font-size: 110%;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #FFFFFF;
}

/* 增加高对比度焦点样式 */
body.a11y-mode *:focus {
    outline: 3px solid #FFFF00 !important;
    outline-offset: 2px !important;
}

/* 图像高对比度处理 */
body.a11y-mode img {
    filter: grayscale(100%) contrast(150%) !important;
    max-width: 100% !important;
    height: auto !important;
}