/* 祈福功能样式 */

/* 祈福对话框样式 */
.blessing-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(5px);
}

.blessing-dialog {
    background: linear-gradient(135deg, #fef9e7 0%, #f8f3e6 100%);
    border: 3px solid #d4af37;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: dialogAppear 0.5s ease-out;
}

@keyframes dialogAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.blessing-header {
    text-align: center;
    margin-bottom: 25px;
}

.blessing-title {
    font-size: 24px;
    color: #8b4513;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(139, 69, 19, 0.3);
}

.blessing-subtitle {
    font-size: 14px;
    color: #a0522d;
    opacity: 0.8;
}

.blessing-content {
    margin-bottom: 25px;
}

.blessing-textarea {
    width: 100%;
    height: 120px;
    border: 2px solid #d4af37;
    border-radius: 10px;
    padding: 15px;
    font-size: 16px;
    resize: none;
    background: #fffdf6;
    color: #8b4513;
    font-family: inherit;
    transition: all 0.3s ease;
}

.blessing-textarea:focus {
    outline: none;
    border-color: #b8860b;
    box-shadow: 0 0 10px rgba(184, 134, 11, 0.3);
}

.blessing-textarea::placeholder {
    color: #cd853f;
    opacity: 0.7;
}

.blessing-templates {
    margin-top: 15px;
}

.template-label {
    font-size: 14px;
    color: #a0522d;
    margin-bottom: 8px;
    display: block;
}

.template-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d4af37;
    border-radius: 8px;
    background: #fffdf6;
    color: #8b4513;
    font-size: 14px;
    cursor: pointer;
}

.blessing-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.blessing-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.blessing-confirm {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}

.blessing-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.4);
}

.blessing-cancel {
    background: transparent;
    color: #8b4513;
    border: 2px solid #d4af37;
}

.blessing-cancel:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* 祈福动画效果 */
.blessing-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2500;
}

.golden-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8) 0%, rgba(255, 215, 0, 0) 70%);
    animation: haloExpand 2s ease-out forwards;
}

@keyframes haloExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    10% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    40% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1.5);
    }
    60% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(2);
    }
    80% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(2.5);
    }
    100% {
        width: 800px;
        height: 800px;
        opacity: 0;
        transform: translate(-50%, -50%) scale(3);
    }
}

.energy-particle {
    position: absolute;
    border-radius: 50%;
    animation: particleFlow 3s ease-out forwards;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    filter: blur(0.5px);
}

@keyframes particleFlow {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
        box-shadow: 0 0 20px rgba(255, 215, 0, 1);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.9);
    }
    100% {
        transform: translate(var(--target-x), var(--target-y)) scale(0.3) rotate(180deg);
        opacity: 0;
        box-shadow: 0 0 30px rgba(255, 215, 0, 0);
    }
}

/* 祈福成功消息 - 3D立体效果 */
.blessing-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) perspective(1000px) rotateX(5deg);
    background: linear-gradient(145deg, #8b4513, #a0522d);
    color: #ffd700;
    padding: 25px 40px;
    border-radius: 20px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    z-index: 3001;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px #ffd700,
        0 0 20px rgba(255, 215, 0, 0.5),
        inset 0 2px 10px rgba(255, 255, 255, 0.2);
    animation: successMessage3D 6s ease-in-out forwards;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 3px solid transparent;
    background-clip: padding-box;
}

@keyframes successMessage3D {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) perspective(1000px) rotateX(-15deg) scale(0.5);
        filter: blur(20px);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -50%) perspective(1000px) rotateX(5deg) scale(1.1);
        filter: blur(0);
    }
    25% {
        transform: translate(-50%, -50%) perspective(1000px) rotateX(-2deg) scale(1);
    }
    35% {
        transform: translate(-50%, -50%) perspective(1000px) rotateX(3deg) scale(1.05);
    }
    50% {
        transform: translate(-50%, -50%) perspective(1000px) rotateX(0deg) scale(1);
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.7),
            0 0 0 2px #ffd700,
            0 0 30px rgba(255, 215, 0, 0.8),
            inset 0 3px 15px rgba(255, 255, 255, 0.3);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) perspective(1000px) rotateX(2deg) scale(1);
    }
    85% {
        opacity: 0.8;
        transform: translate(-50%, -50%) perspective(1000px) rotateX(1deg) scale(0.95);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) perspective(1000px) rotateX(0deg) scale(0.8);
        filter: blur(10px);
    }
}

/* 福报功能样式 */

/* 福报对话框样式 */
.fortune-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(5px);
}

.fortune-dialog {
    background: linear-gradient(135deg, #fff9e6 0%, #fff5d9 100%);
    border: 3px solid #ffd700;
    border-radius: 20px;
    padding: 0; /* 完全移除padding */
    width: 506px; /* 补偿边框宽度：500px + 3px*2 */
    min-height: 706px; /* 补偿边框高度：700px + 3px*2 */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: dialogAppear 0.5s ease-out;
}

/* 删除标题相关样式，标题已移除 */

/* 广告位样式 */
.ad-container {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.ad-slot {
    width: 506px; /* 补偿边框：500px + 3px*2 = 506px */
    height: 645px; /* 保持645px高度 */
    background: linear-gradient(135deg, #e8f4fd 0%, #d9edf7 100%);
    border: none;
    border-radius: 17px 17px 0 0; /* 调整圆角：20px - 3px边框 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #31708f;
    font-size: 12px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* 广告加载状态 */
.ad-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #31708f;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
}

.ad-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #31708f;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: adLoadingSpin 1s linear infinite;
    margin-right: 10px;
}

@keyframes adLoadingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 广告错误状态 */
.ad-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(242, 222, 222, 0.9);
    border-radius: 17px 17px 0 0;
}

.ad-error-content {
    text-align: center;
    color: #721c24;
}

.ad-error-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.ad-error-text {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
}

.ad-retry-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.ad-retry-btn:hover {
    background: #c82333;
}

.ad-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 17px 17px 0 0; /* 图片圆角与容器一致：20px - 3px边框 */
}

/* 福报内容样式 */
.fortune-content {
    margin-bottom: 20px;
}

.fortune-image-container {
    position: relative;
    width: auto;
    max-width: 100%;
    height: 450px; /* 增加发财符显示区域高度 */
    margin-bottom: 15px;
    border: 2px solid #ffd700;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fortune-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.fortune-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #d4af37;
    font-size: 16px;
    font-weight: bold;
}

/* 删除模板名称相关样式，模板名称已移除 */

/* 删除描述文字样式，描述已移除 */

/* 福报按钮样式 */
.fortune-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 25px; /* 给关闭按钮区域添加底部边距 */
}

.fortune-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.fortune-refresh {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #8b4513;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.fortune-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.fortune-close {
    background: transparent;
    color: #8b4513;
    border: 2px solid #d4af37;
}

.fortune-close:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .blessing-dialog {
        width: 95%;
        margin: 20px;
        padding: 20px;
    }
    
    .blessing-title {
        font-size: 20px;
    }
    
    .blessing-actions {
        flex-direction: column;
    }
    
    .blessing-btn {
        width: 100%;
    }
    
    .fortune-dialog {
        width: 90%;
        max-width: 400px;
        min-height: 550px;
        padding: 20px;
    }
    
    .fortune-image-container {
        height: 300px;
    }
    
    .fortune-actions {
        flex-direction: column;
    }
    
    .fortune-btn {
        width: 100%;
    }
}