/* Google AdSense 广告通用样式 */

/* 横幅广告容器样式 */
.adsense-container {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
    background: transparent;
}

/* 侧边栏广告容器 */
.adsense-sidebar-container {
    width: 100%;
    max-width: 160px;
    margin: 1rem auto;
    padding: 0.5rem;
    background: transparent;
}

/* 确保广告不影响布局 */
.adsense-container ins.adsbygoogle {
    display: block !important;
    margin: 0 auto;
}

/* 左侧广告位（最外侧） */
.adsense-left-wrapper {
    display: none;
    width: 160px;
    flex-shrink: 0;
    padding: 1rem 0.5rem;
    background: transparent;
}

.adsense-left-wrapper .adsense-sidebar-container {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    width: 100%;
    max-width: 160px;
}

/* 右侧广告位（最外侧） */
.adsense-right-wrapper {
    display: none;
    width: 160px;
    flex-shrink: 0;
    padding: 1rem 0.5rem;
    background: transparent;
}

.adsense-right-wrapper .adsense-sidebar-container {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    width: 100%;
    max-width: 160px;
}

/* 桌面端显示左右两侧广告位 - 降低阈值以便在更多屏幕上显示 */
@media (min-width: 1200px) {
    .adsense-left-wrapper,
    .adsense-right-wrapper {
        display: block !important;
    }
}

/* 中等屏幕只显示右侧广告 */
@media (min-width: 1024px) and (max-width: 1199px) {
    .adsense-right-wrapper {
        display: block !important;
    }
    .adsense-left-wrapper {
        display: none !important;
    }
}

/* 移动端隐藏所有侧边栏广告 */
@media (max-width: 1023px) {
    .adsense-left-wrapper,
    .adsense-right-wrapper,
    .adsense-sidebar-wrapper {
        display: none !important;
    }
    
    .adsense-container {
        margin: 0.5rem 0;
        min-height: 50px;
    }
}

/* 广告加载占位符 */
.adsense-placeholder {
    min-height: 90px;
    background: rgba(31, 41, 55, 0.5);
    border: 1px dashed #4b5563;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 12px;
}

