/* ============================================
   网址导航页样式（对比度增强 + 紧凑布局 + 与首页同宽）
   ============================================ */

/* ---------- 全局变量 ---------- */
:root {
    --primary: #0087DB;
    --primary-2: #29a0f0;
    --primary-soft: #eff8ff;
    --primary-border: #dbeafe;
    --border: #dbe2ec;
    --border-soft: #e4eaf3;
    --canvas: #f4f6fa;
    --text: #1f2937;
    --muted: #6b7280;
    --faint: #9ca3af;
    --radius: 14px;
    --radius-card: 12px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04),
                 0 4px 12px rgba(16, 24, 40, .04);
    --shadow-card: 0 1px 2px rgba(16, 24, 40, .05),
                   0 6px 16px rgba(16, 24, 40, .06);
    --shadow-brand: 0 14px 30px rgba(0, 135, 219, .16);
}

/* 与首页 .home-wrap 对齐：1280px 居中 */
.nav-page {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    background: var(--canvas);
    border-radius: 16px;
    padding: 8px 14px 14px;
}

/* ============================================
   顶部一级分类栏
   ============================================ */
.nav-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 10px;
    margin-bottom: 16px;
}

.nav-topbar-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.nav-topbar-inner::-webkit-scrollbar { display: none; }

.nav-cat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    line-height: 20px;
    color: #4b5563;
    background: #f7f9fc;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .2s ease;
}
.nav-cat:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.nav-cat-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--faint);
    background: #fff;
    border: 1px solid #eef0f5;
    padding: 0 7px;
    border-radius: 999px;
    transition: all .2s ease;
}

.nav-cat.active {
    background: linear-gradient(135deg, var(--primary-2), var(--primary));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 26px rgba(0, 135, 219, .18);
}
.nav-cat.active .nav-cat-count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
    border-color: transparent;
}

/* ============================================
   我的收藏栏（贴近分类栏）
   ============================================ */
.my-fav-bar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.my-fav-label {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    padding: 4px 0;
}
.my-fav-label i { color: #f59e0b; }

.my-fav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
    align-items: center;
}

.my-fav-link {
    display: inline-flex;
    align-items: center;
    max-width: 180px;
    height: 24px;
    padding: 0 10px;
    font-size: 12px;
    color: #475569;
    background: #eef1f6;
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all .18s ease;
}
.my-fav-link:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.my-fav-empty {
    font-size: 12px;
    color: var(--faint);
    padding: 4px 0;
}

/* ============================================
   导航网格
   ============================================ */
.nav-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

/* ============================================
   导航卡片
   ============================================ */
.nav-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius-card);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    text-decoration: none;
    transition: transform .25s cubic-bezier(.2, .7, .3, 1),
                box-shadow .25s ease,
                border-color .25s ease;
}

.nav-card:hover {
    transform: translateY(-3px);
    border-color: #b9d8f5;
    box-shadow: var(--shadow-brand);
}

.nav-card-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    background: #f2f5fa;
    border: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .25s ease;
}
.nav-card:hover .nav-card-logo { transform: scale(1.06); }

.nav-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nav-card-logo .fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    background: linear-gradient(135deg, #e6f2ff, #fff);
}

.nav-card-body {
    flex: 1;
    min-width: 0;
}

.nav-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .2s;
}
.nav-card:hover .nav-card-name { color: var(--primary); }

.nav-sub-flag {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 4px 8px 5px 9px;
    border-radius: 0 0 0 8px;
    background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(139, 92, 246, .25);
}
.nav-sub-flag i { font-size: 9px; }

.nav-card-desc {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-card-arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eef1f6;
    color: var(--faint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    transition: all .25s ease;
}
.nav-card:hover .nav-card-arrow {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 135, 219, .35);
}

/* ============================================
   卡片收藏星标
   ============================================ */
.nav-fav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #eef1f6;
    color: #cbd5e1;
    font-size: 12px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all .2s ease;
    margin-right: 4px;
}
.nav-fav:hover { color: #f59e0b; background: #fef3c7; }
.nav-fav.is-fav { color: #f59e0b; background: #fef3c7; }

/* ============================================
   空状态
   ============================================ */
.nav-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--faint);
    font-size: 14px;
    background: #fbfcfe;
    border: 1px dashed #d5dde9;
    border-radius: var(--radius-card);
}
.nav-empty i {
    display: block;
    font-size: 34px;
    color: #d1d5db;
    margin-bottom: 12px;
}

/* ============================================
   响应式
   ============================================ */
@media (min-width: 640px) {
    .nav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .nav-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
    .nav-page { padding: 6px 8px 8px; border-radius: 12px; }

    .nav-cat { padding: 7px 13px; font-size: 13px; }

    .nav-card { padding: 14px; gap: 12px; }
    .nav-card-logo { width: 44px; height: 44px; }
    .nav-card-name { font-size: 14px; }

    .my-fav-bar { padding: 8px 10px; gap: 8px; margin-bottom: 6px; }
    .my-fav-label { font-size: 11px; }
    .my-fav-link { height: 22px; padding: 0 8px; font-size: 11px; max-width: 140px; }

    .nav-fav { width: 24px; height: 24px; font-size: 11px; }
}