/* ===== 拆分自 style.css（第 4 部分，原第 1853-2126 行）—— 必须紧跟在上一部分之后按序加载，顺序影响层叠结果 ===== */
/* ===================================
   动画效果
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-up {
    animation: slideUp 0.4s ease;
}

/* ===================================
   响应式设计优化
   =================================== */
@media (max-width: 767.98px) {
    :root {
        --font-size-base: 0.9rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .carousel-item {
        min-height: 18vh;
    }

    /* 导航栏高度控制 */
    .navbar {
        min-height: 6vh;
    }

    /* 内容区最小高度 */
    main {
        min-height: 30vh;
    }

    /* 页脚紧凑 */
    footer {
        padding: 1rem 0;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }

    .display-1 {
        font-size: 2.5rem;
    }

    .display-2 {
        font-size: 2rem;
    }

    .display-3 {
        font-size: 1.75rem;
    }

    .hero-section {
        padding: 2rem 1rem;
    }
}

@media (max-width: 575.98px) {
    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .carousel-item {
        min-height: 15vh;
    }

    .carousel-item .p-5 {
        padding: 1rem !important;
    }

    .carousel-item h2 {
        font-size: 1.25rem;
    }

    .carousel-item .lead {
        font-size: 0.9rem;
    }

    /* 导航栏高度控制 */
    .navbar {
        min-height: 5vh;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    /* 内容区高度 */
    main {
        min-height: 35vh;
    }

    /* 页脚超紧凑 */
    footer {
        padding: 0.5rem 0;
    }
}

/* ===================================
   打印样式
   =================================== */
@media print {

    .navbar,
    .back-to-top,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* ===================================
   辅助功能
   =================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点可见性 */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   首页模块样式
   =================================== */
/* 最新帖子列表 */
#latestPosts .list-group-item {
    border-left: 3px solid transparent;
    transition: background-color 0.3s ease, border-left-color 0.3s ease, transform 0.3s ease;
}

#latestPosts .list-group-item:hover {
    border-left-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.03);
    transform: translateX(5px);
}

#latestPosts .list-group-item h6 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

/* 活跃用户排名 */
#activeUsers .position-relative {
    flex-shrink: 0;
}

#activeUsers .badge.rounded-pill {
    font-size: 0.7rem;
    padding: 0.2rem 0.45rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#activeUsers .text-primary.fw-bold {
    font-size: 0.85rem;
}

/* 热门标签 */
#hotTags .badge {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    border: 1px solid rgba(13, 110, 253, 0.2);
}

#hotTags .badge:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
    border-color: var(--primary-color);
}

/* 模块加载动画 */
.module-loading {
    opacity: 0.5;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.module-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 4px;
}

