/**
 * 开屏广告样式
 * APP启动时的全屏广告展示
 */

/* 广告容器 - 全屏覆盖 */
.splash-ad-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background-color: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 淡出动画 */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.splash-ad-container.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* 广告图片 */
.splash-ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* 可点击的广告区域 */
.splash-ad-clickable {
    cursor: pointer;
    position: relative;
    width: 100%;
    height: 100%;
}

.splash-ad-clickable:active {
    opacity: 0.95;
}

/* 跳过按钮 */
.splash-ad-skip-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 20px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.splash-ad-skip-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.splash-ad-skip-btn:active {
    transform: scale(0.95);
}

/* 跳过按钮禁用状态（倒计时中） */
.splash-ad-skip-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* 倒计时文字 */
.splash-ad-countdown {
    display: inline-block;
    min-width: 20px;
    text-align: center;
    font-weight: 700;
}

/* 加载中状态 */
.splash-ad-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
}

.splash-ad-loading::after {
    content: '...';
    animation: loadingDots 1.5s steps(4, end) infinite;
}

@keyframes loadingDots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* 错误状态 */
.splash-ad-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    text-align: center;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .splash-ad-skip-btn {
        top: env(safe-area-inset-top, 20px);
        right: 15px;
        padding: 6px 16px;
        font-size: 13px;
    }
}

/* 安全区域适配（刘海屏、打孔屏） */
@supports (padding-top: env(safe-area-inset-top)) {
    .splash-ad-skip-btn {
        top: calc(env(safe-area-inset-top) + 20px);
        right: calc(env(safe-area-inset-right) + 20px);
    }
}

/* 横屏适配 */
@media (orientation: landscape) {
    .splash-ad-image {
        object-fit: contain;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .splash-ad-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 防止用户选择 */
.splash-ad-container * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 隐藏状态 */
.splash-ad-container.hidden {
    display: none;
}

