/* 自定义幻灯片基础样式 */
.custom-slideshow {
    position: relative;
    width: 100% !important;
    height: 800px !important; /* 固定PC端高度 */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 容器控制样式 */
.custom-slideshow-container {
    position: relative;
    width: 100% !important;
    height: 800px !important; /* 固定PC端高度 */
    margin: 0 auto;
    transition: all 0.3s ease;
}

/* 容器控制启用时的样式 */
.custom-slideshow-container.container-controlled {
    display: block;
}

/* 全宽容器 */
.custom-slideshow-container.container-full-width {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

/* 自定义宽度容器 */
.custom-slideshow-container.container-custom-width {
    width: auto;
    max-width: 100%;
}

/* 全高容器 */
.custom-slideshow-container.container-full-height {
    height: 100vh;
    min-height: 100vh;
}

.custom-slideshow-container.container-full-height .custom-slideshow {
    height: 100vh;
}

/* 自定义高度容器 */
.custom-slideshow-container.container-custom-height {
    height: auto;
}

/* 自动调整容器 - 优化定点显示支持 */
.custom-slideshow-container.container-auto-resize {
    width: fit-content;
    height: 800px !important; /* 保持固定高度以支持定点显示 */
}

.custom-slideshow-container.container-auto-resize .custom-slideshow {
    width: 100%;
    height: 800px !important; /* 保持固定高度以支持定点显示 */
    min-height: 200px;
}

/* 响应式行为样式 */
.custom-slideshow-container.container-adaptive {
    width: 100%;
    max-width: 1200px;
}

.custom-slideshow-container.container-fixed {
    width: 800px;
    height: 800px !important; /* 固定高度 */
}

.custom-slideshow-container.container-fluid {
    width: 100%;
    height: 800px !important; /* 固定高度 */
}

/* 容器位置样式 */
.custom-slideshow-container.container-left {
    margin: 0 auto 0 0;
}

.custom-slideshow-container.container-center {
    margin: 0 auto;
}

.custom-slideshow-container.container-right {
    margin: 0 0 0 auto;
}

/* 幻灯片容器 */
.slideshow-container {
    position: relative;
    width: 100%;
    height: 800px !important; /* 固定高度 */
}

/* 幻灯片 */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
}

/* 幻灯片图片 */
.slide-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center center !important; /* 默认居中 */
}

/* 图片显示位置样式 - 增强定点显示效果 */
.slide-image.image-position-top img {
    object-position: center top !important;
}

.slide-image.image-position-center img {
    object-position: center center !important;
}

.slide-image.image-position-bottom img {
    object-position: center bottom !important;
}

.slide-image.image-position-left img {
    object-position: left center !important;
}

.slide-image.image-position-right img {
    object-position: right center !important;
}

.slide-image.image-position-top-left img {
    object-position: left top !important;
}

.slide-image.image-position-top-right img {
    object-position: right top !important;
}

.slide-image.image-position-bottom-left img {
    object-position: left bottom !important;
}

.slide-image.image-position-bottom-right img {
    object-position: right bottom !important;
}

/* 幻灯片遮罩 */
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* 幻灯片内容 */
.slide-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
    padding: 20px;
    max-width: 80%;
}

/* 内容位置样式 */
.slide-content.slide-content-top-left {
    align-self: flex-start;
    justify-self: flex-start;
    text-align: left;
}

.slide-content.slide-content-top-center {
    align-self: flex-start;
    justify-self: center;
    text-align: center;
}

.slide-content.slide-content-top-right {
    align-self: flex-start;
    justify-self: flex-end;
    text-align: right;
}

.slide-content.slide-content-center-left {
    align-self: center;
    justify-self: flex-start;
    text-align: left;
}

.slide-content.slide-content-center {
    align-self: center;
    justify-self: center;
    text-align: center;
}

.slide-content.slide-content-center-right {
    align-self: center;
    justify-self: flex-end;
    text-align: right;
}

.slide-content.slide-content-bottom-left {
    align-self: flex-end;
    justify-self: flex-start;
    text-align: left;
}

.slide-content.slide-content-bottom-center {
    align-self: flex-end;
    justify-self: center;
    text-align: center;
}

.slide-content.slide-content-bottom-right {
    align-self: flex-end;
    justify-self: flex-end;
    text-align: right;
}

/* 幻灯片标题 */
.slide-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 0 15px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* 幻灯片描述 */
.slide-description {
    font-size: 1.1rem;
    margin: 0 0 20px 0;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 幻灯片按钮 */
.slide-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-shadow: none;
}

.slide-button:hover {
    background-color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 导航箭头 */
.slideshow-arrow {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 4;
    transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
    margin: 0;
    padding: 0;
    flex: none;
    outline: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.slideshow-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateY(-50%) scale(1.1);
}

.slideshow-prev {
    left: 20px;
}

.slideshow-next {
    right: 20px;
}

.arrow-icon {
    font-size: 24px;
    font-weight: bold;
    pointer-events: none;
}

/* 指示点 */
.slideshow-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    z-index: 4;
    align-items: center;
    justify-content: center;
}

.slideshow-dot {
    all: unset;
    display: inline-block;
    box-sizing: border-box;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #bbb;
    margin: 0;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
    vertical-align: middle;
    flex: none;
}

.slideshow-dot.active {
    background: #191c22;
    border-color: #191c22;
}

.slideshow-dot:hover {
    border-color: #007cba;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .custom-slideshow {
        height: 400px !important; /* 移动端固定高度 */
    }
    
    .custom-slideshow-container {
        height: 400px !important; /* 移动端固定高度 */
    }
    
    .custom-slideshow-container.container-auto-resize {
        height: 400px !important; /* 移动端固定高度 */
    }
    
    .custom-slideshow-container.container-auto-resize .custom-slideshow {
        height: 400px !important; /* 移动端固定高度 */
    }
    
    .custom-slideshow-container.container-fixed {
        height: 400px !important; /* 移动端固定高度 */
    }
    
    .custom-slideshow-container.container-fluid {
        height: 400px !important; /* 移动端固定高度 */
    }
    
    .slideshow-container {
        height: 400px !important; /* 移动端固定高度 */
    }

    .slide-title {
        font-size: 24px;
    }

    .slide-description {
        font-size: 14px;
    }

    .slideshow-arrow {
        width: 40px;
        height: 40px;
    }

    .arrow-icon {
        font-size: 18px;
    }

    .custom-slideshow-container.container-full-width {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
    }

    .custom-slideshow-container.container-fixed {
        width: 100%;
        height: 400px !important;
    }

    .slideshow-dots {
        gap: 12px;
        bottom: 15px;
    }
    .slideshow-dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .custom-slideshow {
        height: 250px;
    }
    
    .slide-title {
        font-size: 1.5rem;
    }
    
    .slide-description {
        font-size: 0.9rem;
    }
    
    .slideshow-arrow {
        width: 32px;
        height: 32px;
    }
    
    .arrow-icon {
        font-size: 16px;
    }
    
    .slideshow-dots {
        gap: 8px;
        bottom: 10px;
    }
    
    .slideshow-dot {
        width: 8px;
        height: 8px;
    }
}

/* 编辑器中的特殊样式 */
.elementor-editor-active .custom-slideshow-container {
    border: 2px dashed #0073aa;
    padding: 10px;
    background-color: rgba(0, 115, 170, 0.05);
}

.elementor-editor-active .custom-slideshow-container:hover {
    border-color: #005a87;
    background-color: rgba(0, 115, 170, 0.1);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.custom-slideshow-container {
    animation: fadeIn 0.3s ease-in-out;
}

/* 自动调整时的特殊处理 */
.custom-slideshow-container.container-auto-resize .slide-image img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* 全屏模式下的特殊处理 */
.custom-slideshow-container.container-full-height {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
}

/* 打印样式 */
@media print {
    .slideshow-arrow,
    .slideshow-dots {
        display: none;
    }
    
    .custom-slideshow-container {
        width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }
    
    .slide {
        opacity: 1 !important;
        position: relative !important;
    }
}

/* 保证幻灯片Widget自身宽度100% */
.custom-slideshow-container,
.custom-slideshow-container .custom-slideshow {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* PC端固定高度800px */
.custom-slideshow-container,
.custom-slideshow {
    height: 800px !important;
    min-height: 800px !important;
}

/* 移动端固定高度400px */
@media (max-width: 767px) {
    .custom-slideshow-container,
    .custom-slideshow {
        height: 400px !important;
        min-height: 400px !important;
    }
} 

/**********************************************************************/
/* 强化选择器，确保样式100%命中 */
/**********************************************************************/
.slide-image.image-position-bottom-right img,
.custom-slideshow-container .slide-image.image-position-bottom-right img,
.custom-slideshow .slide-image.image-position-bottom-right img,
.elementor-widget-container .slide-image.image-position-bottom-right img {
    object-fit: cover !important;
    object-position: right bottom !important;
}

