/**
 * 广告系统样式
 */

/* 通用广告容器样式 */
.ad-container {
    position: relative;
    margin: 10px 0;
    text-align: center;
    overflow: hidden;
}

.ad-container .ad-label {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    opacity: 0.8;
    z-index: 1;
}

.ad-container .ad-content {
    position: relative;
    z-index: 0;
}

/* 广告包装器 */
.advertisement-wrapper {
    margin: 15px 0;
}

.advertisement {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    position: relative;
}

.advertisement .ad-header {
    background: #f0f0f0;
    padding: 5px 10px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 12px;
    color: #666;
    text-align: left;
}

.advertisement .ad-label {
    background: #ff6b6b;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

.advertisement .ad-body {
    padding: 10px;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 不同位置的广告样式 */
/* 主页顶部横幅 */
.ad-home-top {
    max-width: 728px;
    margin: 15px auto;
}

.ad-home-top .advertisement {
    height: 90px;
    max-height: 120px;
}

.ad-home-top .ad-body {
    height: 70px;
    padding: 5px;
}

/* 主页侧边栏 */
.ad-home-sidebar {
    width: 300px;
    margin: 20px 0;
}

.ad-home-sidebar .advertisement {
    width: 100%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 主页底部 */
.ad-home-bottom {
    max-width: 728px;
    margin: 30px auto;
}

.ad-home-bottom .advertisement {
    border: 2px dashed #ddd;
    background: white;
}

/* 频道详情页顶部 */
.ad-channel-top {
    max-width: 728px;
    margin: 15px auto;
}

.ad-channel-top .advertisement {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* 频道详情页中间 */
.ad-channel-middle {
    max-width: 728px;
    margin: 25px auto;
    border: 2px dotted #007bff;
    padding: 10px;
    border-radius: 8px;
    background: rgba(0, 123, 255, 0.05);
}

.ad-channel-middle .advertisement {
    border: none;
    background: transparent;
}

/* 频道详情页底部 */
.ad-channel-bottom {
    max-width: 728px;
    margin: 30px auto;
}

/* 全局头部 */
.ad-global-header {
    max-width: 100%;
    margin: 10px 0;
}

.ad-global-header .advertisement {
    border-radius: 0;
    border-left: none;
    border-right: none;
}

/* 全局底部 */
.ad-global-footer {
    max-width: 100%;
    margin: 20px 0;
}

/* 广告内容样式 */
.advertisement img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.advertisement iframe {
    max-width: 100%;
    border: none;
}

.advertisement script {
    display: block;
}

.advertisement a {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.advertisement a:hover {
    opacity: 0.8;
}

/* 调试信息 */
.ad-debug {
    background: rgba(255, 165, 0, 0.1);
    border-top: 1px dashed #ffa500;
    padding: 5px;
    margin-top: 5px;
    font-size: 11px;
    color: #666;
    text-align: left;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ad-home-top,
    .ad-home-bottom,
    .ad-channel-top,
    .ad-channel-middle,
    .ad-channel-bottom {
        max-width: 100%;
        margin: 10px 0;
    }

    .ad-home-sidebar {
        width: 100%;
        max-width: 320px;
        margin: 15px auto;
    }

    .advertisement .ad-body {
        padding: 8px;
        min-height: 50px;
    }

    .advertisement .ad-header {
        padding: 3px 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .ad-container .ad-label {
        font-size: 9px;
        padding: 1px 4px;
    }

    .advertisement-wrapper {
        margin: 10px 0;
    }

    .advertisement .ad-body {
        padding: 5px;
        min-height: 40px;
    }

    .ad-debug {
        font-size: 10px;
        padding: 3px;
    }
}

/* 广告加载动画 */
.advertisement.loading .ad-body {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: ad-loading 1.5s infinite;
}

@keyframes ad-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 广告点击效果 */
.advertisement .ad-content {
    cursor: pointer;
    transition: transform 0.1s ease;
}

.advertisement .ad-content:hover {
    transform: scale(1.02);
}

.advertisement .ad-content:active {
    transform: scale(0.98);
}

/* 特殊广告样式 */
.advertisement.text-ad {
    background: linear-gradient(45deg, #fff3cd, #fff8dc);
    border: 1px solid #ffeaa7;
}

.advertisement.text-ad .ad-body {
    padding: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.advertisement.image-ad {
    background: white;
}

.advertisement.adsense-ad {
    background: transparent;
    border: 1px dashed #ccc;
}

/* 广告刷新提示 */
.ad-refresh-hint {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 123, 255, 0.8);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s;
}

.ad-container:hover .ad-refresh-hint {
    opacity: 1;
}

/* 广告容器占位符 */
.ad-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.ad-placeholder .placeholder-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.ad-placeholder .placeholder-text {
    font-size: 14px;
}

/* VIP用户广告屏蔽提示 */
.vip-no-ads-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin: 15px 0;
}

.vip-no-ads-message .icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.vip-no-ads-message .text {
    font-size: 14px;
    margin-bottom: 5px;
}

.vip-no-ads-message .sub-text {
    font-size: 12px;
    opacity: 0.9;
}