<template>
    <scroll-view
        :scroll-y="true"
        class="app-container"
        :scroll-top="scrollTop"
        @scroll="checkStickyStatus"
        @scrolltolower="scrollBottom"
    >
        <view class="nav-hidden">
            <view class="container-search">
                <!-- <image class="bg-text" mode="widthFix" src="@/static/icon/index-text-bg.png"></image> -->
                <image class="bg-text" mode="widthFix" src="@/static/imgs/shihezi.jpg"></image>
                <view class="search-inner">
                    <view class="inner-left">
                        <image
                            class="bg-text2"
                            @click="reloadBrowser()"
                            src="@/static/icon/index-text-bg2.png"
                        ></image>
                        <view class="search-input button-click" @click="navTo('/pages/search/search')">
                            <image class="icon" src="@/static/icon/index-search.png"></image>
                            <text class="inpute">请告诉我想找什么工作</text>
                        </view>
                    </view>
                    <image class="bg-robot button-click" mode="widthFix" src="@/static/icon/index-robot.png"></image>
                </view>
            </view>
            <view v-if="!isMachineEnv" class="ai-card-out">
                <view class="ai-card">
                    <image class="ai-card-bg" src="@/static/icon/ai-card-bg.png" />
                    <view class="ai-card-inner">
                        <view class="title">人工智能专区</view>
                        <view class="item-box">
                            <view class="box-l">
                                <view class="item1 button-click" @click="handleItemClick('素质测评')">
                                    <view class="title">劳动力维权</view>
                                    <view class="des">维权申请</view>
                                    <image class="bg-text" mode="widthFix" src="@/static/icon/item-bg-text.png"></image>
                                    <image class="bg-img" src="@/static/icon/item-bg-img1.png"></image>
                                </view>
                            </view>
                            <view class="box-r">
                                <view class="item2 button-click" @click="handleItemClick('就业指导')">
                                    <view class="title">就业指导</view>
                                    <view class="des">根据个人建议</view>
                                    <image class="bg" src="@/static/icon/top-card-bg.png" />
                                    <image class="bg-img" src="@/static/icon/item-bg-img2.png"></image>
                                </view>
                                <view class="item3 button-click" @click="handleItemClick('模拟面试')">
                                    <view class="title">AI模拟面试</view>
                                    <view class="des">提高面试成功率</view>
                                    <image class="bg" src="@/static/icon/bottom-card-bg.png" />
                                    <image class="bg-img" src="@/static/icon/item-bg-img3.png"></image>
                                </view>
                            </view>
                        </view>
                        <view class="tip button-click" @click="navTo('/packageA/pages/myResume/myResume')">
                            <image class="icon" src="@/static/icon/leart-gold.png" />
                            <view class="text">使用人工智能需要先完成素质测评、完善简历 ></view>
                        </view>
                    </view>
                </view>
            </view>
            <view v-if="hasLogin" :class="{ 'match-move-top': isMachineEnv }" class="match-card-out">
                <view class="match-card">
                    <image class="match-card-bg" src="@/static/icon/match-card-bg.png" />
                    <view class="title">简历匹配职位</view>
                    <view class="match-item-container">
                        <AIMatch :tags="matchTags" :loading="matchLoading" @tag-click="handleTagClick"></AIMatch>
                    </view>
                </view>
            </view>
            <view :class="{ 'cards-move-top': isMachineEnv && !hasLogin }" class="cards">
                <view class="card card1 press-button" @click="navTo('/pages/nearby/nearby')">
                    <view class="card-title">附近工作</view>
                    <view class="card-text">好岗职等你来</view>
                    <image class="img1" src="@/static/icon/work-img1.png" />
                </view>
                <view class="card card2 press-button" @click="navTo('/packageA/pages/choiceness/choiceness')">
                    <view class="card-title">精选企业</view>
                    <view class="card-text">优选职得信赖</view>
                    <image class="img2" src="@/static/icon/work-img2.png" />
                </view>
            </view>
        </view>
        <view class="list-card">
            <image v-if="maskFirstEntry" @click="closeVideoTip" class="video-mask" src="@/static/icon/video-mask.png" />
            <view class="nav-filter" :class="{ stuck: isSticky }">
                <view class="filter-top" @touchmove.stop.prevent>
                    <scroll-view :scroll-x="true" :show-scrollbar="false" class="tab-scroll">
                        <view class="jobs-left">
                            <view
                                class="job button-click"
                                :class="{ active: state.tabIndex === 'all' }"
                                @click="choosePosition('all')"
                            >
                                全部
                            </view>
                            <view
                                class="job button-click"
                                :class="{ active: state.tabIndex === index }"
                                v-for="(item, index) in userInfo.jobTitle"
                                :key="index"
                                @click="choosePosition(index)"
                            >
                                {{ item }}
                            </view>
                        </view>
                    </scroll-view>
                    <image
                        @click="navTo('/packageA/pages/addPosition/addPosition')"
                        class="add-icon button-click"
                        src="@/static/icon/add-circle.png"
                    ></image>
                </view>
                <view class="filter-bottom">
                    <view class="btm-left">
                        <view
                            class="button-click filterbtm"
                            :class="{ active: pageState.search.order === item.value }"
                            v-for="item in rangeOptions"
                            @click="handelHostestSearch(item)"
                            :key="item.value"
                        >
                            {{ item.text }}
                        </view>
                    </view>
                    <view class="btm-right button-click" @click="openFilter">
                        筛选
                        <image
                            class="right-sx"
                            :class="{ active: showFilter }"
                            src="@/static/icon/polygon-down.png"
                        ></image>
                    </view>
                </view>
            </view>
            <view class="table-list">
                <view :scroll-y="true" class="falls-scroll">
                    <view class="falls" v-if="list.length">
                        <custom-waterfalls-flow
                            :column="columnCount"
                            :columnSpace="columnSpace"
                            ref="waterfallsFlowRef"
                            :value="list"
                            :listStyle="{
                                background: '#FFFFFF99',
                                'box-shadow': '0 16rpx 20rpx #e6e6e6b3',
                                'background-image': 'radial-gradient(circle 150rpx, #d3e5ff 25%, transparent 100%)',
                                'background-repeat': 'no-repeat',
                                'background-position': 'center bottom 30rpx',
                                'border-radius': '20rpx',
                            }"
                        >
                            <template v-slot:default="job">
                                <view class="item btn-feel" :class="{ 'm-height': !job.education }">
                                    <view class="falls-card" @click="nextDetail(job)">
                                        <view v-if="job.isHot">
                                            <view class="falls-card-pay">
                                                <view class="pay-text">
                                                    <Salary-Expectation
                                                        :max-salary="job.maxSalary"
                                                        :min-salary="job.minSalary"
                                                    ></Salary-Expectation>
                                                </view>
                                                <image class="flame" src="/static/icon/flame3.png"></image>
                                            </view>
                                            <view class="falls-card-title">{{ job.jobTitle }}</view>
                                        </view>
                                        <view v-else>
                                            <view class="falls-card-title">{{ job.jobTitle }}</view>
                                            <view class="falls-card-pay" style="margin-top: 10rpx">
                                                <view class="pay-text">
                                                    <Salary-Expectation
                                                        :max-salary="job.maxSalary"
                                                        :min-salary="job.minSalary"
                                                    ></Salary-Expectation>
                                                </view>
                                            </view>
                                        </view>

                                        <view class="fl_box fl_warp">
                                            <view class="falls-card-education mar_ri10">
                                                <dict-Label dictType="education" :value="job.education"></dict-Label>
                                            </view>
                                            <view class="falls-card-experience" v-if="job.experience">
                                                <dict-Label dictType="experience" :value="job.experience"></dict-Label>
                                            </view>
                                        </view>
                                        <!-- <view class="falls-card-company">
                      石河子
                      <dict-Label dictType="area" :value="job.jobLocationAreaCode"></dict-Label>
                    </view> -->
                                        <view class="falls-card-pepleNumber">
                                            <view>
                                                <image class="point2" src="/static/icon/pintDate2.png"></image>
                                                <view class="fl_1">
                                                    {{ job.postingDate || '发布日期' }}
                                                </view>
                                            </view>
                                            <view>
                                                <image class="point3" src="/static/icon/pointpeople.png"></image>
                                                <view class="fl_1">
                                                    {{ vacanciesTo(job.vacancies) }}
                                                </view>
                                            </view>
                                        </view>
                                        <view class="falls-card-company2">
                                            <image class="point3" src="/static/icon/position-icon.png"></image>
                                            <view class="fl_1">
                                                {{ job.companyName }}
                                            </view>
                                        </view>
                                        <!--  <view class="falls-card-matchingrate">
                                        <view class=""><matchingDegree :job="job"></matchingDegree></view>
                                        <my-icons type="star" size="60"></my-icons>
                                    </view> -->
                                    </view>
                                    <view v-if="!job.education" class="recommend-card" :class="{ isBut: job.isBut }">
                                        <view class="card-content">
                                            <view class="recommend-card-title">
                                                在找岗位：{{ job.jobCategory }}的工作吗？
                                            </view>
                                            <!-- <view class="recommend-card-tip">{{ job.tip }}</view> -->
                                            <view class="recommend-card-tip">确认您的兴趣，为您推荐更多合适的岗位</view>
                                            <!-- <view class="recommend-card-line"></view> -->
                                            <view class="recommend-card-controll">
                                                <view class="controll-no" @click="clearfindJob(job)">不是</view>
                                                <view class="controll-yes" @click="findJob(job)">是的</view>
                                            </view>
                                        </view>
                                        <view class="card-bottom"></view>
                                    </view>
                                </view>
                            </template>
                        </custom-waterfalls-flow>
                        <loadmore ref="loadmoreRef"></loadmore>
                        <view v-if="showScrollBottom" style="height: 200px"></view>
                    </view>
                    <empty v-else is-position></empty>
                </view>
            </view>
        </view>

        <!-- 筛选 -->
        <select-filter ref="selectFilterModel"></select-filter>
        <!-- <view class="maskFirstEntry" v-if="maskFirstEntry">
            <view class="entry-content">
                <text class="text1">左滑查看视频</text>
                <text class="text2">左滑查看视频</text>
                <view class="goExperience">去体验</view>
                <view class="maskFirstEntry-Close" @click="closefirstEntry">1</view>
            </view>
        </view> -->
    </scroll-view>
</template>

<script setup>
import { reactive, inject, watch, ref, onMounted, watchEffect, nextTick, getCurrentInstance } from 'vue';
import img from '@/static/icon/filter.png';
import dictLabel from '@/components/dict-Label/dict-Label.vue';
const { $api, navTo, vacanciesTo, formatTotal, throttle, reloadBrowser } = inject('globalFunction');
import { onLoad, onShow } from '@dcloudio/uni-app';
import { storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
const { userInfo, hasLogin, isMachineEnv } = storeToRefs(useUserStore());
import useDictStore from '@/stores/useDictStore';
const { getTransformChildren, oneDictData } = useDictStore();
import useLocationStore from '@/stores/useLocationStore';
import selectFilter from '@/components/selectFilter/selectFilter.vue';
import { useRecommedIndexedDBStore, jobRecommender } from '@/stores/useRecommedIndexedDBStore.js';
import { useScrollDirection } from '@/hook/useScrollDirection';
import { useColumnCount } from '@/hook/useColumnCount';
const { isScrollingDown, handleScroll } = useScrollDirection();
const recommedIndexDb = useRecommedIndexedDBStore();
import config from '@/config';
import AIMatch from './AIMatch.vue';

const { proxy } = getCurrentInstance();

const maskFirstEntry = ref(true);

const isSticky = ref(false);
const showScrollBottom = ref(false);
const scrollTop = ref(0);

const matchTags = ref([]);
const matchLoading = ref(false);

const emits = defineEmits(['onShowTabbar']);

const waterfallsFlowRef = ref(null);
const loadmoreRef = ref(null);
const conditionSearch = ref({});
const waterfallcolumn = ref(2);

const state = reactive({
    tabIndex: 'all',
});
const list = ref([]);
const pageState = reactive({
    page: 0,
    total: 0,
    maxPage: 2,
    pageSize: 10,
    search: {
        order: 0,
    },
});
const inputText = ref('');
const showFilter = ref(false);
const selectFilterModel = ref(null);
const showModel = ref(false);
const rangeOptions = ref([
    { value: 0, text: '推荐' },
    { value: 1, text: '最热' },
    { value: 2, text: '最新发布' },
]);
const isLoaded = ref(false);

const colors = ['#0069FE', '#FF9400', '#FF6969', '#21EA85', '#87E2EC'];

const occupations = [
    '律师',
    '工程师',
    '医生',
    '教师',
    '设计师',
    '程序员',
    '会计师',
    '建筑师',
    '护士',
    '销售',
    '经理',
    '顾问',
    '分析师',
    '研究员',
    '编辑',
    '记者',
    '摄影师',
    '厨师',
    '司机',
    '保安',
    '客服',
    '行政',
    '人事',
    '市场',
    '运营',
    '产品',
    '测试',
    '运维',
    '前端',
    '后端',
    '全栈',
    '数据',
    '策划',
    '导演',
    '演员',
    '歌手',
    '作家',
    '画家',
    '翻译',
    '导游',
];

onMounted(() => {
    let firstEntry = uni.getStorageSync('firstEntry') === false ? false : true; // 默认未读
    maskFirstEntry.value = firstEntry;
    getMatchTags();
    // console.log(isMachineEnv.value, '+++++++++');
});

async function getMatchTags() {
    if (hasLogin.value) {
        try {
            matchLoading.value = true;
            const { data } = await $api.createRequest('/app/user/getJobAdviceByResume');
            matchTags.value = data;
            matchLoading.value = false;
        } catch (err) {
            console.error('简历匹配职位获取失败');
        }
    } else {
        const vals = getRandomStrings(occupations).map((text) => ({
            job_name: text,
            score: 0,
        }));
        matchTags.value = vals;
    }
}

function getRandomStrings(arr, count = 10) {
    const size = Math.min(arr.length, count);
    const shuffled = [...arr];
    for (let i = shuffled.length - 1; i > 0; i--) {
        const j = Math.floor(Math.random() * (i + 1));
        [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
    }
    return shuffled.slice(0, size);
}

const checkStickyStatus = (e) => {
    scrollTop.value = e.detail.scrollTop;
    nextTick(() => {
        const query = uni.createSelectorQuery().in(proxy);
        query
            .select('.nav-filter')
            .boundingClientRect()
            .exec((res) => {
                if (res[0]) {
                    const rect = res[0];
                    const shouldBeSticky = rect.top <= 0;
                    if (isSticky.value !== shouldBeSticky) {
                        isSticky.value = shouldBeSticky;
                    }
                }
            });
    });
};

function closeVideoTip() {
    uni.setStorageSync('firstEntry', false);
    maskFirstEntry.value = false;
}

const handleTagClick = (tagInfo) => {
    console.log('点击的标签信息:', tagInfo);
    navTo(`/pages/search/search?keyWord=${encodeURIComponent(tagInfo.name)}`);
};

const handleItemClick = (item) => {
    switch (item) {
        case '素质测评':
            // lightAppJssdk.navigation.hide({
            //     url: config.Quality_assessment_URL,
            // });
			navTo('/packageA/pages/rightsProtectionApplication/rightsProtectionApplication')
            break;
        case '就业指导':
            lightAppJssdk.navigation.hide({
                url: config.Career_guidance,
            });
            break;
        case '模拟面试':
            lightAppJssdk.navigation.hide({
                url: config.mock_interview,
            });
            break;
        default:
            $api.msg('暂未开放');
    }
};

const hexToRgba = (hex, opacity) => {
    const r = parseInt(hex.slice(1, 3), 16);
    const g = parseInt(hex.slice(3, 5), 16);
    const b = parseInt(hex.slice(5, 7), 16);
    return `rgba(${r}, ${g}, ${b}, ${opacity})`;
};

const getTextColor = (hexColor) => {
    const r = parseInt(hexColor.slice(1, 3), 16);
    const g = parseInt(hexColor.slice(3, 5), 16);
    const b = parseInt(hexColor.slice(5, 7), 16);
    const brightness = (r * 299 + g * 587 + b * 114) / 1000;
    return brightness > 180 ? '#1D71EF' : '#FFFFFF';
};

const { columnCount, columnSpace } = useColumnCount(() => {
    pageState.pageSize = 10 * (columnCount.value - 1);
    getJobRecommend('refresh');
    nextTick(() => {
        waterfallsFlowRef.value?.refresh?.();
    });
});

async function loadData() {
    try {
        if (isLoaded.value) return;
        isLoaded.value = true;
    } catch (err) {
        isLoaded.value = false; // 重置状态允许重试
        throw err;
    }
}

const scrollBottom = () => {
    if (loadmoreRef.value && typeof loadmoreRef.value.change === 'function') {
        // if (loadmoreRef?.value?.status == 'loading' || loadmoreRef?.value?.status == 'noMore') return;
        loadmoreRef.value.change('loading');
        stopScroll();
        if (state.tabIndex === 'all') {
            getJobRecommend();
        } else {
            getJobList();
        }
    }
};

function stopScroll() {
    scrollTop.value -= 100;
    showScrollBottom.value = true;
    setTimeout(() => {
        showScrollBottom.value = false;
    }, 400);
}

function findJob(job) {
    if (job.isBut) {
        $api.msg('已确认');
    } else {
        list.value = list.value.map((item) => {
            if (item.recommend && item.jobCategory === job.jobCategory) {
                return {
                    ...item,
                    isBut: true,
                };
            }
            return item;
        });
        const jobstr = job.jobCategory;
        const jobsObj = {
            地区: 'area',
            岗位: 'jobTitle',
            经验: 'experience',
        };
        const [name, value] = jobstr.split(':');
        const nameAttr = jobsObj[name];
        if (name === '岗位') {
            conditionSearch.value[nameAttr] = value;
        } else {
            const valueAttr = oneDictData(nameAttr).filter((item) => item.label === value);
            if (valueAttr.length) {
                const val = valueAttr[0].value;
                conditionSearch.value[nameAttr] = val;
            }
        }
    }
}

function clearfindJob(job) {
    if (job.isBut) {
        $api.msg('已确认');
    } else {
        list.value = list.value.map((item) => {
            if (item.recommend && item.jobCategory === job.jobCategory) {
                return {
                    ...item,
                    isBut: true,
                };
            }
            return item;
        });
        recommedIndexDb.deleteRecords(job);
    }
}

function nextDetail(job) {
    // 记录岗位类型，用作数据分析
    if (job.jobCategory) {
        const recordData = recommedIndexDb.JobParameter(job);
        recommedIndexDb.addRecord(recordData);
    }
    navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
}

function openFilter() {
    showFilter.value = true;
    emits('onShowTabbar', false);
    selectFilterModel.value?.open({
        title: '筛选',
        maskClick: true,
        success: (values) => {
            pageState.search = {
                ...pageState.search,
            };
            for (const [key, value] of Object.entries(values)) {
                pageState.search[key] = value.join(',');
            }
            showFilter.value = false;
            getJobList('refresh');
            emits('onShowTabbar', true);
        },
        cancel: () => {
            showFilter.value = false;
            emits('onShowTabbar', true);
        },
    });
}

function handleFilterConfirm(e) {
    console.log(e);
}

function choosePosition(index) {
    state.tabIndex = index;
    list.value = [];
    if (index === 'all') {
        pageState.search = {
            order: pageState.search.order,
        };
        inputText.value = '';
        getJobRecommend('refresh');
    } else {
        // const id = useUserStore().userInfo.jobTitleId.split(',')[index];
        pageState.search.jobTitle = userInfo.value.jobTitle[index];
        inputText.value = '';
        getJobList('refresh');
    }
}

function handelHostestSearch(val) {
    pageState.search.order = val.value;
    if (state.tabIndex === 'all') {
        getJobRecommend('refresh');
    } else {
        getJobList('refresh');
    }
}

function getJobRecommend(type = 'add') {
    if (type === 'refresh') {
        list.value = [];
        if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh();
    }
    let params = {
        pageSize: pageState.pageSize,
        sessionId: useUserStore().seesionId,
        ...pageState.search,
        ...conditionSearch.value,
    };
    let comd = {
        recommend: true,
        jobCategory: '',
        tip: '确认你的兴趣，为您推荐更多合适的岗位',
    };
    $api.createRequest('/app/job/recommend', params).then((resData) => {
        const { data, total } = resData;
        pageState.total = 0;
        if (type === 'add') {
            // 记录系统
            recommedIndexDb.getRecord().then((res) => {
                if (res.length) {
                    // 数据分析系统
                    const resultData = recommedIndexDb.analyzer(res);
                    const { sort, result } = resultData;
                    // 岗位询问系统
                    const conditionCounts = Object.fromEntries(
                        sort.filter((item) => item[1] > 1) // 过滤掉次数为 1 的项
                    );
                    jobRecommender.updateConditions(conditionCounts);

                    const question = jobRecommender.getNextQuestion();

                    if (question) {
                        comd.jobCategory = question;
                        // 生成随机插入位置，排除前两个和最后两个位置
                        let insertIndex;
                        if (data.length <= 4) {
                            // 如果数据长度小于等于4，直接插入到中间位置
                            insertIndex = Math.floor(data.length / 2);
                        } else {
                            // 生成2到data.length-2之间的随机位置
                            insertIndex = Math.floor(Math.random() * (data.length - 4)) + 2;
                        }
                        data.splice(insertIndex, 0, comd);
                    }
                }
                const reslist = dataToImg(data);
                list.value.push(...reslist);
            });
        } else {
            list.value = dataToImg(data);
        }
        // 切换状态
        if (loadmoreRef.value && typeof loadmoreRef.value.change === 'function') {
            if (data.length < pageState.pageSize) {
                loadmoreRef.value.change('noMore');
            } else {
                loadmoreRef.value.change('more');
            }
        }
        // 当没有岗位，刷新sessionId重新啦
        if (!data.length) {
            useUserStore().initSeesionId();
        }
    });
}

function getJobList(type = 'add') {
    if (type === 'add' && pageState.page < pageState.maxPage) {
        pageState.page += 1;
    }
    if (type === 'refresh') {
        list.value = [];
        pageState.page = 1;
        pageState.maxPage = 2;
        // waterfallsFlowRef.value.refresh();
        if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh();
    }
    let params = {
        current: pageState.page,
        pageSize: pageState.pageSize,
        ...pageState.search,
        // ...conditionSearch.value,
    };

    $api.createRequest('/app/job/list', params).then((resData) => {
        const { rows, total } = resData;
        if (type === 'add') {
            const str = pageState.pageSize * (pageState.page - 1);
            const end = list.value.length;
            const reslist = dataToImg(rows);
            list.value.splice(str, end, ...reslist);
        } else {
            list.value = dataToImg(rows);
        }
        pageState.total = resData.total;
        pageState.maxPage = Math.ceil(pageState.total / pageState.pageSize);
        // 切换状态
        if (loadmoreRef.value && typeof loadmoreRef.value.change === 'function') {
            if (rows.length < pageState.pageSize) {
                loadmoreRef.value?.change('noMore');
            } else {
                loadmoreRef.value?.change('more');
            }
        }
    });
}

function dataToImg(data) {
    return data.map((item) => ({
        ...item,
        image: img,
        hide: true,
    }));
}

defineExpose({ loadData });
</script>

<style lang="stylus" scoped>
// .maskFirstEntry
//     position: fixed;
//     // right: 20rpx;
//     // bottom: calc(50% - 200rpx);
//     height: 100vh
//     width: 100vw
//     background: rgba(0,0,0,0.3)
//     .entry-content
//         display: flex;
//         align-items: center
//         position: absolute
//         left: 50%
//         top: 40%
//         transform: translate(-50%, -50%)
//         flex-direction: column
//         background: url('@/static/imgs/firstEntry.png') 0 0 no-repeat;
//         background-size: 100% 100%;
//         width: 480rpx
//         height: 584rpx
//         // padding-left: 80rpx
//         .text1
//             margin-top: 370rpx
//             font-size: 36rpx
//             background: linear-gradient(273.34deg, #356CFA 3.58%, #A47FFD 85.84%);
//             -webkit-background-clip: text;
//             -webkit-text-fill-color: transparent;
//             background-clip: text; /* 有些浏览器兼容用 */
//             text-fill-color: transparent;
//             padding-left: 28rpx
//         .text2
//             padding-left: 28rpx
//             margin-top: 8rpx
//             font-size: 20rpx;
//             color: #666666;
//             text-align: center;
//         .indicateArrow
//             height: 76rpx
//             width: 68rpx
//         .indicatefirstEntry
//             width: 244rpx
//             height: 244rpx
//         .goExperience
//             margin-left: 28rpx
//             margin-top: 28rpx
//             width: 160rpx;
//             height: 60rpx;
//             background: linear-gradient( 180deg, #9974FD 0%, #286BFA 100%);
//             border-radius: 12rpx 12rpx 12rpx 12rpx;
//             font-size: 28rpx;
//             color: #FFFFFF;
//             text-align: center;
//             line-height: 60rpx
//         .maskFirstEntry-Close
//             position: absolute;
//             left: calc(50% - 10rpx);
//             bottom: -130rpx
//             width: 42rpx
//             height: 42rpx
//             background: linear-gradient(273.34deg, #356CFA 3.58%, #A47FFD 85.84%);
//             border-radius: 50%;
//         .maskFirstEntry-Close::before
//             position: absolute;
//             left: calc( 50% - 2rpx)
//             top: calc( 50% - 10rpx)
//             transform: rotate(45deg);
//             content: ''
//             background: #FFFFFF
//             width: 4rpx
//             height: 20rpx
//         .maskFirstEntry-Close::after
//             position: absolute;
//             left: calc( 50% - 2rpx)
//             top: calc( 50% - 10rpx)
//             transform: rotate(-45deg);
//             content: ''
//             background: #FFFFFF
//             width: 4rpx
//             height: 20rpx

.app-container
    width: 100%;
    height: calc(100vh - var(--window-top) - var(--status-bar-height) - var(--window-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    background: url('@/static/icon/background2.png') 0 0 no-repeat;
    background-size: 100% 728rpx;
    background-color: #E5F4FB;
    display: flex;
    flex-direction: column
.container-search
    width:100%;
    padding:60rpx 0 0rpx;
    position: relative
    .bg-text
        position :absolute
        width:100%;
        top:10%;
        left:0
    .search-inner
        position relative;
        z-index:1
        width:100%;
        box-sizing: border-box;
        padding:10% 22rpx 0;
        display:flex;
        .inner-left
          flex:1
          overflow:hidden
          display:flex
          flex-direction: column;

        .bg-robot
            flex:1
            margin-left: - 70rpx
            margin-right:-20rpx
            margin-bottom:-13%
        .bg-text2
            width:100%;
            height:145rpx;
    .search-input
        flex:1
        margin-top:8%;
        margin-bottom:18%;
        display: flex
        align-items: center;
        width: 100%;
        height: 75rpx;
        background: #FFFFFF;
        border-radius: 49rpx;
        box-sizing: border-box;
        padding:0 24rpx;
        .icon
            width:40rpx;
            height:40rpx;
            margin-right:10rpx;
        .iconsearch
            padding-left: 36rpx
        .inpute
            font-family: ABeeZee;
            font-weight: 400;
            font-style: Regular;
            font-size: 24rpx;
            color:#545454
    .chart
        font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
        width: 170rpx;
        background: radial-gradient( 0% 56% at 87% 61%, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.47) 100%);
        box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(210,210,210,0.14);
        border-radius: 80rpx 80rpx 80rpx 80rpx;
        border: 2rpx solid #FFFFFF;
        text-align: center
        font-weight: 500;
        font-size: 28rpx;
        height: 36rpx;
        color: #000000;
        padding: 20rpx 30rpx
.match-move-top
    margin-top:-20rpx !important;
.cards-move-top
    margin-top:-60rpx !important;
    position:relative;
    z-index:1
.ai-card-out
    width:100%;
    box-sizing:border-box
    padding: 0 28rpx
    margin-top:-35rpx
    position relative;
    z-index:1
.ai-card
  position relative;
  .ai-card-bg
    width:100%;
    height:100%;
    position: absolute;
    left:0;
    top:0;
  .ai-card-inner
      width:100%;
      height:100%;
      position:relative;
      z-index: 1
      box-sizing:border-box;
      padding:28rpx 36rpx 40rpx;
      .title
        font-family: Alibaba PuHuiTi;
        font-weight:700;
        font-size: 32rpx;
        color:#333333
      .item-box
          width:100%;
          margin-top:30rpx;
          display:flex;
          justify-content: space-between;
          .box-l
              flex:1
              margin-right:10rpx
          .box-r
              flex:1
              margin-left:10rpx
          .title
              font-family: Alibaba PuHuiTi;
              font-weight: 700;
              font-style: Bold;
              font-size: 28rpx;
              color: #2E75FF;
              position relative;
              z-index:1
          .des
              font-family: Alibaba PuHuiTi;
              font-weight: 400;
              font-style: Regular;
              font-size: 24rpx;
              margin-top:4rpx;
              position relative;
              z-index:1
              color: #00000070;
          .bg
              position:absolute;
              top:0;
              left:0;
              width:100%;
              height:100%
          .item1
              height:272rpx;
              width:100%;
              border-radius: 20rpx;
              background: linear-gradient(127.66deg, #CDE4FF 6.44%, #EAFEFF 93.56%);
              box-sizing:border-box;
              padding:34rpx 32rpx;
              position:relative
              .bg-text
                  position:absolute;
                  bottom:40rpx;
                  left:0;
                  width:100%;
                  opacity 0.5
              .bg-img
                  position:absolute;
                  width:168rpx;
                  height:166rpx;
                  right:16rpx;
                  bottom:12rpx;
          .item2
              height:126rpx;
              width:100%;
              border-radius: 20rpx;
              box-sizing:border-box;
              padding:26rpx 28rpx;
              position :relative
              background: linear-gradient(100.72deg, #C3E2FF 1.79%, #FFEFDD 98.21%);
              .bg-img
                  position:absolute;
                  width:212rpx;
                  height:148rpx;
                  right:-50rpx;
                  bottom:8rpx;
          .item3
              height:126rpx;
              width:100%;
              border-radius: 20rpx;
              box-sizing:border-box;
              padding:26rpx 28rpx;
              margin-top:20rpx;
              position :relative
              background: linear-gradient(100.72deg, #FFDBDB 1.79%, #FFF8F0 98.21%);
              .bg-img
                  position:absolute;
                  width:102rpx;
                  height:92rpx;
                  right:0rpx;
                  bottom:44rpx;
      .tip
          width:100%;
          height:60rpx;
          display:flex;
          align-items:center;
          box-sizing:border-box;
          padding:0 26rpx;
          border-radius: 20rpx;
          background:#FFF9E1
          margin-top:20rpx;
          .icon
              width:32rpx;
              height:32rpx;
              margin-right:14rpx;
          .text
              font-family: ABeeZee;
              font-weight: 400;
              font-style: Regular;
              font-size: 24rpx;
              color:#E1A374
.match-card-out
    width:100%;
    box-sizing:border-box
    padding: 0 28rpx
    position relative;
    z-index:1
    margin-top:20rpx;
.match-card
  width 100%;
  box-sizing:border-box;
  position relative;
  background: #ffffffE6;
  border-radius: 24rpx;
  padding:32rpx 36rpx;
  .title
      font-family: Alibaba PuHuiTi;
      font-weight:700;
      font-size: 32rpx;
      color:#333333
  .match-card-bg
    width:100%;
    height:100%;
    position: absolute;
    left:0;
    top:0;
  .match-item-container
    width:100%;
    height:400rpx;
    margin-top:30rpx;
    position :relative;
    z-index:1
    .match-item-row
      display: flex;
      justify-content: center;
      align-items: center;
      padding:30rpx 0;
    .match-item
      padding: 8rpx 20rpx;
      border-radius: 30rpx;
      white-space: nowrap;
      box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.2);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s;
      position: relative;
      .text{
        position: relative;
        z-index:2
        white-space: nowrap
      }
    .trail-center::after
        content: '';
        position: absolute;
        bottom: -15rpx;
        left: 10%;
        width: 80%;
        height: 30rpx;
        background: linear-gradient(to bottom, var(--trail-color), transparent);
        border-radius: 30% 30% 100% 100%;
        filter: blur(4rpx);
    .trail-left::after
        content: '';
        position: absolute;
        bottom: -15rpx;
        left: -20%;
        width: 90%;
        height: 40rpx;
        background: linear-gradient(to bottom, var(--trail-color), transparent);
        border-radius: 50%;
        filter: blur(4rpx);
        transform: skewX(-8deg);
    .trail-right::after
        content: '';
        position: absolute;
        bottom: -20rpx;
        right: -20%;
        width: 90%;
        height: 40rpx;
        background: linear-gradient(to bottom, var(--trail-color), transparent);
        border-radius: 50%;
        filter: blur(4rpx);
        transform: skewX(8deg);

.cards
    width :100%;
    display:flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    padding:30rpx 28rpx;
    gap:20rpx;
    .card1
        background:linear-gradient(140deg, #FF6D5E,#FF999A);
    .card2
        background:linear-gradient(140deg,#8788DA,#C6F4FE);
    .card
        flex:1;
        position :relative;
        height:158rpx;
        box-sizing: border-box;
        padding:36rpx 34rpx;
        border-radius: 20rpx
        .img1
            width:180rpx;
            height:122rpx;
            position: absolute;
            right:-20rpx;
            bottom:4rpx
        .img2
            width:148rpx;
            height:148rpx;
            position: absolute;
            right:-20rpx;
            bottom:-10rpx;
        .card-title
            font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
            font-weight: 600;
            font-size: 32rpx;
            color: #FFFFFF;
        .card-text
            font-weight: 400;
            font-size: 24rpx;
            color: #FFFFFF90;
            margin-top: 8rpx
.list-card{
    display:flex;
    flex-direction: column;
    background: linear-gradient(to bottom, #fff 0%, #E5F3FA 100%);
    border-radius: 40rpx 40rpx 0 0
    position:relative;
    z-index:3
    transition: .5s
    .video-mask{
      position:fixed;
      right:10rpx;
      bottom:50rpx;
      width:264rpx;
      height:298rpx;
      z-index:6
    }
}
.no-radius
    border-radius: 0
.nav-filter.stuck
    background: linear-gradient( to bottom, #fff 85%,  #ffffff1A 100%);
    padding-bottom:20rpx
.nav-filter
    position:sticky;
    z-index:5;
    top:calc(var(--window-top) + var(--status-bar-height));
    padding: 32rpx 28rpx 0 28rpx
    font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
    .filter-top
        display: flex
        justify-content: space-between;
        align-items: center;
        .tab-scroll
            flex: 1;
            overflow: hidden;
            margin-right: 20rpx
            white-space: nowrap;
            overflow: hidden;
            text-overflow: clip;
            .jobs-left
                display: flex
                flex-wrap: nowrap
                align-items: center
                .job
                    font-weight: 400;
                    font-size: 26rpx;
                    color: #999;
                    margin-right: 32rpx;
                    white-space: nowrap
                .active
                    font-weight: 700;
                    font-size: 32rpx;
                    color: #1677FF;

        .add-icon{
                width:48rpx;
                height:48rpx;
        }
    .filter-bottom
        display: flex
        justify-content: space-between
        padding: 20rpx 0;
        align-items: center
        .btm-left
            display: flex
            font-family: 'PingFangSC-Regular', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
            .filterbtm
                font-weight: 400;
                font-size: 24rpx;
                color: #999999;
                margin-right: 20rpx
                padding: 6rpx 20rpx
                display:flex
                align-items: center
                justify-content: center
                background: #F5F8FA
                border-radius: 40rpx
            .active
                font-weight: 500;
                color: #fff;
                background: #1677FF
        .btm-right
            display: flex
            align-items: center
            padding:6rpx 30rpx
            border:2rpx solid #F2F2F2
            border-radius: 35rpx
            font-family: 'PingFangSC-Regular', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
            font-weight: 400;
            font-size: 24rpx;
            color: #999999;
            background: #eeeeee33
            .right-sx
                width: 14rpx;
                height: 14rpx;
                margin-left: 20rpx
                transition: .3s
            .active
                transform: rotate(-180deg)
.table-list
    position:sticky;
    z-index:4;
    top:calc(var(--window-top) + var(--status-bar-height));
    .load-trigger
        height:200rpx
    .falls-scroll
        width: 100%
        height: 100%
        min-height: 100vh;
        position: relative
        .falls
            padding: 28rpx 28rpx;
            .item,.m-height{
                min-height: 370rpx
            }
            .item
                position: relative;
                // background: linear-gradient( 180deg, rgba(19, 197, 124, 0.4) 0%, rgba(255, 255, 255, 0) 30%), rgba(255, 255, 255, 0);
                .falls-card
                    padding: 30rpx 20rpx 32rpx 30rpx ;
                    .falls-card-title
                        font-family: 'PingFangSC-Medium', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
                        color: #606060;
                        text-align: left;
                        word-break:break-all
                        font-weight: 500;
                        font-size: 28rpx;
                        color: #333;
                        margin-top: 10rpx;
                    .falls-card-pay
                        // height: 50rpx;
                        word-break:break-all
                        color: #002979;
                        text-align: left;
                        display: flex;
                        align-items: end;
                        position: relative
                        .pay-text
                            font-family: DIN-Medium;
                            color: #4C6EFB;
                        .flame
                            width:40rpx;
                            height:40rpx;
                            margin-left: 12rpx;
                    .falls-card-education,.falls-card-experience
                        white-space: nowrap;
                        padding:7rpx 12rpx;
                        font-size: 24rpx;
                        color:#999999;
                        background:#FFFFFF
                        border-radius: 10rpx;
                        margin-top:20rpx;

                    .falls-card-company,.falls-card-pepleNumber
                        margin-top: 22rpx;
                        font-size: 24rpx;
                        color: #999999;
                        line-height: 25rpx;
                        text-align: left;
                    .falls-card-pepleNumber
                        display: flex;
                        justify-content: space-between;
                        flex-wrap: wrap
                        margin-top: 20rpx;
                        font-weight: 400;
                        font-size: 24rpx;
                        color: #999999;
                        line-height: 46rpx
                        view
                            display:flex
                            align-items: center
                            white-space: nowrap;
                            .point2
                                width:40rpx;
                                height:40rpx;
                                margin-right:4rpx
                            .point3
                                margin: 0rpx 4rpx 0 0
                                height: 40rpx
                                width: 40rpx
                    .falls-card-matchingrate
                        margin-top: 10rpx;
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        font-size: 21rpx;
                        color: #4778EC;
                        text-align: left;
                    .falls-card-company2
                        margin-top: 16rpx;
                        font-size: 24rpx;
                        color: #999999;
                        text-align: left;
                        display: flex
                        .point3
                            margin: 4rpx 4rpx 0 0
                            height: 40rpx
                            width: 40rpx
// 推荐卡片
.recommend-card
    position:absolute
    top:0;
    left:0;
    width:100%;
    height:100%;
    box-sizing: border-box
    backdrop-filter: blur(20rpx);
    display: flex;
    flex-direction: column;
    .card-bottom{
        width:100%;
        flex:1;
        overflow: hidden;
        background: #1677FF;
        border-radius:  0 0 20rpx 20rpx
    }
    .card-content
        position: relative;
        z-index: 2;
        background: linear-gradient(to bottom, #FFFFFF40 30%, #ffffff 50%, #DFECFF 100%);
        padding :48rpx 24rpx 35rpx
        .recommend-card-title
            font-weight: 500;
            font-size: 32rpx;
            color: #000;
        .recommend-card-tip
            font-weight: 400;
            font-size: 24rpx;
            color: #999999;
            margin-top: 12rpx
        .recommend-card-line
            width: calc(100%);
            height: 0rpx;
            border-radius: 0rpx 0rpx 0rpx 0rpx;
            border: 2rpx dashed rgba(0,0,0,0.14);
            margin-top: 50rpx
            position: relative
        // .recommend-card-line::before
        //     position: absolute
        //     content: ''
        //     left: 0
        //     top: 0
        //     transform: translate(-50% - 90rpx, -50%)
        //     width: 28rpx;
        //     height: 28rpx;
        //     background: #F4F4F4;
        //     border-radius: 50%;
        // .recommend-card-line::after
        //     position: absolute
        //     content: ''
        //     right: 0
        //     top: 0
        //     transform: translate(50% + 90rpx, -50%)
        //     width: 28rpx;
        //     height: 28rpx;
        //     background: #F4F4F4;
        //     border-radius: 50%;
        .recommend-card-controll
            display: flex
            align-items: center
            justify-content: space-between
            margin-top: 40rpx
            padding: 0 6rpx;
            .controll-yes
                width: 130rpx;
                height: 56rpx;
                background: #1677FF;
                border-radius: 35rpx;
                text-align: center;
                line-height: 56rpx
                color: #fff
                font-weight:500
                font-size: 24rpx;
            .controll-no
                width: 130rpx;
                height: 56rpx;
                border-radius: 35rpx;
                text-align: center;
                line-height: 56rpx
                color: #74AEFF
                font-weight :500
                font-size: 24rpx;
                border: 2rpx solid #74AEFF
                box-sizing: border-box
            .controll-yes:active, .controll-no:active
                width: 120rpx;
                height: 66rpx;
                line-height: 66rpx
                background: #e8e8e8
                border: 2rpx solid #e8e8e8

.isBut{
    filter: grayscale(100%);
}
</style>
