/* 全局动态背景样式 - 从 404.html 提取并增强 */

/* ==================== 防晃动预设样式 ==================== */

/* 强制保持滚动条，避免宽度变化 */
html {
    overflow-y: scroll !important;
}

/* 导航栏防晃动 - 预设高度 */
.nav-menu {
    min-height: 44px !important;
}

.nav-user-center,
.nav-user-center-li {
    min-height: 44px !important;
    height: 44px !important;
}

.top-nav,
.nav-bar,
.navbar {
    min-height: 70px !important;
}

/* 给导航菜单预留空间 */
.nav-menu {
    padding-right: 120px !important;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .nav-menu {
        padding-right: 0 !important;
        padding-left: 0 !important;
    }
}

/* ==================== 防晃动结束 ==================== */

/* 背景动画容器 */
.global-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -9999;
    pointer-events: none;
    background: #0F1923;
}

.global-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image: 
        linear-gradient(rgba(255, 70, 85, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 70, 85, 0.06) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-50px, -50px); }
}

.global-bg-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.global-bg-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: #FF4655;
    border-radius: 50%;
    opacity: 0.6;
    animation: float 10s infinite ease-in-out;
    box-shadow: 0 0 6px #FF4655, 0 0 12px rgba(255, 70, 85, 0.5), 0 0 20px rgba(255, 70, 85, 0.3);
}

@keyframes float {
    0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

.global-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
}

/* ==================== 导航栏布局优化 ==================== */

/* 右侧区域 - 包含搜索框和头像 */
.nav-right {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

/* 搜索框样式 */
.nav-right .nav-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-right .nav-search-input {
    width: 160px;
    height: 36px;
    padding: 0 32px 0 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(236, 232, 225, 0.3);
    color: #ece8e1;
    font-size: 13px;
    transition: all 0.3s;
}

.nav-right .nav-search-input:focus {
    width: 200px;
    border-bottom-color: #ff4655;
    background: rgba(255, 70, 85, 0.05);
    outline: none;
}

.nav-right .nav-search-input::placeholder {
    color: rgba(236, 232, 225, 0.4);
    font-size: 12px;
}

.nav-right .nav-search-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(236, 232, 225, 0.6);
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-right .nav-search-btn:hover {
    color: #ff4655;
}

/* 头像样式 */
.nav-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4655, #ff6b7a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    text-decoration: none;
    overflow: hidden;
    border: 2px solid rgba(255, 70, 85, 0.3);
    transition: all 0.3s;
    flex-shrink: 0;
}

.nav-user-avatar:hover {
    border-color: #ff4655;
    box-shadow: 0 0 12px rgba(255, 70, 85, 0.4);
    transform: scale(1.05);
}

.nav-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 移动端适配 */
@media (max-width: 1200px) {
    .nav-right .nav-search-box {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-user-avatar {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
}

/* ==================== 导航栏布局优化结束 ==================== */

/* 头像在导航栏最右边 */
.nav-user-avatar {
    order: 999; /* 确保在flex容器中最后 */
}

/* ==================== 导航栏布局优化 ==================== */
/* 与用户中心一致的导航布局 */

.navbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 40px !important;
}

.navbar .logo {
    flex-shrink: 0;
}

.navbar .nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0 auto;
    flex: 1;
    justify-content: center;
}

.navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

/* 移动端菜单按钮在 nav-right 里面 */
.navbar .nav-right .mobile-menu-btn {
    display: none;
}

@media (max-width: 1200px) {
    .navbar .nav-right .mobile-menu-btn {
        display: flex;
    }
    
    .navbar .nav-menu {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(15, 25, 35, 0.98);
        flex-direction: column;
        padding: 20px 0;
        margin: 0;
    }
    
    .navbar .nav-menu.active {
        display: flex;
    }
    
    .navbar .nav-right .nav-search-box {
        display: none;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 20px !important;
    }
}

/* ==================== 导航栏布局优化结束 ==================== */

/* 搜索按钮样式优化 */
.navbar .nav-search-btn {
    width: auto;
    height: auto;
    padding: 6px 8px;
    font-size: 14px;
}

.navbar .nav-search-btn i {
    font-size: 14px;
}

/* 导航菜单位置优化 - 紧跟网站名后面 */
.navbar .nav-menu {
    margin-left: 40px !important;
    margin-right: 0 !important;
    flex: 0 1 auto !important;
    justify-content: flex-start !important;
}

.navbar .nav-right {
    margin-left: auto !important;
}
