.gs-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 30px;
}

.gs-carousel {
    position: relative;
}

.gs-carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
    min-height: 350px;
}

.gs-carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 640px;
    display: none;
    transform: translateX(100%);
    transition: transform 0.6s ease;
    overflow: hidden;
}

.gs-carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    transition: transform 0.6s ease;
    overflow: hidden;
}

.gs-carousel-item.prev {
    display: block;
    transform: translateX(-100%);
}

.gs-carousel-item.active {
    position: relative;
    display: block;
    transform: translateX(0);
}

.gs-carousel-item.next {
    display: block;
    transform: translateX(100%);
}

.gs-carousel-content {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    top: 50%;
    max-width: 1320px;
    width: 100%;
    padding: 0 10% 0 0;
    box-sizing: border-box;
    color: #fff;
    z-index: 31;
}

.gs-carousel-title {
    font-size: 40px;
    line-height: 52px;
    letter-spacing: 8%;
    
    word-break: break-word;
}

.gs-carousel-description {
    font-size:18px;
    margin-bottom: 20px;
}

.gs-carousel-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: transparent;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    border: 2px solid #fff;
    transition: all 0.3s ease;
    margin: 5px;
    text-align: center;
}

.gs-carousel-button:hover {
    background-color: #fff;
    color: #000 !important;
    border-color: #fff;
}

.gs-carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    font-size: 50px;
    color: #fff;
    text-decoration: none;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 10px;
    transition: all 0.3s ease;
}

.gs-carousel-control-icon {
    color: #fff;
    transition: color 0.3s ease;
}

.gs-carousel-prev {
    left: 10px;
}

.gs-carousel-next {
    right: 10px;
}

.gs-carousel-control:hover {
    opacity: 1;
}

/* .gs-carousel-control:hover .gs-carousel-control-icon {
    color: #fac230;
} */

.gs-carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: 0;
    margin: 0;
    list-style: none;
    text-align: center;
    display: flex;
}

.gs-carousel-indicators li {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.gs-carousel-indicators li.active {
    background-color: #fff;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 1024px) {
    .gs-carousel {
        width: 100vw;
    }
}

@media (max-width: 1061px) {
    .gs-carousel-inner {
        min-height: 250px;
    }
    
    .gs-carousel-item {
        height: 0;
        padding-bottom: 56.25%; /* 16:9 aspect ratio */
        overflow: hidden;
    }
    
    .gs-carousel-image {
        height: 100%;
        width: 100%;
        background-size: cover;
        background-position: center;
    }
    
    /* .gs-carousel-content {
        max-width: 70%;
        left: 15%;
    } */
    
    .gs-carousel-title {
        font-size: 40px;
        line-height: 52px;
        letter-spacing: 8%;

        word-break: break-word;
        margin: 15px 0;

    }
    
    .gs-carousel-control {
        width: auto;
        font-size: 40px;
        padding: 8px;
    }
}

@media (max-width: 768px) {
    .gs-carousel-content {
        max-width: 100%;
        left: 50%;
        top: 0;
        transform: translateX(-50%);
        margin-top: 48px;
        padding: 0 10%;
    }
    
    .gs-carousel-title {
        font-size: 40px;
        line-height: 52px;
        letter-spacing: 8%;
        word-break: break-word;
    }
    
    .gs-carousel-description {
        font-size: 18px;
    }
    
    .gs-carousel-item {
        height: 578px;
        padding-bottom: 0;
    }
    
    .gs-carousel-inner {
        min-height: 578px;
    }
}

@media (max-width: 480px) {
    .gs-carousel-inner {
        min-height: 578px;
    }
    
    .gs-carousel-item {
        height: 578px;
        padding-bottom: 0;
    }
    
    .gs-carousel-content {
        max-width: 100%;
        padding: 0 5%;
        margin-top: 48px;
    }
    
    .gs-carousel-title {
        font-size: 32px;
        line-height: 42px;
        letter-spacing: 8%;
        word-break: break-word;
    }
    
    .gs-carousel-description {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .gs-carousel-button {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    
    .gs-carousel-control {
        width: auto;
        font-size: 30px;
        padding: 6px;
    }
}

/* Standard button style - white background, black text */
.gs-carousel-button.gs-button-normal {
    background-color: #ffffff00;
    color: #fff !important;
    border: 1px solid #fff;
}

.gs-carousel-button.gs-button-normal:hover {
    background-color: ffffff00;
    color: var(--button-brand-color, #FAC230) !important;
    border: 1px solid var(--button-brand-color, #FAC230);
}

/* Tag button style - yellow background, white text */
.gs-carousel-button.gs-button-tag {
    background-color: #fff;
    color: #000 !important;
    border: 1px solid #fff;
}

.gs-carousel-button.gs-button-tag:hover {
    background-color: var(--button-brand-color, #FAC230);
    color: #fff !important;
    border: 1px solid var(--button-brand-color, #FAC230);
}

/* Font weight style */
.gs-font-weight-700 {
    font-weight: 700;
}

.gs-font-weight-400 {
    font-weight: 400;
}

/* Modify the image container and image style to ensure bottom alignment */
.gs-carousel-item.use-img-tag .gs-carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-end; /* Change to bottom alignment */
    justify-content: center;
}

.gs-carousel-item.use-img-tag .gs-carousel-image img {
    position: absolute;
    display: block;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    object-position: center bottom; /* Change to bottom alignment */
    top: auto; /* Clear top positioning */
    bottom: 0; /* Set bottom alignment */
    left: 50%;
    transform: translateX(-50%); /* Only center horizontally */
    margin: 0;
}

/* Remove conflict styles in media queries */
@media (max-aspect-ratio: 16/9) {
    .gs-carousel-item.use-img-tag .gs-carousel-image img {
        min-width: 100%;
        min-height: 100%;
        object-position: center bottom; /* Ensure bottom alignment in any case */
    }
}

/* Loading state style */
.gs-carousel-loading {
    opacity: 1;
    transition: none;
}

.gs-carousel-loaded {
    opacity: 1;
}

/* Stacked carousel style - only applied on large screens */
@media (min-width: 1921px) {
    .gs-carousel-container {
        position: relative;
        width: 100%;
        overflow: hidden;
    }
    
    .gs-carousel.stacked-mode .gs-carousel-inner {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 640px;
        overflow: visible;
        position: relative;
        max-width: 1920px;
        margin: 0 auto;
    }
    
    .gs-carousel.stacked-mode .gs-carousel-item {
        position: absolute;
        height: 640px;
        transition: all 0.6s ease;
        transform: none;
        display: block !important;
        overflow: hidden;
        border-radius: 4px;
        /* box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); */
        will-change: transform, opacity; /* Optimize rendering performance */
    }
    
    /* The currently displayed project - optimized initial state */
    .gs-carousel.stacked-mode .gs-carousel-item.active {
        z-index: 30;
        width: 100%;
        max-width: 1920px;
        left: 50%;
        transform: translateX(-50%);
        opacity: 1;
        transition: all 0.6s ease;
    }
    
    /* The left project - optimized initial state */
    .gs-carousel.stacked-mode .gs-carousel-item.prev-slide {
        z-index: 20;
        width: 90%;
        max-width: 1728px; /* 1920 * 0.9 */
        left: calc(50% - 960px - 5%);
        transform: translateX(-50%) scale(0.9);
        opacity: 0.7;
        transition: all 0.6s ease;
    }
    
    /* The right project - optimized initial state */
    .gs-carousel.stacked-mode .gs-carousel-item.next-slide {
        z-index: 20;
        width: 90%;
        max-width: 1728px; /* 1920 * 0.9 */
        left: calc(50% + 960px + 5%);
        transform: translateX(-50%) scale(0.9);
        opacity: 0.7;
        transition: all 0.6s ease;
    }
    
    /* The mask effect - add fade-in animation */
    .gs-carousel.stacked-mode .gs-carousel-item.prev-slide::after,
    .gs-carousel.stacked-mode .gs-carousel-item.next-slide::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0); /* 完全透明 */
        z-index: 10;
        transition: none; /* 移除过渡效果 */
    }
    
    /* 移除遮罩可见状态的黑色背景 */
    .gs-carousel.stacked-mode .gs-carousel-item.prev-slide.mask-visible::after,
    .gs-carousel.stacked-mode .gs-carousel-item.next-slide.mask-visible::after {
        background-color: rgba(0, 0, 0, 0); /* 完全透明 */
    }
    
    /* The left and right project mouse style */
    .gs-carousel.stacked-mode .gs-carousel-item.prev-slide,
    .gs-carousel.stacked-mode .gs-carousel-item.next-slide {
        cursor: default; /* Change to default mouse style */
        transition: all 0.6s ease;
    }
    
    /* Ensure the left and right arrows are displayed on top */
    .gs-carousel.stacked-mode .gs-carousel-control {
        z-index: 40;
        opacity: 0.8;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .gs-carousel.stacked-mode .gs-carousel-control:hover {
        opacity: 1;
    }
    
    /* Modify the position of the left and right arrows */
    .gs-carousel.stacked-mode .gs-carousel-prev {
        left: calc(50% - 960px + 10px);
    }
    
    .gs-carousel.stacked-mode .gs-carousel-next {
        right: calc(50% - 960px + 10px);
    }
    
    /* Enhance the indicator style */
    .gs-carousel.stacked-mode .gs-carousel-indicators {
        bottom: 20px;
        z-index: 40;
    }
    
    .gs-carousel.stacked-mode .gs-carousel-indicators li {
        width: 12px;
        height: 12px;
        margin: 0 6px;
        background-color: rgba(255, 255, 255, 0.6);
        border: 2px solid rgba(0, 0, 0, 0.2);
        /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); */
    }
    
    .gs-carousel.stacked-mode .gs-carousel-indicators li.active {
        background-color: #fff;
        transform: scale(1.1);
    }
    
    /* Update the style of the text content in the stacked mode */
    .gs-carousel.stacked-mode .gs-carousel-content {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        max-width: 1320px;
        width: 100%;
        padding: 0 5% 0 0;
        box-sizing: border-box;
        z-index: 35; /* Ensure the text content is at the top in the stacked mode */
    }
}

/* Add media query preload for initial loading */
@media (min-width: 1921px) {
    .gs-carousel-container {
        display: block;
    }
}

/* Responsive adjustment */
@media (max-width: 1320px) {
    .gs-carousel-content {
        max-width: 100%;
        padding: 0 10%;
    }
}

/* 初始样式优化 - 确保层叠模式在HTML渲染时就能应用 */
html.stacked-carousel-mode .gs-carousel .gs-carousel-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 640px;
    overflow: visible;
    position: relative;
    max-width: 1920px;
    margin: 0 auto;
}

html.stacked-carousel-mode .gs-carousel .gs-carousel-item {
    position: absolute;
    height: 640px;
    transition: all 0.6s ease;
    transform: none;
    display: block !important;
    overflow: hidden;
    border-radius: 4px;
    will-change: transform, opacity;
}

html.stacked-carousel-mode .gs-carousel .gs-carousel-item.active {
    z-index: 30;
    width: 100%;
    max-width: 1920px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 1;
}

html.stacked-carousel-mode .gs-carousel .gs-carousel-item.prev-slide {
    z-index: 20;
    width: 90%;
    max-width: 1728px;
    left: calc(50% - 960px - 5%);
    transform: translateX(-50%) scale(0.9);
    opacity: 0.7;
}

html.stacked-carousel-mode .gs-carousel .gs-carousel-item.next-slide {
    z-index: 20;
    width: 90%;
    max-width: 1728px;
    left: calc(50% + 960px + 5%);
    transform: translateX(-50%) scale(0.9);
    opacity: 0.7;
}

/* 同样更新HTML样式规则以保持一致 */
html.stacked-carousel-mode .gs-carousel .gs-carousel-item.prev-slide::after,
html.stacked-carousel-mode .gs-carousel .gs-carousel-item.next-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0); /* 完全透明 */
    z-index: 10;
}

/* 移除HTML样式中遮罩可见状态的黑色背景 */
html.stacked-carousel-mode .gs-carousel .gs-carousel-item.prev-slide.mask-visible::after,
html.stacked-carousel-mode .gs-carousel .gs-carousel-item.next-slide.mask-visible::after {
    background-color: rgba(0, 0, 0, 0); /* 完全透明 */
}

/* 取消加载状态延迟 */
.gs-carousel-loading {
    opacity: 1;
    transition: none;
}

.gs-carousel-loaded {
    opacity: 1;
}

/* 单图模式的样式 - 居中显示且最大宽度1920px */
.gs-carousel.stacked-mode.single-image-mode {
    display: flex;
    justify-content: center;
}

.gs-carousel.stacked-mode.single-image-mode .gs-carousel-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1920px;
    margin: 0 auto;
}

.gs-carousel.stacked-mode.single-image-mode .gs-carousel-item {
    position: relative;
    max-width: 1920px;
    width: 100%;
    margin: 0 auto;
    left: auto;
    transform: none;
}

.gs-carousel.stacked-mode.single-image-mode .gs-carousel-image {
    width: 100%;
    height: 100%;
}

.gs-carousel.stacked-mode.single-image-mode .gs-carousel-image img {
    max-width: 1920px;
    width: 100%;
    height: auto;
    object-fit: cover;
    margin: 0 auto;
}

/* 也为HTML层叠模式下的单图模式添加相同的样式 */
html.stacked-carousel-mode .gs-carousel.single-image-mode .gs-carousel-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1920px;
    margin: 0 auto;
}

html.stacked-carousel-mode .gs-carousel.single-image-mode .gs-carousel-item {
    position: relative;
    max-width: 1920px;
    width: 100%;
    margin: 0 auto;
    left: auto;
    transform: none;
}

html.stacked-carousel-mode .gs-carousel.single-image-mode .gs-carousel-image img {
    max-width: 1920px;
    width: 100%;
    height: auto;
    object-fit: cover;
    margin: 0 auto;
}
