/* 亿资讯 - 广告位样式 */

/* ===== 广告容器通用样式 ===== */
.ad-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 24px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.ad-container:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.ad-label {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 11px;
    color: var(--text-light);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.ad-content {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.ad-placeholder {
    color: var(--text-light);
    font-size: 14px;
}

.ad-placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ===== 首页广告位 ===== */

/* 顶部通栏广告 */
.ad-top-banner {
    max-width: 1200px;
    margin: 0 auto 32px;
    padding: 24px;
}

.ad-top-banner .ad-content {
    min-height: 120px;
}

/* 侧边栏广告 */
.ad-sidebar {
    margin: 24px 0;
}

.ad-sidebar-sticky {
    position: sticky;
    top: 100px;
}

/* 信息流插入广告 */
.ad-infeed {
    margin: 24px 0;
}

.ad-infeed .ad-content {
    min-height: 280px;
}

/* 底部广告 */
.ad-footer {
    max-width: 1200px;
    margin: 48px auto 0;
    padding: 24px;
}

/* ===== 详情页广告位 ===== */

/* 文章顶部广告 */
.ad-article-top {
    margin: 0 0 32px 0;
    padding: 20px;
}

.ad-article-top .ad-content {
    min-height: 100px;
}

/* 文章中间广告 */
.ad-article-mid {
    margin: 40px 0;
    padding: 20px;
}

/* 文章底部广告 */
.ad-article-bottom {
    margin: 40px 0 0 0;
    padding: 20px;
}

.ad-article-bottom .ad-content {
    min-height: 250px;
}

/* 侧边浮动广告（桌面端） */
.ad-floating {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    z-index: 999;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-lg);
}

.ad-floating-left {
    left: 20px;
}

.ad-floating-right {
    right: 20px;
}

.ad-floating .ad-content {
    min-height: 400px;
}

.ad-floating-close {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
    line-height: 1;
}

.ad-floating-close:hover {
    color: var(--accent);
}

/* ===== 广告尺寸变体 ===== */

/* 横幅广告 */
.ad-banner {
    min-height: 90px !important;
}

/* 矩形广告 */
.ad-rectangle {
    min-height: 250px !important;
}

/* 大矩形广告 */
.ad-large-rectangle {
    min-height: 360px !important;
}

/* 摩天楼广告 */
.ad-skyscraper {
    min-height: 600px !important;
}

/* 半页广告 */
.ad-half-page {
    min-height: 300px !important;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .ad-floating {
        display: none; /* 移动端隐藏浮动广告 */
    }
    
    .ad-top-banner,
    .ad-footer {
        padding: 16px;
    }
    
    .ad-content {
        min-height: 200px !important;
    }
}

/* ===== 暗色模式支持 ===== */
@media (prefers-color-scheme: dark) {
    .ad-container {
        background: var(--bg-secondary);
        border-color: var(--border);
    }
    
    .ad-label {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-light);
    }
}

/* ===== 广告加载动画 ===== */
.ad-loading {
    position: relative;
    overflow: hidden;
}

.ad-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== 广告关闭按钮 ===== */
.ad-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-light);
    transition: all 0.2s;
    opacity: 0;
}

.ad-container:hover .ad-close {
    opacity: 1;
}

.ad-close:hover {
    background: var(--accent);
    color: #fff;
}
