/* 广告和动画的完整CSS代码 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

/* 赞助广告弹窗样式 */
.ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 5, 10, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.ad-modal {
    background: linear-gradient(145deg, #151525, #0a0a15);
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    border: 1px solid #3a3a5a;
    position: relative;
    animation: modalAppear 0.6s ease-out;
}

@keyframes modalAppear {
    0% {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.ad-header {
    margin-bottom: 25px;
    text-align: center;
}

.ad-header h3 {
    color: #8a8aff;
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(138, 138, 255, 0.3);
}

.ad-header p {
    color: #b0b0c0;
    font-size: 1.05rem;
    line-height: 1.6;
}

.heart-icon {
    color: #ff6b6b;
    margin: 0 5px;
}

/* 修复二维码容器居中问题 */
.qr-container {
    background: rgba(30, 30, 45, 0.9);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid #4a4a6a;
    margin: 20px 0;
    /* 确保容器本身在父元素中居中 */
    display: block;
    text-align: center;
    width: 100%;
}

.qr-code {
    width: 220px;
    height: 220px;
    background-color: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #5a5a8a;
    position: relative;
}

.qr-code::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #8a2be2, #4169e1, #8a2be2);
    z-index: -1;
    border-radius: 14px;
    opacity: 0.5;
}

/* 二维码图片样式 */
.qr-code img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

/* 二维码占位符样式（当图片加载失败时显示） */
.qr-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8a8aff;
}

.qr-placeholder i {
    font-size: 4rem;
    color: #8a8aff;
    margin-bottom: 15px;
    opacity: 0.7;
}

/* 二维码加载指示器 */
.qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8a8aff;
}

.qr-loading i {
    font-size: 2rem;
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sponsor-note {
    margin-top: 25px;
    padding: 18px;
    background-color: rgba(30, 30, 50, 0.5);
    border-radius: 12px;
    border-left: 4px solid #8a2be2;
}

.sponsor-note p {
    color: #b0b0c0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.sponsor-note i {
    color: #8a8aff;
    margin-right: 8px;
}

.action-btn {
    background: linear-gradient(135deg, #8a2be2, #4169e1);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(138, 43, 226, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    width: 100%;
    justify-content: center;
    position: relative;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(138, 43, 226, 0.6);
    background: linear-gradient(135deg, #9a3bf2, #5179f1);
}

/* 按钮禁用状态样式 */
.action-btn.disabled {
    background: linear-gradient(135deg, #5a5a8a, #3a3a5a) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4) !important;
    color: #aaaacc !important;
    opacity: 0.8;
}

.action-btn.disabled:hover {
    background: linear-gradient(135deg, #5a5a8a, #3a3a5a) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4) !important;
}

.action-btn.disabled::after {
    content: " (6秒后可用)";
    font-size: 0.9rem;
    opacity: 0.8;
}

.credit {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(100, 100, 150, 0.2);
    color: #8a8acc;
    font-size: 0.9rem;
    text-align: center;
}

/* 爱心烟花动画样式 */
.animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0f;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow: hidden;
    cursor: pointer;
}

.animation-title {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
    
    /* 使用纯色确保显示完整 */
    color: #ff6b6b;
    
    /* 添加发光效果替代渐变 */
    text-shadow: 
        0 0 5px #fff,
        0 0 10px #ff6b6b,
        0 0 15px #ff6b6b,
        0 0 20px #ff8e8e,
        0 0 25px #ff8e8e,
        0 0 30px #ff8e8e;
    
    z-index: 10;
    
    /* 确保文字完整显示 */
    line-height: 1.3;
    padding: 15px 25px;
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 2px solid rgba(255, 107, 107, 0.3);
    
    /* 添加脉冲动画 */
    animation: simplePulse 1.5s ease-in-out infinite;
    
    /* 指定中文字体，确保中文字符正确显示 */
    font-family: 'Microsoft YaHei', 'SimHei', 'Segoe UI', sans-serif;
}

@keyframes simplePulse {
    0% {
        transform: scale(1);
        text-shadow: 
            0 0 5px #fff,
            0 0 10px #ff6b6b,
            0 0 15px #ff6b6b;
    }
    50% {
        transform: scale(1.05);
        text-shadow: 
            0 0 10px #fff,
            0 0 20px #ff6b6b,
            0 0 30px #ff6b6b,
            0 0 40px #ff8e8e;
    }
    100% {
        transform: scale(1);
        text-shadow: 
            0 0 5px #fff,
            0 0 10px #ff6b6b,
            0 0 15px #ff6b6b;
    }
}

.hearts-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.heart {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 24px;
    color: #ff6b6b;
    text-shadow: 0 0 15px #ff6b6b, 0 0 30px #ff8e8e;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    animation: heartFirework 2.5s ease-out forwards;
}

@keyframes heartFirework {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
    }
    10% {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) scale(1) rotate(var(--rotate));
    }
    80% {
        opacity: 0.7;
        transform: translate(var(--tx2), var(--ty2)) scale(1.5) rotate(var(--rotate2));
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx2), var(--ty2)) scale(1.8) rotate(var(--rotate3));
    }
}

@media (max-width: 600px) {
    .ad-modal {
        padding: 20px;
        width: 95%;
    }
    
    .qr-code {
        width: 200px;
        height: 200px;
    }
    
    .animation-title {
        font-size: 2.5rem;
        padding: 10px 15px;
        line-height: 1.2;
        text-shadow: 
            0 0 5px #fff,
            0 0 8px #ff6b6b,
            0 0 12px #ff6b6b,
            0 0 16px #ff8e8e,
            0 0 20px #ff8e8e;
    }
    
    .action-btn {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    .action-btn.disabled::after {
        content: "";
        font-size: 0;
    }
    
    .action-btn.disabled::before {
        content: "(6秒)";
        font-size: 0.8rem;
        opacity: 0.8;
        margin-left: 5px;
    }
}

/* 兼容性修复：为不支持backdrop-filter的浏览器提供备用方案 */
@supports not (backdrop-filter: blur(8px)) {
    .ad-overlay {
        background-color: rgba(5, 5, 10, 0.98);
    }
}

/* 确保动画容器中的文字不会被爱心遮挡 */
.animation-title {
    position: relative;
    z-index: 20;
}

/* 可选：为广告弹窗添加额外的安全字体 */
.ad-header h3,
.ad-header p,
.sponsor-note p,
.credit p,
.action-btn {
    font-family: 'Microsoft YaHei', 'SimHei', 'Segoe UI', sans-serif;
}

/* 倒计时提示样式 */
.countdown-tip {
    font-size: 0.9rem;
    color: #8a8acc;
    text-align: center;
    margin-top: 10px;
    opacity: 0.8;
}