/* 广告横幅样式 */

/* 广告容器基础样式 */
.ad-banner-container {
    margin: 20px 0;
    text-align: center;
}

/* 单个广告横幅样式 */
.ad-banner {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: #fff;
}

.ad-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 广告图片样式 */
.ad-banner-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.ad-banner:hover .ad-banner-image {
    transform: scale(1.02);
}

/* 广告链接样式 */
.ad-banner a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ad-banner a:hover {
    text-decoration: none;
}

/* 不同位置的广告样式 */

/* 页面顶部广告 */
.ad-position-header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 30px;
}

.ad-position-header .ad-banner-image {
    max-height: 120px;
    object-fit: cover;
}

/* 侧边栏广告 */
.ad-position-sidebar {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px;
}

.ad-position-sidebar .ad-banner-image {
    max-height: 250px;
    object-fit: cover;
}

/* 内容区顶部广告 */
.ad-position-content_top {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 30px;
}

.ad-position-content_top .ad-banner-image {
    max-height: 150px;
    object-fit: cover;
}

/* 内容区底部广告 */
.ad-position-content_bottom {
    width: 100%;
    max-width: 800px;
    margin: 30px auto 0;
}

.ad-position-content_bottom .ad-banner-image {
    max-height: 150px;
    object-fit: cover;
}

/* 页面底部广告 */
.ad-position-footer {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto 0;
}

.ad-position-footer .ad-banner-image {
    max-height: 100px;
    object-fit: cover;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ad-banner-container {
        margin: 15px 0;
    }
    
    .ad-banner {
        margin: 8px 0;
        border-radius: 6px;
    }
    
    /* 移动端广告高度调整 */
    .ad-position-header .ad-banner-image {
        max-height: 80px;
    }
    
    .ad-position-sidebar .ad-banner-image {
        max-height: 180px;
    }
    
    .ad-position-content_top .ad-banner-image,
    .ad-position-content_bottom .ad-banner-image {
        max-height: 100px;
    }
    
    .ad-position-footer .ad-banner-image {
        max-height: 60px;
    }
}

@media (max-width: 480px) {
    .ad-banner-container {
        margin: 10px 0;
    }
    
    .ad-banner {
        margin: 5px 0;
        border-radius: 4px;
    }
    
    /* 小屏幕广告高度进一步调整 */
    .ad-position-header .ad-banner-image {
        max-height: 60px;
    }
    
    .ad-position-sidebar .ad-banner-image {
        max-height: 120px;
    }
    
    .ad-position-content_top .ad-banner-image,
    .ad-position-content_bottom .ad-banner-image {
        max-height: 80px;
    }
    
    .ad-position-footer .ad-banner-image {
        max-height: 50px;
    }
}

/* 广告加载动画 */
.ad-banner.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 广告标识 */
.ad-banner::before {
    content: "广告";
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 1;
    opacity: 0.7;
}

/* 多个广告的网格布局 */
.ad-banner-container.grid {
    display: grid;
    gap: 20px;
}

.ad-banner-container.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.ad-banner-container.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.ad-banner-container.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .ad-banner-container.grid-3,
    .ad-banner-container.grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ad-banner-container.grid-2,
    .ad-banner-container.grid-3,
    .ad-banner-container.grid-4 {
        grid-template-columns: 1fr;
    }
}

/* 广告点击统计样式（管理后台） */
.wp-admin .column-ad_clicks {
    width: 80px;
    text-align: center;
}

/* 无广告时的占位符 */
.ad-banner-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.ad-banner-placeholder::before {
    content: "📢";
    display: block;
    font-size: 24px;
    margin-bottom: 10px;
}