:root {
    --white: #ffffff;
    --menu-width: 280px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--white);
    background-color: #f0f2f5;
    transition: transform 0.3s ease;
}

.container {
    margin-top: 80px;
}

/* 图片放大效果 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1002;
    justify-content: center;
    align-items: center;
}

.image-modal.show {
    display: flex;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.section-blue-black {
    position: relative;
    background: linear-gradient(to top, rgb(32 32 32) 50%, rgba(0, 0, 0, 0) 100% );
    z-index: 3;
    -webkit-mask: linear-gradient(to top, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%);
    mask: linear-gradient(to top, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 0) 100%);
    height: 40vh;
    margin-top: -30vh;
}

/* Section 样式 */
.section-container {
    display: flex;
    width: 100%;
    max-height: 60em;
    padding: 40px;
    padding-right:78px;    
    background-color: #202020;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.content-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

.text-content {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateY(50px);
}

.gallery-content {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    padding: 20px;
    opacity: 0;
    transform: translateX(50px);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 78px;
    color: var(--white);
}

.section-text {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: var(--white);
    opacity: 0.9;
}

.detail-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    width: fit-content;
    opacity: 0;
    transform: translateY(20px);
}

.detail-button:hover {
    background-color: var(--white);
    color: rgb(0, 0, 0);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
}

.gallery-item {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    opacity: 0;
    transform: scale(0.9);
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 折叠展开按钮样式 */
/* 折叠展开按钮容器 */
.toggle-sections-container {
    padding: 20px 0;
    background-color: #202020;
    position: relative;
    z-index: 10;
    text-align: left; /* 改为左对齐 */
}

/* 按钮基础样式 */
.toggle-all-sections {
    padding: 12px 30px;
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block; /* 确保左对齐生效 */
    margin-left: 25px; /* 移动端默认25px */
}

.toggle-all-sections:hover {
    background-color: var(--white);
    color: #202020;
}

/* 电脑端适配 */
@media screen and (min-width: 769px) {
    .toggle-sections-container {
        padding-left: 70px; /* 电脑端容器左侧间距70px */
    }
    .toggle-all-sections {
        margin-left: 0; /* 重置移动端的25px间距 */
    }
}

/* 折叠展开效果 */
.collapsible-section {
    transition: 
        max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease;
    overflow: hidden;
    will-change: max-height;
}

.collapsible-section.minimized {
    max-height: 200px;
}

.collapsible-section.expanded {
    max-height: 60em;
    padding-bottom: 4em;
}

/* 折叠状态下只显示主图片 */
.collapsible-section.minimized .gallery-grid {
    display: flex;
    justify-content: flex-start;
}

.collapsible-section.minimized .secondary-image {
    display: none;
}

.collapsible-section.minimized .main-image {
    width: 150px !important;
    height: 150px !important;
    padding-bottom: 0 !important;
    margin-right: 20px;
    top:-20px;
}

.collapsible-section.minimized .gallery-item img {
    position: static;
    margin-top: 20px;
    width: 70%;
    height: 70%;
}

.collapsible-section.minimized .section-text,
.collapsible-section.minimized .detail-button {
    display: none;
}

.collapsible-section.minimized .text-content {
    padding: 0;
    margin: 0;
    justify-content: center;
}

.collapsible-section.minimized .content-wrapper {
    align-items: center;
}

/* 展开状态下恢复原有样式 */
.collapsible-section.expanded .gallery-grid {
    display: grid;
}

.collapsible-section.expanded .secondary-image {
    display: block;
}

.collapsible-section.expanded .main-image {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    position: relative;
}

.collapsible-section.expanded .section-text,
.collapsible-section.expanded .detail-button {
    display: block;
}

/* 电脑端样式 */
@media screen and (min-width: 769px) {
    .collapsible-section.minimized .content-wrapper {
        display: flex;
        justify-content: space-between; /* 关键：两端对齐 */
        align-items: center; /* 垂直居中 */
        width: 100%;
        padding-left: 30px; /* 保持您要求的左侧间距 */
    }

    .collapsible-section.minimized .text-content {
        flex: 1; /* 文字占据剩余空间 */
        padding-right: 20px; /* 和图片保持间距 */
        min-width: 0; /* 防止长标题溢出 */
    }

    .collapsible-section.minimized .gallery-content {
        flex: 0 0 auto; /* 图片容器不伸缩 */
    }

    .collapsible-section.minimized .main-image {
        width: 120px; /* 固定图片宽度 */
        height: 120px; /* 固定图片高度 */
        margin-left: auto; /* 确保图片靠右 */
    }
}

/* 平板样式 */
@media (min-width: 425px) and (max-width: 768px) {
    .section-container {
        padding:20px;
        padding-right: 45px;
        padding-top: 60px;
    }
}

/* 移动端样式 */
@media screen and (max-width: 768px) {
    .section-container {
        padding: 10px;
        padding-right: 45px;
        padding-top: 35px;
    }

    .section-blue-black {
        height: 20vh;
    }
    
    .content-wrapper {
        flex-direction: column;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        margin: 0 !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-item {
        padding-bottom: 100%;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    .section-text {
        font-size: 0.9rem;
    }

    .text-content {
        padding: 15px;
        margin-bottom: 20px;
    }

    .gallery-content {
        padding: 10px;
    }

    /* 折叠状态下的移动端特定样式 */
    .collapsible-section.minimized .content-wrapper {
        flex-direction: row !important;
        align-items: center;
    }

    .collapsible-section.minimized .text-content {
        padding: 0 15px !important;
        margin-bottom: 0 !important;
        justify-content: flex-start !important;
        text-align: left !important;
        flex: 1;
    }

    .collapsible-section.minimized .gallery-content {
        padding: 0 !important;
        flex: 0 0 auto;
    }

    .collapsible-section.minimized .main-image {
        width: 80px !important;
        height: 80px !important;
    }

    .collapsible-section.minimized .section-title {
        text-align: left;
        /* margin-bottom: 5px !important; */
    }

    /* 特别针对超小屏幕(小于400px)的折叠状态 */
    @media screen and (max-width: 400px) {
        .collapsible-section.minimized .main-image {
            display: none !important;
        }
        
        .collapsible-section.minimized .content-wrapper {
            flex-direction: column !important;
            align-items: flex-start;
        }
        
        .collapsible-section.minimized .text-content {
            padding: 15px !important;
            width: 100%;
        }
    }
}