/* ========================================
   博客标签导航样式
   遵循 css-style-guide.md 规范
======================================== */

/* 整体容器 */
.lsd-blog-filter {
    background-color: #fff;
}
.lsd-bottom-20 { margin-bottom: 20px; }
.lsd-top-20 { margin-top: 20px; }
/* 分类导航与搜索框同行布局 */
.lsd-filter-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 分类导航左边距，与下方标签对齐 */
.lsd-category-nav {
    margin-left: -16px;
}

/* ----------------------------------------
   分类导航
---------------------------------------- */
.lsd-category-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lsd-category-item {
    display: inline-block;
    padding: 8px 16px;
    font-size: 16px;
    color: #374151;
    text-decoration: none;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s;
}

.lsd-category-item:hover {
    color: #2563EB;
}

/* 选中状态 - 蓝色文字 + 下方蓝色下划线 */
.lsd-category-item.lsd-active {
    color: #2563EB;
    font-weight: 500;
}

.lsd-category-item.lsd-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    height: 2px;
    background-color: #2563EB;
    border-radius: 1px;
}

/* ----------------------------------------
   搜索框
---------------------------------------- */
.lsd-search-box {
    display: flex;
    align-items: center;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
    background-color: #fff;
    min-width: 220px;
    transition: border-color 0.2s;
}

.lsd-search-box:focus-within {
    border-color: #2563EB;
}

.lsd-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 12px;
    font-size: 14px;
    color: #374151;
    background-color: transparent;
    min-width: 0;
}

.lsd-search-input::placeholder {
    color: #9CA3AF;
}

.lsd-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    color: #6B7280;
    flex-shrink: 0;
    transition: color 0.2s;
}

.lsd-search-btn:hover {
    color: #2563EB;
}

.lsd-search-btn svg {
    width: 16px;
    height: 16px;
}

/* ----------------------------------------
   标签筛选行
---------------------------------------- */
.lsd-tag-filter {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.lsd-tag-label {
    font-size: 14px;
    color: #374151;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 30px;
}

.lsd-tag-list {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
    flex-wrap: wrap;
}

.lsd-tag-item {
    display: inline-block;
    padding: 4px 14px;
    font-size: 14px;
    color: #374151;
    background-color: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
    cursor: pointer;
}

.lsd-tag-item:hover {
    color: #2563EB;
    border-color: #2563EB;
}

.lsd-tag-item.lsd-active {
    color: #2563EB;
    border: 1px solid #2563EB;
    background-color: #E8F3FF;
    border-radius: 4px;
}

/* ========================================
   移动端适配（max-width: 768px）
======================================== */
@media screen and (max-width: 768px) {
    /* 分类与搜索框换行，搜索框移至底部或隐藏 */
    .lsd-filter-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* 分类导航横向滚动 */
    .lsd-category-nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        padding-bottom: 2px;
    }

    .lsd-category-nav::-webkit-scrollbar {
        display: none;
    }

    .lsd-category-item {
        font-size: 15px;
        padding: 8px 12px;
        flex-shrink: 0;
    }

    .lsd-category-item.lsd-active::after {
        width: calc(100% - 24px);
    }

    /* 搜索框宽度撑满 */
    .lsd-search-box {
        width: 100%;
        min-width: unset;
    }

    /* 标签筛选行 */
    .lsd-tag-filter {
        margin-top: 12px;
    }

    .lsd-tag-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .lsd-tag-list::-webkit-scrollbar {
        display: none;
    }

    .lsd-tag-item {
        flex-shrink: 0;
    }
}
