/* ==========================================================================
   跨域公共组件 —— 漫画 / 小说 / 短剧共用
   只放与内容域无关的 UI 组件（筛选栏、空结果等）；各域专有样式放 domain 文件
   （comic.css / novel.css / drama.css）
   改动本文件会影响所有引用它的页面，属于预期行为
   ========================================================================== */

/* ---------- 筛选栏：分类页 / 频道首页 ---------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #e9edf3;
    position: relative;
}

.filter-tag {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 6px 16px;
    color: #64748b;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 48px;
}

.filter-tag:hover {
    border-color: rgba(37, 99, 235, 0.4);
    color: #2563eb;
}

.filter-tag.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
    font-weight: 500;
}

/* 分类折叠：JS 计算第三行起的标签并加 tag-hidden，最多显示两行 */
.filter-bar.collapsed .filter-tag.tag-hidden {
    display: none;
}

.filter-expand {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 6px 12px;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* 折叠态：按钮浮动紧跟第二行末尾标签，不再独立换行 */
.filter-expand.is-float {
    position: absolute;
    z-index: 2;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.filter-expand:hover {
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.4);
}

.filter-expand .expand-icon {
    font-size: 12px;
    transition: transform 0.25s ease;
}

.filter-expand.expanded .expand-icon {
    transform: rotate(180deg);
}

/* ---------- 区块标题 ---------- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    position: relative;
    padding-left: 12px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: #2563eb;
}

/* ---------- 排序切换 ---------- */
.sort-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 2px;
}

.sort-item {
    padding: 5px 14px;
    border-radius: 2px;
    font-size: 13px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sort-item.active {
    background: #ffffff;
    color: #2563eb;
    font-weight: 500;
}

.sort-item:hover {
    color: #2563eb;
}

/* ---------- 空结果 ---------- */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 15px;
}

@media (max-width: 768px) {
    .filter-bar {
        padding: 12px;
        gap: 8px;
    }
}
