/* Falorant Ads 样式优化 */

/* 广告容器基础样式 */
[id^="ad-"], [id*="container-"] {
    margin: 0 auto;
    text-align: center;
}

/* 移动端 Sticky Banner */
#mobile-sticky-ad {
    animation: slideUpFade 0.3s ease-out;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 侧边栏广告 hover 效果 */
#ad-left-sidebar,
#ad-right-sidebar {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#ad-left-sidebar:hover,
#ad-right-sidebar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.2);
}

/* 左侧边栏广告：标准 160x600 竖幅位。
   用 background/box-shadow 画可见槽位 —— 它们不参与盒模型，不会压缩测量宽度；
   padding/border 会压缩内容宽（254px 问题的根源），故刻意不用 */
#ad-left-sidebar {
    width: 160px;
    min-height: 600px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
}

/* 右侧边栏广告：标准 300x250 MREC 位 */
#ad-right-sidebar {
    width: 300px;
    min-height: 250px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
}

/* Native Banner 融入内容 */
#ad-native-content {
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.8));
    padding: 16px;
    backdrop-filter: blur(10px);
}

/* 内容区原生空位折叠：桌面三栏页原生位归右侧栏 300x250 时，隐藏空的内容区容器 */
#ad-native-content:empty {
    display: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    [id^="ad-banner"] {
        max-width: 100%;
        padding: 0 8px;
    }

    #ad-native-content {
        padding: 12px;
    }
}

/* 加载占位符 */
[id^="ad-"]:empty::before,
[id*="container-"]:empty::before {
    content: '';
    display: block;
    width: 100%;
    height: 90px;
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.5) 25%, rgba(51, 65, 85, 0.5) 50%, rgba(30, 41, 59, 0.5) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

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

/* 侧边栏空位占位符：高度对齐标准广告位，等待填充 */
#ad-left-sidebar:empty::before {
    height: 600px;
}

#ad-right-sidebar:empty::before {
    height: 250px;
}

/* 广告标签（可选）*/
.ad-label {
    font-size: 10px;
    color: rgba(148, 163, 184, 0.6);
    text-align: center;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Google AdSense 底部粘性横幅（双 banner 铺满） */
.sticky-ad-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    padding: 4px 0;
}

.sticky-ad-row {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 4px;
    flex-wrap: wrap;
}

/* 两个 banner 均分撑满整条宽度 */
.sticky-ad-slot {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

/* 让 AdSense 能测量到容器宽度 */
.sticky-ad-slot .adsbygoogle {
    display: block;
    max-width: 100%;
}

/* 关闭按钮：底条最右侧靠边，垂直居中 */
.sticky-ad-close {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.95);
    color: rgba(226, 232, 240, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 6px;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    z-index: 51;
    transition: color 0.2s, background 0.2s;
}

.sticky-ad-close:hover {
    color: #ffffff;
    background: #1e293b;
}

/* 移动端：降低高度，避免遮挡过多内容 */
@media (max-width: 768px) {
    .sticky-ad-banner {
        padding: 4px 0;
    }

    .sticky-ad-slot {
        flex-basis: 100%;
    }
}
