<template>
  <div class="p-2">
    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
      <div v-show="showSearch" v-loading="loading" class="mb-[10px]">
        <el-card shadow="hover">
          <el-form ref="queryFormRef" :model="queryParams" :rules="rules" :inline="true" label-width="80px">
            <el-row>
              <el-form-item label="核对类型" prop="verifiType">
                <el-select v-model="queryParams.verifiType" clearable placeholder="请选择核对类型" @change="verifiTypeChange">
                  <el-option v-for="dict in bfs_verifi_type" :key="dict.value" :label="dict.value + '-' + dict.label" :value="dict.value">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-row>
            <el-form-item v-if="queryParams.verifiType === '3'" label="凭证大类" prop="certificateIds">
              <el-select v-model="queryParams.certificateIds" multiple clearable collapse-tags collapse-tags-tooltip :max-collapse-tags="3" placeholder="凭证大类">
                <template #header>
                  <el-input v-model="likeCostName" placeholder="可根据场景编码或名称模糊查询" @input="filterByCostIdName"></el-input>
                  <div style="padding: 5px 0px; display: flex; align-items: center; gap: 0;">
                    <el-input v-model="rangeStart" placeholder="起始编号" maxlength="10" style="width: 80px; margin-right: 5px;" @blur="handleRangeQuery"></el-input>
                    <span style="margin-right: 5px;">---</span>
                    <el-input v-model="rangeEnd" placeholder="结束编号" maxlength="10" style="width: 80px; margin-right: 8px;" @blur="handleRangeQuery"></el-input>
                    <el-button size="small" type="primary" @click="selectAllFinItems" style="margin: 0 4px 0 0;">全选</el-button>
                    <el-button size="small" @click="cancelAllFinItems" style="margin: 0;">取消</el-button>
                  </div>
                </template>
                <el-option
                  v-for="option in filteredCostList"
                  :key="option.certificateId"
                  :label="option.certificateId + '-' + option.certificateName"
                  :value="option.certificateId"
                >
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item v-if="queryParams.verifiType === '2'" label="保单号" prop="policyNo">
              <el-input v-model="queryParams.policyNo" clearable placeholder="请输入团体保单号" />
            </el-form-item>
            <el-form-item v-if="queryParams.verifiType === '2'" label="业务号码" prop="businessNo">
              <el-input v-model="queryParams.businessNo" clearable placeholder="请输入业务号码" />
            </el-form-item>
            <el-form-item v-if="queryParams.verifiType === '1' || queryParams.verifiType === '3'" label="管理机构" prop="manageCom">
              <el-select v-model="queryParams.manageCom" clearable placeholder="请输入管理机构">
                <template #header>
                  <el-input v-model="likeName" placeholder="可根据机构编码或名称模糊查询" @input="filterByManageCom"></el-input>
                </template>
                <el-option
                  v-for="dict in filteredManagecom"
                  :key="dict.dictValue"
                  :label="dict.dictValue + '-' + dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item
              v-if="queryParams.verifiType === '1' || queryParams.verifiType === '2' || queryParams.verifiType === '3'"
              label="记账日期"
              prop="dateRange"
            >
              <el-date-picker
                v-model="queryParams.dateRange"
                value-format="YYYY-MM-DD"
                type="daterange"
                range-separator="-"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                clearable
                style="width: 240px"
                @change="handleDateRangeChange"
              >
              </el-date-picker>
            </el-form-item>

            <el-form-item v-if="queryParams.verifiType === '1'" label="凭证类型" prop="dataType">
              <el-select v-model="queryParams.dataType" clearable placeholder="请选择凭证类型">
                <el-option v-for="dict in bfs_certificate_type" :key="dict.value" :label="dict.value + '-' + dict.label" :value="dict.value">
                </el-option>
              </el-select>
            </el-form-item>

            <el-form-item v-if="queryParams.verifiType === '1'" label="总账科目" prop="finItemCodeList">
              <el-select v-model="queryParams.finItemCodeList" multiple clearable collapse-tags collapse-tags-tooltip :max-collapse-tags="3" placeholder="请选择总账科目">
                <template #header>
                  <el-input v-model="likeFinItemName" placeholder="可根据场景编码或名称模糊查询" @input="filterByFinItemName"></el-input>
                </template>
                <el-option
                  v-for="option in filteredFinItemList"
                  :key="option.finItemCode"
                  :label="option.finItemCode + '-' + option.finItemName"
                  :value="option.finItemCode"
                >
                </el-option>
              </el-select>
            </el-form-item>

            <el-form-item v-if="queryParams.verifiType === '1'" label="借贷标记" prop="finItemType">
              <el-select v-model="queryParams.finItemType" clearable placeholder="请选择借贷标记">
                <el-option v-for="dict in bfs_debit_and_credit" :key="dict.value" :label="dict.value + '-' + dict.label" :value="dict.value">
                </el-option>
              </el-select>
            </el-form-item>

            <el-form-item v-if="queryParams.verifiType === '4'" label="凭证号" prop="belnrSap">
              <el-input v-model="queryParams.belnrSap" clearable placeholder="请输入凭证号" />
            </el-form-item>
          </el-form>
          <el-form-item v-if="queryParams.verifiType != ''">
            <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
            <el-button icon="Refresh" @click="resetQuery">重置</el-button>
            <el-button v-hasPermi="['bfs:businessdata:export']" icon="Download" type="success" @click="handleExport">导出</el-button>
          </el-form-item>
        </el-card>
        <el-table v-if="queryParams.verifiType != ''" v-loading="loading" :data="datatransList">
          <el-table-column v-if="false" label="id" align="center" prop="id" />
          <el-table-column label="业务机构" align="center" prop="manageCom" width="150px" show-overflow-tooltip />
          <el-table-column label="凭证号" align="center" prop="belnrSap" width="150px" />
          <el-table-column label="凭证类型" align="center" prop="dataType">
            <template #default="scope">
              <dict-tag :options="bfs_certificate_type" :value="scope.row.dataType" />
            </template>
          </el-table-column>
          <el-table-column label="凭证大类编码" align="center" prop="certificateId" />
          <el-table-column label="场景编码" align="center" prop="costId" width="150px" />
          <el-table-column label="总账科目" align="center" prop="finItemCode" width="150px" />
          <el-table-column label="明细科目" align="center" prop="subItemCode" width="150px" />
          <el-table-column label="借贷标记" align="center" prop="finItemType">
            <template #default="scope">
              <dict-tag :options="bfs_debit_and_credit" :value="scope.row.finItemType" />
            </template>
          </el-table-column>
          <el-table-column label="金额" align="center" prop="amount" width="150px" />
          <el-table-column label="记账日期" align="center" prop="accountDate" width="150px">
            <template #default="scope">
              <span>{{ parseTime(scope.row.accountDate, '{y}-{m}-{d}') }}</span>
            </template>
          </el-table-column>
          <el-table-column label="保单号" align="center" prop="policyNo" width="200px" show-overflow-tooltip />
          <el-table-column label="分单号" align="center" prop="singlePolicyNo" width="200px" show-overflow-tooltip />
          <el-table-column label="业务号码" align="center" prop="businessNo" width="200px" show-overflow-tooltip />
          <el-table-column label="险种编码" align="center" prop="riskCode" width="150px" show-overflow-tooltip />
          <el-table-column label="销售渠道" align="center" prop="saleChnl" show-overflow-tooltip />
          <el-table-column label="业务渠道" align="center" prop="busiChnl" show-overflow-tooltip />
          <el-table-column label="供应商" align="center" prop="intraBranch" width="200px" show-overflow-tooltip />
          <el-table-column label="供应商名称" align="center" prop="intraBranchName" width="200px" show-overflow-tooltip />
          <el-table-column label="往来单位分类" align="center" prop="businessPartners" show-overflow-tooltip />
          <el-table-column label="业务性质" align="center" prop="businessNature" show-overflow-tooltip />
          <el-table-column label="成本中心" align="center" prop="costCenter" width="150px" show-overflow-tooltip />
          <el-table-column label="交费年期" align="center" prop="payendyear" show-overflow-tooltip />
          <el-table-column label="开户行" align="center" prop="openingBank" show-overflow-tooltip />
          <el-table-column label="账户标识" align="center" prop="accountMark" show-overflow-tooltip />
          <el-table-column label="银行对账码" align="center" prop="reconCode" width="200px" show-overflow-tooltip />
          <el-table-column label="现金流" align="center" prop="cashFlow" width="200px" show-overflow-tooltip />
          <el-table-column label="税率" align="center" prop="taxRate" show-overflow-tooltip />
          <el-table-column label="税码" align="center" prop="taxCode" show-overflow-tooltip />
          <el-table-column label="税项" align="center" prop="taxClass" width="150px" show-overflow-tooltip />
          <el-table-column label="承诺项目" align="center" prop="budget" show-overflow-tooltip />
        </el-table>
        <pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" />
      </div>
    </transition>
    <!-- 导出进度弹窗 -->
    <el-dialog v-model="exportProgressVisible" title="导出进度" width="400px" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">
      <div style="text-align: center; padding: 20px 0">
        <el-progress type="circle" :percentage="exportProgress.percentage" :width="120" :status="exportProgress.percentage === 100 ? 'success' : undefined" />
        <p style="margin-top: 20px; font-size: 14px; color: #606266">已导出 {{ exportProgress.processedCount }} / {{ exportProgress.totalCount }} 条</p>
        <p style="margin-top: 10px; font-size: 12px; color: #909399">点击"后台运行"后任务将继续，完成后自动下载</p>
      </div>
      <template #footer>
        <el-button @click="handleBackgroundFail">取消下载</el-button>
        <el-button @click="handleBackgroundRun">后台运行</el-button>
      </template>
    </el-dialog>

    <!-- 后台运行气泡 -->
    <transition name="el-fade-in">
      <div v-if="showBackgroundTip" class="background-export-tip" @click="reopenProgressDialog">
        <el-icon :size="20" color="#409EFF" style="margin-bottom: 5px"><Loading /></el-icon>
        <div style="font-size: 12px">导出中 {{ exportProgress.percentage }}%</div>
        <div style="font-size: 11px; color: #909399; margin-top: 2px">点击查看</div>
      </div>
    </transition>
  </div>
</template>
<script setup lang="ts">
import { datatransResultList, getCacheList, exportDatatransResultAsync, getDatatransExportProgress, datatranscancelExport, getDatatransLatestExportTask } from '@/api/bfs/busnessQury/costBalance';
import { queryManageCom } from '@/api/bfs/cache';
import { ElMessage } from 'element-plus';
import { Loading } from '@element-plus/icons-vue';
import { getCurrentInstance, onMounted, reactive, ref, toRefs } from 'vue';

const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const showSearch = ref(true);
const loading = ref(false);
const datatransList = ref([]);
const { bfs_certificate_type, bfs_debit_and_credit } = toRefs<any>(proxy?.useDict('bfs_certificate_type', 'bfs_debit_and_credit'));
const { sys_managecom } = toRefs<any>(proxy?.useDict('sys_managecom'));
const { bfs_verifi_type } = toRefs<any>(proxy?.useDict('bfs_verifi_type'));

const total = ref(0);

const initQueryParams = {
  pageNum: 1,
  pageSize: 10,
  verifiType: undefined,
  dateRange: undefined,
  certificateIds: undefined,
  costId: undefined,
  finItemCodeList: undefined,
  manageCom: undefined,
  businessNo: undefined,
  policyNo: undefined,
  belnrSap: undefined,
  dataType: undefined,
  finItemType: undefined
};

const data = reactive({
  queryParams: { ...initQueryParams },
  rules: {
    // dateRange: [{ required: true, message: '业务日期不能为空', trigger: 'blur' }]
  }
});
const { queryParams, rules } = toRefs(data);

const likeCostName = ref('');
const filteredCostList = ref([]);
const selectCostList = ref([]);
const likeName = ref('');
const filteredManagecom = ref([]);
const sys_managecomCache = ref([]);
const queryFormRef = ref<ElFormInstance>();

const finItemList = ref([]);
const filteredFinItemList = ref([]);
const likeFinItemName = ref('');
const rangeStart = ref('');
const rangeEnd = ref('');
const exportProgressVisible = ref(false);
const showBackgroundTip = ref(false);
const exportProgress = reactive({
  taskId: '',//任务ID
  percentage: 0,//进度
  processedCount: 0,//已处理
  totalCount: 0//总数
});
let exportTimer: any; //轮询定时
const isExportCancelled = ref(false); //是否已取消导出
const isDownloaded = ref(false); //是否已经下载
const hasShownFailedMessage = ref(false); //是否已显示失败提示

const getCache = async () => {
  const res = await getCacheList();
  selectCostList.value = res.data.certificateList1;
  filteredCostList.value = selectCostList.value;

  finItemList.value = res.data.certificateList;
  filteredFinItemList.value = finItemList.value;
};

const filterByCostIdName = () => {
  if (likeCostName.value) {
    filteredCostList.value = selectCostList.value.filter((item) => {
      return item.certificateId.includes(likeCostName.value) || item.certificateName.includes(likeCostName.value);
    });
  } else {
    filteredCostList.value = selectCostList.value;
  }
};

/** 模糊查询 */
const filterByManageCom = () => {
  if (likeName.value) {
    filteredManagecom.value = sys_managecomCache.value.filter((item) => {
      return item.dictLabel.includes(likeName.value) || item.dictValue.includes(likeName.value);
    });
  } else {
    filteredManagecom.value = sys_managecomCache.value;
  }
};

const filterByFinItemName = () => {
  if (likeFinItemName.value) {
    filteredFinItemList.value = finItemList.value.filter((item) => {
      return item.finItemCode.includes(likeFinItemName.value) || item.finItemName.includes(likeFinItemName.value);
    });
  } else {
    filteredFinItemList.value = finItemList.value;
  }
};

/** 凭证大类编号查询操作 */
const handleRangeQuery = () => {
  const start = rangeStart.value.trim();
  const end = rangeEnd.value.trim();
  const startNum = parseInt(start);
  const endNum = parseInt(end);
  if (!startNum && !endNum) {
    filterByCostIdName();
    return;
  }
  if (!startNum || !endNum){
    return;
  }
  if (startNum > endNum) {
    proxy?.$modal.msgError('起始编号不能大于结束编号');
    return;
  }
  
  filteredCostList.value = selectCostList.value.filter((item) => {
    const code = item.certificateId.trim();
    const codeNum = parseInt(code);
    if (codeNum >= startNum && codeNum <= endNum) {
      return true;
    }
    return false;
  });
  
  if (filteredCostList.value.length === 0) {
    proxy?.$modal.msgWarning('该范围内没有找到凭证大类');
  } else {
    proxy?.$modal.msgSuccess(`找到 ${filteredCostList.value.length} 个凭证大类`);
  }
};

/** 凭证大类全选按钮操作 */
const selectAllFinItems = () => {
  queryParams.value.certificateIds = [];
  if (filteredCostList.value.length === 0) {
    proxy?.$modal.msgError('没有可选择的凭证大类');
    return;
  }
  const currentSelected = queryParams.value.certificateIds || [];
  const allFilteredCodes = filteredCostList.value.map(item => item.certificateId);
  const merged = [...new Set([...currentSelected, ...allFilteredCodes])];
  queryParams.value.certificateIds = merged;
  proxy?.$modal.msgSuccess(`已选择 ${allFilteredCodes.length} 个凭证大类`);
};

/** 凭证大类取消按钮操作 */
const cancelAllFinItems = () => {
  queryParams.value.certificateIds = [];
  rangeStart.value = '';
  rangeEnd.value = '';
  filterByCostIdName();
};

/** 搜索按钮操作 */
const handleQuery = () => {
  queryParams.value.pageNum = 1;
  getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value?.resetFields();
  queryParams.value.pageNum = 1;
  rangeStart.value = '';
  rangeEnd.value = '';
};

const getList = () => {
  if (!validateAllFields()) {
    proxy?.$modal.msgError('录入项不能全部为空');
    return;
  }
  if (!validateInputFields()) {
    return;
  }
  queryFormRef.value?.validate(async (valid: boolean) => {
    if (valid) {
      loading.value = true;
      const res = await datatransResultList(proxy?.addDateRange(queryParams.value, queryParams.value.dateRange));
      datatransList.value = res.rows;
      total.value = res.total;
      loading.value = false;
    }
  });
};

/** 导出按钮操作 */
const handleExport = async () => {
  if (!validateAllFields()) {
    proxy?.$modal.msgError('录入项不能全部为空');
    return;
  }
  if (!validateInputFields()) {
    return;
  }
  queryFormRef.value?.validate(async (valid: boolean) => {
    if (valid) {
      try {
        loading.value = true;
        const exportParams = proxy?.addDateRange({ ...queryParams.value }, queryParams.value.dateRange);
        const res = await exportDatatransResultAsync(exportParams);
        const taskId = res.msg || res.data;
        if (!taskId) {
          proxy?.$modal.msgError('获取任务ID失败');
          return;
        }
        exportProgress.taskId = taskId;
        proxy?.$modal.msgSuccess('导出任务已提交，正在后台生成文件...');
        showExportProgress();
      } catch (error) {
        proxy?.$modal.msgError('导出任务提交失败');
      } finally {
        loading.value = false;
      }
    }
  });
};

/** 取消下载按钮操作 */
const handleBackgroundFail = async() => {
  if (!exportProgress.taskId) return;
  isExportCancelled.value = true;
  isDownloaded.value = false;
  hasShownFailedMessage.value = true;
  clearInterval(exportTimer);
  exportTimer = null;
  exportProgressVisible.value = false;
  showBackgroundTip.value = false;
  try {
    await datatranscancelExport(exportProgress.taskId);
  } catch (error) {}
  proxy?.$modal.msgWarning('导出任务已取消');
  exportProgress.taskId = '';
};

/** 显示导出进度弹窗 */
const showExportProgress = () => {
  exportProgress.percentage = 0;
  exportProgress.processedCount = 0;
  exportProgress.totalCount = 0;
  exportProgressVisible.value = false;
  showBackgroundTip.value = true;
  isExportCancelled.value = false;
  isDownloaded.value = false;
  hasShownFailedMessage.value = false;
  const cleanupExport = () => {
    clearInterval(exportTimer);
    exportTimer = null;
    exportProgressVisible.value = false;
    showBackgroundTip.value = false;
  };

  const checkProgress = async () => {
    try {
      if (!exportProgress.taskId) return;
      const res = await getDatatransExportProgress(exportProgress.taskId);
      const task = res.data;
      if (!task) {
        cleanupExport();
        return;
      }
      exportProgress.percentage = task.progress || 0;
      exportProgress.processedCount = task.processedCount || 0;
      exportProgress.totalCount = task.totalCount || 0;
      
      if (task.status === 'completed') {
        if (!isExportCancelled.value && !isDownloaded.value) {
          isDownloaded.value = true;
          cleanupExport();
          proxy?.download(
            'bfs/bussnessQury/exportDatatransResult/download/' + exportProgress.taskId,
            {},
            task.fileName || '费用明细.xlsx'
          );
          proxy?.$modal.msgSuccess('导出完成！文件下载中...');
        }else{
          cleanupExport();
        }
      } else if (task.status === 'failed') {
        cleanupExport();
        if (!hasShownFailedMessage.value) {
          hasShownFailedMessage.value = true;
          if (isExportCancelled.value || (task.errorMessage && task.errorMessage.indexOf('取消') !== -1)) {
            proxy?.$modal.msgWarning('导出任务已取消');
          } else {
            proxy?.$modal.msgError('导出失败：' + (task.errorMessage || '未知错误'));
          }
        }
      }
    } catch (error: any) {
      if (error?.message?.includes('任务不存在') || error?.message?.includes('已过期')){
        cleanupExport();
        return;
      }
      cleanupExport();
      proxy?.$modal.msgError('查询导出进度失败');
    }
  };
  checkProgress();
  if (exportTimer) {
    clearInterval(exportTimer);
    exportTimer = null;
  }
  exportTimer = setInterval(checkProgress, 500);
};

const handleBackgroundRun = () => {
  exportProgressVisible.value = false;
  showBackgroundTip.value = true;
  ElMessage.info('任务将在后台继续，完成后自动下载');
};

const reopenProgressDialog = () => {
  exportProgressVisible.value = true;
  showBackgroundTip.value = false;
};

/** 恢复未完成的导出任务 */
const restoreExportTask = async () => {
  try {
    const res = await getDatatransLatestExportTask();
    const task = res.data;
    if (task && task.taskId) {
      const fileName = task.fileName || '';
      if (fileName && fileName.indexOf('费用明细') === -1 && fileName.indexOf('datatransResult') === -1) {
        return;
      }
      exportProgress.taskId = task.taskId;
      exportProgress.percentage = task.progress || 0;
      exportProgress.processedCount = task.processedCount || 0;
      exportProgress.totalCount = task.totalCount || 0;
      if (task.status === 'running') {
        showBackgroundTip.value = true;
        showExportProgress();
      }
    }
  } catch (error) {}
};

// 计算属性用于动态设置 picker options
const handleDateRangeChange = (value: [string, string] | null) => {
  if (!value || !value[0] || !value[1]) return;

  const startDate = new Date(value[0]);
  const endDate = new Date(value[1]);

  const maxEndDate = new Date(startDate);
  maxEndDate.setDate(maxEndDate.getDate() + 365);

  if (endDate > maxEndDate) {
    proxy.$modal.msgError('结束日期不能超过开始日期一年以上');
    queryParams.value.dateRange = ['', ''];
  }
};

const validateAllFields = () => {
  const { queryParams } = data;
  for (const param in queryParams) {
    if (param !== 'pageNum' && param !== 'pageSize' && param !== 'params' && param !== 'verifiType') {
      if (queryParams[param] !== undefined && queryParams[param] !== null && queryParams[param] !== '') {
        return true;
      }
    }
  }
  return false;
};

const validateInputFields = () => {
  if (!queryParams.value.verifiType) {
    proxy?.$modal.msgError('请选择验证类型');
    return false;
  }
  if (queryParams.value.verifiType === '1' || queryParams.value.verifiType === '3') {
    if (!queryParams.value.manageCom) {
      proxy?.$modal.msgError('管理机构不能为空');
      return false;
    }
    // 独立验证管理机构
    if (!queryParams.value.manageCom) {
      proxy?.$modal.msgError('管理机构不能为空');
      return false;
    }

    // 独立验证记账日期
    if (!queryParams.value.dateRange || queryParams.value.dateRange.length !== 2) {
      proxy?.$modal.msgError('记账日期不能为空');
      return false;
    }
  }

  if (queryParams.value.verifiType === '2') {
    if (!queryParams.value.policyNo && !queryParams.value.businessNo) {
      proxy?.$modal.msgError('保单号和业务号不能同时为空');
      return false;
    }
  }

  if (queryParams.value.verifiType === '2') {
    if (!queryParams.value.policyNo && !queryParams.value.businessNo) {
      proxy?.$modal.msgError('保单号和业务号不能同时为空');
      return false;
    }
  }

  if (queryParams.value.verifiType === '4') {
    if (!queryParams.value.belnrSap) {
      proxy?.$modal.msgError('凭证号不能为空');
      return false;
    }
  }

  return true;
};

const verifiTypeChange = (newVerifiType) => {
  queryParams.value = { ...initQueryParams };
  queryParams.value.verifiType = newVerifiType;
};

const getCacheManageCom = async () => {
  const res = await queryManageCom();
  if (res.code == 200) {
    sys_managecomCache.value = res.data;
    filteredManagecom.value = sys_managecomCache.value;
  }
};

onMounted(() => {
  getCache();
  getCacheManageCom();
  restoreExportTask();
});
</script>
<style scoped lang="scss">
.background-export-tip {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 100px;
  height: 100px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s;
  border: 1px solid #e4e7ed;
}

.background-export-tip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.15);
  border-color: #409EFF;
}
</style>
