/* 广告轮播组件样式 */
.ad-carousel-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    background: var(--ads-bg-color, #ffffff);
    border: 1px solid var(--ads-border-color, #e0e0e0);
    border-radius: var(--ads-border-radius, 8px);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.ad-carousel-container:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.ad-carousel-wrapper {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.ad-carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    cursor: pointer;
    display: flex;
    text-decoration: none;
    color: inherit;
}

.ad-carousel-item.active {
    opacity: 1;
}

.ad-carousel-item.slide-animation {
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
    transform: translateX(100%);
}

.ad-carousel-item.slide-animation.active {
    transform: translateX(0);
}

.ad-carousel-item.slide-animation.prev {
    transform: translateX(-100%);
}

.ad-image-container {
    flex: 0 0 100px;
    height: 100%;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ad-carousel-item:hover .ad-image {
    transform: scale(1.05);
}

.ad-content {
    flex: 1;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--ads-text-color, #333333);
}

.ad-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 6px 0;
    color: var(--ads-text-color, #333333);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ad-description {
    font-size: 12px;
    line-height: 1.3;
    color: var(--ads-text-color, #666666);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ad-carousel-indicators {
    position: absolute;
    bottom: 8px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.ad-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ad-indicator.active {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.2);
}

.ad-carousel-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.ad-carousel-container:hover .ad-carousel-controls {
    opacity: 1;
}

.ad-carousel-controls:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.ad-carousel-controls.prev {
    left: 8px;
}

.ad-carousel-controls.next {
    right: 8px;
}

.ad-carousel-pause-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.ad-carousel-container.paused .ad-carousel-pause-indicator {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ad-carousel-container {
        margin-bottom: 15px;
    }
    
    .ad-carousel-wrapper {
        height: 120px;
    }
    
    .ad-image-container {
        flex: 0 0 80px;
    }
    
    .ad-content {
        padding: 10px 12px;
    }
    
    .ad-title {
        font-size: 13px;
        -webkit-line-clamp: 1;
    }
    
    .ad-description {
        font-size: 11px;
        -webkit-line-clamp: 2;
    }
    
    .ad-carousel-controls {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* 无图片时的占位样式 */
.ad-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 24px;
}

/* 加载动画 */
.ad-carousel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    background: #f9f9f9;
    color: #666;
    font-size: 14px;
}

.ad-carousel-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid #ddd;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: ad-spin 1s linear infinite;
}

@keyframes ad-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .ad-carousel-container {
        background: var(--ads-bg-color, #2d2d2d);
        border-color: var(--ads-border-color, #404040);
    }
    
    .ad-title {
        color: var(--ads-text-color, #ffffff);
    }
    
    .ad-description {
        color: var(--ads-text-color, #cccccc);
    }
    
    .ad-image-placeholder {
        background: linear-gradient(135deg, #404040 0%, #2d2d2d 100%);
        color: #666;
    }
}

/* 动画禁用选项 */
.ad-carousel-container.no-animation .ad-carousel-item {
    transition: none;
}

.ad-carousel-container.no-animation .ad-image {
    transition: none;
}

.ad-carousel-container.no-animation .ad-carousel-controls {
    transition: none;
}

