/* Component: Nav Grid + Featured + Tabs (isolated, clean) */

/* Tabs */
.tabs {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin: 16px 0 12px;
}

.tab {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
    color: #333;
    font-weight: 700;
    letter-spacing: .2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
    transition: all .2s ease;
    cursor: pointer;
}

.tab:hover {
    border-color: rgba(10, 132, 255, .25);
    box-shadow: 0 3px 12px rgba(10, 132, 255, .06);
}

.tab.active {
    background: linear-gradient(135deg, #0a84ff, #0066cc);
    color: #fff;
    border-color: rgba(10, 132, 255, .40);
    box-shadow: 0 6px 18px rgba(10, 132, 255, .18);
}

/* Section title center */
.nav-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 18px 0 8px;
}

/* Base grid */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width:1280px) {
    .nav-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

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

@media (max-width:768px) {
    .nav-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Featured row: first 8 in Hot tab */
.nav-grid.featured {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

/* Card */
.nav-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 28px 12px 12px 12px;
    /* 上边距增加为胶囊留空间 */
    background: #f7f7f8;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 10px;
    min-height: 56px;
    color: inherit;
    text-decoration: none;
    /* 移除 overflow: hidden 以防止热度值图标被裁剪 */
}

/* Card hover overlay */
.nav-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.nav-card:hover .nav-card-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Overlay action buttons */
.overlay-action {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    will-change: transform;
}

.overlay-action:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.overlay-action.preview-action {
    color: #0a84ff;
}

.overlay-action.link-action {
    color: #34c759;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}


.nav-card:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
    border-color: rgba(0, 0, 0, .12);
    transform: translateY(-2px);
}

/* Featured card bigger */
.nav-card.featured {
    min-height: 78px;
    padding: 14px 14px;
}

/* Left area */
.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    justify-content: flex-start;
}

.nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    color: #0a84ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    /* 图标不被压缩 */
}

/* 限制标题区域最大宽度，避免挤压图标 */
.nav-title {
    max-width: calc(100% - 48px);
}


.nav-icon img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: block;
}

.nav-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
}

/* 左侧标题区：允许换行（最多两行），卡片尺寸不受标题影响 */
.nav-title .txt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
}

/* Top-right fire badge (refined capsule, airy) */
.hot-badge {
    position: absolute;
    top: -12px;
    /* 向上移动20px创建悬浮效果 */
    right: 12px;
    height: 22px;
    line-height: 22px;
    padding: 0 12px;
    border-radius: 999px;
    background: #fff;
    /* 实体胶囊，不透明底 */
    border: 1px solid rgba(224, 49, 49, .35);
    color: #e03131;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
    z-index: 15;
    /* 确保在遮罩层之上显示 */
    white-space: nowrap;
}

/* 确保悬停时热度值图标依然在最上层 */
.nav-card:hover .hot-badge {
    z-index: 20;
}


/* Hot badge value hidden by default; show on hover (desktop) */
.hot-badge i {
    font-size: 12px;
    line-height: 20px;
}

.hot-badge .value {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
}

.nav-card:hover .hot-badge .value {
    display: inline;
}

@media (max-width: 1024px) {
    .hot-badge {
        top: -14px;
        /* 移动端视图下也向上移动，保持悬浮效果 */
        right: 8px;
        height: 20px;
        line-height: 20px;
        padding: 0 10px;
        gap: 4px;
    }

    .hot-badge i {
        font-size: 11px;
        line-height: 20px;
    }

    .hot-badge .value {
        display: inline-block;
        font-size: 11px;
        font-weight: 700;
        line-height: 20px;
        margin-left: 6px;
    }

    /* 移动端遮罩和按钮优化 */
    .overlay-action {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .nav-card-overlay {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    /* 移动端触摸优化 */
    .overlay-action {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .nav-card-overlay {
        gap: 12px;
    }

    /* 确保移动端热度值图标不被遮挡 */
    .hot-badge {
        top: -12px;
        right: 6px;
        height: 18px;
        line-height: 18px;
        padding: 0 8px;
        font-size: 10px;
    }

    .hot-badge i {
        font-size: 10px;
        line-height: 18px;
    }

    .hot-badge .value {
        font-size: 10px;
        line-height: 18px;
        margin-left: 4px;
    }

    /* 移动端：卡片与标题优化，避免标题被挤压 */
    .nav-card {
        gap: 6px;
        padding: 24px 10px 10px 10px;
    }
    .nav-left {
        gap: 6px;
    }
    .nav-icon {
        width: 32px;
        height: 32px;
    }
    .nav-title {
        font-size: 12px;
        line-height: 1.45;
    }
    .nav-title .txt {
        -webkit-line-clamp: 2;
        line-height: 1.45;
        word-break: break-word;
    }
}