*
{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body
{
    background-color: #f5f5f5;
    color: #333;
    overflow-x: hidden;
}

/* PC端默认样式 */
.navbar
{
    background-color: transparent; /* 透明背景，只保留磨砂效果 */
    backdrop-filter: blur(10px); /* 磨砂效果 */
    -webkit-backdrop-filter: blur(10px); /* Safari浏览器支持 */
    overflow: visible; /* 改为visible让下拉菜单可以显示 */
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-end; /* 按钮居右 */
    align-items: center; /* 垂直居中 */
    padding: 0 20px; /* 添加内边距 */
    height: 60px; /* 固定高度 */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05); /* 更轻微的阴影 */
}
.navbar-logo-link
{
    margin-right: auto; /* 占据左侧空间，将logo推到最左边 */
    display: flex;
    align-items: center;
    outline: none; /* 移除点击时的轮廓 */
    box-shadow: none !important; /* 强制移除阴影 */
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
    background: transparent !important; /* 强制透明背景 */
    backdrop-filter: none !important; /* 强制移除背景滤镜 */
    -webkit-backdrop-filter: none !important;
    border: none !important; /* 移除边框 */
}
.navbar-logo-link:focus,
.navbar-logo-link:active,
.navbar-logo-link:hover
{
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.navbar-logo-link img
{
    box-shadow: none !important;
}
.navbar-logo
{
    height: 50px; /* Logo高度 */
    display: flex;
    align-items: center;
}
.navbar-logo img
{
    height: 100%;
    width: auto;
    max-height: 50px;
    max-width: 150px;
    object-fit: contain;
}

.nav-links
{
    display: flex;
    justify-content: flex-end;
    flex: 1; /* 占据剩余空间 */
}
.navbar a
{
    color: rgba(0, 0, 0, 0.8); /* 深色文字，提高透明背景下的可读性 */
    text-align: center;
    padding: 18px 20px; /* 增加垂直内边距 */
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s ease, color 0.3s ease; /* 添加颜色过渡效果 */
}
.navbar a i
{
    font-size: 16px;
    width: 18px;
    text-align: center;
}
.navbar a span
{
    display: inline-block;
}
.navbar a:hover
{
    background-color: rgba(0, 0, 0, 0.05); /* 浅灰色悬停效果，适应透明背景 */
}
.navbar a.active
{
    background-color: rgba(76, 175, 80, 0.25); /* 半透明绿色激活状态 */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: rgba(0, 0, 0, 0.9); /* 活动状态文字颜色加深 */
}
.navbar a.active i
{
    color: rgba(0, 0, 0, 0.9); /* 活动状态图标颜色加深 */
}

/* 移动端汉堡菜单按钮 */
.menu-toggle
{
    display: none; /* 默认隐藏 */
    background: transparent; /* 透明背景 */
    color: white; /* 白色图标 */
    padding: 0; /* 完全无内边距 */
    font-size: 24px; /* 增大图标以补偿无内边距 */
    cursor: pointer;
    z-index: 1001;
    margin-left: auto; /* 在flex容器中居右 */
    border: none; /* 移除边框 */
    outline: none; /* 移除轮廓 */
    margin: 0; /* 移除外边距 */
    box-shadow: none; /* 移除阴影 */
    width: 44px; /* 固定宽度 */
    height: 44px; /* 固定高度 */
    display: flex; /* 使用flex让图标居中 */
    align-items: center;
    justify-content: center;
}


/* 移动端侧边栏 */
.sidebar
{
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: linear-gradient(160deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%); /* 半透明渐变背景 */
    backdrop-filter: blur(10px); /* 磨砂玻璃效果 */
    -webkit-backdrop-filter: blur(10px);
    transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* 平滑滑动动画 */
    z-index: 1000;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sidebar.active
{
    left: 0;
}

/* 侧边栏头部 */
.sidebar-header
{
    padding: 15px 20px 20px;
    text-align: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-avatar
{
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sidebar-avatar img
{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-info h3
{
    color: white;
    font-size: 18px;
    margin-bottom: 5px;
    font-family: inherit;
}

.sidebar-user-info p
{
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* 侧边栏菜单 */
.sidebar-menu
{
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.sidebar-menu a
{
    display: flex;
    align-items: center;
    color: white;
    padding: 15px 25px;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
}

.sidebar-menu a i
{
    width: 24px;
    font-size: 18px;
    margin-right: 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-menu a span
{
    flex: 1;
    font-family: inherit;
}

.sidebar-menu a:hover
{
    background: rgba(255, 255, 255, 0.15);
    border-left: 4px solid rgba(255, 255, 255, 0.5);
    padding-left: 30px;
}

.sidebar-menu a.active
{
    background: rgba(255, 255, 255, 0.2);
    border-left: 4px solid white;
    font-weight: bold;
}

.sidebar-menu a.active i
{
    color: white;
}

/* ===== 侧边栏下拉菜单 ===== */
.sidebar-dropdown {
    position: relative;
}

.sidebar-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* 左对齐 */
    color: white;
    padding: 15px 25px;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    cursor: pointer;
    text-align: left; /* 文字左对齐 */
}

.sidebar-dropdown-toggle span {
    text-align: left; /* 确保文字左对齐 */
}

/* 覆盖 .sidebar-menu a span 的 flex: 1 样式 */
.sidebar-menu a.sidebar-dropdown-toggle span {
    flex: none;
}

.sidebar-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-left: 4px solid rgba(255, 255, 255, 0.5);
    padding-left: 30px;
}

.sidebar-dropdown-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-dropdown.active .sidebar-dropdown-arrow {
    transform: rotate(180deg);
}

.sidebar-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-dropdown.active .sidebar-dropdown-menu {
    max-height: 400px; /* 足够容纳多个分类项 */
    overflow-y: auto;
}

.sidebar-dropdown-menu .category-item {
    display: block;
    padding: 12px 25px 12px 50px; /* 左侧缩进 */
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-dropdown-menu .category-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* 侧边栏下拉菜单分类项选中状态 */
.sidebar-dropdown-menu .category-item.active {
    background-color: #3498db;
    color: white;
    border-left: 4px solid #3498db;
}

.sidebar-dropdown-menu .category-item.active:hover {
    background-color: #2980b9;
}

.sidebar-dropdown-menu .category-item i {
    margin-right: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* 侧边栏下拉菜单中的加载状态 */
.sidebar-dropdown-menu .dropdown-loading {
    padding: 16px 25px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 侧边栏底部 */
.sidebar-footer
{
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

/* 侧边栏底部背景图时的文字阴影 */
.sidebar-footer[style*="background:"]
{
    position: relative;
}

.sidebar-footer[style*="background:"]::before
{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.sidebar-footer[style*="background:"] p
{
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.sidebar-footer p
{
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin: 0;
}

/* 移动端：隐藏侧边栏版权卡片 */
@media (max-width: 768px)
{
    .sidebar-footer
    {
        display: none;
    }
}

/* 侧边栏遮罩 */
.sidebar-overlay
{
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}
.sidebar-overlay.active
{
    display: block;
}

.content
{
    padding: 20px;
    min-height: 80vh;
    transition: margin-left 0.3s ease;
}
.content.shifted
{
    margin-left: 280px;
}

.footer
{
    background-color: #333;
    color: white;
    text-align: center;
    padding: 10px;
    position: relative;
    bottom: 0;
    width: 100%;
    /* 确保子元素可以正确定位 */
    overflow: hidden;
}

/* 页脚背景图时的文字阴影，确保可读性 */
.footer:has(style),
.footer[style*="background:"]
{
    position: relative;
}

.footer:has(style)::before,
.footer[style*="background:"]::before
{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* 页脚容器 - 相对定位作为子元素定位参考 */
.footer
{
    position: relative;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 鱼群动画容器 - 绝对定位覆盖整个页脚 */
#j-fish-skip
{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* 背景层 canvas - 在文字后面 */
#j-fish-skip canvas:nth-child(1)
{
    z-index: 5;
}

/* 前景层 canvas - 在文字前面 */
#j-fish-skip canvas:nth-child(2)
{
    z-index: 60;
}

/* 确保 canvas 填满容器 */
#j-fish-skip canvas
{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 版权文字 - 在中间层（背景鱼之后，前景鱼之前） */
.footer p
{
    position: relative;
    z-index: 50;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    color: white;
}

/* 备案号链接样式 */
.footer p a
{
    color: inherit;
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

.footer p a:hover
{
    opacity: 0.8;
    text-decoration: underline;
}

/* 备案号容器 */
.footer-beian
{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* 备案链接 */
.beian-link
{
    color: inherit;
    text-decoration: none;
}

/* 分隔符 */
.beian-separator
{
    display: none;
}

/* 公安备案链接 */
.gongan-link
{
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 国徽图标 */
.gongan-icon
{
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* 移动端样式 */
@media (max-width: 768px)
{
    .gongan-link
    {
        display: flex;
        align-items: center;
        gap: 4px;
    }
}

/* 页脚背景图遮罩 */
.footer[style*="background:"]::before
{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}


/* 加载指示器 */
.loading
{
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #777;
}

/* 响应式设计 */
/* 移动端：屏幕宽度小于768px */
@media (max-width: 768px)
{
    .nav-links
    {
        display: none; /* 移动端隐藏导航链接 */
    }
    .menu-toggle
    {
        display: block; /* 显示汉堡菜单按钮 */
    }
    .navbar-logo
    {
        height: 35px; /* 移动端稍微缩小Logo */
    }
    .sidebar
    {
        width: 280px; /* 侧边栏宽度 */
        max-width: 80%; /* 最大宽度为屏幕80% */
        left: -280px; /* 确保完全隐藏，与宽度匹配 */
    }
    .content
    {
        padding-top: 80px; /* 为顶部导航栏和内容间距留出空间 */
    }
    .content.shifted
    {
        margin-left: 0; /* 移动端不偏移内容 */
    }
    .footer
    {
        padding: 10px 5px;
    }
}

/* PC端：屏幕宽度大于768px */
@media (min-width: 769px)
{
    .sidebar
    {
        display: none; /* PC端隐藏侧边栏 */
    }
    .sidebar-overlay
    {
        display: none !important;
    }
    .menu-toggle
    {
        display: none; /* PC端隐藏汉堡菜单按钮 */
    }
}

/* 首页特殊样式 - 支持全屏背景卡片 */
body[data-current-page="main"] .content
{
    padding: 0;
    min-height: 100vh;
    position: relative;
}



/* 移动端首页样式 */
@media (max-width: 768px)
{
    body[data-current-page="main"] .content
    {
        padding-top: 0;
    }
}

/* 页面切换动画 */

/* 页面退出动画 */
.page-exit
{
    animation: pageExit 0.3s ease forwards;
}

@keyframes pageExit
{
    0%
    {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100%
    {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
}

/* 页面进入动画 */
.page-enter
{
    animation: pageEnter 0.4s ease forwards;
    animation-delay: 0.1s; /* 等待退出动画完成后开始 */
    opacity: 0;
    transform: translateY(20px) scale(0.98);
}

@keyframes pageEnter
{
    0%
    {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100%
    {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 确保内容容器可以定位，以便动画正常工作 */
#content
{
    position: relative;
    min-height: 80vh; /* 保持现有高度 */
}

/* 加载指示器样式增强 */
.loading
{
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
    color: #777;
    font-size: 1.2rem;
    opacity: 0.7;
    animation: fadeInOut 2s infinite alternate;
}

@keyframes fadeInOut
{
    0%
    {
        opacity: 0.5;
    }
    100%
    {
        opacity: 0.9;
    }
}

/* ===== 下拉菜单样式 ===== */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 200px;
    background: rgba(245, 245, 245, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 9999;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.5);
    min-height: 50px;
    padding: 10px;
    margin-top: 8px;
}

/* 下拉菜单箭头 */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: rgba(245, 245, 245, 0.85);
    transform: rotate(45deg);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-loading {
    padding: 16px;
    text-align: center;
    color: #8c8c8c;
    font-size: 14px;
}

/* 测试样式：确保下拉菜单可见 */
.nav-dropdown .dropdown-menu {
    /* 添加红色边框以便调试 */
    /* border: 2px solid red !important; */
}

/* 确保下拉菜单不会被其他元素裁剪 */
.nav-links {
    overflow: visible !important;
}

.dropdown-menu .category-item {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    margin-bottom: 8px;
    border: none;
}

.dropdown-menu .category-item:last-child {
    margin-bottom: 0;
}

.dropdown-menu .category-item:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    transform: translateX(3px);
}

/* 分类项选中状态 */
.dropdown-menu .category-item.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateX(3px);
}

.dropdown-menu .category-item.active:hover {
    background: #2980b9;
    color: white;
}

.dropdown-menu .category-item i {
    display: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .nav-dropdown {
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background-color: transparent;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        margin-top: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu .category-item {
        padding: 12px 25px;
        color: white;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-menu .category-item:hover {
        background-color: rgba(255, 255, 255, 0.15);
        color: white;
    }
    
    /* 移动端分类项选中状态 */
    .dropdown-menu .category-item.active {
        background-color: #3498db;
        color: white;
    }
}

/* 首页文章列表加载更多按钮和移动端提示样式 */
.load-more-btn {
    grid-column: 1/-1;
    margin: 30px auto;
    padding: 12px 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: block;
    min-width: 200px;
}

.load-more-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.load-more-btn .fa-spinner,
.load-more-btn .fa-plus,
.load-more-btn .fa-check {
    margin-right: 8px;
}

/* 移动端下拉加载提示 */
.mobile-load-hint {
    grid-column: 1/-1;
    margin: 20px auto;
    padding: 16px;
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.05);
    width: calc(100% - 40px);
    max-width: 400px;
}

.mobile-load-hint i {
    font-size: 16px;
}

.mobile-load-hint .fa-arrow-down {
    color: #667eea;
}

.mobile-load-hint .fa-check-circle {
    color: #27ae60;
}

.mobile-load-hint .fa-spinner {
    color: #667eea;
}

#mobile-loading-indicator {
    display: none;
    align-items: center;
    gap: 8px;
}

@media (max-width: 480px) {
    .mobile-load-hint {
        font-size: 13px;
        padding: 12px;
        width: calc(100% - 20px);
    }
    
    .load-more-btn {
        padding: 10px 24px;
        font-size: 15px;
        min-width: 180px;
    }
}