/* ==============================================
   全屏横幅样式
   ============================================== */

/* 让横幅突破容器限制，铺满整个屏幕宽度 */
.banner-section {
    /* 重置所有边距和位置 */
    margin: 0 !important;
    padding: 0 !important;
    
    /* 突破容器限制，铺满整个屏幕宽度 - 使用更强的方法 */
    width: 100vw !important;
    position: relative;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    transform: translateX(0) !important; /* 防止其他transform干扰 */
    
    /* 高度自适应 */
    height: 160px;
    min-height: 120px;
    
    /* 其他样式 */
    border-radius: 0 !important; /* 去掉圆角，更好地铺满 */
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-medium) ease;
    
    /* 确保在正确的层级 */
    z-index: 1;
    
    /* 强制确保铺满屏幕 */
    box-sizing: border-box !important;
    
    /* 确保没有任何边距影响 */
    border: none !important;
    outline: none !important;
}

/* 横幅内容 */
.banner-item {
    width: 100%;
    height: 100%;
    /* 移除默认背景，让JavaScript动态设置的背景生效 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    position: relative;
    overflow: hidden; /* 确保图片不会溢出 */
}

/* 横幅图片 */
.banner-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
    /* 确保GIF动画正常播放 */
    image-rendering: auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* 防止图片被拖拽 */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* 渐变遮罩 - 仅在有内容时显示 */
.banner-item.with-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
    z-index: 1;
}

/* 横幅内容 */
.banner-item .banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 90%;
    padding: 0 var(--space-md);
}

/* 横幅图标 */
.banner-item .placeholder-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    display: block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 横幅标题 */
.banner-item .banner-title {
    font-size: var(--font-xxl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
}

/* 横幅描述 */
.banner-item .banner-desc {
    font-size: var(--font-md);
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    line-height: 1.4;
}

/* 占位符样式 */
.banner-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: relative;
}

/* 添加一些微交互效果 */
.banner-section:hover {
    transform: none; /* 移除悬停缩放，避免影响铺满效果 */
}

.banner-section:active {
    transform: none;
}

/* 响应式适配 - 针对各种iPhone尺寸优化 */

/* iPhone SE, 12 mini (375px) */
@media (max-width: 375px) {
    .banner-section {
        height: 140px !important;
        min-height: 120px !important;
        width: 100vw !important;
        left: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
    }
}

/* iPhone 12/13 Pro (390px) */  
@media (min-width: 376px) and (max-width: 390px) {
    .banner-section {
        height: 150px !important;
        width: 100vw !important;
        left: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
    }
}

/* iPhone XR, 11 (414px) */
@media (min-width: 391px) and (max-width: 414px) {
    .banner-section {
        height: 150px !important;
        width: 100vw !important;
        left: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
    }
}

/* iPhone 12/13/14 Pro Max (428px+) */
@media (min-width: 415px) {
    .banner-section {
        height: 160px !important;
        width: 100vw !important;
        left: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
    }
}

@media (min-width: 481px) {
    .banner-section {
        height: 200px;
    }
    
    .banner-item .placeholder-icon {
        font-size: 56px;
        margin-bottom: var(--space-lg);
    }
    
    .banner-item .banner-title {
        font-size: 22px;
        margin-bottom: var(--space-md);
    }
    
    .banner-item .banner-desc {
        font-size: var(--font-lg);
    }
}

/* 横向屏幕适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .banner-section {
        height: 120px;
        min-height: 100px;
    }
    
    .banner-item .placeholder-icon {
        font-size: 32px;
        margin-bottom: var(--space-xs);
    }
    
    .banner-item .banner-title {
        font-size: var(--font-lg);
        margin-bottom: var(--space-xs);
    }
    
    .banner-item .banner-desc {
        font-size: var(--font-sm);
    }
}

/* 确保分类导航正确显示 */
.category-section {
    margin-top: var(--space-lg);
    position: relative;
    z-index: 2;
}

/* 优化内容区域间距 */
.main-content {
    position: relative;
}

/* 修复可能的布局问题 */
.container {
    position: relative;
    overflow-x: visible !important; /* 允许横幅突破容器 */
}

/* 确保body不会阻止横幅铺满 */
body {
    overflow-x: hidden; /* 在body层面控制横向滚动 */
    margin: 0 !important;
    padding: 0 !important;
}

/* 确保html不会有影响 */
html {
    overflow-x: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
    .banner-item .banner-title,
    .banner-item .banner-desc {
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 深色模式支持（如果需要） */
@media (prefers-color-scheme: dark) {
    .banner-placeholder {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 50%, #2b6cb0 100%);
    }
}

/* 减少动画以提升性能（如果用户偏好） - 但保留GIF动画 */
@media (prefers-reduced-motion: reduce) {
    .banner-section {
        transition: none;
    }
    
    .banner-item::before {
        transition: none;
    }
    
    /* 注意: 不阻止GIF图片的动画播放 */
    .banner-item img {
        /* GIF动画应该继续播放，即使用户偏好减少动作 */
    }
}