/* ==================== 手机端导航栏修复 ==================== */

/* 所有手机屏幕 (<= 768px) */
@media (max-width: 768px) {
    /* ========== 基础导航栏设置 ========== */
    .navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        min-height: 50px !important;
    }
    
    .nav-container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 8px 12px !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        max-width: 100% !important;
    }
    
    /* ========== Logo ========== */
    .logo {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        font-size: 15px !important;
        font-weight: bold !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
    
    .logo-icon {
        font-size: 20px !important;
    }
    
    .logo-text {
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
    }
    
    .logo-label {
        font-size: 15px !important;
    }
    
    /* ========== 导航链接 ========== */
    .nav-links {
        display: flex !important;
        list-style: none !important;
        gap: 2px !important;
        margin: 0 !important;
        padding: 0 !important;
        flex-shrink: 1 !important;
    }
    
    .nav-links li {
        display: inline-block !important;
    }
    
    .nav-links a {
        display: block !important;
        padding: 5px 8px !important;
        color: white !important;
        text-decoration: none !important;
        font-size: 13px !important;
        border-radius: 16px !important;
        white-space: nowrap !important;
    }
    
    /* ========== 强制隐藏用户名 ========== */
    .nav-text,
    .navbar .nav-text,
    .user-profile-wrapper .nav-text {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        left: -9999px !important;
    }
    
    /* ========== 用户操作区 ========== */
    .user-actions {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;  /* 增加按钮间距 */
        flex-shrink: 0 !important;
    }
    
    .user-profile-wrapper {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;  /* 增加按钮间距 */
    }
    
    /* ========== 摸鱼皮肤按钮 - 完全清空内容只显示emoji ========== */
    #skinBtn,
    .btn-skin {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        margin: 0 2px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(255,255,255,0.2) !important;
        color: transparent !important;  /* 隐藏所有文字颜色 */
        border: none !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        font-size: 0 !important;  /* 隐藏字体大小 */
        line-height: 0 !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
        text-indent: -9999px !important;  /* 隐藏文字内容 */
        position: relative !important;
    }
    
    /* 强制显示emoji */
    #skinBtn::before,
    .btn-skin::before {
        content: "🎨" !important;
        font-size: 22px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-indent: 0 !important;
        color: white !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    /* ========== 个人中心/退出按钮 - 完全清空内容只显示emoji ========== */
    .user-profile-wrapper a.btn,
    .user-profile-wrapper .btn {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        margin: 0 2px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        font-size: 0 !important;  /* 隐藏字体 */
        line-height: 0 !important;
        overflow: hidden !important;
        text-decoration: none !important;
        flex-shrink: 0 !important;
        text-indent: -9999px !important;  /* 隐藏原文字 */
        position: relative !important;
    }
    
    /* 隐藏按钮内的所有内容 */
    .user-profile-wrapper a.btn *,
    .user-profile-wrapper .btn * {
        display: none !important;
    }
    
    /* 用emoji替代按钮文字 */
    .user-profile-wrapper a[href*="profile"]::before,
    .user-profile-wrapper .btn-primary::before {
        content: "👤" !important;
        font-size: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-indent: 0 !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .user-profile-wrapper a[href*="logout"]::before,
    .user-profile-wrapper .btn-secondary::before {
        content: "🚪" !important;
        font-size: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-indent: 0 !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    /* ========== 登录/注册按钮 ========== */
    #loginBtn, 
    #registerBtn {
        padding: 6px 12px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
        border-radius: 16px !important;
    }
    
    #loginBtn {
        background: rgba(255,255,255,0.2) !important;
        color: white !important;
        border: none !important;
    }
    
    #registerBtn {
        background: white !important;
        color: #667eea !important;
        border: none !important;
    }
    
    /* ========== 皮肤面板 ========== */
    .skin-panel {
        position: fixed !important;
        top: 60px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: none !important;
        background: white !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
        z-index: 9999 !important;
    }
    
    body {
        padding-top: 70px !important;
    }
}

/* 小屏幕手机 (<= 480px) */
@media (max-width: 480px) {
    .navbar {
        min-height: 46px !important;
    }
    
    .nav-container {
        padding: 6px 8px !important;
        gap: 4px !important;
    }
    
    .logo {
        font-size: 14px !important;
    }
    
    .logo-icon {
        font-size: 18px !important;
    }
    
    .nav-links a {
        padding: 4px 6px !important;
        font-size: 12px !important;
    }
    
    #skinBtn,
    .btn-skin,
    .user-profile-wrapper a.btn,
    .user-profile-wrapper .btn {
        width: 36px !important;
        height: 36px !important;
        margin: 0 2px !important;
    }
    
    #skinBtn::before,
    .btn-skin::before {
        font-size: 18px !important;
    }
    
    .user-profile-wrapper a.btn::before,
    .user-profile-wrapper .btn::before {
        font-size: 18px !important;
    }
    
    #loginBtn, 
    #registerBtn {
        padding: 5px 10px !important;
        font-size: 11px !important;
    }
    
    body {
        padding-top: 60px !important;
    }
}

/* 超小屏幕 (<= 375px) */
@media (max-width: 375px) {
    .navbar {
        min-height: 44px !important;
    }
    
    .nav-container {
        padding: 5px 6px !important;
        gap: 3px !important;
    }
    
    .logo {
        font-size: 13px !important;
    }
    
    .nav-links a {
        padding: 3px 5px !important;
        font-size: 11px !important;
    }
    
    #skinBtn,
    .btn-skin,
    .user-profile-wrapper a.btn,
    .user-profile-wrapper .btn {
        width: 30px !important;
        height: 30px !important;
    }
    
    #loginBtn, 
    #registerBtn {
        padding: 4px 8px !important;
        font-size: 10px !important;
    }
    
    body {
        padding-top: 55px !important;
    }
}

/* 极小屏幕 (<= 320px) */
@media (max-width: 320px) {
    .nav-links a {
        padding: 3px 4px !important;
        font-size: 10px !important;
    }
    
    #skinBtn,
    .btn-skin,
    .user-profile-wrapper a.btn,
    .user-profile-wrapper .btn {
        width: 28px !important;
        height: 28px !important;
    }
    
    #skinBtn::before,
    .btn-skin::before {
        font-size: 16px !important;
    }
}

/* ==================== 分页导航修复 ==================== */
/* 修复手机端底部分页导航不可见问题 */
@media (max-width: 768px) {
    /* 强制显示分页导航容器 */
    .ct-pagination,
    nav.ct-pagination {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        margin-top: 30px;
        padding: 15px 0;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* 强制显示页码数字 */
    .ct-pagination .page-numbers {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* 强制显示上一页/下一页按钮 */
    .ct-pagination .prev,
    .ct-pagination .next {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* 数字分页容器 */
    .ct-pagination[data-pagination="simple"] > div {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    /* 调整页码按钮大小适配移动端 */
    .ct-pagination .page-numbers {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        border: 1px solid #e0e5eb;
        background: #fff;
        color: #333;
        text-decoration: none;
    }
    
    .ct-pagination .page-numbers.current {
        background: #007bff;
        color: #fff;
        border-color: #007bff;
    }
    
    /* 覆盖隐藏类 */
    .ct-pagination .ct-hidden-sm {
        display: inline-flex !important;
    }
}

@media (max-width: 480px) {
    .ct-pagination {
        gap: 3px;
    }
    
    .ct-pagination .page-numbers {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* ==================== 论坛自定义分页导航修复 ==================== */
/* 修复首页/论坛页面的分页在移动端不可见 */

@media (max-width: 768px) {
    /* 确保分页容器显示 */
    #postsContainer > div[style*="margin-top:30px"],
    #postsContainer > div[style*="text-align:center"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 100 !important;
        margin-top: 30px !important;
        padding: 15px 10px !important;
        width: 100% !important;
        clear: both !important;
    }
    
    /* 分页内部flex容器 */
    #postsContainer > div[style*="margin-top:30px"] > div,
    #postsContainer > div[style*="text-align:center"] > div {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        background: white !important;
        padding: 10px 15px !important;
        border-radius: 20px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
        max-width: 100% !important;
    }
    
    /* 分页链接样式 */
    #postsContainer > div[style*="margin-top:30px"] a,
    #postsContainer > div[style*="text-align:center"] a {
        display: inline-flex !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        white-space: nowrap !important;
    }
    
    /* 分页文字 */
    #postsContainer > div[style*="margin-top:30px"] span,
    #postsContainer > div[style*="text-align:center"] span {
        display: inline-flex !important;
        padding: 0 8px !important;
        font-size: 13px !important;
        color: #666 !important;
        align-items: center !important;
    }
}

@media (max-width: 480px) {
    #postsContainer > div[style*="margin-top:30px"],
    #postsContainer > div[style*="text-align:center"] {
        padding: 10px 5px !important;
    }
    
    #postsContainer > div[style*="margin-top:30px"] > div,
    #postsContainer > div[style*="text-align:center"] > div {
        padding: 8px 10px !important;
        gap: 5px !important;
    }
    
    #postsContainer > div[style*="margin-top:30px"] a,
    #postsContainer > div[style*="text-align:center"] a {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
}

/* ==================== 论坛分页精确修复 ==================== */
.forum-pagination {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.forum-pagination-inner {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (max-width: 768px) {
    .forum-pagination {
        display: block !important;
        margin-top: 30px !important;
        padding: 15px 10px !important;
        text-align: center !important;
        width: 100% !important;
        clear: both !important;
        position: relative !important;
        z-index: 100 !important;
    }
    
    .forum-pagination-inner {
        display: inline-flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        background: white !important;
        padding: 10px 15px !important;
        border-radius: 20px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
        max-width: 100% !important;
        align-items: center !important;
    }
    
    .forum-pagination-inner a {
        display: inline-flex !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        white-space: nowrap !important;
    }
    
    .forum-pagination-inner span {
        display: inline-flex !important;
        padding: 0 8px !important;
        font-size: 13px !important;
        color: #666 !important;
        align-items: center !important;
    }
}

@media (max-width: 480px) {
    .forum-pagination {
        padding: 10px 5px !important;
    }
    
    .forum-pagination-inner {
        padding: 8px 10px !important;
        gap: 5px !important;
    }
    
    .forum-pagination-inner a {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
    
    .forum-pagination-inner span {
        font-size: 12px !important;
        padding: 0 5px !important;
    }
}
