/* ============================================================
 * filter_topbar.css —— 顶部一行 + Tab 高级筛选栏
 * 主色跟随站点 --accent（落地改 design-system.css 即全站高级黑）。
 * 容器 max-width: var(--w) 跟随后台 data-width 宽度设置并居中。
 * ============================================================ */

.filter-topbar {
    max-width: var(--w, 1100px);
    margin: 0 auto 14px;
    background: var(--c-surface, #fff);
    border: 1px solid var(--c-border, #e7e0d5);
    border-radius: var(--radius, 10px);
    box-shadow: 0 1px 2px rgba(60, 40, 30, .04);
    overflow: hidden;
}

/* ---------- 一行 ---------- */
.filter-topbar .ft-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
}
.filter-topbar .ft-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-bg, #F5F0E8);
    border: 1px solid var(--c-border, #e7e0d5);
    border-radius: 8px;
    padding: 0 10px;
    height: 38px;
    min-width: 0;
}
.filter-topbar .ft-search svg { flex: none; color: var(--c-muted, #8a8175); }
.filter-topbar .ft-search-input {
    flex: 1; border: 0; background: transparent; outline: none;
    font-size: 14px; color: var(--c-text, #2b2620); min-width: 0;
}
.filter-topbar .ft-sep { width: 1px; height: 22px; background: var(--c-border, #e7e0d5); flex: none; }
.filter-topbar .ft-sort { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.filter-topbar .ft-sort a {
    font-size: 13px; color: var(--c-muted, #8a8175); text-decoration: none;
    padding: 7px 9px; border-radius: 7px;
}
.filter-topbar .ft-sort a.active { color: var(--accent); background: var(--accent-soft, #ecebe8); font-weight: 600; }
.filter-topbar .ft-adv-btn {
    display: inline-flex; align-items: center; gap: 7px; flex: none;
    height: 38px; padding: 0 14px; cursor: pointer;
    border: 1px solid var(--accent); color: var(--accent);
    background: var(--c-surface, #fff); border-radius: 8px; font-size: 14px;
    transition: background .15s;
}
.filter-topbar .ft-adv-btn:hover { background: var(--accent-soft, #ecebe8); }
.filter-topbar .ft-adv-btn .ft-badge {
    background: var(--accent); color: #fff; font-size: 12px;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: none; align-items: center; justify-content: center; padding: 0 5px;
}
.filter-topbar .ft-adv-btn .ft-caret { transition: transform .2s; }
.filter-topbar .ft-adv-btn.open .ft-caret { transform: rotate(180deg); }

/* ---------- 展开面板 ---------- */
.filter-topbar .ft-panel {
    border-top: 1px solid var(--c-border, #e7e0d5);
    padding: 0;
}
.filter-topbar .ft-panel[hidden] { display: none; }

/* Tab 栏（动态生成，不写死） */
.filter-topbar .ft-tabs {
    display: flex; gap: 4px; padding: 0 14px;
    border-bottom: 1px solid var(--c-border, #e7e0d5);
    overflow-x: auto;
    background: var(--accent-bg, #F5F0E8);
}
.filter-topbar .ft-tab {
    flex: none; appearance: none; border: 0; background: none; cursor: pointer;
    padding: 13px 14px; font-size: 14px; color: var(--c-muted, #8a8175);
    border-bottom: 2px solid transparent; white-space: nowrap; transition: color .12s;
}
.filter-topbar .ft-tab:hover { color: var(--accent); }
.filter-topbar .ft-tab.active { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.filter-topbar .ft-tab .ft-tcount { font-size: 11px; opacity: .7; margin-left: 4px; }

/* Pane */
.filter-topbar .ft-pane { display: none; padding: 16px 18px; }
.filter-topbar .ft-pane.active { display: block; }
.filter-topbar .ft-group { margin-bottom: 14px; }
.filter-topbar .ft-group:last-child { margin-bottom: 0; }
.filter-topbar .ft-group-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--c-muted, #8a8175); font-weight: 600; margin: 0 0 7px;
}
.filter-topbar .ft-group-pick {
    font-size: 11px; color: var(--accent); text-decoration: none;
    border: 1px solid var(--c-border, #e7e0d5); border-radius: 10px; padding: 1px 8px; font-weight: 400;
}
.filter-topbar .ft-group-pick:hover { background: var(--accent-soft, #ecebe8); }
.filter-topbar .ft-chips {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding-left: 12px; border-left: 2px solid var(--c-border, #e7e0d5);
}
.filter-topbar .ft-chip {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid var(--c-border, #e7e0d5); color: var(--c-text, #2b2620);
    text-decoration: none; padding: 4px 10px; border-radius: 14px; font-size: 13px;
    cursor: pointer; background: #fff; transition: all .12s;
}
.filter-topbar .ft-chip:hover { border-color: var(--accent); }
.filter-topbar .ft-chip.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-topbar .ft-chip .cnt { font-size: 11px; opacity: .65; }
.filter-topbar .ft-chip.sel .cnt { opacity: .85; }

/* 已选汇总 */
.filter-topbar .ft-active { border-top: 1px dashed var(--c-border, #e7e0d5); padding: 14px 18px; }
.filter-topbar .ft-active-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-topbar .ft-active-tag {
    display: inline-flex; align-items: center; gap: 5px; font-size: 13px;
    background: var(--accent-soft, #ecebe8); color: var(--accent);
    border: 1px solid var(--accent); border-radius: 14px; padding: 3px 10px;
}
.filter-topbar .ft-active-tag a { color: var(--accent); text-decoration: none; font-weight: 700; }
.filter-topbar .ft-clear { margin-left: auto; font-size: 13px; color: var(--c-muted, #8a8175); text-decoration: none; }
.filter-topbar .ft-clear:hover { color: var(--accent); }

/* 列表加载态（filter.js 会加 .is-loading 到 .content-list-wrapper；此处仅保底） */
.filter-topbar.is-loading { opacity: .6; pointer-events: none; }
