<template>
	<view class="my-page">
		<scroll-view class="my-scroll" scroll-y refresher-enabled :refresher-triggered="refreshing"
			@refresherrefresh="onRefresh">
			<view class="my-content">
				<view class="top-zone fade-up" style="animation-delay: 0ms;">
					<view class="profile-row">
						<view class="avatar-card">
							<view class="avatar-face">{{avatarText}}</view>
							<view class="level-chip">Lv.8</view>
						</view>
						<view class="profile-main">
							<view class="name-row">
								<text class="user-name">{{userName}}</text>
								<text class="verify-dot"></text>
							</view>
							<view class="school-row">{{schoolName}}</view>
							<view class="identity-pill">半径等级 Lv.8</view>
						</view>
						<view class="top-actions">
							<view class="icon-btn" hover-class="tap-soft" hover-stay-time="80" @tap="showComingSoon('设置')">
								<view class="line-gear"></view>
							</view>
							<view class="icon-btn icon-btn--notice" hover-class="tap-soft" hover-stay-time="80"
								@tap="showComingSoon('消息')">
								<view class="line-message"></view>
								<view class="notice-dot"></view>
							</view>
						</view>
					</view>
					<view class="ticket-card" hover-class="tap-soft" hover-stay-time="80" @tap="navigatorTo('blindBox')">
						<view>
							<view class="ticket-label">我的星球券</view>
							<view class="ticket-value">{{blindBoxCount}}张</view>
						</view>
						<image class="ticket-icon" src="/package3/static/planet-ticket.png" mode="aspectFit"></image>
					</view>
				</view>

				<view class="saving-hero fade-up" hover-class="tap-soft" hover-stay-time="80"
					style="animation-delay: 50ms;" @tap="navigatorTo('qianbao')">
					<image class="saving-bg" src="/package3/static/saving-hero.png" mode="aspectFill"></image>
					<view class="saved-badge">已经帮你省下</view>
					<view class="saved-main">
						<view class="saved-money money-roll">￥{{savedMoney}}</view>
						<view class="saved-desc">≈ {{milkTeaCount}} 杯蜜雪冰城</view>
						<view class="saved-week">本周又省了 +38</view>
					</view>
				</view>

				<view class="section-card earn-section fade-up" style="animation-delay: 100ms;">
					<view class="section-head">
						<view>
							<view class="section-title section-title--icon">
								<image class="title-icon" src="/package3/static/earn-title.png" mode="aspectFit"></image>
								<text>今天还能赚</text>
							</view>
							<view class="section-desc">每日都有新机会，省钱又赚钱</view>
						</view>
						<view class="text-link" @tap="showComingSoon('全部任务')">查看全部</view>
					</view>
					<view class="task-row">
						<view class="task-card" hover-class="tap-soft" hover-stay-time="80"
							v-for="(item,index) in taskCards" :key="index" :class="'task-card--' + item.type"
							@tap="navigatorTo(item.action)">
							<view class="task-title">{{item.title}}</view>
							<view class="task-sub">{{item.sub}}</view>
							<view class="task-visual">
								<image class="task-asset" :class="'task-asset--' + item.type" :src="item.icon"
									mode="aspectFit"></image>
							</view>
							<view class="task-btn">{{item.cta}}</view>
						</view>
					</view>
				</view>

				<view class="section-card identity-section fade-up" style="animation-delay: 150ms;">
					<view class="section-head">
						<view>
							<view class="section-title">我的身份</view>
							<view class="section-desc">一个账号，多重身份</view>
						</view>
						<view class="text-link" @tap="showComingSoon('切换身份')">切换身份</view>
					</view>
					<view class="identity-row">
						<view class="identity-card" hover-class="tap-soft" hover-stay-time="80"
							v-for="(item,index) in identityCards" :key="index" :class="'identity-card--' + item.type"
							@tap="navigatorTo(item.action)">
							<view class="identity-tag" v-if="item.tag">{{item.tag}}</view>
							<image class="identity-icon" :class="'identity-icon--' + item.type" :src="item.icon"
								mode="aspectFit"></image>
							<view class="identity-title">{{item.title}}</view>
							<view class="identity-desc">{{item.desc}}</view>
							<view class="identity-go">›</view>
						</view>
					</view>
				</view>

				<view class="quick-card fade-up" style="animation-delay: 200ms;">
					<view class="quick-item" hover-class="tap-soft" hover-stay-time="80"
						v-for="(item,index) in quickItems" :key="index" @tap="navigatorTo(item.action)">
						<image class="quick-icon" :class="'quick-icon--' + item.type" :src="item.icon"
							mode="aspectFit"></image>
						<view class="quick-title">{{item.title}}</view>
						<view class="quick-tip">{{item.tip}}</view>
					</view>
				</view>

				<view class="section-card life-section fade-up" style="animation-delay: 250ms;">
					<view class="section-head">
						<view>
							<view class="section-title">校园生活</view>
							<view class="section-desc">发现更多有趣的校园生活</view>
						</view>
						<view class="text-link" @tap="showComingSoon('全部服务')">全部服务</view>
					</view>
					<view class="life-grid">
						<view class="life-card" hover-class="tap-soft" hover-stay-time="80"
							v-for="(item,index) in lifeCards" :key="index" :class="'life-card--' + item.type"
							@tap="navigatorTo(item.action)">
							<view class="life-title">{{item.title}}</view>
							<view class="life-desc">{{item.desc}}</view>
							<view class="life-visual">
								<image class="life-asset" :class="'life-asset--' + item.type" :src="item.icon"
									mode="aspectFit"></image>
								<view class="life-go">›</view>
							</view>
						</view>
					</view>
				</view>

				<view class="logout-btn fade-up" hover-class="logout-active" hover-stay-time="80"
					style="animation-delay: 300ms;" @tap="navigatorTo('tuichu')">
					<text class="logout-power"></text>
					<text>退出登录</text>
				</view>
			</view>
		</scroll-view>

		<!-- 未注册兼职弹窗 -->
		<uni-popup ref="jianzhiPopup" background-color="rgba(2, 171, 255, 1)" borderRadius="40px 40px 40px 40px">
			<view class="jianzhi-content" @tap="navigatorTo('partTimeReg')">
				<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/faf25c687bc1417282ebac719fd1bfba.png" alt=""
					style="width: 100%;height: 100%;">
				<view style="position: absolute;bottom: -50px;left: 130px;" @tap.stop="$refs.jianzhiPopup.close()">
					<uni-icons type="close" size="40" color="#fff"></uni-icons>
				</view>
			</view>
		</uni-popup>
		<!-- 多个商家选择弹窗 -->
		<uni-popup ref="shopPopup" background-color="transparent" borderRadius="40px 40px 40px 40px">
			<view class="shop-content">
				<view class="popup-pay-title">
					<text>选择要进入的店铺</text>
				</view>
				<view class="popup-list" hover-class="tap-soft" hover-stay-time="80" @tap="clickShop(item)"
					v-for="(item,index) in schoolShop" :key="index">
					{{item.shopName}}
				</view>
			</view>
		</uni-popup>
		<!-- 弹出区域选择 -->
		<uni-popup ref="areaPopup" background-color="transparent">
			<view class="popup-area-content">
				<view class="popup-area-title">
					<text>选择你的校园半径</text>
				</view>
				<view class="popup-area-container" hover-class="tap-soft" hover-stay-time="80"
					v-for="(item,index) in areaList" :key="index" @tap="onClickArea(item)">
					<text style="display: inline-block">{{item.title}}</text>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				areaList: [],
				schoolShop: [],
				workerCounts: 0,
				shopCounts: 0,
				balance: '0.00',
				worker: uni.getStorageSync('worker'),
				balanceRefreshId: 0,
				refreshing: false,
				couponCount: Number(uni.getStorageSync('couponCount')) || 8,
				blindBoxCount: Number(uni.getStorageSync('blindBoxCount')) || 8,
				orderCounts: {
					pay: Number(uni.getStorageSync('orderPayCount')) || 2,
					delivery: Number(uni.getStorageSync('orderDeliveryCount')) || 1,
					evaluate: Number(uni.getStorageSync('orderEvaluateCount')) || 3,
					refund: Number(uni.getStorageSync('orderRefundCount')) || 1
				},
				savedMoney: uni.getStorageSync('savedMoney') || '286',
				rewardMoney: uni.getStorageSync('rewardMoney') || '58.6',
				deliveryIncome: uni.getStorageSync('deliveryIncome') || '86',
				deliveryDoneCount: Number(uni.getStorageSync('deliveryDoneCount')) || 123,
				collegeRank: Number(uni.getStorageSync('collegeRank')) || 18
			}
		},
		computed: {
			hasWorker() {
				return !!this.worker
			},
			hasShop() {
				const shopId = uni.getStorageSync('shopId')
				const shops = this.normalizeShopList(this.schoolShop.length ? this.schoolShop : uni.getStorageSync('schoolShop'))
				return !!shopId || shops.length > 0
			},
			userName() {
				return uni.getStorageSync('nickName') || uni.getStorageSync('nickname') || uni.getStorageSync('userName') || '张昊雯'
			},
			avatarText() {
				return (this.userName || '张').slice(0, 1)
			},
			schoolName() {
				const area = this.getArea()
				return uni.getStorageSync('schoolName') || area.title || '沧州师范学院'
			},
			milkTeaCount() {
				return Math.max(1, Math.round((Number(this.savedMoney) || 0) / 5))
			},
			userOrderTotal() {
				return this.orderCounts.pay + this.orderCounts.delivery + this.orderCounts.evaluate + this.orderCounts.refund
			},
			taskCards() {
				return [{
					type: 'group',
					title: '拼团省钱',
					sub: '还差 2 人成团',
					icon: '/package3/static/group-buy.png',
					cta: '去拼团',
					action: 'dingdan'
				}, {
					type: 'cash',
					title: '白嫖现金',
					sub: '22:00 开奖',
					icon: '/package3/static/free-cash.png',
					cta: '去参与',
					action: 'planet'
				}, {
					type: 'school',
					title: '学院奖金',
					sub: '当前排名 12',
					icon: '/package3/static/college-bonus.png',
					cta: '去助推',
					action: 'planet'
				}, {
					type: 'wallet',
					title: '可提现',
					sub: '余额 ¥' + this.rewardMoney,
					icon: '/package3/static/withdraw.png',
					cta: '去提现',
					action: 'qianbao'
				}]
			},
			identityCards() {
				return [{
					type: 'user',
					title: '普通用户',
					desc: '点外卖 · 拼团 · 领券',
					icon: '/package3/static/user.png',
					action: 'dingdan'
				}, {
					type: 'delivery',
					title: '校园配送员',
					desc: '自由接单 · 灵活赚钱',
					icon: '/package3/static/campus-courier.png',
					tag: this.hasWorker ? '接单中' : '可注册',
					action: this.hasWorker ? 'jianzhizhuye' : 'jianzhizhuce'
				}, {
					type: 'shop',
					title: '商家中心',
					desc: '管理店铺 · 经营数据',
					icon: '/package3/static/merchant-center.png',
					action: this.hasShop ? 'merchantCenter' : 'merchant'
				}]
			},
			quickItems() {
				return [{
					type: 'order',
					title: '我的订单',
					tip: '待付款 ' + this.orderCounts.pay,
					icon: '/package3/static/orders.png',
					action: 'dingdan'
				}, {
					type: 'wallet',
					title: '我的钱包',
					tip: '余额 ¥' + this.balance,
					icon: '/package3/static/wallet.png',
					action: 'qianbao'
				}, {
					type: 'coupon',
					title: '优惠券',
					tip: '8 张可用',
					icon: '/package3/static/coupon.png',
					action: 'youhui'
				}, {
					type: 'address',
					title: '收货地址',
					tip: '3 个地址',
					icon: '/package3/static/address.png',
					action: 'address'
				}, {
					type: 'collect',
					title: '我的收藏',
					tip: '12 个收藏',
					icon: '/package3/static/favorite.png',
					action: 'collect'
				}]
			},
			lifeCards() {
				return [{
					type: 'ie',
					title: 'IE',
					desc: '找搭子一起吃饭学习',
					icon: '/package3/static/IE.png',
					action: 'ie'
				}, {
					type: 'fish',
					title: '鱼塘',
					desc: '二手交易更省钱',
					icon: '/package3/static/fish-market.png',
					action: 'fishRelease'
				}, {
					type: 'secret',
					title: '校园秘闻',
					desc: '看看学校新鲜事',
					icon: '/package3/static/campus-secret.png',
					action: 'planet'
				}, {
					type: 'agent',
					title: '成为代理',
					desc: '邀请好友赚佣金',
					icon: '/package3/static/agent.png',
					action: 'agent'
				}]
			}
		},
		mounted() {
			uni.$on('myCenterCountsChange', this.setPendingCounts)
		},
		beforeDestroy() {
			uni.$off('myCenterCountsChange', this.setPendingCounts)
		},
		methods: {
			getArea() {
				try {
					return uni.getStorageSync('area') ? JSON.parse(uni.getStorageSync('area')) : {}
				} catch (e) {
					return {}
				}
			},
			normalizeShopList(list) {
				if (Array.isArray(list)) return list
				if (!list) return []
				if (typeof list == 'string') {
					try {
						const parsed = JSON.parse(list)
						return Array.isArray(parsed) ? parsed : []
					} catch (e) {
						return []
					}
				}
				return typeof list == 'object' ? [list] : []
			},
			showComingSoon(title) {
				this.tui.toast(title + '即将开放')
			},
			setPendingCounts(counts) {
				this.workerCounts = Number(counts.workerCounts) || 0
				this.shopCounts = Number(counts.shopCounts) || 0
				this.$forceUpdate()
			},
			onRefresh() {
				this.refreshing = true
				Promise.resolve(this.init()).then(() => {
					this.refreshing = false
				}).catch(() => {
					this.refreshing = false
				})
			},
			init() {
				this.schoolShop = this.normalizeShopList(uni.getStorageSync('schoolShop'))
				this.worker = uni.getStorageSync('worker')
				let shopId = uni.getStorageSync('shopId')
				let worker = uni.getStorageSync('worker')
				this.workerCounts = 0
				this.shopCounts = 0
				if (worker) {
					this.workerCounts = Number(uni.getStorageSync('workerCounts')) || 0
				}
				if (shopId) {
					this.shopCounts = Number(uni.getStorageSync('shopCounts')) || 0
				}
				this.balance = '0.00'
				const refreshId = ++this.balanceRefreshId
				return this.tui.request("/worker/getAllDepo/", "GET", {
					userId: uni.getStorageSync('id')
				}, false, true).then((res) => {
					if (refreshId != this.balanceRefreshId) return
					if (res.code == 200) {
						let balance = 0
						if (res.result.user) {
							balance += Number(res.result.user.depoBal) || 0
						}
						if (res.result.worker) {
							balance += Number(res.result.worker.depoBal) || 0
							balance += Number(res.result.worker.depoBalRel) || 0
						}
						if (res.result.shop) {
							for (let i = 0; i < res.result.shop.length; i++) {
								balance += Number(res.result.shop[i].balance) || 0
							}
						}
						this.balance = balance.toFixed(2)
						this.$forceUpdate()
					} else {
						this.tui.toast(res.message)
					}
					uni.hideLoading()
				}).catch((res) => {
					uni.hideLoading()
				})
			},
			clickShop(item) {
				uni.setStorageSync('shopId', item.id)
				uni.setStorageSync('shopName', item.shopName)
				uni.setStorageSync('shopIcon', item.shopIcon)
				uni.setStorageSync('shopScore', item.shopScore)
				uni.setStorageSync('shopTakeaway', item.shopTakeaway)
				uni.setStorageSync('attrId', item.attrId)
				this.$refs.shopPopup.close()
				uni.navigateTo({
					url: '/package2/shop/merchantCenter'
				})
			},
			checkArea() {
				this.tui.request("/app/shopArea/getByParentId/0", "get", {}, false, false).then((res) => {
					if (res.code == 200) {
						this.areaList = res.result
						this.$refs.areaPopup.open()
					} else {
						this.tui.toast(res.message)
					}
				})
			},
			onClickArea(item) {
				uni.setStorageSync('area', JSON.stringify(item))
				this.tui.toast('切换成功')
				this.$refs.areaPopup.close()
			},
			navigatorTo(e, index) {
				let url = ""
				if (e == 'addgoods') {
					url = '/package2/myCenter/addGoods'
				} else if (e == 'merchantCenter') {
					this.schoolShop = this.normalizeShopList(this.schoolShop.length ? this.schoolShop : uni.getStorageSync('schoolShop'))
					if (this.schoolShop && this.schoolShop.length) {
						let shopItem = []
						const area = this.getArea()
						for (let aa = 0; aa < this.schoolShop.length; aa++) {
							if (!area.id || this.schoolShop[aa].regionId == area.id) {
								shopItem.push(this.schoolShop[aa])
							}
						}
						this.schoolShop = shopItem
						if (this.schoolShop.length > 1) {
							this.$refs.shopPopup.open()
							return
						} else if (this.schoolShop.length == 1) {
							uni.setStorageSync('shopId', this.schoolShop[0].id)
							uni.setStorageSync('attrId', this.schoolShop[0].attrId)
							uni.setStorageSync('shopName', this.schoolShop[0].shopName)
							uni.setStorageSync('shopIcon', this.schoolShop[0].shopIcon)
							uni.setStorageSync('shopScore', this.schoolShop[0].shopScore)
							uni.setStorageSync('shopTakeaway', this.schoolShop[0].shopTakeaway)
							url = '/package2/shop/merchantCenter'
						}
					} else {
						uni.showModal({
							title: '提示',
							content: '您还没有注册成为商家，要去注册吗？',
							cancelText: '暂时不了',
							confirmText: '去注册',
							success: function(res) {
								if (res.confirm) {
									uni.navigateTo({
										url: '/package2/shop/merchantRegister'
									})
								}
							}
						})
						return
					}
				} else if (e == 'dingdan') {
					url = '/package1/order/orderList'
				} else if (e == 'addType') {
					url = '/package2/myCenter/addType'
				} else if (e == 'qianbao') {
					url = '/package2/myCenter/wallet'
				} else if (e == 'youhui') {
					url = '/package2/myCenter/couponList'
				} else if (e == 'goodsList') {
					url = '/package2/myCenter/goodsList'
				} else if (e == 'merchant') {
					url = '/package2/shop/merchantRegister'
				} else if (e == 'tuichu') {
					uni.clearStorageSync()
					uni.reLaunch({
						url: '/package2/login/login'
					})
					return
				} else if (e == 'qiehuan') {
					this.checkArea()
					return
				} else if (e == 'address') {
					url = '/package2/myCenter/addressList'
				} else if (e == 'collect') {
					url = '/package2/myCenter/myCollect'
				} else if (e == 'evaluate') {
					this.showComingSoon('我的评价')
					return
				} else if (e == 'feedback') {
					this.showComingSoon('意见反馈')
					return
				} else if (e == 'blindBox') {
					this.showComingSoon('星球券')
					return
				} else if (e == 'fishRelease') {
					url = '/package1/tabbar/release'
				} else if (e == 'myPost') {
					url = '/package2/myCenter/myPost'
				} else if (e == 'idleTrad') {
					url = '/package2/IdleTrad/detail'
				} else if (e == 'agent') {
					this.showComingSoon('成为代理')
					return
				} else if (e == 'ie') {
					url = '/package1/ieBrowser/index'
				} else if (e == 'planet') {
					url = '/package1/planet/index'
				} else if (e == 'deliveryRank') {
					url = '/package2/shop/ranking'
				} else if (e == 'shopData') {
					url = '/package2/myCenter/dataStatistics'
				} else if (e == 'jianzhichaping') {
					let item = {
						shopScore: uni.getStorageSync('worker').score,
						id: uni.getStorageSync('worker').workerId
					}
					url = '/package2/group/shopEvaluate?item=' + JSON.stringify(item) + '&isMerchant=2&isCha=' + (index ==
						'cha' ? 1 : 0)
				} else if (e == 'partTimeReg') {
					let worker = uni.getStorageSync('worker')
					let that = this
					if (worker == undefined || worker == '' || worker == null) {
						const area = this.getArea()
						that.tui.request("/worker/admin/add", "POST", {
							userId: uni.getStorageSync('id'),
							isChangeArea: 1,
							region: area.id
						}, false, true).then((res) => {
							if (res.code == 200) {
								if (res.result != null) {
									uni.setStorageSync('worker', res.result)
								}
								this.$refs.jianzhiPopup.close()
								uni.navigateTo({
									url: '/package2/myCenter/partTimeJobRegister'
								})
							} else {
								that.tui.toast(res.message)
								return
							}
							uni.hideLoading()
						}).catch((res) => {})
						return
					} else {
						url = '/package2/myCenter/partTimeJobRegister'
						this.$refs.jianzhiPopup.close()
					}
				} else if (e == 'jianzhizhuce') {
					if (uni.getStorageSync('worker')) {
						url = '/package2/myCenter/partTimeJobRegister'
					} else {
						this.$refs.jianzhiPopup.open()
						return
					}
				} else if (e == 'jianzhizhuye') {
					url = '/package2/partTimeJob/partTimeJobCenter'
				}
				if (!url) return
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style>
	page {
		width: 100%;
		height: 100%;
		font-size: 28rpx;
		background: #F8FCFA;
	}

	.my-page {
		width: 100%;
		height: 100%;
		color: #202124;
		background:
			radial-gradient(circle at 8% 0%, rgba(52, 200, 160, .12) 0, rgba(52, 200, 160, 0) 320rpx),
			radial-gradient(circle at 94% 32%, rgba(255, 166, 61, .1) 0, rgba(255, 166, 61, 0) 360rpx),
			#F8FCFA;
	}

	.my-scroll {
		width: 100%;
		height: 100%;
	}

	.my-content {
		padding: 28rpx 32rpx 156rpx;
		box-sizing: border-box;
	}

	.fade-up {
		opacity: 0;
		transform: translateY(28rpx);
		animation: fadeUp .48s ease forwards;
	}

	.top-zone {
		position: relative;
		min-height: 156rpx;
	}

	.profile-row {
		display: flex;
		align-items: center;
		padding-right: 140rpx;
	}

	.avatar-card {
		position: relative;
		flex-shrink: 0;
		width: 104rpx;
		height: 104rpx;
		margin-right: 24rpx;
		border-radius: 32rpx;
		background: linear-gradient(145deg, #EAFBF4, #B7F3D5);
		box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
	}

	.avatar-face {
		width: 100%;
		height: 100%;
		color: #202124;
		font-size: 48rpx;
		font-weight: 900;
		line-height: 104rpx;
		text-align: center;
	}

	.level-chip,
	.identity-pill,
	.saved-badge,
	.task-btn,
	.identity-tag {
		border-radius: 999rpx;
	}

	.level-chip {
		position: absolute;
		right: -12rpx;
		bottom: 2rpx;
		height: 32rpx;
		padding: 0 12rpx;
		background: #FFF2D8;
		color: #9A5C11;
		font-size: 22rpx;
		font-weight: 900;
		line-height: 32rpx;
	}

	.profile-main {
		flex: 1;
		min-width: 0;
		text-align: left;
	}

	.name-row {
		display: flex;
		align-items: center;
	}

	.user-name {
		max-width: 230rpx;
		color: #202124;
		font-size: 36rpx;
		font-weight: 900;
		line-height: 48rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.verify-dot {
		width: 18rpx;
		height: 18rpx;
		margin-left: 12rpx;
		border-radius: 50%;
		background: #34C8A0;
		box-shadow: inset 0 0 0 4rpx rgba(255, 255, 255, .68);
	}

	.school-row {
		margin-top: 4rpx;
		color: #70757A;
		font-size: 22rpx;
		line-height: 30rpx;
	}

	.identity-pill {
		display: inline-flex;
		height: 36rpx;
		margin-top: 10rpx;
		padding: 0 16rpx;
		align-items: center;
		background: rgba(52, 200, 160, .12);
		color: #34C8A0;
		font-size: 22rpx;
		font-weight: 900;
	}

	.top-actions {
		position: absolute;
		right: 0;
		top: 4rpx;
		display: flex;
		gap: 16rpx;
	}

	.icon-btn {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 56rpx;
		height: 56rpx;
		border-radius: 50%;
		background: rgba(255, 255, 255, .72);
		box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
		transition: transform .16s ease;
	}

	.line-gear,
	.line-message {
		width: 26rpx;
		height: 26rpx;
		border-radius: 50%;
		box-shadow: inset 0 0 0 4rpx #202124;
	}

	.line-message {
		border-radius: 12rpx;
		box-shadow: inset 0 0 0 4rpx #202124;
	}

	.notice-dot {
		position: absolute;
		right: 6rpx;
		top: 4rpx;
		width: 14rpx;
		height: 14rpx;
		border-radius: 50%;
		background: #FF6464;
	}

	.ticket-card {
		position: absolute;
		right: 0;
		bottom: 0;
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 166rpx;
		height: 82rpx;
		padding: 14rpx 16rpx;
		border-radius: 24rpx;
		background: rgba(255, 255, 255, .72);
		box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
		box-sizing: border-box;
		transition: transform .16s ease;
	}

	.ticket-label {
		color: #34C8A0;
		font-size: 22rpx;
		font-weight: 900;
		line-height: 26rpx;
	}

	.ticket-value {
		margin-top: 4rpx;
		color: #202124;
		font-size: 28rpx;
		font-weight: 900;
		line-height: 32rpx;
	}

	.ticket-icon {
		width: 42rpx;
		height: 42rpx;
	}

	.saving-hero,
	.section-card,
	.quick-card,
	.logout-btn,
	.shop-content,
	.popup-area-content {
		margin-top: 28rpx;
		border-radius: 32rpx;
		box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
		box-sizing: border-box;
	}

	.saving-hero {
		position: relative;
		height: 260rpx;
		padding: 24rpx;
		overflow: hidden;
		background: linear-gradient(135deg, rgba(227, 255, 243, .96), rgba(244, 255, 250, .88) 48%, rgba(255, 244, 224, .8));
		transition: transform .16s ease;
	}

	.saving-bg {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		z-index: 0;
	}

	.saved-badge {
		position: relative;
		z-index: 2;
		display: inline-flex;
		height: 44rpx;
		padding: 0 18rpx;
		align-items: center;
		background: rgba(255, 255, 255, .72);
		color: #202124;
		font-size: 22rpx;
		font-weight: 900;
	}

	.saved-main {
		position: relative;
		z-index: 2;
		margin-top: 8rpx;
		text-align: left;
	}

	.saved-money {
		color: #10231E;
		font-size: 96rpx;
		font-weight: 900;
		line-height: 104rpx;
		letter-spacing: -4rpx;
	}

	.saved-desc,
	.saved-week {
		color: #34C8A0;
		font-size: 22rpx;
		font-weight: 900;
		line-height: 30rpx;
	}

	.saved-week {
		margin-top: 4rpx;
		color: #70757A;
	}

	.section-card {
		padding: 24rpx;
		background: rgba(255, 255, 255, .76);
	}

	.section-head {
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		gap: 24rpx;
		margin-bottom: 24rpx;
	}

	.section-title {
		display: flex;
		align-items: center;
		color: #202124;
		font-size: 36rpx;
		font-weight: 900;
		line-height: 48rpx;
		text-align: left;
	}

	.title-icon {
		width: 44rpx;
		height: 44rpx;
		margin-right: 12rpx;
	}

	.section-desc {
		margin-top: 4rpx;
		color: #70757A;
		font-size: 22rpx;
		line-height: 30rpx;
		text-align: left;
	}

	.text-link {
		flex-shrink: 0;
		color: #34C8A0;
		font-size: 22rpx;
		font-weight: 900;
		line-height: 36rpx;
	}

	.task-row {
		display: flex;
		gap: 16rpx;
	}

	.task-card {
		flex: 1;
		min-width: 0;
		height: 210rpx;
		padding: 18rpx 10rpx 12rpx;
		border-radius: 24rpx;
		box-sizing: border-box;
		text-align: center;
		transition: transform .16s ease;
	}

	.task-card--group {
		background: linear-gradient(180deg, #E5FFF3, #C9F5DC);
	}

	.task-card--cash {
		background: linear-gradient(180deg, #FFF0E1, #FFE0C4);
	}

	.task-card--school {
		background: linear-gradient(180deg, #EAF6FF, #D8ECFF);
	}

	.task-card--wallet {
		background: linear-gradient(180deg, #FFF2D8, #FFE4B8);
	}

	.task-title {
		color: #202124;
		font-size: 28rpx;
		font-weight: 900;
		line-height: 36rpx;
		white-space: nowrap;
	}

	.task-sub {
		margin-top: 4rpx;
		color: #FFA63D;
		font-size: 22rpx;
		font-weight: 900;
		line-height: 28rpx;
		white-space: nowrap;
	}

	.task-visual {
		display: flex;
		justify-content: center;
		margin-top: 14rpx;
	}

	.task-asset,
	.identity-icon,
	.quick-icon,
	.life-asset {
		display: block;
	}

	.task-asset {
		width: 74rpx;
		height: 74rpx;
	}

	.task-btn {
		height: 44rpx;
		margin: 12rpx auto 0;
		padding: 0 14rpx;
		background: #34C8A0;
		color: #FFFFFF;
		font-size: 22rpx;
		font-weight: 900;
		line-height: 44rpx;
	}

	.task-card--cash .task-btn,
	.task-card--wallet .task-btn {
		background: #FFA63D;
	}

	.identity-row {
		display: flex;
		gap: 16rpx;
	}

	.identity-card {
		position: relative;
		flex: 1;
		min-width: 0;
		height: 172rpx;
		padding: 18rpx 14rpx;
		border-radius: 24rpx;
		box-sizing: border-box;
		overflow: hidden;
		transition: transform .16s ease;
	}

	.identity-card--user {
		background: linear-gradient(145deg, #E5FFF3, #F5FFFA);
	}

	.identity-card--delivery {
		background: linear-gradient(145deg, #EAF6FF, #F5FFFA);
	}

	.identity-card--shop {
		background: linear-gradient(145deg, #FFF0E1, #FFF9F0);
	}

	.identity-tag {
		position: absolute;
		right: 12rpx;
		top: 10rpx;
		height: 32rpx;
		padding: 0 12rpx;
		background: rgba(52, 200, 160, .16);
		color: #34C8A0;
		font-size: 22rpx;
		font-weight: 900;
		line-height: 32rpx;
	}

	.identity-icon {
		width: 58rpx;
		height: 58rpx;
	}

	.identity-title {
		margin-top: 12rpx;
		color: #202124;
		font-size: 28rpx;
		font-weight: 900;
		line-height: 36rpx;
		text-align: left;
		white-space: nowrap;
	}

	.identity-desc {
		margin-top: 4rpx;
		color: #70757A;
		font-size: 22rpx;
		line-height: 28rpx;
		text-align: left;
		white-space: nowrap;
	}

	.identity-go {
		position: absolute;
		right: 14rpx;
		bottom: 14rpx;
		width: 42rpx;
		height: 42rpx;
		border-radius: 50%;
		background: rgba(255, 255, 255, .74);
		color: #34C8A0;
		font-size: 36rpx;
		line-height: 38rpx;
		text-align: center;
	}

	.quick-card {
		display: flex;
		justify-content: space-between;
		padding: 24rpx 18rpx;
		background: rgba(255, 255, 255, .76);
	}

	.quick-item {
		flex: 1;
		min-width: 0;
		text-align: center;
		transition: transform .16s ease;
	}

	.quick-icon {
		width: 64rpx;
		height: 64rpx;
		margin: 0 auto 10rpx;
	}

	.quick-title {
		color: #202124;
		font-size: 22rpx;
		font-weight: 900;
		line-height: 28rpx;
		white-space: nowrap;
	}

	.quick-tip {
		margin-top: 2rpx;
		color: #70757A;
		font-size: 22rpx;
		line-height: 28rpx;
		white-space: nowrap;
		transform: scale(.86);
	}

	.life-grid {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 16rpx;
	}

	.life-card {
		height: 154rpx;
		padding: 18rpx;
		border-radius: 24rpx;
		box-sizing: border-box;
		transition: transform .16s ease;
	}

	.life-card--ie,
	.life-card--fish {
		background: linear-gradient(145deg, #E5FFF3, #F5FFFA);
	}

	.life-card--secret {
		background: linear-gradient(145deg, #EAF6FF, #F5FFFA);
	}

	.life-card--agent {
		background: linear-gradient(145deg, #FFF0E1, #FFF9F0);
	}

	.life-title {
		color: #202124;
		font-size: 28rpx;
		font-weight: 900;
		line-height: 36rpx;
		text-align: left;
	}

	.life-desc {
		margin-top: 4rpx;
		color: #70757A;
		font-size: 22rpx;
		line-height: 28rpx;
		text-align: left;
		white-space: nowrap;
	}

	.life-visual {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 14rpx;
	}

	.life-asset {
		width: 78rpx;
		height: 58rpx;
	}

	.life-go {
		width: 38rpx;
		height: 38rpx;
		border-radius: 50%;
		background: rgba(255, 255, 255, .78);
		color: #34C8A0;
		font-size: 32rpx;
		line-height: 34rpx;
		text-align: center;
	}

	.logout-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 72rpx;
		background: rgba(255, 255, 255, .78);
		color: #FF6464;
		font-size: 28rpx;
		font-weight: 900;
		line-height: 72rpx;
		transition: transform .16s ease;
	}

	.logout-power {
		position: relative;
		width: 26rpx;
		height: 26rpx;
		margin-right: 12rpx;
		border-radius: 50%;
		box-shadow: inset 0 0 0 4rpx #FF6464;
	}

	.logout-power:before {
		content: '';
		position: absolute;
		left: 11rpx;
		top: -4rpx;
		width: 4rpx;
		height: 16rpx;
		border-radius: 999rpx;
		background: #FF6464;
	}

	.tap-soft,
	.logout-active {
		transform: scale(.98);
	}

	.jianzhi-content {
		width: 300px;
		height: 350px;
		position: relative;
	}

	.shop-content,
	.popup-area-content {
		width: 600rpx;
		padding: 24rpx;
		background: rgba(255, 255, 255, .92);
	}

	.popup-pay-title,
	.popup-area-title {
		margin-bottom: 24rpx;
		color: #202124;
		font-size: 36rpx;
		font-weight: 900;
		text-align: left;
	}

	.popup-list,
	.popup-area-container {
		min-height: 88rpx;
		margin-top: 16rpx;
		padding: 0 24rpx;
		border-radius: 24rpx;
		background: #F8FCFA;
		color: #202124;
		font-size: 28rpx;
		font-weight: 900;
		line-height: 88rpx;
		text-align: left;
		box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
		box-sizing: border-box;
	}

	@keyframes fadeUp {
		from {
			opacity: 0;
			transform: translateY(28rpx);
		}

		to {
			opacity: 1;
			transform: translateY(0);
		}
	}

	@keyframes moneyRoll {
		0% {
			opacity: 0;
			transform: translateY(24rpx) scale(.96);
		}

		70% {
			opacity: 1;
			transform: translateY(-4rpx) scale(1.02);
		}

		100% {
			opacity: 1;
			transform: translateY(0) scale(1);
		}
	}
</style>
