/* ============================================
   广告样式表 - Ads Stylesheet
   支持响应式布局和多种广告尺寸
   ============================================ */

/* 基础广告容器样式 */
.ad-responsive-wrapper {
    width: 100%;
    text-align: center;
    margin: 0 auto;
    overflow: hidden;
}

/* 广告容器内部样式 */
.ad-responsive-wrapper > div {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

.ad-responsive-wrapper > div.ad-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 广告图片/iframe 响应式 */
.ad-responsive-wrapper img,
.ad-responsive-wrapper iframe {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ============================================
   头部广告样式
   ============================================ */
.ad-header {
    background: linear-gradient(180deg, rgba(138, 43, 226, 0.1) 0%, transparent 100%);
    padding: 10px 0;
    margin-bottom: 10px;
    text-align: center;
}

.ad-header .ad-responsive-wrapper {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ============================================
   内容区域广告样式
   ============================================ */
.ad-content {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

/* 侧边栏广告 */
.ad-sidebar {
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

/* 原生广告卡片 */
.native-ad-card {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.15) 0%, rgba(255, 20, 147, 0.15) 100%);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    overflow: hidden;
}

.native-ad-card > div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   页脚广告样式
   ============================================ */
.ad-footer {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-footer .ad-responsive-wrapper {
    max-width: 728px;
}

/* ============================================
   响应式断点
   ============================================ */

/* 桌面端 (>= 1024px) */
@media (min-width: 1024px) {
    .ad-responsive-wrapper {
        max-width: 728px;
    }
    
    .ad-desktop {
        display: block !important;
        opacity: 1;
        transform: translateY(0);
    }
    
    .ad-tablet,
    .ad-mobile {
        display: none !important;
        opacity: 0;
        transform: translateY(10px);
    }
}

/* 平板端 (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .ad-responsive-wrapper {
        max-width: 468px;
    }
    
    .ad-desktop {
        display: none !important;
        opacity: 0;
        transform: translateY(10px);
    }
    
    .ad-tablet {
        display: block !important;
        opacity: 1;
        transform: translateY(0);
    }
    
    .ad-mobile {
        display: none !important;
        opacity: 0;
        transform: translateY(10px);
    }
    
    /* 原生广告在平板上的调整 */
    .native-ad-card {
        grid-column: span 1 !important;
        min-height: 200px;
    }
}

/* 手机端 (< 768px) */
@media (max-width: 767px) {
    .ad-responsive-wrapper {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .ad-desktop,
    .ad-tablet {
        display: none !important;
        opacity: 0;
        transform: translateY(10px);
    }
    
    .ad-mobile {
        display: block !important;
        opacity: 1;
        transform: translateY(0);
    }
    
    /* 头部广告在手机上的调整 */
    .ad-header {
        padding: 5px 0;
    }
    
    /* 内容广告在手机上的调整 */
    .ad-content {
        margin: 10px 0;
        padding: 10px;
    }
    
    /* 原生广告在手机上的调整 */
    .native-ad-card {
        grid-column: span 2 !important;
        min-height: 150px;
        margin: 10px 0;
    }
    
    /* 页脚广告在手机上的调整 */
    .ad-footer {
        padding: 10px 0;
    }
}

/* 小屏手机 (< 480px) */
@media (max-width: 480px) {
    .ad-responsive-wrapper {
        padding: 0 5px;
    }
    
    .native-ad-card {
        min-height: 100px;
    }
}

/* ============================================
   广告加载状态
   ============================================ */
.ad-loading {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

/* ============================================
   广告占位符 - 新样式
   ============================================ */
.ad-placeholder-box {
    background: linear-gradient(135deg, 
        rgba(138, 43, 226, 0.08) 0%, 
        rgba(255, 20, 147, 0.08) 100%);
    border: 2px dashed rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: all 0.3s ease;
    min-height: 90px;
    max-width: 100%;
}

.ad-placeholder-box:hover {
    background: linear-gradient(135deg, 
        rgba(138, 43, 226, 0.15) 0%, 
        rgba(255, 20, 147, 0.15) 100%);
    border-color: rgba(138, 43, 226, 0.5);
}

.ad-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
}

.ad-placeholder-icon {
    font-size: 24px;
    opacity: 0.6;
}

.ad-placeholder-text {
    font-size: 14px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    background-color: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 旧版占位符样式（兼容） */
.ad-placeholder {
    background: linear-gradient(90deg, 
        rgba(138, 43, 226, 0.1) 0%, 
        rgba(255, 20, 147, 0.1) 50%,
        rgba(138, 43, 226, 0.1) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
    min-height: 90px;
}

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

/* ============================================
   广告标签
   ============================================ */
.ad-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    text-align: center;
}

/* ============================================
   游戏内嵌广告特殊样式
   ============================================ */
.game-inline-ad {
    margin: 15px 0;
    padding: 15px;
    background: rgba(26, 26, 26, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Popunder 广告样式（隐藏） */
.ad-popunder {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
