/* ============================================================
 * 2.0 · query 多列筛选面板样式
 * 附加层：只在 2.0 生效，1.x 不引用本文件。
 * 配色沿用站内既有主题（#667eea → #764ba2，白卡片，8px 圆角）
 * ============================================================ */

/* 2.0 只保留多列筛选：1.x 的「🎯 快捷筛选」和「📊 完整语法说明」收起来。
   注意只是 display:none —— 元素仍在 DOM 里，query.js 的取值和
   面板的插入位置（.filter-form-section 后面）都还依赖它。 */
.filter-form-section,
.filter-hint {
    display: none !important;
}

.v2qf {
    margin: 0 0 22px 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .10);
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, .18);
}

.v2qf-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    cursor: pointer;
    user-select: none;
}

.v2qf-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.v2qf-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .22);
}

.v2qf-head .v2qf-caret {
    margin-left: auto;
    font-size: 12px;
    transition: transform .2s;
}

.v2qf.collapsed .v2qf-caret {
    transform: rotate(-90deg);
}

.v2qf-body {
    padding: 16px 18px 6px;
}

.v2qf.collapsed .v2qf-body {
    display: none;
}

/* ---------- 条件组 ---------- */
.v2qf-group {
    border: 1px dashed rgba(102, 126, 234, .35);
    border-radius: 8px;
    padding: 10px 12px 12px;
    margin-bottom: 12px;
    background: rgba(102, 126, 234, .03);
}

.v2qf-group-label {
    font-size: 12px;
    color: #764ba2;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.v2qf-group-label .v2qf-or {
    color: #b04a5a;
}

.v2qf-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.v2qf-row select,
.v2qf-row input[type="number"],
.v2qf-row input[type="date"],
.v2qf-row input[type="text"] {
    height: 34px;
    border: 1px solid #dfe3ee;
    border-radius: 6px;
    padding: 0 8px;
    font-size: 13px;
    color: #333;
    background: #fff;
    outline: none;
}

.v2qf-row select:focus,
.v2qf-row input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .12);
}

.v2qf-col {
    min-width: 118px;
    max-width: 150px;
}

.v2qf-op {
    width: 74px;
}

.v2qf-val {
    position: relative;
    min-width: 190px;
    flex: 1;
    max-width: 320px;
}

.v2qf-val .searchable-select {
    width: 100%;
}

.v2qf-val .searchable-select-input {
    height: 34px !important;
    font-size: 13px !important;
}

.v2qf-scope {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    background: #f4f6fc;
    border-radius: 6px;
    padding: 0 8px;
    height: 34px;
}

.v2qf-scope label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 2px;
}

.v2qf-scope input {
    margin: 0;
}

.v2qf-del {
    width: 30px;
    height: 34px;
    border: none;
    background: #fbe9ec;
    color: #b04a5a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.v2qf-del:hover {
    background: #f6d4da;
}

.v2qf-hide {
    display: none !important;
}

/* ---------- 操作区 ---------- */
.v2qf-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 0 14px;
    border-top: 1px solid #eef0f7;
    margin-top: 4px;
}

.v2qf-btn {
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    background: #f2f4fb;
    color: #4a5578;
}

.v2qf-btn:hover {
    background: #e7ecfa;
}

.v2qf-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.v2qf-btn.primary:hover {
    filter: brightness(1.06);
}

.v2qf-btn.danger {
    background: #fbe9ec;
    color: #b04a5a;
}

.v2qf-btn.ghost {
    background: #fff;
    border-color: #dfe3ee;
    color: #5b6584;
}

/* ---------- 链接预览 ---------- */
.v2qf-preview {
    font-size: 12px;
    color: #7a839c;
    padding: 0 0 14px;
    line-height: 1.7;
    word-break: break-all;
}

.v2qf-preview code {
    background: #f4f6fc;
    border-radius: 4px;
    padding: 2px 6px;
    color: #4a5578;
    font-family: Consolas, Monaco, monospace;
}

.v2qf-warn {
    font-size: 12px;
    color: #8a6d00;
    background: #fff8e1;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    display: none;
}

/* ---------- 表头漏斗 ---------- */
th .v2qf-funnel {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    color: #9aa3bd;
    cursor: pointer;
    padding: 0 2px;
    border-radius: 3px;
    vertical-align: middle;
    opacity: .35;
    transition: opacity .15s, color .15s, background .15s;
}

th:hover .v2qf-funnel {
    opacity: 1;
}

th .v2qf-funnel:hover {
    color: #667eea;
    background: rgba(102, 126, 234, .12);
    opacity: 1;
}

/* ---------- 结果统计 ---------- */
.v2qf-stat {
    font-size: 12px;
    color: #7a839c;
    padding: 10px 4px;
    text-align: right;
}

.v2qf-sentinel td {
    text-align: center;
    color: #9aa3bd;
    font-size: 12px;
    padding: 12px 0 !important;
}

/* ---------- 列管理弹层 ---------- */
.v2qf-mask {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 40, .45);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.v2qf-mask.open {
    display: flex;
}

.v2qf-modal {
    background: #fff;
    border-radius: 12px;
    width: min(880px, 100%);
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.v2qf-modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f7;
    display: flex;
    align-items: center;
    gap: 12px;
}

.v2qf-modal-head h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.v2qf-modal-head .v2qf-close {
    margin-left: auto;
    border: none;
    background: none;
    font-size: 20px;
    color: #9aa3bd;
    cursor: pointer;
    line-height: 1;
}

.v2qf-modal-body {
    padding: 16px 20px;
    overflow: auto;
}

.v2qf-colgroup {
    margin-bottom: 18px;
}

.v2qf-colgroup h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #4a5578;
}

.v2qf-cols {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.v2qf-cols label {
    font-size: 12px;
    color: #5b6584;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 5px;
}

.v2qf-cols label:hover {
    background: #f4f6fc;
}

.v2qf-modal-foot {
    padding: 12px 20px;
    border-top: 1px solid #eef0f7;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .v2qf-col {
        min-width: 96px;
        max-width: 110px;
    }

    .v2qf-op {
        width: 64px;
    }

    .v2qf-val {
        min-width: 100%;
        max-width: none;
        order: 5;
    }

    .v2qf-scope {
        height: 30px;
    }

    .v2qf-btn {
        padding: 0 12px;
        font-size: 12px;
    }
}
