<template>
	<view class="container">
		<!-- 搜索+筛选栏 -->
		<view class="top-box">
			<view class="input-item">
					<image class="icon search-icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/search.png" mode="widthFix"></image>
					<input v-model="searchKeywords" @input="handleSearchInput" placeholder="请输入发起人姓名、手机号" placeholder-class="placeholder" />
				</view>
		</view>

		<!-- 顶部选项卡 -->
		<view class="top-tabs">
			<view class="top-tab-item" :class="{ active: currentTopTab === index }" @click="switchTopTab(index)"
				v-for="(item, index) in topTabs" :key="index">
				{{ item.label }}·{{ item.badge }}
			</view>
		</view>

		<!-- 核心修改：新增子标签容器，作为popup-box的定位参考 -->
		<view class="sub-tabs-wrapper">
			<!-- 动态子标签 -->
			<view class="sub-tabs">
				<view class="sub-tab-item" :class="{ active: currentSubTab === 'all' || currentSubTab === 'taskCreate' }" @click="openSubTabPopup('all')">
						<text>{{ selectedSubTabLabels['all'] || '全部审核' }}</text>
						<image class="icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_expand.png" mode="widthFix"></image>
				</view>
				<view class="sub-tab-item" :class="{ active: currentSubTab === 'unfinished' || currentSubTab === 'finished' }" @click="openSubTabPopup('unfinished')">
						<text>{{ selectedSubTabLabels['unfinished'] || '最新发起' }}</text>
						<image class="icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_expand.png" mode="widthFix"></image>
				</view>
			</view>
			<!-- 子标签弹窗 -->
			<view class="sub-tab-popup-overlay" v-if="showSubTabPopup" @click="showSubTabPopup = false"></view>
			<view class="sub-tab-popup" v-if="showSubTabPopup">
				<view class="sub-tab-options">
					<!-- 全部审核选项 -->
						<template v-if="currentPopupType === 'all'">
							<view class="sub-tab-option" :class="{ active: selectedSubTabOptions['all'] === 'all' }" @click="selectSubTabOption('all', '全部审核')">
								<text>全部审核</text>
							</view>
							<view class="sub-tab-option" :class="{ active: selectedSubTabOptions['all'] === 'taskCreate' }" @click="selectSubTabOption('taskCreate', '任务创建')">
								<text>任务创建</text>
							</view>
						</template>
						<!-- 最新发起选项 -->
						<template v-else-if="currentPopupType === 'unfinished'">
							<view class="sub-tab-option" :class="{ active: selectedSubTabOptions['unfinished'] === 'unfinished' }" @click="selectSubTabOption('unfinished', '最新发起')">
								<text>最新发起</text>
							</view>
							<view class="sub-tab-option" :class="{ active: selectedSubTabOptions['unfinished'] === 'finished' }" @click="selectSubTabOption('finished', '最早发起')">
								<text>最早发起</text>
							</view>
						</template>
				</view>
			</view>
		</view>
		<!-- 列表内容 -->
		<scroll-view class="content" scroll-y refresher-enabled :refresher-triggered="refreshing" @refresherrefresh="onRefresh" @refresherrestore="onRestore">
			<view class="task-card" v-for="(item, index) in currentList" :key="index" @click="goDetails(item)">
				<!-- 任务/审核标题+状态 -->
				<view class="card-top">
					<text class="card-task-title">{{ getAuditNameDisplay(item.auditName) }}</text>

					<view class="status-tag" :class="item.statusClass">{{ item.statusText }}</view>
				</view>

				<view class="card-content">
					<!-- 时间信息 -->
					<view class="time-info">
						<view class="time-item">
							<text class="title">任务名称：</text>
							<text>{{ item.auditName || '未设置' }}</text>
						</view>
						<view class="time-item">
												<text class="title">任务类型：</text>
												<text>{{ getBusinessTypeLabel(item.businessType) }}</text>
											</view>
					</view>

					<!-- 操作按钮 -->
					<view class="operate-btn-group">
						<view class="share-btn" @click="handleShare(item)">
							<image class="share-icon" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_user.png" mode="widthFix"></image>
							<text>{{ item.initiatorName || '未命名' }}</text>
						</view>
						<view class="date">
							{{ formatTime(item.createTime) }}
						</view>
					</view>
				</view>
			</view>
		</scroll-view>

		<!-- 筛选弹窗 -->
		<view class="filter-popup" v-if="showFilter" @click="closeFilter">
			<view class="filter-content" @click.stop>
				<view class="filter-header">
					<view class="filter-title">筛选</view>
					<image class="filter-close-btn" src="https://ysrw-1395926010.cos.ap-chengdu.myqcloud.com/image/icon_close.png" @click="closeFilter"
						mode="widthFix"></image>
				</view>

				<view class="filter-form">
					<!-- 任务申请时间 -->
					<view class="filter-section">
						<view class="section-label">任务申请时间</view>
						<view class="time-range">
							<input class="time-input" placeholder="开始时间" v-model="filters.applyTimeStart" />
							<view class="time-separator">-</view>
							<input class="time-input" placeholder="结束时间" v-model="filters.applyTimeEnd" />
						</view>
					</view>

					<!-- 任务完成时间：改为判断index：1对应已办 -->
					<view class="filter-section" v-if="currentTopTab === 1">
						<view class="section-label">任务完成时间</view>
						<view class="time-range">
							<input class="time-input" placeholder="开始时间" v-model="filters.finishTimeStart" />
							<view class="time-separator">-</view>
							<input class="time-input" placeholder="结束时间" v-model="filters.finishTimeEnd" />
						</view>
					</view>

					<!-- 完成审核时间：改为判断index：1对应已办 -->
					<view class="filter-section" v-if="currentTopTab === 1">
						<view class="section-label">完成审核时间</view>
						<view class="time-range">
							<input class="time-input" placeholder="开始时间" v-model="filters.auditTimeStart" />
							<view class="time-separator">-</view>
							<input class="time-input" placeholder="结束时间" v-model="filters.auditTimeEnd" />
						</view>
					</view>

					<!-- 任务归属 -->
					<view class="filter-section">
						<view class="section-label">任务归属</view>
						<view class="btn-group">
							<view class="filter-btn" :class="{ active: filters.taskBelong === 'my' }"
								@click="filters.taskBelong = 'my'">我的任务</view>
							<view class="filter-btn" :class="{ active: filters.taskBelong === 'dept' }"
								@click="filters.taskBelong = 'dept'">部门任务</view>
						</view>
					</view>

					<!-- 完结状态：改为判断index：1对应已办 -->
					<view class="filter-section" v-if="currentTopTab === 1">
						<view class="section-label">完结状态</view>
						<view class="btn-group">
							<view class="filter-btn" :class="{ active: filters.finishStatus === 'unfinished' }"
								@click="filters.finishStatus = 'unfinished'">未完结</view>
							<view class="filter-btn" :class="{ active: filters.finishStatus === 'finished' }"
								@click="filters.finishStatus = 'finished'">已完结</view>
						</view>
					</view>

					<!-- 归属类型 -->
					<view class="filter-section">
						<view class="section-label">归属类型</view>
						<view class="btn-group">
							<view class="filter-btn" :class="{ active: filters.belongType === 'inner' }"
								@click="filters.belongType = 'inner'">院内</view>
							<view class="filter-btn" :class="{ active: filters.belongType === 'outer' }"
								@click="filters.belongType = 'outer'">院外</view>
						</view>
					</view>
				</view>

				<view class="filter-actions">
					<view class="reset-btn" @click="resetFilters">重置</view>
					<view class="confirm-btn" @click="confirmFilters">确定</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
import utils from '@/utils/common.js'
	import TabPopup from '@/components/tab-popup.vue'
	import { getPendingAuditList, searchCompanyUser } from '@/api/audit.js'
	
	export default {
		components: {
			TabPopup
		},
		data() {
											return {
													processTemplate: null,
													popShow: false,
													showFilter: false,
													selectedTabItem: '',
													searchKeywords: '',
													searchTimer: null,
													filters: {
														applyTimeStart: '',
														applyTimeEnd: '',
														finishTimeStart: '',
														finishTimeEnd: '',
														auditTimeStart: '',
														auditTimeEnd: '',
														taskBelong: 'my',
														finishStatus: '',
														belongType: ''
													},
													refreshing: false,
													showSubTabPopup: false,
													currentPopupType: 'all',
													// 为每种类型的弹窗分别存储选中的选项
													selectedSubTabOptions: {
														all: 'all',
														unfinished: 'unfinished'
													},
													selectedSubTabLabels: {
														all: '全部审核',
														unfinished: '最新发起'
													},
					// 顶部选项卡数组
					topTabs: [{
								label: '待办',
								value: 'todo',
								badge: 0
							},
							{
								label: '已办',
								value: 'done',
								badge: 0
							},
							{
								label: '我发起的',
								value: 'myInitiate',
								badge: 0
							}
						],
					currentTopTab: 0,
					currentSubTab: 'all',
					// 子标签数组
					taskSubTabs: [{
							label: '全部审批',
							value: 'all'
						},
						{
							label: '最新发起',
							value: 'unfinished'
						}
					],
					tabsList: ['全部审批', '任务创建'],
					tabsList2: ['最新发起', '最早发起'],
					// auditSubTabs: [{
					// 		label: '全部',
					// 		value: 'all'
					// 	},
					// 	{
					// 		label: '驳回',
					// 		value: 'rejected'
					// 	}
					// ],
					// 加载状态
					loading: {
						todo: false,
						done: false,
						myInitiate: false
					},
					// 列表数据
					todoList: [], // 待办列表（index=0）
					doneList: [], // 已办列表（index=1）
					myInitiateList: [] // 我发起的列表（index=2）
				}
			},
			computed: {
				currentSubTabsList() {
					 return this.taskSubTabs;

					// if (this.currentTopTab === 0) return this.taskSubTabs;
					// if (this.currentTopTab === 1) return this.auditSubTabs;
					// if (this.currentTopTab === 2) return this.myInitiateList;
				},
				currentList() {
					if (this.currentTopTab === 0) return this.todoList;
					if (this.currentTopTab === 1) return this.doneList;
					if (this.currentTopTab === 2) return this.myInitiateList;
				}
			},
			onLoad() {
				// 页面加载时的初始化操作
				this.loadData();
				utils.getDicts("FLOW_TEMPLATE").then(res => {
					this.processTemplate = res;
					console.log("流程模板", this.processTemplate)
				});
			},
		methods: {
			onRefresh() {
				this.refreshing = true;
				this.loadData().finally(() => {
					setTimeout(() => {
						this.refreshing = false;
					}, 500);
				});
			},
			onRestore() {
				this.refreshing = false;
			},
			openSubTabPopup(type) {
				this.currentPopupType = type;
				this.showSubTabPopup = true;
			},
			selectSubTabOption(value, label) {
					// 根据当前弹窗类型更新对应类型的选中选项
					this.selectedSubTabOptions[this.currentPopupType] = value;
					this.selectedSubTabLabels[this.currentPopupType] = label;
					this.currentSubTab = value;
					this.showSubTabPopup = false;
					// 这里可以添加根据选择的子标签过滤数据的逻辑
					this.loadData();
				},
			selectTabItem(item) {
				this.selectedTabItem = item;
				this.popShow = false;
			},
			goDetails(item) {
				console.log("跳转参数",item)
				uni.navigateTo({
					url: `/pages_task/approvalTaskDetail?taskId=${item.id}&businessType=${item.businessType}`
				})
			},
			switchTopTab(index) {
					this.currentTopTab = index;
					this.currentSubTab = 'all';
					// 重置所有子标签选项
					this.selectedSubTabOptions = {
						all: 'all',
						unfinished: 'unfinished'
					};
					this.selectedSubTabLabels = {
						all: '全部审核',
						unfinished: '最新发起'
					};
					this.popShow = false;
					this.showSubTabPopup = false;
					// 切换标签时重新加载数据
					this.loadData();
				},
			closeFilter() {
				this.showFilter = false
			},
			resetFilters() {
				this.filters = {
					applyTimeStart: '',
					applyTimeEnd: '',
					finishTimeStart: '',
					finishTimeEnd: '',
					auditTimeStart: '',
					auditTimeEnd: '',
					taskBelong: 'my',
					finishStatus: '',
					belongType: ''
				}
			},
			confirmFilters() {
				this.showFilter = false
				console.log('筛选条件：', this.filters)
				// 筛选后重新加载数据
				this.loadData()
				},
				getAuditNameDisplay(auditName) {
					if (!auditName) return '未设置'
					switch (auditName) {
						case '完成任务审核':
							return '"完成任务"审核'
						case '定级审核':
							return '"讲者定级"审核'
						default:
							// 对于其他审核类型，在最开始和审核前都加双引号
							const prefix = auditName.replace('审核', '')
							return '"' + prefix + '"审核'
					}
				},
								handleShare(item) {
									uni.showToast({
										title: '分享功能待实现',
										icon: 'none'
									})
									},
								handleSearchInput() {
									// 防抖处理，避免频繁请求
									if (this.searchTimer) {
										clearTimeout(this.searchTimer)
									}
									
									this.searchTimer = setTimeout(async () => {
										if (this.searchKeywords.trim()) {
											try {
												// 调用搜索发起人接口
												const res = await searchCompanyUser({
													keywords: this.searchKeywords.trim(),
													pageNum: 1,
													pageSize: 10
												})
												
												if (res.code === 200 && res.rows) {
													// 根据当前标签页更新对应列表
													if (this.currentTopTab === 0) {
														this.todoList = res.rows.map(item => ({
															auditName: item.auditName || '未知审核',
															statusText: '待审核',
															statusClass: 'status-createPending',
															id: item.id,
															status: item.status,
															auditType: item.auditType,
															businessId: item.businessId,
															businessType: item.businessType,
															createTime: item.createTime,
															initiatorName: item.initiatorName
														}))
													} else if (this.currentTopTab === 1) {
														this.doneList = res.rows.map(item => ({
															auditName: item.auditName || '未知审核',
															statusText: item.status === 1 ? '已通过' : '已驳回',
															statusClass: item.status === 1 ? 'status-finish' : 'status-rejected',
															id: item.id,
															status: item.status,
															auditType: item.auditType,
															businessId: item.businessId,
															businessType: item.businessType,
															createTime: item.createTime,
															initiatorName: item.initiatorName
														}))
													} else if (this.currentTopTab === 2) {
														this.myInitiateList = res.rows.map(item => ({
															auditName: item.auditName || '未知审核',
															statusText: '待审核',
															statusClass: 'status-createPending',
															id: item.id,
															status: item.status,
															auditType: item.auditType,
															businessId: item.businessId,
															businessType: item.businessType,
															createTime: item.createTime,
															initiatorName: item.initiatorName
														}))
													}
												} else {
													// 搜索结果为空，清空对应列表
													if (this.currentTopTab === 0) {
														this.todoList = []
													} else if (this.currentTopTab === 1) {
														this.doneList = []
													} else if (this.currentTopTab === 2) {
														this.myInitiateList = []
													}
												}
												} catch (e) {
												console.error('搜索失败', e)
												uni.showToast({
													title: '搜索失败',
													icon: 'none'
												})
											}
										} else {
											// 搜索框为空，重新加载默认数据
											this.loadData()
										}
									}, 300)
									},
				// 加载审批数据
				async loadData() {
					try {
						// 无论当前标签是什么，都调用getPendingAuditList请求
						const userInfoStr = uni.getStorageSync('userInfo')
						const userInfo = userInfoStr ? (typeof userInfoStr === 'string' ? JSON.parse(userInfoStr) : userInfoStr) : {}
						// 获取不同status的数据total并更新badge
					const getBadgeData = async () => {
						// 获取待办数据(total)
						const todoParams = {
							initiatorName: userInfo.nickName || '',
							initiatorPhone: userInfo.phone || '',
							status: 1,
							sort: 0,
							userId: userInfo.userId || '',
							companyId: userInfo.companyId || 0
						}
						const todoRes = await getPendingAuditList(todoParams)
						this.topTabs[0].badge = todoRes.code === 200 ? (todoRes.total || 0) : 0

						// 获取已办数据(total)
						const doneParams = {
							initiatorName: userInfo.nickName || '',
							initiatorPhone: userInfo.phone || '',
							status: 2,
							sort: 0,
							userId: userInfo.userId || '',
							companyId: userInfo.companyId || 0
						}
						const doneRes = await getPendingAuditList(doneParams)
						this.topTabs[1].badge = doneRes.code === 200 ? (doneRes.total || 0) : 0

						// 获取我发起的数据(total)
						const myInitiateParams = {
							initiatorName: userInfo.nickName || '',
							initiatorPhone: userInfo.phone || '',
							status: '',
							sort: 0,
							userId: userInfo.userId || '',
							companyId: 1 || 0
						}
						const myInitiateRes = await getPendingAuditList(myInitiateParams)
						this.topTabs[2].badge = myInitiateRes.code === 200 ? (myInitiateRes.total || 0) : 0
					}

						// 先获取所有badge数据
						await getBadgeData()

						// 获取当前标签页的数据
					const params = {
						initiatorName: userInfo.nickName || '',
						initiatorPhone: userInfo.phone || '',
						status: this.currentTopTab === 0 ? 1 : this.currentTopTab === 1 ? 2 : '',
						sort: 0,
						userId: userInfo.userId || '',
						companyId: this.currentTopTab === 2 ? 1 : (userInfo.companyId || 0)
					}
						const res = await getPendingAuditList(params)
						if (res.code === 200) {
								// 处理返回的数据
							const responseData = res.rows || [];
								
							// 直接使用responseData作为对应列表的数据
							if (this.currentTopTab === 0) {
								// 待办列表
								this.loading.todo = true
								this.todoList = responseData.map(item => ({
									auditName: item.auditName || '未知审核',
									statusText: '待审核',
									statusClass: 'status-createPending',
									id: item.id,
									status: item.status,
									auditType: item.auditType,
									businessId: item.businessId,
									businessType: item.businessType,
									createTime: item.createTime,
									initiatorName: item.initiatorName
								}))
								this.loading.todo = false
							} else if (this.currentTopTab === 1) {
								// 已办列表
								this.loading.done = true
								this.doneList = responseData.map(item => ({
									auditName: item.auditName || '未知审核',
									statusText: item.status === 1 ? '已通过' : '已驳回',
									statusClass: item.status === 1 ? 'status-finish' : 'status-rejected',
									id: item.id,
									status: item.status,
									auditType: item.auditType,
									businessId: item.businessId,
									businessType: item.businessType,
									createTime: item.createTime,
									initiatorName: item.initiatorName
								}))
								this.loading.done = false
							} else if (this.currentTopTab === 2) {
								// 我发起的列表
								this.loading.myInitiate = true
								this.myInitiateList = responseData.map(item => ({
									auditName: item.auditName || '未知审核',
									statusText: '待审核',
									statusClass: 'status-createPending',
									id: item.id,
									status: item.status,
									auditType: item.auditType,
									businessId: item.businessId,
									businessType: item.businessType,
									createTime: item.createTime,
									initiatorName: item.initiatorName
								}))
								this.loading.myInitiate = false
							}
								
							// 这里不再需要更新badge，因为已经在getBadgeData中更新过了
						} else {
							uni.showToast({
								title: '获取审核列表失败',
								icon: 'none'
							})
						}
					} catch (e) {
						console.error('加载数据失败', e)
						uni.showToast({
							title: '加载数据失败',
							icon: 'none'
						})
						// 重置加载状态
							this.loading.todo = false
							this.loading.done = false
							this.loading.myInitiate = false
						}
					},
					// 格式化时间
					formatTime(timeStr) {
									if (!timeStr) return ''
									const date = new Date(timeStr)
									const year = date.getFullYear()
									const month = String(date.getMonth() + 1).padStart(2, '0')
									const day = String(date.getDate()).padStart(2, '0')
									const hours = String(date.getHours()).padStart(2, '0')
									const minutes = String(date.getMinutes()).padStart(2, '0')
									return `${year}-${month}-${day} ${hours}:${minutes}`
								},
								getBusinessTypeLabel(businessType) {
										if (!businessType || !this.processTemplate) {
											return '未设置'
										}
										const dictItem = this.processTemplate.find(item => item.dictValue === businessType)
										return dictItem ? dictItem.dictLabel : businessType
										}
				}
	}
</script>
<style lang="scss" scoped>
	.container {
		min-height: 100vh;
		background: #F7F8FA;
		position: relative;

		// 搜索栏
		.top-box {
			padding: 20rpx 32rpx;
			display: flex;
			align-items: center;
			background: #fff;
			position: relative;
			z-index: 101;

			.input-item {
				display: flex;
				align-items: center;
				flex: 1;
				height: 72rpx;
				background: #F7F8FA;
				border-radius: 38rpx;

				.search-icon {
					width: 26rpx;
					height: 26rpx;
					margin: 0 10rpx 0 28rpx;
				}

				input {
					flex: 1;
					font-size: 28rpx;
					color: #333;
				}
			}
		}

		// 顶部选项卡
		.top-tabs {
			display: flex;
			background: #fff;
			position: relative;
			z-index: 101;

			.top-tab-item {
				flex: 1;
				text-align: center;
				padding: 24rpx 0;
				font-size: 28rpx;
				color: #999;
				transition: all 0.2s;

				&.active {
					color: #333;
					font-weight: 500;
					position: relative;

					&::after {
						content: '';
						position: absolute;
						bottom: 0;
						left: 50%;
						transform: translateX(-50%);
						border-radius: 3rpx;
						width: 80rpx;
						height: 6rpx;
						background: #388BFF;
					}
				}
			}
		}

		// 核心修改：子标签容器（定位参考）
		.sub-tabs-wrapper {
			position: relative; // 作为popup-box的定位参考
			z-index: 101; // 确保在遮罩层之上

			// 子标签栏
			.sub-tabs {
				display: flex;
				justify-content: space-between;
				background: #fff;
				padding: 16rpx 32rpx;
				gap: 24rpx;

				.sub-tab-item {
					flex: 1;
					height: 64rpx;
					display: flex;
					border-radius: 70rpx;
					border: 2rpx solid #F2F2F2;
					justify-content: center;
					align-items: center;
					font-size: 28rpx;
					color: #666;
					transition: all 0.2s;

					.icon {
						width: 28rpx;
						height: 28rpx;
						margin-left: 12rpx;
					}
				}
			}
		}

		/* 子标签弹窗样式 */
		.sub-tab-popup-overlay {
			position: absolute;
			top: 100%;
			height: 100vh;
			left: 0;
			right: 0;
			bottom: -1000rpx;
			background: rgba(0, 0, 0, 0.5);
			z-index: 8;
		}

		.sub-tab-popup {
			position: absolute;
			top: 100%;
			left: 0;
			right: 0;
			background: #fff;
			border-radius: 0;
			padding: 32rpx;
			width: 100%;
			box-sizing: border-box;
			box-shadow: none;
			z-index: 9;
		}

		.sub-tab-options {
			display: flex;
			flex-wrap: wrap;
			gap: 24rpx;
			border-radius: 70rpx 70rpx 70rpx 70rpx;
			justify-content: flex-start;
		}

		.sub-tab-option {
			padding: 24rpx 14rpx;
			border-radius: 70rpx;
			font-size: 28rpx;
			color: #666666;
			background: #ffffff;
			border: 1rpx solid #e8e8e8;
			transition: all 0.2s ease;
			text-align: center;
			min-width: 214rpx;
			box-sizing: border-box;

			&.active {
				background: rgba(56,139,255,0.15);
				color: #ffffff;
				color: #388BFF;
				border: 1rpx solid #388BFF ;
			}
		}

		// 列表区域
		.content {
			padding: 24rpx;
			box-sizing: border-box;
			min-height: calc(100vh - 300rpx);
			position: relative;
			z-index: 98; // 低于遮罩层

			.task-card {
				background: #fff;
				border-radius: 24rpx;
				margin-bottom: 20rpx;
				border: 2rpx solid #E9F2FF;
				position: relative;
				padding-bottom: 24rpx;

				.card-top {
					display: flex;
					justify-content: space-between;
					align-items: center;
					background: linear-gradient(90deg, #E8F1FF 0%, #FFFFFF 100%);
					border-radius: 24rpx 24rpx 0 0;
					padding: 26rpx 24rpx;
					margin-bottom: 16rpx;

					.card-task-title {
						font-size: 32rpx;
						font-weight: 600;
						color: #333;
					}

					.status-tag {
						padding: 8rpx 16rpx;
						border-radius: 20rpx;
						font-size: 24rpx;

						&.status-wait {
							background: #E3F2FD;
							color: #2196F3;
						}

						&.status-finish {
							background: #E6FAEF;
							color: #07C160;
						}

						&.status-rejected {
							background: #FFF4F5;
							color: #CF3546;
						}

						&.status-createPending {
							background: #FFF8E6;
							color: #FF9500;
						}
					}
				}

				.card-content {
					padding: 0 24rpx;

					.time-info {
						font-size: 28rpx;
						color: #666;
						display: flex;
						flex-direction: column;
						gap: 8rpx;
						margin-bottom: 24rpx;

						.time-item {
							display: flex;
							font-size: 28rpx;
							color: #333;

							.title {
								color: #666;
							}
						}
					}

					.operate-btn-group {
						display: flex;
						align-items: center;
						justify-content: space-between;

						.share-btn {
							display: flex;
							align-items: center;
							font-size: 28rpx;
							color: #666;

							.share-icon {
								width: 36rpx;
								height: 36rpx;
								margin-right: 8rpx;
							}
						}

						.date {
							font-size: 24rpx;
							color: #999;
						}
					}
				}
			}
		}

		// 筛选弹窗
		.filter-popup {
			position: fixed;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			background: rgba(0, 0, 0, 0.5);
			z-index: 999;
			display: flex;
			align-items: flex-end;

			.filter-content {
				width: 100%;
				background: #fff;
				border-radius: 24rpx 24rpx 0 0;
				padding: 32rpx;

				.filter-header {
					display: flex;
					align-items: center;
					justify-content: center;
					margin-bottom: 32rpx;
					position: relative;

					.filter-title {
						font-size: 32rpx;
						font-weight: bold;
						color: #333;
					}

					.filter-close-btn {
						position: absolute;
						right: 0;
						width: 44rpx;
						height: 44rpx;
					}
				}

				.filter-form {
					padding: 0 0 24rpx 0;

					.filter-section {
						margin-bottom: 32rpx;

						.section-label {
							font-weight: 500;
							font-size: 28rpx;
							color: #333;
							margin-bottom: 24rpx;
						}

						.time-range {
							display: flex;
							align-items: center;
							gap: 16rpx;

							.time-input {
								flex: 1;
								height: 72rpx;
								text-align: center;
								background: #F7F8FA;
								border-radius: 8rpx;
								padding: 0 16rpx;
								font-size: 26rpx;
								color: #333;
							}

							.time-separator {
								font-size: 24rpx;
								color: #999;
							}
						}

						.btn-group {
							display: flex;
							gap: 16rpx;

							.filter-btn {
								width: 214rpx;
								height: 72rpx;
								background: #F7F8FA;
								border-radius: 70rpx;
								line-height: 72rpx;
								text-align: center;
								font-size: 28rpx;
								transition: all 0.2s;
								color: #333;

								&.active {
									background: rgba(56, 139, 255, 0.15);
									color: #388BFF;
								}
							}
						}
					}
				}

				.filter-actions {
					display: flex;
					gap: 24rpx;
					margin-top: 40rpx;

					.reset-btn,
					.confirm-btn {
						flex: 1;
						height: 80rpx;
						line-height: 80rpx;
						text-align: center;
						border-radius: 200rpx;
						font-size: 28rpx;
						transition: all 0.2s;
					}

					.reset-btn {
						background: #fff;
						color: #388BFF;
						border: 2rpx solid #388BFF;

						&:active {
							background: #EBF3FF;
						}
					}

					.confirm-btn {
						background: #388BFF;
						color: #fff;

						&:active {
							background: #2A78E5;
						}
					}
				}
			}
		}
	}
</style>