/* Mobile Exclusive Styles (Screens < 600px) */

@media (min-width: 601px) {
    .mobile-nav-bar { display: none !important; }
}

@media (max-width: 600px) {
    /* =====================
       1. Header - Logo 置中，隱藏導覽列與搜尋按鈕
    ===================== */
    .kuaibao-header .nav-menu,
    .kuaibao-header .header-extra {
        display: none !important;
    }

    .kuaibao-header .header-inner {
        justify-content: center;
        padding: 10px 0;
        flex-wrap: nowrap;
        gap: 0;
    }

    /* =====================
       2. 底部固定導覽列
    ===================== */
    .mobile-nav-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        background: var(--nav-bg);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        display: flex;
        justify-content: space-around;
        align-items: center;
        border-top: 1px solid var(--border);
        z-index: 999;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.68rem;
        font-weight: 700;
        transition: all 0.2s;
        padding: 6px 10px;
        background: none;
        border: none;
        cursor: pointer;
        font-family: inherit;
    }

    .mobile-nav-item i {
        font-size: 1.2rem;
        margin-bottom: 3px;
    }

    .mobile-nav-item.active {
        color: var(--accent);
    }

    /* =====================
       3. 通用間距
    ===================== */
    .container {
        padding: 0 16px;
    }

    main {
        padding-bottom: 85px;
    }

    /* =====================
       4. 回到頂部按鈕 - 避免被導覽列遮住
    ===================== */
    .back-to-top {
        bottom: 80px !important;
        right: 16px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }

    /* =====================
       5. index.html - 新聞卡片左圖右文
    ===================== */
    .hero-section {
        margin-top: 16px;
    }

    .section-title {
        font-size: 1.05rem;
        margin-bottom: 14px;
    }

    .news-group-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .news-card {
        flex-direction: row;
        height: 100px;
        border-radius: 14px;
        padding: 8px;
        overflow: hidden;
    }

    .news-thumb-wrap {
        width: 96px;
        min-width: 96px;
        height: 100%;
        flex-shrink: 0;
        border-radius: 10px;
        overflow: hidden;
        background: #f1f5f9;
    }

    .news-thumb-wrap img,
    .news-thumb {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        border-radius: 10px;
    }

    .news-body {
        flex: 1;
        padding: 4px 10px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        overflow: hidden;
    }

    .news-title {
        font-size: 0.9rem;
        margin-bottom: 0;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.4;
    }

    .news-summary {
        display: none;
    }

    .news-meta {
        font-size: 0.72rem;
        color: #94a3b8;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: 4px;
    }

    .news-date-divider {
        margin: 24px 0 12px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .news-date-divider-label {
        font-size: 0.75rem;
        padding: 4px 12px;
        background: #fff1f2;
        color: var(--accent);
        border-radius: 20px;
        font-weight: 700;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .news-date-divider::after {
        content: "";
        flex-grow: 1;
        height: 1px;
        background: var(--border);
    }

    /* 頁碼導覽 */
    .page-nav {
        gap: 10px;
        margin: 24px 0;
        padding-top: 24px;
    }

    .page-btn {
        padding: 10px 16px;
        font-size: 0.82rem;
        border-radius: 30px;
    }

    /* =====================
       6. article.html - 文章頁
    ===================== */
    .article-container {
        padding: 24px 16px !important;
        margin-top: 12px !important;
        border-radius: 16px !important;
        margin-bottom: 20px !important;
    }

    .article-title {
        font-size: 1.5rem !important;
        line-height: 1.35 !important;
    }

    .article-meta {
        flex-wrap: wrap;
        gap: 12px !important;
        font-size: 0.82rem !important;
    }

    .article-content {
        font-size: 1rem !important;
    }

    /* =====================
       7. sites.html - 好站分享
    ===================== */
    .page-header {
        margin-top: 20px !important;
        margin-bottom: 20px !important;
    }

    .page-header h1 {
        font-size: 1.5rem !important;
    }

    .page-header p {
        font-size: 0.9rem !important;
    }

    .filter-bar {
        gap: 8px;
        margin-bottom: 20px;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

    .filter-bar::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        flex-shrink: 0;
        padding: 6px 16px;
        font-size: 0.82rem;
    }

    .sites-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .site-card {
        border-radius: 16px !important;
        padding: 18px !important;
    }

    /* =====================
       8. about.html - 關於我們
    ===================== */
    .content-card {
        padding: 24px 16px !important;
        border-radius: 16px !important;
        margin-bottom: 30px !important;
    }

    .tabs {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        scrollbar-width: none;
        padding-bottom: 4px;
        gap: 8px !important;
        border: none !important;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        flex-shrink: 0;
        padding: 8px 16px !important;
        font-size: 0.85rem !important;
        width: auto !important;
    }

    .prose h2 {
        font-size: 1.3rem !important;
    }

    .prose p {
        font-size: 1rem !important;
    }

    /* =====================
       9. Overlay 搜尋面板
    ===================== */
    .nav-overlay {
        padding: 56px 16px 24px;
    }

    .overlay-close {
        top: 16px;
        right: 20px;
        font-size: 1.6rem;
    }

    .overlay-search-input {
        font-size: 1rem;
        padding: 12px 16px 12px 48px;
    }

    .date-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .date-grid-item {
        padding: 10px 4px;
        font-size: 0.78rem;
        border-radius: 12px;
    }

    /* =====================
       10. 三格 widget accordion
    ===================== */
    .widget-card .widget-header {
        user-select: none;
        cursor: pointer;
    }

    .widget-arrow {
        margin-left: auto;
        font-size: 0.75rem;
        color: #94a3b8;
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }

    .widget-body {
        transition: max-height 0.35s ease;
        overflow: hidden;
    }

    .widget-card.collapsed .widget-body {
        max-height: 0 !important;
    }
}