/* 基础工具类（保留原有�?*/
.hidden-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}
.hidden-line:hover {
    color: #E63946 !important;
}
.hidden-line-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-all;
}
.b2_gap { gap: 8px; }
.b2_gap-block { margin: 4px 0; }
.b2_gap-padding { padding: 12px; }
.resource-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.resource-divider {
    border-bottom: 1px solid #F8D2D3;
    margin: 4px 0;
    opacity: 0.5;
}
.tag-cloud-item {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    background: #F0F2F5;
    color: #7A272A;
    display: inline-block;
    margin: 0 4px 8px 0;
}
.tag-cloud-item:hover {
    background: #E63946;
    color: white !important;
}
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #E63946;
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.3);
}
.back-to-top.show {
    display: flex;
}
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: #E63946;
    width: 0%;
    z-index: 9999;
    transition: width 0.2s ease;
}
.resource-item {
    position: relative;
}
.download-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 10;
}

/* 新春主题样式（保留原有） */
body {
    background-color: #FFF5F5 !important;
    color: #7A272A !important;
    overflow-x: hidden; /* 防止动态元素溢出横向滚�?*/
}
header {
    background-color: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.1) !important;
}
.text-primary {
    color: #E63946 !important;
}
.bg-primary {
    background-color: #E63946 !important;
}
.bg-accent {
    background-color: #FFB703 !important;
}
.text-accent {
    color: #FFB703 !important;
}
.bg-card {
    background-color: #FFFFFF !important;
    border-color: #F8D2D3 !important;
}
.border-border {
    border-color: #F8D2D3 !important;
}
.bg-gradient-to-r {
    background-image: linear-gradient(to right, #E63946, #FFB703) !important;
}
footer {
    background-color: #7A272A !important;
}
.nav-pill { color: #7A272A !important; }
.nav-pill:hover { background: rgba(230,57,70,0.12) !important; color: #E63946 !important; }
.nav-pill-active { background: #E63946 !important; color: #fff !important; box-shadow: 0 2px 8px rgba(230,57,70,0.25) !important; }
.user-login-btn { background: #E63946 !important; box-shadow: 0 2px 8px rgba(230,57,70,0.3) !important; }
.back-to-top { background: #E63946 !important; box-shadow: 0 2px 8px rgba(230,57,70,0.3) !important; }
.dark-toggle { background: #E63946 !important; color: #fff !important; border: 1px solid rgba(255,183,3,0.35) !important; box-shadow: 0 2px 8px rgba(230,57,70,0.3) !important; }
/* 侧栏分类/标签等使用的背景�?hover 颜色 */
.bg-primary\/10 { background-color: rgba(230,57,70,0.1) !important; }
.bg-primary\/5 { background-color: rgba(230,57,70,0.05) !important; }
.hover\:bg-primary\/5:hover { background-color: rgba(230,57,70,0.05) !important; }
.hover\:bg-primary\/10:hover { background-color: rgba(230,57,70,0.1) !important; }
.hover\:border-primary:hover { border-color: #E63946 !important; }
.text-primary\/70 { color: rgba(230,57,70,0.7) !important; }
.text-accent { color: #FFB703 !important; }
.hover\:text-primary:hover { color: #E63946 !important; }
.text-white\/70 { color: rgba(255,255,255,0.7) !important; }
.text-white\/80 { color: rgba(255,255,255,0.8) !important; }

/* ========== 新增动态效果========== */
/* 1. 动态摇摆灯笼（替换原有静态灯笼） */
.spring-lantern {
    position: fixed;
    top: 20px;
    width: 60px;
    height: 80px;
    z-index: 9998;
    pointer-events: none;
    animation: lantern-swing 3s ease-in-out infinite alternate; /* 摇摆动画 */
    transform-origin: top center; /* 以顶部为轴心摇摆 */
}
.spring-lantern.left { 
    left: 20px; 
    animation-delay: 0.5s; /* 左右灯笼错开摇摆 */
}
.spring-lantern.right { 
    right: 20px; 
    animation-delay: 1s;
}
/* 灯笼摇摆动画 */
@keyframes lantern-swing {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}

/* 2. 新春飘雪效果 */
.snowflake {
    position: fixed;
    top: -10px;
    z-index: 9997;
    pointer-events: none;
    color: #fff;
    opacity: 0.7;
    font-size: 12px;
    animation: snowfall linear infinite;
}
/* 雪花飘落动画 */
@keyframes snowfall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* 3. 烟花绽放效果 */
.firework {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    width: 0;
    height: 0;
    border-radius: 50%;
    animation: firework-burst 1.5s ease-out forwards;
}
/* 烟花爆炸动画 */
@keyframes firework-burst {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}
/* 烟花粒子 */
.firework-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    opacity: 1;
    animation: firework-particle-fall 1.2s ease-out forwards;
}
@keyframes firework-particle-fall {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* 4. 红包飘落效果 */
.red-packet {
    position: fixed;
    top: -50px;
    z-index: 9997;
    pointer-events: none;
    width: 40px;
    height: 50px;
    animation: packet-fall 6s ease-in-out infinite;
}
/* 红包飘落动画（带摇摆�?*/
@keyframes packet-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* 5. 春联/福字挂件样式 */
/* 左侧春联 */
/* 核心修复：完善春联样式，确保文字竖向展示 */
.spring-couplet-left,
.spring-couplet-right {
    position: fixed; /* 固定定位，保证在页面两侧 */
    top: 50%; /* 垂直居中 */
    transform: translateY(-50%); /* 精准垂直居中 */
    height: 200px; /* 必须设置高度，writing-mode才会生效 */
    padding: 10px;
    background: #d40000; /* 春联红色背景 */
    color: #fff; /* 白色文字 */
    border-radius: 4px;
}

.spring-couplet-text {
    writing-mode: vertical-rl; /* 竖排文字：从右到左 */
    -webkit-writing-mode: vertical-rl; /* 兼容webkit内核浏览器 */
    writing-mode: tb-rl; /* 兼容旧版浏览器 */
    text-orientation: upright; /* 文字直立，不旋转 */
    letter-spacing: 2px; /* 字间距 */
    line-height: 1.8; /* 行高，调整字间距 */
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    height: 100%; /* 占满父容器高度 */
    display: flex; /* 确保垂直居中 */
    justify-content: center;
}
.spring-couplet-left {
    left: 20px;
}

.spring-couplet-right {
    right: 20px;
}

.spring-fu {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9996;
    pointer-events: none;
    width: 60px;
    height: 60px;
    background: #E63946;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFB703;
    font-size: 30px;
    font-weight: bold;
    font-family: "SimHei", sans-serif;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: fu-rotate 8s linear infinite; /* 缓慢旋转 */
}
/* 福字旋转动画 */
@keyframes fu-rotate {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(360deg); }
}

/* ========== 原有爆竹动画样式（保留） ========== */
.firecracker {
    position: fixed;
    bottom: -50px;
    z-index: 9999;
    width: 15px;
    height: 30px;
    background: linear-gradient(#8B0000, #FF0000);
    border-radius: 3px 3px 0 0;
    animation: firecracker-rise 2s ease-in-out forwards;
}
.firecracker::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 10px;
    background: #FFD700;
    border-radius: 50%;
}
.firecracker-explosion {
    position: fixed;
    z-index: 9999;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: explosion 0.8s ease-out forwards;
}
@keyframes firecracker-rise {
    0% { bottom: -50px; opacity: 1; }
    90% { opacity: 1; }
    100% { bottom: calc(100vh - 100px); opacity: 0; }
}
@keyframes explosion {
    0% { transform: scale(0); opacity: 1; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}

/* 新春祝福动画（保留） */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -40%); }
    20% { opacity: 1; transform: translate(-50%, -50%); }
    80% { opacity: 1; transform: translate(-50%, -50%); }
    100% { opacity: 0; transform: translate(-50%, -60%); }
}

/* Festive user login button */
.tw-festive-mode .user-login-btn {
    background: linear-gradient(135deg, #E63946, #C02739);
    color: #FFECB3;
    border: 1px solid rgba(255, 183, 3, 0.45);
    box-shadow: 0 6px 14px rgba(230, 57, 70, 0.35);
}
.tw-festive-mode .user-login-btn:hover {
    background: #c72f3d;
    color: #fff7d6;
    transform: translateY(-2px);
}
.tw-festive-mode.dark .user-login-btn {
    background: #7A1F26;
    color: #FFE7A0;
    border-color: rgba(255, 183, 3, 0.35);
}
