/* ================================================
   首页轮播图 + 推荐位 样式
   ================================================ */

/* Hero 区域容器 */
.hero-section {
    padding: 20px 0;
}

/* 网格布局：左侧轮播 70%，右侧推荐位 30% */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    min-height: 320px;
}

/* =========================================
   轮播图区域
   ========================================= */
.carousel-wrapper {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--card-bg, rgba(30, 41, 59, 0.5));
}

.carousel-track {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden; /* Force hide vertical scroll */
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    height: 100%;
    touch-action: pan-y pinch-zoom; /* Let browser handle Y scroll, JS handles X */
    user-select: none; /* Prevent text selection during drag */
    -webkit-user-select: none;
}

.carousel-track::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* 单张轮播图 */
.carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    min-height: 320px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; /* Prevent image dragging (ghost) */
    user-drag: none;
    -webkit-user-drag: none;
}

/* hover 效果：紫色边框光晕（仅 PC 端） */
@media (min-width: 992px) {
    .carousel-slide:hover {
        transform: scale(1.01);
        box-shadow: 0 0 0 2px var(--primary, #667eea), 0 0 15px rgba(108, 92, 231, 0.4);
    }
}

/* 轮播图遮罩层（加深渐变，确保标题清晰） */
.carousel-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0.2) 70%, transparent 100%);
    pointer-events: none;
}

/* 轮播图文字叠加层（底部） */
.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    z-index: 2;
}

/* 左上角浮动标签（保持之前风格） */
.carousel-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 5;
    background: rgba(40, 80, 70, 0.85); /* 深苔绿色 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(245, 245, 245, 0.95); /* 暖白色 */
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 8px rgba(30, 60, 50, 0.3);
    letter-spacing: 0.5px;
}

.carousel-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin: 0 0 12px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 浏览量/日期元信息 */
.carousel-meta {
    position: absolute;
    bottom: 12px;
    right: 15px;
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    z-index: 3;
}

/* 轮播指示点 */
.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.carousel-dot.active {
    background: #fff;
    width: 24px;
    border-radius: 5px;
}

/* 空状态 */
.carousel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg, rgba(30, 41, 59, 0.8));
}

.carousel-empty .carousel-overlay {
    position: static;
    background: none;
    text-align: center;
}

/* =========================================
   右侧推荐位
   ========================================= */
.sidespots-wrapper {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.sidespot-card {
    flex: 1;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    color: inherit;
    min-height: 140px; /* (320 - 40) / 2 = 140px */
    background: var(--card-bg, rgba(30, 41, 59, 0.5));
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.sidespot-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* hover 效果：仅放大（仅 PC 端） */
@media (min-width: 992px) {
    .sidespot-card:hover {
        transform: scale(1.02);
    }
}

/* 推荐位遮罩层 */
.sidespot-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0.2) 70%, transparent 100%);
    pointer-events: none;
}

.sidespot-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    z-index: 2;
}

/* 推荐位左上角标签 */
.sidespot-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    background: rgba(40, 80, 70, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(245, 245, 245, 0.95);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 6px rgba(30, 60, 50, 0.3);
    letter-spacing: 0.3px;
}

.sidespot-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    margin: 0;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 推荐位空状态 */
.sidespot-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 255, 255, 0.1);
}

.sidespot-empty::after {
    display: none; /* 空状态不需要遮罩 */
}

.sidespot-empty .sidespot-overlay {
    position: static;
    background: none;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
}

/* =========================================
   响应式适配
   ========================================= */

/* 平板端 */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr 280px;
        gap: 30px;
        min-height: 280px;
    }
    
    .carousel-slide {
        min-height: 280px;
    }
    
    .carousel-title {
        font-size: 1.4rem;
    }
    
    .sidespot-card {
        min-height: 125px;
    }
}

/* 移动端：推荐位隐藏，轮播全宽 */
@media (max-width: 768px) {
    .hero-section {
        padding: 16px 0;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 0;
        min-height: auto;
    }
    
    .sidespots-wrapper {
        display: none; /* 移动端隐藏推荐位 */
    }
    
    .carousel-slide {
        min-height: 180px;
    }
    
    .carousel-overlay {
        padding: 20px;
    }
    
    .carousel-title {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .carousel-tag {
        top: 10px;
        left: 10px;
        font-size: 0.65rem;
        padding: 4px 10px;
    }
    
    .carousel-meta {
        bottom: 8px;
        right: 10px;
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    
    .carousel-dots {
        bottom: 12px;
    }
    
    .carousel-dot {
        width: 8px;
        height: 8px;
    }
    
    .carousel-dot.active {
        width: 20px;
    }
}
