/* ============================================================ */
/* ===== 移动端底部导航 ===== */
/* ============================================================ */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #ffffff;
    border-top: 1px solid #e8ecf1;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    padding: 4px 0 env(safe-area-inset-bottom, 4px) 0;
    height: 60px;
}

.mobile-bottom-nav .nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #94a3b8;
    font-size: 0.6rem;
    padding: 2px 8px;
    min-height: 44px;
    min-width: 44px;
    transition: color 0.2s;
    position: relative;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
    transition: color 0.2s;
}

.mobile-bottom-nav .nav-item span {
    font-size: 0.6rem;
    line-height: 1.2;
}

.mobile-bottom-nav .nav-item.active {
    color: #4a6cf7;
}

.mobile-bottom-nav .nav-item.active i {
    color: #4a6cf7;
}

.mobile-bottom-nav .nav-item .badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
}

.mobile-bottom-nav .nav-item .badge-count {
    position: absolute;
    top: 0;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.5rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    border: 2px solid #fff;
}

@supports (padding: max(0px)) {
    .mobile-bottom-nav {
        padding-bottom: max(env(safe-area-inset-bottom, 4px), 4px);
    }
}

/* ============================================================ */
/* ===== 移动端顶部标题栏 ===== */
/* ============================================================ */

.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 1040;
    background: #ffffff;
    border-bottom: 1px solid #e8ecf1;
    padding: 10px 16px;
    min-height: 52px;
}

.mobile-header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 500px;
    margin: 0 auto;
}

.mobile-header .header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
}

.mobile-header .header-title i {
    color: #4a6cf7;
    margin-right: 6px;
}

.mobile-header .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-header .header-actions a {
    color: #4a5568;
    text-decoration: none;
    font-size: 0.9rem;
}

.mobile-header .header-actions a:hover {
    color: #4a6cf7;
}

.mobile-header .vip-tag-mobile,
.mobile-header .svip-tag-mobile {
    font-size: 0.55rem;
    padding: 1px 8px;
    border-radius: 12px;
    font-weight: 600;
}
.mobile-header .vip-tag-mobile {
    background: #d4edda;
    color: #155724;
}
.mobile-header .svip-tag-mobile {
    background: #e9d8fd;
    color: #6d28d9;
}

.mobile-header .coins-display-mobile {
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.75rem;
}

/* ============================================================ */
/* ===== 移动端分类导航 ===== */
/* ============================================================ */

.mobile-category-nav {
    display: none;
    background: #ffffff;
    border-bottom: 1px solid #eef2f6;
    padding: 6px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mobile-category-nav::-webkit-scrollbar {
    display: none;
}

.mobile-category-nav .category-scroll {
    display: flex;
    gap: 4px;
    padding: 0 12px;
    white-space: nowrap;
}

.mobile-category-nav .category-scroll a {
    display: inline-block;
    padding: 4px 14px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #4a5568;
    border-radius: 20px;
    text-decoration: none;
    transition: 0.2s;
}

.mobile-category-nav .category-scroll a.active {
    background: #4a6cf7;
    color: #fff;
}

.mobile-category-nav .category-scroll a:hover {
    background: #eef2ff;
    color: #4a6cf7;
}

.mobile-category-nav .category-scroll a.important {
    color: #e53e3e;
}

.mobile-category-nav .category-scroll a.important.active {
    background: #e53e3e;
    color: #fff;
}

/* ============================================================ */
/* ===== 移动端内容容器 ===== */
/* ============================================================ */

.mobile-page {
    padding-bottom: 70px;
    min-height: 100vh;
}

.mobile-page-transition {
    animation: fadeSlideUp 0.25s ease-out;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================ */
/* ===== 移动端显示控制 ===== */
/* ============================================================ */

.mobile-only {
    display: none !important;
}
.desktop-only {
    display: block;
}

/* ============================================================ */
/* ===== 移动端响应式 ===== */
/* ============================================================ */

@media (max-width: 992px) {
    .mobile-bottom-nav {
        display: block;
    }
    .mobile-header {
        display: block;
    }
    .mobile-category-nav {
        display: block;
    }
    .mobile-page {
        padding-bottom: 70px;
    }
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: block !important;
    }

    .navbar-top {
        display: none !important;
    }
    .category-bar {
        display: none !important;
    }
    .hot-tags {
        display: none !important;
    }

    .date-header {
        font-size: 0.85rem;
        padding: 8px 0 4px 0;
        margin-bottom: 10px;
    }

    .flash-item {
        padding: 10px 12px;
        gap: 6px;
    }
    .flash-item .time {
        font-size: 0.7rem;
        min-width: 40px;
    }
    .flash-item .content {
        font-size: 0.85rem;
    }
    .flash-item .content .summary {
        font-size: 0.78rem;
    }
    .flash-item .content .source {
        font-size: 0.65rem;
        gap: 6px;
    }

    .sidebar-right {
        width: 100%;
        order: 2;
    }
    .news-feed,
    .article-left {
        order: 1;
    }

    .article-card {
        padding: 14px 16px;
    }
    .article-title {
        font-size: 1.2rem;
    }
    .article-meta {
        font-size: 0.7rem;
        gap: 6px;
    }
    .article-content {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .follow-section {
        flex-direction: column;
        text-align: center;
        padding: 12px 14px;
    }
    .follow-section .follow-links {
        justify-content: center;
    }

    .pagination-custom .page-link {
        padding: 4px 10px;
        font-size: 0.8rem;
    }

    .comment-form textarea {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .mobile-header {
        padding: 8px 12px;
        min-height: 44px;
    }
    .mobile-header .header-title {
        font-size: 0.95rem;
    }
    .mobile-header .header-actions a {
        font-size: 0.75rem;
    }

    .mobile-bottom-nav {
        height: 52px;
        padding: 2px 0 env(safe-area-inset-bottom, 2px) 0;
    }
    .mobile-bottom-nav .nav-item i {
        font-size: 1.1rem;
    }
    .mobile-bottom-nav .nav-item span {
        font-size: 0.5rem;
    }
    .mobile-bottom-nav .nav-item {
        min-height: 36px;
        min-width: 36px;
        padding: 1px 4px;
    }

    .mobile-page {
        padding-bottom: 60px;
    }

    .flash-item {
        padding: 8px 10px;
    }
    .flash-item .content {
        font-size: 0.8rem;
    }
    .flash-item .content .summary {
        font-size: 0.72rem;
    }

    .article-card {
        padding: 10px 12px;
    }
    .article-title {
        font-size: 1.05rem;
    }
    .article-content {
        font-size: 0.85rem;
    }

    .mobile-category-nav .category-scroll a {
        font-size: 0.65rem;
        padding: 3px 10px;
    }
}

@media (min-width: 993px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    .mobile-header {
        display: none !important;
    }
    .mobile-category-nav {
        display: none !important;
    }
    .mobile-only {
        display: none !important;
    }
    .desktop-only {
        display: block;
    }
}
/* ================================================================
   移动端 - 文章内容优化（图片、代码块、表格、附件、内边距）
   ================================================================ */

@media (max-width: 768px) {
    
    /* ===== 1. 文章卡片内边距 ===== */
    .article-card {
        padding: 16px 16px !important;
        border-radius: 12px !important;
    }
    
    .article-content {
        padding: 0 !important;
    }

    /* ===== 2. 图片自适应 ===== */
    .article-content img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px !important;
        display: block !important;
        margin: 12px 0 !important;
    }

    /* ===== 3. 代码块（横向滚动） ===== */
    .article-content pre,
    .article-content code {
        font-size: 0.78rem !important;
        white-space: pre-wrap !important;
        word-break: break-all !important;
    }
    
    .article-content pre {
        padding: 12px !important;
        border-radius: 8px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: 100% !important;
        background: #1a1a2e !important;
        color: #e2e8f0 !important;
    }

    /* ===== 4. 表格（横向滚动） ===== */
    .article-content table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: 100% !important;
        font-size: 0.82rem !important;
        margin: 10px 0 !important;
        border-collapse: collapse !important;
    }
    
    .article-content table th,
    .article-content table td {
        padding: 6px 10px !important;
        border: 1px solid #e2e8f0 !important;
        white-space: nowrap !important;
    }

    /* ===== 5. 附件下载（纵向排列 + 全宽按钮） ===== */
    .files-section {
        padding: 12px 14px !important;
        border-radius: 10px !important;
    }
    
    .files-section .file-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 10px 12px !important;
    }
    
    .files-section .file-item .file-info {
        flex-wrap: wrap !important;
        gap: 4px 8px !important;
    }
    
    .files-section .file-item .file-info .file-name {
        font-size: 0.85rem !important;
        word-break: break-all !important;
    }
    
    .files-section .file-item .file-info .file-size {
        font-size: 0.7rem !important;
    }
    
    .files-section .file-item .btn,
    .files-section .file-item form .btn {
        font-size: 0.78rem !important;
        padding: 8px 12px !important;
        width: 100% !important;
        text-align: center !important;
        border-radius: 20px !important;
    }
    
    .files-section .file-item .badge {
        font-size: 0.7rem !important;
        padding: 4px 12px !important;
        text-align: center !important;
    }
    
    .coin-price-badge {
        font-size: 0.7rem !important;
        padding: 1px 10px !important;
    }

}