/* 
 * 新年氛围样式 - 灯笼与福字
 * 目的：为首页添加春节装饰，提升节日氛围
 * 逻辑：通过 CSS 绘制灯笼和福字，并添加平滑的摇摆和浮动动画
 */

/* 灯笼容器 - 固定定位，挂在屏幕顶部两侧 */
.lantern-box {
    position: fixed;
    top: -10px;
    z-index: 9998; /* 确保在大多数元素之上，但在某些弹窗之下 */
    pointer-events: none; /* 防止遮挡点击 */
}

.lantern-left {
    left: 40px;
}

.lantern-right {
    right: 40px;
}

/* 灯笼挂绳 */
.lantern-line {
    width: 2px;
    height: 60px; /* 缩短长度 */
    background-color: #dc8f03;
    margin: 0 auto;
}

/* 灯笼主体 - 椭圆红灯笼 */
.lantern {
    position: relative;
    width: 80px;  /* 缩小宽度 */
    height: 60px; /* 缩小高度 */
    background: #d8000f;
    background: radial-gradient(circle at center, #ff4d4d, #d8000f);
    border-radius: 50% / 50%;
    /* 增加外部发光效果 */
    box-shadow: 0 0 30px rgba(255, 77, 77, 0.5), 0 5px 20px rgba(216, 0, 15, 0.4);
    animation: swing 3s infinite ease-in-out, glow 2s infinite ease-in-out;
    transform-origin: top center;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 内部发光核心 */
.lantern::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 30px;
    background: radial-gradient(circle at center, rgba(255, 255, 200, 0.4), transparent);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

/* 灯笼骨架线条 - 增加立体感 */
.lantern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    bottom: 0;
    border-left: 2px solid #dc8f03;
    border-right: 2px solid #dc8f03;
    border-radius: 50%;
    opacity: 0.5;
}

/* 灯笼上的文字 */
.lantern-text {
    color: #dc8f03;
    font-size: 24px; /* 缩小字号 */
    font-weight: bold;
    font-family: "Noto Serif SC", "KaiTi", serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    z-index: 2;
}

/* 灯笼顶部和底部盖子 */
.lantern-top, .lantern-bottom {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 30px; /* 缩小盖子宽度 */
    height: 6px; /* 缩小盖子高度 */
    background: #dc8f03;
    border-radius: 3px;
    z-index: 3;
}

.lantern-top {
    top: -3px;
}

.lantern-bottom {
    bottom: -3px;
}

/* 灯笼流苏 */
.tassel {
    position: absolute;
    bottom: -35px; /* 缩短流苏距离 */
    left: 50%;
    width: 3px;
    height: 35px; /* 缩短流苏高度 */
    background: #dc8f03;
    transform: translateX(-50%);
    z-index: 1;
}

.tassel::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 15px;
    background: #d8000f;
    border-radius: 2px;
}

/* 灯笼摇摆动画 */
@keyframes swing {
    0% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
    100% { transform: rotate(-5deg); }
}

/* 灯笼发光动画 */
@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 40px rgba(255, 77, 77, 0.6), 0 10px 30px rgba(216, 0, 15, 0.5);
        filter: brightness(1);
    }
    50% { 
        box-shadow: 0 0 60px rgba(255, 100, 100, 0.8), 0 10px 40px rgba(216, 0, 15, 0.7);
        filter: brightness(1.2);
    }
}

/* 福字装饰 - 菱形背景 */
.fu-character {
    position: fixed;
    bottom: 40px;
    width: 50px;
    height: 50px;
    background: #d8000f;
    border: 2px solid #dc8f03;
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(216, 0, 15, 0.4);
    z-index: 9998;
    animation: float 4s infinite ease-in-out;
    pointer-events: auto; /* 允许交互 */
    cursor: pointer;
    transition: transform 0.3s ease;
}

.fu-character:hover {
    transform: rotate(45deg) scale(1.1);
}

/* 福字文字 - 需旋转回来保持水平 */
.fu-character span {
    transform: rotate(-45deg);
    color: #dc8f03;
    font-size: 24px;
    font-weight: bold;
    font-family: "Noto Serif SC", "KaiTi", serif;
}

.fu-left {
    left: 40px;
    animation-delay: 0s;
}

.fu-right {
    right: 40px;
    animation-delay: 2s;
}

/* 福字浮动动画 */
@keyframes float {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(-15px); }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .lantern-line {
        height: 40px; /* 移动端缩短挂绳 */
    }
    .lantern {
        width: 60px;  /* 移动端进一步缩小 */
        height: 45px;
    }
    .lantern-text {
        font-size: 16px;
    }
    .lantern-top, .lantern-bottom {
        width: 22px;
        height: 4px;
    }
    .tassel {
        height: 25px;
        bottom: -25px;
    }
    .lantern-left { left: 15px; }
    .lantern-right { right: 15px; }
    
    .fu-character {
        width: 40px;
        height: 40px;
        bottom: 20px;
    }
    .fu-character span {
        font-size: 18px;
    }
    .fu-left { left: 15px; }
    .fu-right { right: 15px; }
}
