<template>
	<!-- 拼团单一商家 -->
	<page-meta :page-style="popupPageStyle"></page-meta>
	<view class="page1" :class="{'store-group-page': isStoreGroupOrder}">
		<!-- 固定顶部导航栏（悬浮在背景图之上） -->
		<view class="nav-bar" :class="{'nav-bar--popup-open': bottomPopupOpenCount > 0}"
			:style="{'padding-top': menuButtonInfo.top +'px','background': navBarBackground}">
			<view class="back-btn" @tap="back">
				<uni-icons type="left" size="28"></uni-icons>
			</view>
			<view class="title-search">
				<uni-icons type="search" size="18" style="margin: 9rpx;"></uni-icons>
				<input type="text" v-model="searchForm.productName" placeholder="搜索" confirm-type="search"
					@confirm="onSearchConfirm" @input="onSearchInput" />
			</view>
		</view>
		<!-- 背景头图（随页面滚动） -->
		<view class="title">
			<view class="hero-spark spark-a"></view>
			<view class="hero-spark spark-b"></view>
			<view class="hero-spark spark-c"></view>
		</view>
		<view class="content">
			<view class="pintuan shop-card group-hero-card">
				<view class="group-card-glow"></view>
				<!-- <view class="shop-rally-badge">
					<text>有件事你知道吗？</text>
					<text class="shop-rally-dot"></text>
					<text>拼团和期末不挂科一样重要！</text>
				</view> -->
				<view class="shop-top">
					<view class="shop-img">
						<img :src="shopItem.shopIcon" alt="">
						<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6c4ab92a43c842d8bb22035bce1f65cc.png"
							alt=""
							style="width:30rpx;height:30rpx;position: absolute;top: 0;left: 0;background-size: 100%;" />
					</view>
					<view class="shop-content" @tap="goDetail('shopDetail')">
						<view class="shop-name">
							{{shopItem.shopName}}
						</view>
						<view class="shop-subtitle">
							{{isStoreGroupOrder ? '到店核销，约上同学一起拼更划算' : '约上室友同学一起拼，越快成团越快开吃'}}
						</view>
						<view class="shop-content-center">
							<view class="shop-rate">
								<view class="shop-rate-num">{{shopItem.shopScore ? shopItem.shopScore : 5}}</view>
								<view>
									<uni-rate :disabled="true" size="20" disabledColor="rgba(255, 184, 84, 1)"
										:value="shopItem.shopScore ? shopItem.shopScore : 5" />
								</view>
							</view>
							<view class="shop-tag">
								<text
									style="padding: 4rpx 10rpx;background: rgba(223, 255, 176, 1);color: #777;border-radius: 6rpx;">
									{{shopItem.shopTypeTitle}}
								</text>
							</view>
						</view>
						<view class="shop-content-bottom">
							<view class="shop-action-list">
								<view class="shop-action-btn" @tap.stop="goDetail('openKitchen')">
									明厨亮灶
								</view>
								<view class="shop-action-btn" @tap.stop="goDetail('shopDetail')">
									商家资质
								</view>
								<view class="shop-action-btn" @tap.stop="goDetail('shopEvaluate')">
									店铺评价
								</view>
							</view>
							<view class="shop-deal1">
								销量 <text> {{shopItem.saleCount != null ? shopItem.saleCount : 0}}</text>
							</view>
						</view>
					</view>
				</view>
				<view class="shop-bottom">
					<text class="notice-label">公告</text>
					<text>{{shopItem.remark}}</text>
				</view>
			</view>

			<view class="pintuan group-live-card" :class="{'group-live-card-empty': orderListWait.length === 0}"
				style="padding: 0;margin-top:20rpx;display: flex;" @tap="openOrderWait('')">
				<view class="live-card-header">
					<view class="live-title-wrap">
						<image class="live-title-gif" src="/static/images/img/loading.gif" mode="aspectFit"></image>
						<view class="live-title">你知道吗？拼团和期末不挂科一样重要！</view>
					</view>
					<view class="live-pill" v-if="orderListWait.length > 0">去凑团</view>
				</view>
				<swiper v-if="orderListWait.length > 0" class="zaixian-swiper" vertical circular
					:autoplay="orderListWait.length > 0" :interval="onlineWorkerInterval"
					:duration="onlineWorkerDuration">
					<swiper-item v-for="(item,index) in orderListWait" :key="index">
						<view class="live-swiper-item">
							<view class="pintuan-left">
								<view class="pintuan-left-img">
									<img :src="item.productPicture" alt="">
								</view>
								<view class="pintuan-left-box">
									<view class="pintuan-left-name">
										{{item.productName}}
									</view>
									<view class="pintuan-left-price">
										拼团<text style="color: red;">￥{{item.groupPrice}}</text>
									</view>
								</view>
							</view>
							<view class="pintuan-right">
								<view class="pintuan-right-img">
									<img src="/static/images/img/songshu.png" alt="" />
									<view class="weipincheng">+</view>
								</view>
								<view class="pintuan-right-cha">
									差<text class="missing-count">{{item.targetMembers - item.currentMembers}}人</text>拼成
								</view>
							</view>
						</view>
					</swiper-item>
				</swiper>
			</view>
			<!-- 整页 page-scroll：左侧分类条 sticky 吸顶，右侧商品跟随页面滚动 -->
			<view class="catalog-row" id="catalog-row">
				<view class="catalog-menu-wrap" :style="{ top: navBarHeight + 'px' }">
					<scroll-view scroll-y id="menuList" class="menu-scroll"
						:style="{ height: stickyInnerHeight + 'px' }">
						<view class="menu1" @tap="checkTab(index)" v-for="(item,index) in menuList" :key="index"
							:style="{'border-top-right-radius':item.checked?'20rpx':'','border-bottom-right-radius':item.checked?'20rpx':'','color':item.checked ? (isStoreGroupOrder ? '#f0642f' : 'rgba(0, 35, 28, 1)') : (isStoreGroupOrder ? '#9b6a4c' : '#777'),'background':item.checked ? (isStoreGroupOrder ? 'linear-gradient(90deg, #fff4e8, #fff)' : '#fff') : ''}">
							<!-- <image class="menu-active-dot" v-if="item.checked" src="/static/images/img/loading.gif"
								mode="aspectFit"></image> -->
							<view style="width: 160rpx;">{{item.categoryName}}</view>
						</view>
					</scroll-view>
				</view>
				<view class="catalog-goods">
					<view class="goods-member goods-card" :id="'category-' + item.categoryId"
						v-for="(item,index) in productItem" :key="index" @tap="openGoodsDetail(item)">
						<view class="goods-card-shine"></view>
						<view @tap.stop="buyingye" v-if="item.status == 1"
							style="width: 100%;height:100%;position: absolute;top: 0;background: rgba(0, 0, 0, 0.1);z-index: 999;border-radius: 20rpx;">
						</view>
						<view class="goods-top">

							<view class="goods-img">
								<img :src="item.productPicture" alt="" style="border-radius: 20rpx;">
								<view class="group-corner-badge" v-if="item.isMoreBuy != 1">可拼团</view>
							</view>
							<view class="goods-content">
								<view class="goods-name">
									{{item.productName}}
								</view>
								<view class="goods-vibe"  v-if="item.isMoreBuy != 1">
									<text class="goods-vibe-tag">拼团价更香</text>
									<text class="goods-vibe-copy">约人一起下单</text>
								</view>
								<view class="goods-content-center">
									<view class="goods-deal1">
										销量 <text> {{item.tailWarn != null ? item.tailWarn : 0}}</text>
									</view>
									<view
										style="width: 40%;text-align: right;font-size: 14px;color: #777;font-weight: 700;text-decoration: line-through;"
										v-if="groupId && item.isMoreBuy != 0">
										¥{{item.attributeListPrice | sliceMsg}}
									</view>
								</view>
								<view class="shop-tag1">
									<view class="goods-tag" @tap.stop="openOrderWait(item)"
										v-if="item.orderListWait != undefined && item.orderListWait.length > 0">
										<view class="pintuan-right-img">
											<img src="/static/images/img/songshu.png" alt="" />
											<view class="weipincheng">+</view>
										</view>
										<view class="pintuan-right-cha">
											差<text style="color: red;">{{item.minGroupCount}}人</text>拼成
										</view>
									</view>
								</view>
							</view>
						</view>
						<view class="goods-bottom">

							<view v-if="item.productGroupBuyPrices != null && item.isMoreBuy != 1"
								class="goods-btn group-buy-btn" style="margin-left: 6%;"
								:style="{'float':groupId != ''?'right':''}" @tap.stop="openPopup('xiadan','pintuan',item)">
								<view class="btn-spark">
									<view class="spark-dot spark-dot-1"></view>
									<view class="spark-dot spark-dot-2"></view>
									<view class="spark-dot spark-dot-3"></view>
								</view>
								<text>拼团购买¥{{ getGroupPrice(item) }}</text>
							</view>
							<view class="goods-btn solo-buy-btn" v-if="!groupId" @tap.stop="openPopup('xiadan','dandu',item)"
								style="background: rgba(166, 255, 234, 0.3);border: 1px solid rgba(166, 255, 234, 0.5);height:68rpx;">
								直接购买¥{{item.attributeListPrice | sliceMsg}}
							</view>
						</view>
					</view>
					<uni-load-more :status="loadStatus" @change="onChange" />
					<view style="width: 100%;height: 160rpx;"></view>
				</view>
			</view>
		</view>
		<view style="width: 100%;height: 160rpx;"></view>
		<view class="bottom checkout-bar">
			<view class="bottom-left">
				<view class="cart-bag-wrap" style="position: relative;width: 60rpx;height: 80rpx;margin-top: 20rpx;"
					@tap="openPopup('car','','')">
					<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/60db52398a65459e9541881c926986a4.png"
						alt="" />
					<view class="bottom-dot" v-if="cartTotalCount > 0">{{cartTotalCount}}</view>
				</view>
				<view class="bottom-price">
					<view class="bottom-price-label">已选合计</view>
					<view>￥{{cartTotalPayPrice}}</view>
					<view class="package-fee-tip" v-if="cartTotalPackageFeeNumber > 0">
						含餐盒费￥{{cartTotalPackageFee}}
					</view>
				</view>
			</view>
			<view class="bottom-right checkout-btn" @tap="submitCartCheckout">
				<view class="checkout-text-btn" :class="{'store-checkout-btn': isStoreGroupOrder}">
					<text>去下单</text>
					<view class="checkout-text-shine"></view>
				</view>
			</view>
		</view>


		<!-- 购物车弹窗 -->
		<uni-popup ref="carPopup" background-color="#fff" @change="onBottomPopupChange">
			<view class="car-content">
				<view class="car-close" @tap="$refs.carPopup.close()">
					<uni-icons type="close" size="30" color="#fff"></uni-icons>
				</view>
				<view class="car-title">
					已加购商品（{{cartTotalCount}}）
				</view>

				<scroll-view scroll-y style="max-height: 400rpx;">
					<view class="goods-top" style="padding: 20rpx 0;" v-for="(cartItem, index) in cartItems"
						:key="index">
						<view class="goods-img" style="width: 168rpx;height: 168rpx;">
							<img :src="cartItem.item.productPicture" alt=""
								style="border-radius: 20rpx;width:100%;height:100%;">
						</view>
						<view class="goods-content" style="padding-left: 20rpx;">
							<view class="goods-name">
								{{cartItem.item.productName}}
							</view>
							<view class="goods-content-center">
								<view class="goods-deal1" v-if="cartItem.specs">
									<text style="color: #999; font-size: 20rpx;">
										已选规格:{{getSpecDisplayString(cartItem.specs)}}
									</text>
								</view>
							</view>
							<view class="goods-content-bottom" style="margin-top: 10rpx;">
								<view
									class="cart-item-price">
									￥{{cartItem.price}}
									<text class="package-fee-pill" v-if="getPackageFee(cartItem.item) > 0">
										餐盒费￥{{formatMoney(getPackageFee(cartItem.item))}}
									</text>
								</view>
								<view class="goods-num">
									<view class="num-plus" style="background: #999;color: #fff;"
										@tap="adjustCart(cartItem.cartId, -1)">
										-
									</view>
									<view class="num">
										{{cartItem.quantity}}
									</view>
									<view class="num-plus" @tap="adjustCart(cartItem.cartId, 1)">
										+
									</view>
								</view>
							</view>
						</view>
					</view>
				</scroll-view>

				<view style="width: 100%;height: 160rpx;"></view>
				<view class="bottom" style="padding-bottom: 20rpx;">
					<view class="bottom-left">
						<view style="width: 60rpx;height: 80rpx;margin-top: 10rpx;" @tap="$refs.carPopup.close()">
							<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/60db52398a65459e9541881c926986a4.png"
								alt="" />
						</view>
						<view class="bottom-price" style="line-height: 48rpx;">
							<view>￥{{cartTotalPayPrice}}</view>
							<view class="package-fee-tip" v-if="cartTotalPackageFeeNumber > 0">
								含餐盒费￥{{cartTotalPackageFee}}
							</view>
						</view>
					</view>
					<view class="bottom-right" @tap="submitCartCheckout">
						<view class="checkout-text-btn" :class="{'store-checkout-btn': isStoreGroupOrder}">
							<text>去下单</text>
							<view class="checkout-text-shine"></view>
						</view>
					</view>
				</view>
			</view>
		</uni-popup>

		<!-- 未选商品提示弹窗 -->
		<uni-popup ref="selectGoodsPopup" background-color="transparent">
			<view class="select-goods-popup" @tap.stop>
				<view class="select-goods-close" @tap="$refs.selectGoodsPopup.close()">
					<uni-icons type="closeempty" size="22" color="#6f7f79"></uni-icons>
				</view>
				<view class="select-goods-decor decor-left"></view>
				<view class="select-goods-decor decor-right"></view>
				<view class="select-goods-icon">
					<uni-icons type="cart" size="38" color="#20cda8"></uni-icons>
				</view>
				<view class="select-goods-title">温馨提示~</view>
				<view class="select-goods-text">请先选择商品后再下单</view>
				<view class="select-goods-btn" @tap="$refs.selectGoodsPopup.close()">我知道了</view>
			</view>
		</uni-popup>
		<!-- 商品详情弹窗 -->
		<uni-popup ref="goodsDetailPopup" background-color="#fff" @change="onBottomPopupChange">
			<view class="car-content goods-detail-popup">
				<view class="car-close" @tap="$refs.goodsDetailPopup.close()">
					<uni-icons type="close" size="30" color="#fff"></uni-icons>
				</view>
				<view class="detail-popup-title">商品详情</view>
				<scroll-view scroll-y style="max-height: 68vh;">
					<view class="detail-cover" v-if="detailItem.productPicture">
						<image class="detail-cover-img" :src="detailItem.productPicture" mode="widthFix"></image>
					</view>
					<view class="detail-info">
						<view class="detail-name">{{detailItem.productName || ''}}</view>
						<view class="detail-meta">
							<view class="detail-price">￥{{formatMoney(getAttributePrice(detailItem))}}</view>
							<view class="detail-group-price" v-if="getDetailGroupPrice(detailItem)">
								拼团￥{{getDetailGroupPrice(detailItem)}}
							</view>
							<view class="detail-sale">销量 {{detailItem.tailWarn != null ? detailItem.tailWarn : 0}}</view>
						</view>
						<view class="detail-fee" v-if="getPackageFee(detailItem) > 0">
							餐盒费 ￥{{formatMoney(getPackageFee(detailItem))}}
						</view>
					</view>
					<view class="detail-section">
						<view class="detail-section-title">商品详情</view>
						<view class="detail-rich" v-if="getProductIntro(detailItem)">
							<rich-text :nodes="getProductIntro(detailItem)"></rich-text>
						</view>
						<view class="detail-empty" v-else>暂无商品详情</view>
					</view>
					<view style="height: 36rpx;"></view>
				</scroll-view>
			</view>
		</uni-popup>
		<!-- 拼团和选规格弹窗 -->
		<uni-popup ref="pintuanPopup" background-color="#fff" @change="onBottomPopupChange">
			<view class="car-content group-order-popup">
				<view class="car-close" @tap="$refs.pintuanPopup.close()">
					<uni-icons type="close" size="30" color="#fff"></uni-icons>
				</view>
				<view class="popup-rally-title" v-if="isPintuan">
					<view class="popup-rally-main">{{isStoreGroupOrder ? '到店团购搭子哪里找-同校同学一起省！' : '拼团搭子哪里找-隔壁宿舍全是宝！'}}
					</view>
				</view>
				<view class="goods-top popup-product-card">
					<view class="goods-img">
						<img :src="currentItem.productPicture" alt="" style="border-radius: 20rpx;">
						<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6c4ab92a43c842d8bb22035bce1f65cc.png"
							alt=""
							style="width:30rpx;height:30rpx;position: absolute;top: 0;left: 0;background-size: 100%;" />
					</view>
					<view class="goods-content">
						<view class="goods-name">
							{{currentItem.productName}}
						</view>
						<view class="goods-content-center">
							<view class="goods-deal1">
								月售 <text> 100+</text>
							</view>
						</view>
						<view class="goods-content-bottom">
							<view class="popup-origin-price"
								style="font-size: 28rpx;line-height: 54rpx;margin-right: 20rpx;">
								<text v-if="isPintuan">
									￥{{selectedGroupRule.groupPrice}}
								</text>
								<text v-if="!isPintuan">
									￥{{currentItem.attributeListPrice | sliceMsg}}
								</text>
								<text class="package-fee-pill popup-package-fee" v-if="currentPackageFeeNumber > 0">
									餐盒费￥{{currentPackageFee}}
								</text>
							</view>
						</view>
					</view>
				</view>
				<scroll-view scroll-y style="max-height: 50vh;">
					<view class="goods-spec" v-if="parsedSpecs.length > 0">
						<view class="spec1" v-for="(spec, sIndex) in parsedSpecs" :key="sIndex">
							<view class="spec11">
								选{{spec.name}}（可选{{spec.canbuy}}个）
							</view>
							<view class="spec22">
								<view :class="spec.selected.indexOf(option) !== -1 ? 'spec-check' : 'spec222'"
									v-for="(option, oIndex) in spec.options" :key="oIndex"
									@tap="selectSpec(sIndex, option)">
									{{option}}
								</view>
							</view>
						</view>
					</view>
					<template
						v-if="(groupId == null || groupId == '') && isPintuan && currentItem.productGroupBuyPrices && currentItem.productGroupBuyPrices.length > 0">
						<view class="spec11">
							成团选择
						</view>
						<view class="goods-team">
							<view
								:class="selectedGroupRule && selectedGroupRule.groupCount === rule.groupCount ? 'team-check team-rule-card' : 'team1 team-rule-card'"
								v-for="(rule, rIndex) in currentItem.productGroupBuyPrices" :key="rIndex"
								@tap="selectGroupRule(rule)">
								<view class="team11" style="margin-top: 0;">
									￥{{parseFloat(rule.groupPrice).toFixed(2)}}
								</view>
								<view class="team11">
									{{rule.groupCount}}人团
								</view>
							</view>
						</view>
					</template>
					<view class="spec11" v-if="moreBuyList.length > 0 && isPintuan" style="display: flex;">
						<view style="flex: 1;">
							搭配小食
						</view>
						<view style="padding-top: 10rpx;">
							<view class="goods-num">
								<view class="num-plus" style="background: #999;color: #fff;"
									@tap="changeValue('minus')">
									-
								</view>
								<view class="num">
									{{vModelValue}}
								</view>
								<view class="num-plus" @tap="changeValue('plus')">
									+
								</view>
							</view>
						</view>

					</view>
					<view class="goods-team" v-if="moreBuyList.length > 0 && isPintuan" style="height: 300rpx;">
						<view :class="spec.isChecked ? 'team-check1' : 'team2'" v-for="(spec, sIndex) in moreBuyList"
							:key="sIndex" @tap="selectMoreBuy(spec,sIndex)">
							<view>
								<img :src="spec.productPicture" alt=""
									style="width: 70px;height: 70px;background-size: 100%;border-radius: 10px;">
							</view>
							<view class="team11" style="margin-top:10rpx;">
								￥{{spec.attributeListPrice | sliceMsg}}
							</view>
							<view class="team11" style="margin-top:10rpx;">
								{{spec.productName}}
							</view>
							<view class="jiaobiao" v-if="spec.quantity>0">
								{{spec.quantity ? spec.quantity : ''}}
							</view>
						</view>
					</view>
					<view style="width: 100%;height: 160rpx;"></view>
				</scroll-view>
				<view class="bottom popup-bottom-bar" style="padding-bottom: 40rpx;height: 160rpx;z-index: 10;">
					<view v-if="isPintuan" class="pintuan1">
						<template v-if="!groupId">
							<view class="pintuan2 group-face-btn" @tap.stop="submitPintuan(true)">
								<uni-icons type="help" size="20" @tap.stop="openMianRemark"></uni-icons>
								<text class="group-face-text">面对面团</text>
							</view>
							<view class="pintuan2 group-submit-btn" @tap.stop="submitPintuan(false)">
								{{isStoreGroupOrder ? '发起到店团' : '发起拼团'}}￥{{selectedGroupRule && selectedGroupRule.groupPrice ? parseFloat(selectedGroupRule.groupPriceAndMore).toFixed(2) : '0.00'}}
							</view>
						</template>
						<template v-else>
							<view class="pintuan2" style="width: 100%; border-radius: 100rpx;"
								@tap.stop="submitPintuan(false)">
								{{isStoreGroupOrder ? '参与到店团' : '参与拼团'}}￥{{selectedGroupRule && selectedGroupRule.groupPriceAndMore ? parseFloat(selectedGroupRule.groupPriceAndMore).toFixed(2) : '0.00'}}
							</view>
						</template>
					</view>
					<view v-else class="pintuan0" @tap="submitAddToCart">
						加入购物车
					</view>
				</view>
			</view>
		</uni-popup>
		<!-- 拼团和选规格弹窗 -->
		<uni-popup ref="pintuanGroupPopup" background-color="#fff" @change="onBottomPopupChange">
			<view class="car-content join-team-popup">
				<view class="car-close" @tap="$refs.pintuanGroupPopup.close()">
					<uni-icons type="close" size="30" color="#fff"></uni-icons>
				</view>
				<view class="join-popup-title" style="font-size: 28rpx;font-weight: 700;">
					<view class="join-popup-main">快来加入拼团吧！</view>
					<view class="join-popup-sub">选一支快成团的队伍，马上省</view>
				</view>
				<scroll-view scroll-y style="max-height: 50vh;">
					<template>
						<!-- 占位假数据展示 -->
						<view class="">
							<view class="goods-center team-wait-card" v-for="(item, index) in orderListWait"
								:key="index">
								<view class="list-right">
									<view class="list-right-img">
										<img src="/static/images/img/songshu.png" alt="" />
										<view class="list-weipincheng">+</view>
									</view>
									<view class="list-right-cha">
										<view class="cha11">
											{{item.targetMembers}}人拼
										</view>
										<view style="line-height: 40rpx;padding-left: 10rpx;">
											差<text
												class="missing-count">{{item.targetMembers - item.currentMembers}}人</text>拼成
										</view>
									</view>
								</view>
								<view class="list-btn" @tap.stop="chooseOrderWait(item)">
									去拼单
								</view>
							</view>
						</view>
					</template>
					<view style="width: 100%;height: 160rpx;"></view>
				</scroll-view>
			</view>
		</uni-popup>

		<!-- 支付弹出层 -->
		<uni-popup ref="payPopup" background-color="#fff" @change="onPayPopupChange">
			<view class="pay-popup">
				<view class="content pay-popup-content">
					<view class="box1 pay-summary-card">
						<view class="pay-countdown">
							支付剩余时间 <uni-countdown :show-day="false" :hour="00" :minute="59" :second="59" />
						</view>
						<view class="pay-amount">
							￥<text>{{formatMoney(getPayTotalAmount())}}</text>
						</view>
						<view class="minimum-pay-tip" v-if="isMinimumPayAmount">
							最低需支付0.01元
						</view>
						<view class="pay-fee-list">
							<view class="pay-fee-row">
								<text>商品金额</text>
								<text>￥{{formatMoney(getPayGoodsAmount())}}</text>
							</view>
							<view class="pay-fee-row" v-if="groupdeliveryType == 1 && getPayPackageFee() > 0">
								<text>餐盒费</text>
								<text>￥{{formatMoney(getPayPackageFee())}}</text>
							</view>
							<view class="pay-fee-row" v-if="groupId != '' && isFaceToFaceGroup && groupdeliveryType == 1">
								<text>配送费(均摊)</text>
								<text>￥{{formatMoney(getPayDeliveryFee())}}</text>
							</view>
							<view class="pay-fee-row pay-coupon-entry" @tap="openCouponPopup">
								<text>优惠券</text>
								<view class="pay-coupon-value">
									<text v-if="selectedCoupon">-￥{{formatMoney(getCouponDiscount(selectedCoupon))}}</text>
									<text v-else-if="availableCoupons.length > 0">有 {{availableCoupons.length}} 张可用</text>
									<text v-else>无可用券</text>
									<uni-icons type="right" size="14" color="#9aa6a2"></uni-icons>
								</view>
							</view>
						</view>
						<view class="pay-refund-tip" v-if="isStoreGroupOrder">
							若24小时内拼团失败，将会为您自动退款
						</view>
						<view class="pay-refund-tip" v-if="!isStoreGroupOrder">
							若1小时内拼团失败，将会为您自动退款
						</view>
					</view>
					<view class="box1 pay-more-buy-card" v-if="showPayPopupMoreBuy">
						<view class="spec11 pay-more-buy-title" style="display: flex;">
							<view style="flex: 1;">
								搭配小食
							</view>
							<view style="padding-top: 10rpx;">
								<view class="goods-num">
									<view class="num-plus" style="background: #999;color: #fff;"
										@tap="changeValue('minus')">
										-
									</view>
									<view class="num">
										{{vModelValue}}
									</view>
									<view class="num-plus" @tap="changeValue('plus')">
										+
									</view>
								</view>
							</view>
						</view>
						<scroll-view scroll-x class="pay-more-buy-scroll">
							<view class="pay-more-buy-list">
								<view :class="spec.isChecked ? 'team-check1 pay-more-buy-item' : 'team2 pay-more-buy-item'"
									v-for="(spec, sIndex) in moreBuyList" :key="sIndex"
									@tap="selectMoreBuy(spec,sIndex)">
									<view>
										<img :src="spec.productPicture" alt=""
											style="width: 70px;height: 70px;background-size: 100%;border-radius: 10px;">
									</view>
									<view class="team11" style="margin-top:10rpx;">
										￥{{spec.attributeListPrice | sliceMsg}}
									</view>
									<view class="team11" style="margin-top:10rpx;">
										{{spec.productName}}
									</view>
									<view class="jiaobiao" v-if="spec.quantity>0">
										{{spec.quantity ? spec.quantity : ''}}
									</view>
								</view>
							</view>
						</scroll-view>
					</view>
					<view class="box1" style="display: flex;padding: 40rpx;"
						v-if="groupdeliveryType == 2 && !isStoreGroupOrder">
						<view style="flex: 1;">
							<view style="height: 42rpx;line-height: 42rpx;display: flex;">
								<!-- <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/4c8e0cc311db4d38ab43e019673c4b8c.png"
									alt="" style="width: 42rpx;height: 42rpx;margin-right: 20rpx;" /> -->
								<text style="font-size: 30rpx;font-weight: 700;">立即出餐</text>
							</view>
							<view style="color: #777;width: 500rpx;">
								拼团成功后立即出餐
							</view>
							<view class="pack-options" v-if="nowMake">
								<view class="pack-option" @tap="isPack = 0">
									<view :class="isPack === 0 ? 'radio-check' : 'radio-no-check'">
										<uni-icons v-if="isPack === 0" type="checkmarkempty" size="12"></uni-icons>
									</view>
									堂食
								</view>
								<view class="pack-option" @tap="isPack = 1">
									<view :class="isPack === 1 ? 'radio-check' : 'radio-no-check'">
										<uni-icons v-if="isPack === 1" type="checkmarkempty" size="12"></uni-icons>
									</view>
									打包
								</view>
							</view>
						</view>
						<view style="width: 36rpx;padding-top: 20rpx;">
							<view :class="nowMake ? 'radio-check' : 'radio-no-check'" @tap="nowMakeMethod">
								<uni-icons v-if="nowMake" type="checkmarkempty" size="12"></uni-icons>
							</view>
						</view>
					</view>
					<view class="box1" style="display: flex;padding: 40rpx;">
						<view style="flex: 1;">
							<view style="height: 42rpx;line-height: 42rpx;display: flex;">
								<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/4c8e0cc311db4d38ab43e019673c4b8c.png"
									alt="" style="width: 42rpx;height: 42rpx;margin-right: 20rpx;" />
								<text style="font-size: 30rpx;font-weight: 700;">微信支付</text>
							</view>
							<view style="text-align: right;margin-left: 60rpx;color: #777;width: 146rpx;">
								使用微信支付
							</view>
						</view>
						<view style="width: 36rpx;padding-top: 20rpx;">
							<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/02bff7edc4e04caaa1868955ff684f1f.png"
								alt="" style="width: 36rpx;height: 36rpx;" />
						</view>
					</view>
					<view class="btn pay-confirm-btn" @tap="wxPayment">
						确认付款{{nowMake && groupdeliveryType == 2 && !isStoreGroupOrder ? '-即刻出餐' : ''}}
					</view>
				</view>
			</view>
		</uni-popup>
		<!-- 参团成功提示弹出层 -->
		<uni-popup ref="tishiPopup" background-color="transparent">
			<view v-if="!isPindan && isStoreGroupOrder" class="group-face-tip-popup" @tap.stop>
				<view class="group-face-tip-close" @tap="$refs.tishiPopup.close()">
					<uni-icons type="closeempty" size="22" color="#9a6a42"></uni-icons>
				</view>
				<view class="group-face-tip-title">温馨提示</view>
				<view class="group-face-tip-text">面对面拼团只能分享好友链接参团</view>
				<view class="group-face-tip-btn" @tap="$refs.tishiPopup.close()">我知道了</view>
			</view>
			<view v-else class="tishi-popup">
				<view class="tishi-copy" v-if="!isPindan">
					<view class="tishi-copy-title">面对面拼团只能分享好友链接参团</view>
					<view class="tishi-copy-desc">
						选择<text class="tishi-copy-highlight">配送</text>时，订单会统一送达
					</view>
				</view>
				<view class="tishi-copy" v-if="isPindan">
					<view class="tishi-copy-title">拼单提醒</view>
					<view class="tishi-copy-desc">
						您已开启拼单模式，赶快选择心动的商品吧！
					</view>
				</view>
			</view>
		</uni-popup>
		<!-- 参团成功提示弹出层 -->
		<uni-popup ref="joinSuccessPopup" background-color="#fff" @change="onJoinSuccessPopupChange">
			<view class="pintuan-popup"
				style="position: relative;height: 1200rpx;width: 100%;border-top-left-radius: 20rpx;border-top-right-radius: 20rpx;padding: 20rpx;">
				<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/ecd00dab1c9c44198d765bc08bc1bd71.png" alt=""
					style="position: absolute;top: 0;right: 0;width: 240rpx;height: 180rpx;"
					@tap="$refs.joinSuccessPopup.close()">
				<view style="position: absolute;bottom: 0;width: 100%;height: 760rpx;">
					<view class="kaituan1">
						<view class="kaituan1-title"
							style="margin-top: 100rpx;text-align: center;font-size: 40rpx;font-weight: bold;">
							参团成功！
						</view>
						<view class="kaituan1-title1" style="text-align: center;margin-top: 20rpx;color: #777;">
							您已成功参与拼团
						</view>
					</view>
					<view class="kaituan2" style="display: flex;justify-content: center;margin-top: 60rpx;">
						<view class="kaituan22">
							<img src="/static/images/img/songshu.png" alt=""
								style="width: 90rpx;height: 90rpx;border-radius: 90rpx;margin: 0 auto;display: block;" />
						</view>
					</view>
				</view>
			</view>
		</uni-popup>

		<!-- 优惠券选择弹出层 -->
		<uni-popup ref="couponPopup" type="bottom" background-color="#F5F8F5" @change="onBottomPopupChange">
			<view style="width: 100%; height: 800rpx; display: flex; flex-direction: column; overflow: hidden;">
				<view
					style="height: 100rpx; line-height: 100rpx; text-align: center; font-size: 32rpx; font-weight: bold; border-bottom: 1px solid #eee; position: relative; background: #fff;">
					选择优惠券
					<uni-icons type="closeempty" size="24" @tap="$refs.couponPopup.close()"
						style="position: absolute; right: 30rpx; top: 0;"></uni-icons>
				</view>
				<scroll-view scroll-y style="height: 560rpx; padding: 20rpx; box-sizing: border-box;">
					<view v-for="(item, index) in availableCoupons" :key="index" @tap="selectCoupon(item)"
						style="background: #fff; border-radius: 12rpx; padding: 30rpx 20rpx; margin-bottom: 20rpx; display: flex; align-items: center; justify-content: space-between;">
						<view style="display: flex; align-items: center; flex: 1;">
							<view style="color: #ff5722; font-size: 40rpx; font-weight: bold; width: 140rpx;">
								<text style="font-size: 24rpx;">￥</text>{{formatMoney(getCouponDiscount(item))}}
							</view>
							<view
								style="flex: 1; display: flex; flex-direction: column; justify-content: center; margin-left: 20rpx;">
								<view style="font-size: 28rpx; font-weight: bold; color: #333; margin-bottom: 6rpx;">
									{{getCouponName(item)}}
								</view>
								<view style="font-size: 22rpx; color: #999;" v-if="getCouponMinAmount(item) > 0">
									满{{formatMoney(getCouponMinAmount(item))}}可用</view>
								<view style="font-size: 22rpx; color: #999;" v-else>无门槛使用</view>
							</view>
						</view>
						<uni-icons v-if="selectedCoupon && selectedCoupon.id === item.id" type="checkmarkempty"
							size="20" color="#0b9b73"></uni-icons>
						<view v-else style="width: 40rpx; height: 40rpx; border-radius: 50%; border: 1px solid #ddd;">
						</view>
					</view>
					<view v-if="availableCoupons.length===0"
						style="text-align:center; padding-top: 100rpx; color: #999;">
						暂无可用优惠券
					</view>
					<view style="height:40rpx;"></view>
				</scroll-view>
				<view style="padding: 20rpx 40rpx; background: #fff;" v-if="availableCoupons.length>0">
					<view @tap="selectCoupon(null)"
						style="width: 100%; height: 80rpx; background: linear-gradient(90deg, #e3ff96, #a6ffea); font-size: 30rpx; font-weight: 700; line-height: 80rpx; text-align: center; border-radius: 100rpx;">
						不使用优惠券
					</view>
				</view>
			</view>
		</uni-popup>
		<common-loading />
		<view class="free-order-mask" v-if="freeOrderEffectVisible" @tap.stop="closeFreeOrderEffect">
			<view class="free-order-card" @tap.stop>
				<view class="free-order-rays"></view>
				<view class="free-order-orb orb-1"></view>
				<view class="free-order-orb orb-2"></view>
				<view class="free-order-confetti confetti-1"></view>
				<view class="free-order-confetti confetti-2"></view>
				<view class="free-order-confetti confetti-3"></view>
				<view class="free-order-confetti confetti-4"></view>
				<view class="free-order-confetti confetti-5"></view>
				<view class="free-order-star star-1"></view>
				<view class="free-order-star star-2"></view>
				<view class="free-order-star star-3"></view>
				<view class="free-order-badge">今日好运爆棚</view>
				<view class="free-order-title">锦鲤附体</view>
				<view class="free-order-subtitle">参团遇到好运啦！</view>
				<view class="free-order-amount">
					<text class="amount-label" style="margin-top: 20rpx;">免单</text>
					<text class="amount-number" style="margin-top: 20rpx;">{{freeOrderAmount}}</text>
					<text class="amount-unit" style="margin-top: 20rpx;">元</text>
				</view>
				<view class="free-order-btn" @tap.stop="closeFreeOrderEffect">开心收下</view>
				<view class="free-order-subtitle">未支付免单资格会传递给下一个小伙伴</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { requireLoginToCurrentPage } from '@/utils/authRedirect.js'
	export default {
		data() {
			return {
				loadStatus: 'more',
				type: '',
				isPindan: true,
				orderScene: '',
				shopId: '',
				shopItem: {
					shopIcon: '',
					shopName: '',
					shopScore: '',
					shopTypeTitle: '',
					saleCount: '',
					remark: '',
				},
				productId: '',
				nowMake: true,
				isPack: 0,
				productItem: [],
				tuanzhangOrder: {},
				cartItems: [],
				moreBuyData: [],
				vModelValue: 0,
				currentItem: {},
				detailItem: {},
				checkMoreBuyIndex: '',
				parsedSpecs: [],
				moreBuyList: [],
				selectedGroupRule: {},
				pageNum: 1,
				total: 1,
				chooseWaitType: false,
				// 导航栏高度（用于sticky top偏移）
				navBarHeight: 0,
				orderListWait: [],
				lastScrollTop: 0,
				// 防止切换分类之后 onPageScroll 闪回的标志
				isSwitching: false,
				// onPageScroll 节流时间戳（非响应式语义，但放 data 防止 undefined）
				_lastDetectTs: 0,
				searchTimer: null,
				searchForm: {
					shopId: '',
					delFlag: 1,
					pageNum: 1,
					pageSize: '1000',
					categoryId: '',
					productName: ''
				},
				menuButtonInfo: {},
				groupdeliveryType: '',
				isPintuan: true,
				groupId: null,
				isFaceToFaceGroup: false,
				targetMembers: 2,
				backendTotalAmount: 0,
				currentOrderId: '',
				isCreatingOrder: false,
				createdOrderInfo: null,
				pendingPaySpecChoices: null,
				onlineWorkerInterval: 2500,
				onlineWorkerDuration: 500,
				menuList: [{
					categoryName: '推荐',
					id: 'tuijian',
					checked: true
				}],
				shopRecommend: [],
				availableCoupons: [],
				selectedCoupon: null,
				navigatingFromPayPopup: false,
				freeOrderEffectVisible: false,
				freeOrderAmount: '0.00',
				pendingFreeOrderAutoPay: false,
				popupPageStyle: '',
				bottomPopupOpenCount: 0
			}
		},
		components: {

		},
		computed: {
			isStoreGroupOrder() {
				return this.orderScene === 'storeGroup' || this.shopItem.merchantType == 2;
			},
			cartTotalCount() {
				return this.cartItems.reduce((acc, curr) => acc + curr.quantity, 0);
			},
			cartTotalPrice() {
				return this.cartItems.reduce((acc, curr) => acc + (curr.quantity * curr.price), 0).toFixed(2);
			},
			cartTotalPackageFeeNumber() {
				return this.cartItems.reduce((acc, curr) => acc + (curr.quantity * this.getPackageFee(curr.item)), 0);
			},
			cartTotalPackageFee() {
				return this.formatMoney(this.cartTotalPackageFeeNumber);
			},
			cartTotalPayPrice() {
				return this.formatMoney(parseFloat(this.cartTotalPrice || 0) + this.cartTotalPackageFeeNumber);
			},
			currentPackageFeeNumber() {
				return this.getPackageFee(this.currentItem);
			},
			currentPackageFee() {
				return this.formatMoney(this.currentPackageFeeNumber);
			},
			isMinimumPayAmount() {
				return this.formatMoney(this.getPayTotalAmount()) === '0.01';
			},
			showPayPopupMoreBuy() {
				return this.groupId && this.isFaceToFaceGroup && this.parsedSpecs.length === 0 &&
					this.moreBuyList.length > 0 && !this.currentOrderId;
			},
			stickyInnerHeight() {
				// 左侧分类条 sticky 吸顶时的可视区高度（像素）。
				// 必须为像素值，避免百分比高度在大屏 iPhone 上无法解析导致菜单条无法滚动。
				const sysInfo = uni.getSystemInfoSync();
				const safeBottom = sysInfo.safeArea ? Math.max(sysInfo.windowHeight - sysInfo.safeArea.bottom, 0) : 0;
				const checkoutBarPx = Math.round(126 * sysInfo.windowWidth / 750);
				const checkoutOffsetPx = Math.round(18 * sysInfo.windowWidth / 750);
				const bottomReservedPx = checkoutBarPx + checkoutOffsetPx + safeBottom;
				return Math.max(240, sysInfo.windowHeight - this.navBarHeight - bottomReservedPx);
			},
			navBarBackground() {
				return this.lastScrollTop > 0 ? '#fff' : '';
			}
		},
		filters: {
			sliceMsg(val) {
				var name = ''
				if (typeof(val) == 'string') {
					let newObj = JSON.parse(val)
					for (let as in newObj) {
						name = newObj[as].specPrice
					}
				}
				return name;
			},
			slicePrice(val) {
				let begin = ''
				if (val != null) {
					begin = val[0].groupPrice
					for (let i = 0; i < val.length; i++) {
						if (val[i].groupPrice < begin) {
							begin = val[i].groupPrice
						}
					}
				}
				return begin;
			}
		},
		onLoad(option) {
			this.type = option.type;
			this.orderScene = option.orderScene || '';
			this.rememberShareTarget(option || {});
			if (option.groupId) {
				this.groupId = option.groupId;
			}
			if (option.isFaceToFace) {
				this.isFaceToFaceGroup = option.isFaceToFace === '1' || option.isFaceToFace === 'true';
			}
			if (this.isFaceToFaceGroup && this.groupId) {
				this.loadGroupOrder();
			}
			if (option.targetMembers) {
				this.targetMembers = parseInt(option.targetMembers);
			} else {
				this.targetMembers = 2; // Default fallback
			}
			let parsedItem = this.parseRouteItem(option.item);
			if (this.type == 'shop') {
				if (parsedItem) {
					this.shopItem = parsedItem;
					if (this.shopItem.products) {
						this.shopRecommend = this.shopItem.products
						for (let i = 0; i < this.shopRecommend.length; i++) {
							this.shopRecommend[i].categoryId = '1'
							this.shopRecommend[i].isChecked = false
						}
					}
				}
			} else {
				if (parsedItem) {
					this.productItem = Array.isArray(parsedItem) ? parsedItem : [parsedItem];
				}
			}
			if (this.shopItem && this.shopItem.id) {
				this.getCategory(this.shopItem.id);
				this.getProduct('');
			} else if (option.shopId) {
				this.loadShopById(option.shopId);
			} else if (this.groupId) {
				this.loadShopByGroupId();
			}
		},
		onShow() {
			this.menuButtonInfo = uni.getMenuButtonBoundingClientRect();
			this.fetchCoupons();
			// 通过胶囊按钮(menuButton)真实坐标计算自定义导航栏高度，
			// 兼容带灵动岛/异形屏的 iPhone（旧版 statusBarHeight + 40 估算会偏差）。
			const info = uni.getSystemInfoSync();
			if (this.menuButtonInfo && this.menuButtonInfo.height) {
				const top = this.menuButtonInfo.top;
				const padding = Math.max(top - info.statusBarHeight, 0);
				this.navBarHeight = info.statusBarHeight + padding * 2 + this.menuButtonInfo.height;
			} else {
				this.navBarHeight = info.statusBarHeight + 40;
			}
		},
		onPullDownRefresh() {
			this.menuList = [{
				categoryName: '推荐',
				id: 'tuijian',
				checked: true
			}]
			this.productItem = []
			this.getCategory(this.shopItem.id);
			this.getProduct('');
		},
		onReady() {},
		onPageScroll(e) {
			this.lastScrollTop = e.scrollTop;
			// 节流：80ms 内不重复检测，避免频繁的 selectorQuery
			const now = Date.now();
			if (now - this._lastDetectTs < 80) return;
			this._lastDetectTs = now;
			this.detectCurrentCategory();
		},
		methods: {
			rememberShareTarget(option) {
				if (uni.getStorageSync('id')) return;
				if (!option || !option.shopId || !option.groupId) return;
				let targetPath = '/package2/group/groupBuySingle?type=shop' +
					'&shopId=' + encodeURIComponent(option.shopId) +
					'&groupId=' + encodeURIComponent(option.groupId) +
					'&targetMembers=' + encodeURIComponent(option.targetMembers || 2) +
					'&isFaceToFace=' + encodeURIComponent(option.isFaceToFace || 0);
				if (option.orderScene) {
					targetPath += '&orderScene=' + encodeURIComponent(option.orderScene);
				}
				uni.setStorageSync('authPendingTargetPath', targetPath);
				uni.setStorageSync('pendingShareTargetPath', targetPath);
			},
			getCurrentRegionId() {
				let area = uni.getStorageSync('area');
				if (!area) return '';
				try {
					let areaInfo = typeof area === 'string' ? JSON.parse(area) : area;
					return areaInfo && areaInfo.id ? areaInfo.id : '';
				} catch (e) {
					return '';
				}
			},
			parseRouteItem(item) {
				if (item == null || item === '') return null;
				try {
					return JSON.parse(decodeURIComponent(item));
				} catch (e) {
					try {
						return JSON.parse(item);
					} catch (err) {
						return null;
					}
				}
			},
			loadShopByGroupId() {
				if (!this.groupId) return;
				this.tui.request("/mall/order/selectMallOrderByGroupId/" + this.groupId, "GET", {}, false, true).then((res) => {
					if (res.code != 200 || !res.result) {
						this.tui.toast(res.message || '拼团信息不存在');
						return;
					}
					this.tuanzhangOrder = res.result;
					let shopId = res.result.shopId;
					if (!shopId) {
						this.tui.toast('商家信息缺失，暂时无法参团');
						return;
					}
					this.loadShopById(shopId);
				}).catch(() => {});
			},
			loadGroupOrder() {
				if (!this.groupId) return;
				this.tui.request("/mall/order/selectMallOrderByGroupId/" + this.groupId, "GET", {}, false, true).then((res) => {
					if (res.code == 200 && res.result) {
						this.tuanzhangOrder = res.result;
					}
				}).catch(() => {});
			},
			normalizeShopDeliveryFields(result) {
				const shop = result && result.shop ? result.shop : (result || {});
				const shopTakeaway = result && result.shopTakeaway ? result.shopTakeaway : (shop.shopTakeaway || {});
				const products = result && result.products ? result.products : (shop.products || []);
				const cookingTimeValue = shopTakeaway && shopTakeaway.cookingTime ? Number(shopTakeaway.cookingTime) : 0;
				const cookingTime = isNaN(cookingTimeValue) || cookingTimeValue < 0 ? 0 : cookingTimeValue;
				const selfDeliveryTime = Number(shop.shopDeliveryDuration);
				const transferTimeValue = Number(shop.transferDeliveryDuration);
				const transferTime = shop.supportTransferDelivery == 1 && !isNaN(transferTimeValue) && transferTimeValue > 0 ? transferTimeValue : 0;
				let baseDeliveryTime;
				if (shop.supportShopDelivery == 1 && !isNaN(selfDeliveryTime) && selfDeliveryTime > 0) {
					baseDeliveryTime = cookingTime + selfDeliveryTime;
				} else {
					const groupDeliveryTime = Number(shop.groupDeliveryTime);
					baseDeliveryTime = !isNaN(groupDeliveryTime) && groupDeliveryTime > 0 ? groupDeliveryTime : cookingTime + 30;
				}
				return {
					...shop,
					shopTakeaway,
					products,
					groupDeliveryBaseTime: baseDeliveryTime,
					groupDeliveryTime: baseDeliveryTime + transferTime,
					groupDeliveryTimeIncludesTransfer: transferTime > 0 ? 1 : 0
				};
			},
			loadShopById(shopId) {
				if (!shopId) return;
				let area = uni.getStorageSync('area');
				let regionId = '';
				try {
					regionId = area ? JSON.parse(area).id : '';
				} catch (e) {}
				if (!regionId) {
					this.tui.toast('请先选择校区');
					return;
				}
				this.tui.request("/app/shop/getShopInfoById", "POST", {
					id: shopId,
					regionId: regionId
				}, false, true).then((shopRes) => {
					if (shopRes.code != 200 || !shopRes.result || !shopRes.result.shop) {
						this.tui.toast(shopRes.message || '商家信息获取失败');
						return;
					}
					this.shopItem = this.normalizeShopDeliveryFields(shopRes.result);
					if (this.shopItem.products) {
						this.shopRecommend = this.shopItem.products;
						for (let i = 0; i < this.shopRecommend.length; i++) {
							this.shopRecommend[i].categoryId = '1';
							this.shopRecommend[i].isChecked = false;
						}
					}
					this.getCategory(this.shopItem.id);
					this.getProduct('');
				});
			},
			onBottomPopupChange(e) {
				if (e.show) {
					this.bottomPopupOpenCount += 1;
				} else {
					this.bottomPopupOpenCount = Math.max(0, this.bottomPopupOpenCount - 1);
				}
				this.popupPageStyle = this.bottomPopupOpenCount > 0 ? 'overflow:hidden;' : '';
			},
			onPayPopupChange(e) {
				this.onBottomPopupChange(e);
				if (!e.show && this.currentOrderId && !this.navigatingFromPayPopup) {
					this.goPayOrderDetail();
				}
			},
			nowMakeMethod() {
				this.nowMake = !this.nowMake
			},
			toNumber(value) {
				let amount = parseFloat(value);
				return isNaN(amount) ? 0 : amount;
			},
			getCouponDiscount(coupon) {
				if (!coupon) return 0;
				return this.toNumber(coupon.discountAmount || coupon.discountFee || coupon.amount || 0);
			},
			getCouponMinAmount(coupon) {
				if (!coupon) return 0;
				return this.toNumber(coupon.minAmount || coupon.thresholdAmount || 0);
			},
			getCouponName(coupon) {
				if (!coupon) return '优惠券';
				if (coupon.couponName) return coupon.couponName;
				if (coupon.name) return coupon.name;
				if (coupon.title) return coupon.title;
				return coupon.issuerType == 2 ? '商家优惠券' : '平台优惠券';
			},
			normalizeCoupons(list) {
				return (list || []).map(item => {
					return Object.assign({}, item, {
						discountAmount: this.getCouponDiscount(item),
						minAmount: this.getCouponMinAmount(item),
						couponName: this.getCouponName(item)
					});
				});
			},
			getMoreBuyAmount() {
				let list = this.currentItem && this.currentItem.moreBuyData ? this.currentItem.moreBuyData : this.moreBuyData;
				let amount = 0;
				for (let i = 0; i < list.length; i++) {
					if (list[i].quantity > 0) {
						amount += Number((Number(list[i].quantity) * Number(this.sliceMsg2(list[i].attributeListPrice))).toFixed(2));
					}
				}
				return amount;
			},
			getFaceToFaceGoodsAmount() {
				return this.toNumber(this.selectedGroupRule && this.selectedGroupRule.groupPrice) + this.getMoreBuyAmount();
			},
			getPayGoodsAmount() {
				if (this.createdOrderInfo && this.createdOrderInfo.goodsAmount != null) {
					return this.toNumber(this.createdOrderInfo.goodsAmount);
				}
				return this.getFaceToFaceGoodsAmount();
			},
			getPayPackageFee() {
				if (this.createdOrderInfo && this.createdOrderInfo.packageFee != null) {
					return this.toNumber(this.createdOrderInfo.packageFee);
				}
				return this.groupdeliveryType == 1 ? this.toNumber(this.currentItem && this.currentItem.lunchBox) : 0;
			},
			getPayDeliveryFee() {
				if (this.createdOrderInfo && this.createdOrderInfo.deliveryFee != null) {
					return this.toNumber(this.createdOrderInfo.deliveryFee);
				}
				return this.toNumber(this.tuanzhangOrder && this.tuanzhangOrder.deliveryFee);
			},
			getPayTotalAmount() {
				if (this.createdOrderInfo && this.backendTotalAmount) {
					return this.toNumber(this.backendTotalAmount);
				}
				let total = this.getPayGoodsAmount() + this.getPayPackageFee() + this.getPayDeliveryFee();
				if (this.selectedCoupon) {
					total -= this.getCouponDiscount(this.selectedCoupon);
				}
				return total > 0 ? total : 0.01;
			},
			refreshSelectedGroupPayPrice() {
				if (!this.selectedGroupRule) return;
				let amount = this.getFaceToFaceGoodsAmount();
				if (this.selectedCoupon) {
					amount -= this.getCouponDiscount(this.selectedCoupon);
				}
				this.selectedGroupRule.groupPriceAndMore = amount > 0 ? amount : 0.01;
			},
			syncCurrentItemMoreBuyData() {
				this.currentItem.moreBuyData = [];
				for (let i = 0; i < this.moreBuyData.length; i++) {
					if (this.moreBuyData[i].quantity != undefined && this.moreBuyData[i].quantity > 0) {
						this.currentItem.moreBuyData.push(this.moreBuyData[i]);
					}
				}
			},
			goPayOrderDetail() {
				if (!this.currentOrderId) return;
				this.navigatingFromPayPopup = true;
				uni.redirectTo({
					url: '/package1/order/orderDetail?id=' + this.currentOrderId
				});
			},
			goPayOrderConfirm() {
				this.navigatingFromPayPopup = true;
				uni.redirectTo({
					url: '/package1/order/orderConfirm?id=' + this.currentOrderId + '&groupId=' + this.groupId +
						'&amount=' + this.backendTotalAmount
				});
			},
			scrollGoodsListToTop() {
				// 滚到 catalog-row 顶部并紧贴 nav-bar
				const query = uni.createSelectorQuery().in(this);
				query.select('#catalog-row').boundingClientRect();
				query.selectViewport().scrollOffset();
				query.exec((res) => {
					if (!res || !res[0] || !res[1]) {
						this.isSwitching = false;
						return;
					}
					const target = Math.max(res[1].scrollTop + res[0].top - this.navBarHeight, 0);
					uni.pageScrollTo({
						scrollTop: target,
						duration: 200
					});
					setTimeout(() => {
						this.isSwitching = false;
					}, 350);
				});
			},
			// 检测当前在 nav-bar 下沿可见的分类，并同步左侧菜单高亮
			detectCurrentCategory() {
				if (this.isSwitching) return;
				const query = uni.createSelectorQuery().in(this);
				query.selectAll('.goods-member').boundingClientRect();
				query.exec((res) => {
					if (!res || !res[0]) return;
					const items = res[0];
					// 判定基准：相对视口顶端的 navBarHeight 偏移
					const baseline = this.navBarHeight + 20;
					let currentCategoryId = '';
					for (let i = items.length - 1; i >= 0; i--) {
						if (items[i].top <= baseline) {
							if (this.productItem[i]) {
								currentCategoryId = this.productItem[i].categoryId;
							}
							break;
						}
					}
					let found = false;
					for (let i = 0; i < this.menuList.length; i++) {
						if (String(this.menuList[i].id) === String(currentCategoryId)) {
							if (!this.menuList[i].checked) {
								for (let j = 0; j < this.menuList.length; j++) {
									this.menuList[j].checked = (j === i);
								}
							}
							found = true;
							break;
						}
					}
					if (!found && currentCategoryId === '') {
						for (let j = 0; j < this.menuList.length; j++) {
							this.menuList[j].checked = (j === 0);
						}
					}
				});
			},
			onSearchInput() {
				if (this.searchTimer) {
					clearTimeout(this.searchTimer);
				}
				this.searchTimer = setTimeout(() => {
					this.refreshProductSearch();
				}, 300);
			},
			onSearchConfirm() {
				if (this.searchTimer) {
					clearTimeout(this.searchTimer);
					this.searchTimer = null;
				}
				this.refreshProductSearch();
			},
			refreshProductSearch() {
				this.searchForm.pageNum = 1;
				this.productItem = [];
				this.moreBuyList = [];
				this.getProduct('');
			},
			getProduct(categoryId) {
				let that = this;
				this.loadStatus = 'loading';
				this.searchForm.shopId = this.shopItem.id;
				this.searchForm.categoryId = categoryId;
				that.tui.request("/app/product/getShareList", "POST", this.searchForm, false, false).then((res) => {
					that.loadStatus = 'nomore';
					uni.stopPullDownRefresh()
					if (res.code == 200) {
						if (that.searchForm.pageNum == 1) {
							that.productItem = res.result.records;
						} else {
							that.productItem = [...that.productItem, ...res.result.records];
						}
						let hasTuijian = false 
						let tuijianList = []
						let putongList = []
						that.moreBuyList = []
						for (let i = 0; i < that.productItem.length; i++) {
							if (this.productItem[i].sellBeginTime != '' && this.productItem[i].sellEndTime != '') {
								let isEndTime = this.isWithinBusinessHours(this.productItem[i].sellBeginTime, this
									.productItem[i].sellEndTime)

								this.productItem[i].status = isEndTime ? 0 : 1
							}
							if (that.productItem[i].isMoreBuy == 1) {
								//搭配的小料商品
								that.productItem[i].isChecked = false
								that.moreBuyList.push(that.productItem[i])
							}
							if (that.productItem[i].isPush == 1) {
								that.productItem[i].categoryId = 'tuijian'
								hasTuijian = true
								tuijianList.push(that.productItem[i])
							} else {
								putongList.push(that.productItem[i])
							}
						}
						if (hasTuijian == false) {
							that.menuList.splice(0, 1)
						} else {
							that.productItem = [...tuijianList, ...putongList];
						}
						//获取当前店铺待成团列表
						that.getOrderWait();

						that.total = res.result.pages; // pages = 总页数
						that.pageNum = that.searchForm.pageNum;
						that.$forceUpdate();
					} else {
						that.tui.toast(res.message);
						return;
					}
					uni.hideLoading();
				}).catch((res) => {});
			},
			getCategory(id) {
				let that = this
				that.tui.request("/app/productCategory/list", "GET", {
					shopId: id
				}, false, true).then((res) => {
					if (res.code == 200) {
						if (res.result.length > 0) {
							for (let i = 0; i < res.result.length; i++) {
								res.result[i].checked = false
								that.menuList.push(res.result[i])
							}
						}
						that.$forceUpdate()
					} else {
						that.tui.toast(res.message)
						return
					}
					uni.hideLoading()
				}).catch((res) => {})
			},
			checkTab(index) {
				this.isSwitching = true;
				for (let i = 0; i < this.menuList.length; i++) {
					this.menuList[i].checked = (i === index);
				}

				const selectedCategory = this.menuList[index];
				if (!selectedCategory.id && selectedCategory.id !== 0) {
					this.scrollGoodsListToTop();
					return;
				}

				// 通过页面 scroll 滚到 #category-<id> 紧贴 nav-bar 下沿
				const targetSelector = '#category-' + selectedCategory.id;
				this.$nextTick(() => {
					const query = uni.createSelectorQuery().in(this);
					query.select(targetSelector).boundingClientRect();
					query.selectViewport().scrollOffset();
					query.exec((res) => {
						if (!res || !res[0] || !res[1]) {
							this.isSwitching = false;
							return;
						}
						const rect = res[0];
						const vp = res[1];
						const target = Math.max(vp.scrollTop + rect.top - this.navBarHeight, 0);
						uni.pageScrollTo({
							scrollTop: target,
							duration: 200
						});
						setTimeout(() => {
							this.isSwitching = false;
						}, 350);
					});
				});
			},
			openOrderWait(item) {
				this.chooseWaitType = false
				if (item != '') {
					this.chooseWaitType = true
					this.orderListWait = item.orderListWait

					this.currentItem = item;
					// Parse specifications
					this.parsedSpecs = [];
					if (item.attributeList && item.attributeList !== '{}') {
						try {
							let attrs = typeof item.attributeList === 'string' ? JSON.parse(item.attributeList) : item
								.attributeList;
							for (let key in attrs) {
								if (attrs[key] && attrs[key].title && attrs[key].title.length > 0) {
									let canbuy = attrs[key].canbuy || 1; // 历史数据没有canbuy字段默认为1
									this.parsedSpecs.push({
										name: key,
										options: attrs[key].title,
										canbuy: canbuy,
										selected: [attrs[key].title[0]] // 默认选中第一个
									});
								}
							}
						} catch (e) {}
					}
					this.isPintuan = true;

					if (this.groupId) {
						// Determine best price match given targetMembers
						let prices = item.productGroupBuyPrices || [];
						let validPrices = prices.filter(p => p.groupCount <= this.targetMembers);
						if (validPrices.length > 0) {
							this.selectedGroupRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ?
								obj : max));
							this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
							if (this.selectedCoupon) {
								this.selectedGroupRule.groupPriceAndMore -= this.getCouponDiscount(this.selectedCoupon);
								if (this.selectedGroupRule.groupPriceAndMore <= 0) {
									this.selectedGroupRule.groupPriceAndMore = 0.01
								}
							}
						} else if (prices.length > 0) {
							this.selectedGroupRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ?
								prev : curr));
							this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
							if (this.selectedCoupon) {
								this.selectedGroupRule.groupPriceAndMore -= this.getCouponDiscount(this.selectedCoupon);
								if (this.selectedGroupRule.groupPriceAndMore <= 0) {
									this.selectedGroupRule.groupPriceAndMore = 0.01
								}
							}
						} else {
							this.selectedGroupRule = {};
						}
					} else {
						// Normal init
						if (item.productGroupBuyPrices && item.productGroupBuyPrices.length > 0) {
							this.selectedGroupRule = item.productGroupBuyPrices[0];
							this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
							if (this.selectedCoupon) {
								this.selectedGroupRule.groupPriceAndMore -= this.getCouponDiscount(this.selectedCoupon);
								if (this.selectedGroupRule.groupPriceAndMore <= 0) {
									this.selectedGroupRule.groupPriceAndMore = 0.01
								}
							}
						} else {
							this.selectedGroupRule = {};
						}
					}

					let moreBuyPrice = 0
					for (let i = 0; i < this.moreBuyList.length; i++) {
						if (this.moreBuyList[i].quantity > 0) {
							moreBuyPrice += Number((Number(this.moreBuyList[i].quantity) * Number(this.sliceMsg2(this
								.moreBuyList[i].attributeListPrice))).toFixed(2))
						}
					}
					this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice
					if (this.selectedCoupon) {
						this.selectedGroupRule.groupPriceAndMore -= this.getCouponDiscount(this.selectedCoupon);
						if (this.selectedGroupRule.groupPriceAndMore <= 0) {
							this.selectedGroupRule.groupPriceAndMore = 0.01
						}
					}
				}
				this.$refs.pintuanGroupPopup.open('bottom')
			},
			getOrderWait() {
				let that = this

				this.tui.request("/mall/order/getMallOrderGroupByShopId", "POST", {
					shopId: this.shopItem.id,
					status: 0,
					isFace: 0,
				}, false, false).then((res) => {
					that.loadStatus = 'nomore';
					if (res.code == 200) {
						that.orderListWait = res.result;
						for (let i = 0; i < that.productItem.length; i++) {
							that.productItem[i].orderListWait = []
							if (that.orderListWait != null && that.orderListWait.length > 0) {
								that.productItem[i].minGroupCount = that.orderListWait[0].targetMembers - that
									.orderListWait[0].currentMembers
								for (let y = 0; y < that.orderListWait.length; y++) {
									if (that.productItem[i].id == that.orderListWait[y].productId) {
										if (that.productItem[i].minGroupCount > (that.orderListWait[y]
												.targetMembers - that.orderListWait[y].currentMembers)) {
											that.productItem[i].minGroupCount = that.orderListWait[y]
												.targetMembers - that.orderListWait[y].currentMembers
										}
										that.productItem[i].orderListWait.push(that.orderListWait[y])
									}
								}
							}
						}

						that.$forceUpdate();
					} else {
						that.tui.toast(res.message);
						return;
					}
					uni.hideLoading();
				}).catch((res) => {});
			},
			chooseOrderWait(item) {
				this.$refs.pintuanGroupPopup.close();
				this.isPindan = true;
				this.$refs.tishiPopup.open();
				this.groupId = item.id;
				this.targetMembers = parseInt(item.targetMembers);
				this.selectedCoupon = null;
				if (this.chooseWaitType) {
					this.fetchCoupons();
					this.$refs.pintuanPopup.open('bottom');
				}
			},
			openPopup(type, index, item) {
				if (type == 'car') {
					this.$refs.carPopup.open('bottom')
				} else if (type == 'xiadan') {
					this.currentItem = item;
					// Parse specifications
					this.parsedSpecs = [];
					if (item.attributeList && item.attributeList !== '{}') {
						try {
							let attrs = typeof item.attributeList === 'string' ? JSON.parse(item.attributeList) : item
								.attributeList;
							for (let key in attrs) {
								if (attrs[key] && attrs[key].title && attrs[key].title.length > 0) {
									let canbuy = attrs[key].canbuy || 1; // 历史数据没有canbuy字段默认为1
									this.parsedSpecs.push({
										name: key,
										options: attrs[key].title,
										canbuy: canbuy,
										selected: [attrs[key].title[0]] // 默认选中第一个
									});
								}
							}
						} catch (e) {}
					}

					if (index == 'pintuan') {
						this.isPintuan = true;
						this.selectedCoupon = null;

						if (this.groupId) {
							// Determine best price match given targetMembers
							let prices = item.productGroupBuyPrices || [];
							let validPrices = prices.filter(p => p.groupCount <= this.targetMembers);
							if (validPrices.length > 0) {
								this.selectedGroupRule = validPrices.reduce((max, obj) => (obj.groupCount > max
									.groupCount ? obj : max));
								this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
								if (this.selectedCoupon) {
									this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon
										.discountAmount);
									if (this.selectedGroupRule.groupPriceAndMore <= 0) {
										this.selectedGroupRule.groupPriceAndMore = 0.01
									}
								}
							} else if (prices.length > 0) {
								this.selectedGroupRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ?
									prev : curr));
								this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
								if (this.selectedCoupon) {
									this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon
										.discountAmount);
									if (this.selectedGroupRule.groupPriceAndMore <= 0) {
										this.selectedGroupRule.groupPriceAndMore = 0.01
									}
								}
							} else {
								this.selectedGroupRule = {};
							}

							if (this.isFaceToFaceGroup) {
								if (this.parsedSpecs.length === 0) {
									this.submitFTFJoinPay({});
									return;
								}
							}
						} else {
							// Normal init
							if (item.productGroupBuyPrices && item.productGroupBuyPrices.length > 0) {
								this.selectedGroupRule = item.productGroupBuyPrices[0];
								this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
								if (this.selectedCoupon) {
									this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon
										.discountAmount);
									if (this.selectedGroupRule.groupPriceAndMore <= 0) {
										this.selectedGroupRule.groupPriceAndMore = 0.01
									}
								}
							} else {
								this.selectedGroupRule = {};
							}
						}

						let moreBuyPrice = 0
						for (let i = 0; i < this.moreBuyList.length; i++) {
							if (this.moreBuyList[i].quantity > 0) {
								moreBuyPrice += Number((Number(this.moreBuyList[i].quantity) * Number(this.sliceMsg2(this
									.moreBuyList[i].attributeListPrice))).toFixed(2))
							}
						}
						this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice

						this.fetchCoupons();
						this.$refs.pintuanPopup.open('bottom');
					} else {
						this.isPintuan = false;
						// If solo buy and NO specs, add immediately to cart
						if (this.parsedSpecs.length === 0) {
							this.addToCart(item, null);
							uni.showToast({
								title: '已加入购物车',
								icon: 'none'
							});
						} else {
							// Open popup to select specs
							this.$refs.pintuanPopup.open('bottom');
						}
					}
				}
			},
			selectSpec(sIndex, option) {
				let spec = this.parsedSpecs[sIndex];
				let idx = spec.selected.indexOf(option);
				if (idx !== -1) {
					// 已选中，取消选中（但至少保留一个选中）
					if (spec.selected.length > 1) {
						spec.selected.splice(idx, 1);
					}
				} else {
					// 未选中
					if (spec.selected.length < spec.canbuy) {
						// 还没达到上限，直接添加
						spec.selected.push(option);
					} else if (spec.canbuy === 1) {
						// 只能选1个，替换
						spec.selected = [option];
					} else {
						// 已达到上限，提示
						uni.showToast({
							title: spec.name + '最多选' + spec.canbuy + '个',
							icon: 'none'
						});
					}
				}
				this.$forceUpdate();
			},
			selectGroupRule(rule) {
				this.selectedGroupRule = rule;
				this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
				if (this.selectedCoupon) {
					this.selectedGroupRule.groupPriceAndMore -= this.getCouponDiscount(this.selectedCoupon);
					if (this.selectedGroupRule.groupPriceAndMore <= 0) {
						this.selectedGroupRule.groupPriceAndMore = 0.01
					}
				}
			},
			submitAddToCart() {
				let specChoices = {};
				for (let spec of this.parsedSpecs) {
					specChoices[spec.name] = spec.canbuy === 1 ? spec.selected[0] : spec.selected;
				}
				this.addToCart(this.currentItem, specChoices);
				uni.showToast({
					title: '已加入购物车',
					icon: 'none'
				});
				this.$refs.pintuanPopup.close();
			},
			submitPintuan(isFaceToFace) {
				if (!requireLoginToCurrentPage()) return;
				if (this.currentOrderId && this.backendTotalAmount) {
					this.$refs.payPopup.open('bottom');
					if (this.$refs.pintuanPopup) this.$refs.pintuanPopup.close();
					return;
				}
				if (this.isCreatingOrder) return;
				let specChoices = {};
				for (let spec of this.parsedSpecs) {
					specChoices[spec.name] = spec.canbuy === 1 ? spec.selected[0] : spec.selected;
				}
				let packageFee = parseFloat(this.currentItem.lunchBox || 0);

				this.syncCurrentItemMoreBuyData();
				if (this.groupId && this.isFaceToFaceGroup) {
					this.submitFTFJoinPay(specChoices);
					return
				}

				// Pack data for checkout

				let goData = {
					item: this.currentItem,
					groupRule: this.selectedGroupRule,
					specs: specChoices,
					orderType: 2, // 2 indicates Group Buy
					groupId: this.groupId,
					isFaceToFace: this.groupId ? this.isFaceToFaceGroup : (isFaceToFace || false),
					orderScene: this.orderScene
				};
				uni.navigateTo({
					url: '/package1/buyFood/buyFood?item=' + encodeURIComponent(JSON.stringify(goData)) +
						'&shopItem=' + encodeURIComponent(JSON.stringify(this.shopItem)) + '&packageFee=' +
						packageFee + (this.orderScene ? '&orderScene=' + this.orderScene : '')
				});
				this.$refs.pintuanPopup.close();
			},
			submitFTFJoinPay(specChoices) {
				if (!requireLoginToCurrentPage()) return;
				if (this.currentOrderId && this.backendTotalAmount) {
					this.$refs.payPopup.open('bottom');
					if (this.$refs.pintuanPopup) this.$refs.pintuanPopup.close();
					return;
				}
				this.pendingPaySpecChoices = specChoices || {};
				this.groupdeliveryType = this.tuanzhangOrder.deliveryType;
				this.backendTotalAmount = 0;
				this.createdOrderInfo = null;
				this.navigatingFromPayPopup = false;
				this.fetchCoupons();
				this.$refs.payPopup.open('bottom');
				if (this.$refs.pintuanPopup) this.$refs.pintuanPopup.close();
			},
			buildFTFJoinPayload(specChoices) {
				let items = [{
					productId: this.currentItem.id,
					specs: JSON.stringify(specChoices || {}),
					price: parseFloat(this.selectedGroupRule && this.selectedGroupRule.groupPrice ? this
						.selectedGroupRule.groupPrice : 0),
					quantity: 1
				}];
				if (this.currentItem.moreBuyData) {
					for (let a = 0; a < this.currentItem.moreBuyData.length; a++) {
						items.push({
							productId: this.currentItem.moreBuyData[a].id,
							specs: '',
							price: parseFloat(this.sliceMsg2(this.currentItem.moreBuyData[a].attributeListPrice))
								.toFixed(2),
							quantity: this.currentItem.moreBuyData[a].quantity
						});
					}
				}

				let packageFee = parseFloat(this.currentItem.lunchBox || 0);
				let regionId = this.getCurrentRegionId();
				if (!regionId) {
					this.tui.toast('请先选择校区');
					return null;
				}

				return {
					userId: uni.getStorageSync('id'),
					shopId: this.shopItem.id,
					deliveryType: this.tuanzhangOrder.deliveryType,
					packageFee: this.tuanzhangOrder.deliveryType == 1 ? packageFee : 0,
					remark: '',
					items: items,
					receiverName: '',
					receiverPhone: '',
					receiverAddress: '',
					shopName: this.shopItem.shopName,
					shopPhone: this.shopItem.shopPhone || '',
					shopAddress: this.shopItem.shopAddress || '',
					groupId: this.groupId,
					userCouponId: this.selectedCoupon ? this.selectedCoupon.id : null,
					regionId: regionId
				};
			},
			createFTFJoinOrder(specChoices, autoPay) {
				if (this.isCreatingOrder) return;
				this.isCreatingOrder = true;
				this.syncCurrentItemMoreBuyData();
				let payload = this.buildFTFJoinPayload(specChoices);
				if (!payload) {
					this.isCreatingOrder = false;
					return;
				}
				uni.showLoading({
					title: '创建订单中....'
				});
				if(this.isStoreGroupOrder){
					payload.otherOrder = 2
				}
				this.tui.request("/mall/order/create", "POST", payload, false, false).then(res => {
					uni.hideLoading();
					this.isCreatingOrder = false;
					if (res.success && res.result) {
						this.currentOrderId = res.result.id;
						this.groupdeliveryType = res.result.deliveryType;
						this.backendTotalAmount = res.result.totalAmount;
						this.createdOrderInfo = res.result;
						if (res.result.isFreeOrder == 1) {
							this.showFreeOrderEffect(res.result);
							this.pendingFreeOrderAutoPay = !!autoPay;
						} else if (autoPay) {
							this.$nextTick(() => {
								this.wxPayment();
							});
						} else {
							this.$refs.payPopup.open('bottom');
						}
						this.pendingPaySpecChoices = null;
						if (this.$refs.pintuanPopup) this.$refs.pintuanPopup.close();
					} else {
						uni.showToast({
							title: res.message || '下单失败',
							icon: 'none'
						});
					}
				}).catch(err => {
					uni.hideLoading();
					this.isCreatingOrder = false;
				});
			},
			showFreeOrderEffect(orderInfo) {
				let amount = orderInfo && orderInfo.freeAmount != null ? parseFloat(orderInfo.freeAmount) : 0;
				if (isNaN(amount)) amount = 0;
				this.freeOrderAmount = amount.toFixed(2);
				this.freeOrderEffectVisible = true;
				if (uni.vibrateShort) {
					uni.vibrateShort({
						type: 'medium'
					});
				}
			},
			closeFreeOrderEffect() {
				this.freeOrderEffectVisible = false;
				if (this.pendingFreeOrderAutoPay) {
					this.pendingFreeOrderAutoPay = false;
					this.$nextTick(() => {
						this.wxPayment();
					});
				}
			},
			addToCart(item, specs) {
				let specStr = specs ? JSON.stringify(specs) : '';
				let cartId = item.id + '_' + specStr;
				let existingItem = this.cartItems.find(c => c.cartId === cartId);
				if (existingItem) {
					existingItem.quantity++;
				} else {
					let priceToUse = 0;
					if (item.attributeListPrice) {
						try {
							let pObj = typeof item.attributeListPrice === 'string' ? JSON.parse(item.attributeListPrice) :
								item.attributeListPrice;
							if (Array.isArray(pObj) && pObj.length > 0) {
								priceToUse = parseFloat(pObj[0].specPrice);
							} else {
								for (let k in pObj) {
									priceToUse = parseFloat(pObj[k].specPrice);
									break;
								}
							}
						} catch (e) {}
					}
					this.cartItems.push({
						cartId: cartId,
						item: item,
						specs: specs,
						quantity: 1,
						price: priceToUse.toFixed(2)
					});
				}
			},
			//判断是否在营业时间内
			isWithinBusinessHours(begin, end) {
				// 获取当前时间的时和分
				const now = new Date();
				const currentMinutes = now.getHours() * 60 + now.getMinutes();

				// 解析开始和结束时间（格式 "HH:MM"）
				const parseTime = (timeStr) => {
					const [hours, minutes] = timeStr.split(':').map(Number);
					return hours * 60 + minutes;
				};

				const startMinutes = parseTime(begin);
				const endMinutes = parseTime(end);

				// 判断是否在区间内（包含端点）
				return currentMinutes >= startMinutes && currentMinutes <= endMinutes;
			},
			adjustCart(cartId, delta) {
				let index = this.cartItems.findIndex(c => c.cartId === cartId);
				if (index !== -1) {
					let newQty = this.cartItems[index].quantity + delta;
					if (newQty <= 0) {
						this.cartItems.splice(index, 1);
					} else {
						this.cartItems[index].quantity = newQty;
					}
				}
			},
			getPackageFee(item) {
				let fee = item && item.lunchBox != null ? parseFloat(item.lunchBox) : 0;
				return isNaN(fee) ? 0 : fee;
			},
			formatMoney(value) {
				let amount = parseFloat(value);
				return (isNaN(amount) ? 0 : amount).toFixed(2);
			},
			getSpecDisplayString(specs) {
				if (!specs) return '';
				let arr = [];
				for (let k in specs) {
					if (Array.isArray(specs[k])) {
						arr.push(specs[k].join('+'));
					} else {
						arr.push(specs[k]);
					}
				}
				return arr.join(',');
			},
			submitCartCheckout() {
				if (!requireLoginToCurrentPage()) return;
				if (this.cartItems.length === 0) {
					this.$refs.selectGoodsPopup.open()
					return;
				}

				let totalPackageFee = 0;
				for (let cartItem of this.cartItems) {
					totalPackageFee += parseFloat(cartItem.item.lunchBox || 0) * cartItem.quantity;
				}
				// 类似普通订单结算逻辑
				uni.navigateTo({
					url: '/package1/buyFood/buyFood?cart=' + encodeURIComponent(JSON.stringify(this.cartItems)) +
						'&shopItem=' + encodeURIComponent(JSON.stringify(this.shopItem)) + '&packageFee=' +
						totalPackageFee
				});
			},
			goDetail(type) {
				if (type == 'shopDetail') {
					uni.setStorageSync('groupShopDetail', this.shopItem)
					uni.navigateTo({
						url: '/package2/group/groupBuyDetail?id=' + this.shopItem.id
					})
				} else if (type == 'shopEvaluate') {
					uni.navigateTo({
						url: '/package2/group/shopEvaluate?item=' + encodeURIComponent(JSON.stringify(this.shopItem))
					})
				} else if (type == 'openKitchen') {
					this.tui.toast('明厨亮灶暂未开放');
				}
			},
			openGoodsDetail(item) {
				this.detailItem = item || {};
				this.$refs.goodsDetailPopup.open('bottom');
			},
			getProductIntro(item) {
				if (!item || item.productIntro == undefined || item.productIntro == null) return '';
				let intro = '';
				if (typeof item.productIntro === 'object') {
					intro = item.productIntro.html || item.productIntro.text || '';
				} else {
					intro = item.productIntro;
				}
				return this.normalizeRichText(intro);
			},
			normalizeRichText(html) {
				if (!html || typeof html !== 'string') return html || '';
				const imageStyle = 'max-width:100%;width:100%;height:auto;display:block;margin:12px auto;';
				return html.replace(/<img\b([^>]*)>/gi, (match, attrs) => {
					if (/style\s*=/i.test(attrs)) {
						return '<img' + attrs.replace(/style=(["'])(.*?)\1/i, (styleMatch, quote, styleValue) => {
							return 'style=' + quote + imageStyle + styleValue + quote;
						}) + '>';
					}
					return '<img style="' + imageStyle + '"' + attrs + '>';
				});
			},
			getAttributePrice(item) {
				let price = 0;
				if (!item || !item.attributeListPrice) return price;
				try {
					let pObj = typeof item.attributeListPrice === 'string' ? JSON.parse(item.attributeListPrice) : item.attributeListPrice;
					if (Array.isArray(pObj) && pObj.length > 0) {
						price = parseFloat(pObj[0].specPrice);
					} else {
						for (let k in pObj) {
							price = parseFloat(pObj[k].specPrice);
							break;
						}
					}
				} catch (e) {}
				return isNaN(price) ? 0 : price;
			},
			getDetailGroupPrice(item) {
				if (!item || !item.productGroupBuyPrices || item.isMoreBuy == 1) return '';
				return this.getGroupPrice(item);
			},
			buyingye() {
				uni.showToast({
					title: '商品不在售卖时间！',
					icon: 'none'
				});
			},
			getGroupPrice(item) {
				if (!this.groupId) {
					return this.$options.filters.slicePrice(item.productGroupBuyPrices);
				}
				let target = this.targetMembers;
				let prices = item.productGroupBuyPrices || [];
				if (prices.length === 0) return '0.00';
				let validPrices = prices.filter(p => p.groupCount <= target);
				if (validPrices.length === 0) {
					let minRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ? prev : curr));
					return parseFloat(minRule.groupPrice).toFixed(2);
				}
				let bestRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ? obj : max));
				return parseFloat(bestRule.groupPrice).toFixed(2);
			},
			selectMoreBuy(item, index) {
				this.checkMoreBuyIndex = item.id
				this.moreBuyList[index].isChecked = !this.moreBuyList[index].isChecked;
				
				let isHas = false
				let index1 = ''
				for (let i = 0; i < this.moreBuyList.length; i++) {
					if (this.moreBuyList[i].id != item.id && this.moreBuyList[index].isChecked) {
						this.moreBuyList[i].isChecked = false
					}
				}
				for (let i = 0; i < this.moreBuyData.length; i++) {
					if (this.moreBuyData[i].id == this.moreBuyList[index].id) {
						isHas = true
						index1 = i
						this.vModelValue = this.moreBuyData[i].quantity ? this.moreBuyData[i].quantity : 0
						this.moreBuyList[index].quantity = this.moreBuyData[i].quantity ? this.moreBuyData[i].quantity : 0
					}
				}
				if (!isHas) {
					this.vModelValue = 0
				}

				if (this.moreBuyList[index].isChecked && !isHas) {
					item.quantity = 0
					this.moreBuyData.push(item)
				}
				if (!this.moreBuyList[index].isChecked && isHas) {
					this.moreBuyData.splice(index1, 1)
					this.moreBuyList[index].quantity = 0
				}

				let moreBuyPrice = 0
				for (let i = 0; i < this.moreBuyData.length; i++) {
					if (this.moreBuyData[i].quantity > 0) {
						moreBuyPrice += Number((Number(this.moreBuyData[i].quantity) * Number(this.sliceMsg2(this
							.moreBuyData[i].attributeListPrice))).toFixed(2))
					}
				}
				this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice
				if (this.selectedCoupon) {
					this.selectedGroupRule.groupPriceAndMore -= this.getCouponDiscount(this.selectedCoupon);
					if (this.selectedGroupRule.groupPriceAndMore <= 0) {
						this.selectedGroupRule.groupPriceAndMore = 0.01
					}
				}
				if(this.moreBuyList[index].isChecked == false){
					this.vModelValue = 0
				}
			},
			sliceMsg2(val) {
				var name = ''
				if (typeof(val) == 'string') {
					let newObj = JSON.parse(val)
					for (let as in newObj) {
						name = newObj[as].specPrice
					}
				}
				return name;
			},
			changeValue(type) {
				let checkedMoreBuy = this.moreBuyList.find(item => item.isChecked && item.id == this.checkMoreBuyIndex);
				if (!checkedMoreBuy) {
					uni.showToast({
						title: '请先选择搭配小食商品',
						icon: 'none'
					});
					return;
				}
				if (type == 'plus') {
					this.vModelValue += 1
				} else {
					this.vModelValue = this.vModelValue > 0 ? this.vModelValue -= 1 : 0
				}
				let moreBuyPrice = 0
				for (let i = 0; i < this.moreBuyList.length; i++) {
					if (this.moreBuyList[i].id == this.checkMoreBuyIndex) {
						this.moreBuyList[i].quantity = this.vModelValue
					}
					if (this.moreBuyList[i].quantity > 0) {
						moreBuyPrice += Number((Number(this.moreBuyList[i].quantity) * Number(this.sliceMsg2(this
							.moreBuyList[i].attributeListPrice))).toFixed(2))
					}
				}
				this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice
				if (this.selectedCoupon) {
					this.selectedGroupRule.groupPriceAndMore -= this.getCouponDiscount(this.selectedCoupon);
					if (this.selectedGroupRule.groupPriceAndMore <= 0) {
						this.selectedGroupRule.groupPriceAndMore = 0.01
					}
				}
				for (let i = 0; i < this.moreBuyData.length; i++) {
					if (this.moreBuyData[i].id == this.checkMoreBuyIndex) {
						this.moreBuyData[i].quantity = this.vModelValue
					}
				}
				this.$forceUpdate()
			},
			wxPayment() {
				if (!requireLoginToCurrentPage()) return;
				let that = this;
				if (!this.currentOrderId || !this.backendTotalAmount) {
					if (this.pendingPaySpecChoices) {
						this.createFTFJoinOrder(this.pendingPaySpecChoices, true);
					}
					return;
				}

				let amountInCents = Math.round(this.backendTotalAmount * 100);
				let userRequireMake = 0
				if (this.nowMake && this.groupdeliveryType == 2 && !this.isStoreGroupOrder) {
					userRequireMake = 1
				}

				this.tui.request("/api/wechat/pay/unified-order", "POST", {
					openid: uni.getStorageSync('miniProgramOpenid') || 'test-openid',
					amount: amountInCents,
					description: '商城订单',
					userRequireMake: userRequireMake,
					isPack: this.groupdeliveryType == 2 ? this.isPack : 1,
					outTradeNo: this.currentOrderId
				}, false, false).then((res) => {
					if (res.code == 200) {
						uni.requestPayment({
							provider: 'wxpay',
							timeStamp: res.timeStamp,
							nonceStr: res.nonceStr,
							package: res.package,
							signType: res.signType,
							paySign: res.paySign,
							success: function(res2) {
								/* uni.showToast({ title: '支付成功', icon: 'success' });
									that.tui.request("/api/wechat/pay/paySuccess", "POST", {
										outTradeNo: that.currentOrderId
									}, false, false).then((res3) => {
										if(res3.code == 200){
											uni.redirectTo({
												url: '/package1/order/orderConfirm?id=' + that.currentOrderId + '&groupId=' + that.groupId + '&amount=' + this.backendTotalAmount 
											});
										}else{
											that.tui.toast("订单创建失败，请联系客服处理");
										}
									}) */
								that.goPayOrderConfirm();
							},
							fail: function(err) {
								that.goPayOrderDetail();
							}
						});
					} else {
						// 模拟支付成功
						if (res.code == 404 || res.code == 500 || res.code == 400 || !res.code) {
							that.tui.request(
								`/hiver/order/payMallOrderSuccess?orderId=${that.currentOrderId}&workerId=`,
								"POST", {}, false, false).then(res2 => {
								that.navigatingFromPayPopup = true;
								that.$refs.payPopup.close();
								uni.showToast({
									title: '支付成功(模拟)',
									icon: 'none'
								});
								setTimeout(() => {
									that.goPayOrderConfirm();
								}, 1500);
							});
						} else {
							that.tui.toast(res.message);
						}
					}
				})
			},
			onJoinSuccessPopupChange(e) {
				this.onBottomPopupChange(e);
				if (!e.show) {
					uni.redirectTo({
						url: '/package1/order/pendGroup?groupId=' + this.groupId
					});
				}
			},
			fetchCoupons() {
				let userId = uni.getStorageSync('id');
				if (!userId) return Promise.resolve([]);
				let regionId = this.getCurrentRegionId();
				if (!regionId) return Promise.resolve([]);
				let amount = this.getFaceToFaceGoodsAmount();
				return this.tui.request('/mall/coupon/available', 'GET', {
					userId: userId,
					applyScene: this.isStoreGroupOrder ? 4 : 1,
					regionId: regionId,
					amount: amount,
					merchantId: this.shopItem.id || '0'
				}, false, true).then((res) => {
					if (res.code == 200 && res.result) {
						this.availableCoupons = this.normalizeCoupons(res.result);
						if (this.selectedCoupon) {
							let stillValid = this.availableCoupons.find(c => c.id === this.selectedCoupon.id);
							if (!stillValid) this.selectedCoupon = null;
						}
					}
					return this.availableCoupons;
				});
			},
			openMianRemark() {
				this.isPindan = false;
				this.$refs.tishiPopup.open()
			},
			selectCoupon(item) {
				this.selectedCoupon = item;
				this.refreshSelectedGroupPayPrice();
				this.$refs.couponPopup.close();
			},
			openCouponPopup() {
				this.fetchCoupons();
				this.$refs.couponPopup.open('bottom');
			},
			back() {
				const pages = getCurrentPages();
				if (pages.length > 1) {
					uni.navigateBack();
				} else {
					uni.switchTab({
						url: '/pages/index/index'
					});
				}
			}
		}
	}
</script>

<style lang="scss">
	page {
		width: 100%;
		height: 100%;
		font-size: 24rpx;
		background: #F5F8F5;
		color: #00231C;
	}

	.page1 {
		width: 100%;
		height: 100%;
		font-size: 24rpx;
		position: relative;
	}

	/* 顶部背景图随页面滚动（不固定） */
	.title {
		background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') no-repeat;
		width: 100%;
		height: 340rpx;
		background-size: 100%;
		position: relative;
		overflow: hidden;
	}

	/* 固定在顶部的导航栏，覆盖在背景图上 */
	.nav-bar {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		display: flex;
		align-items: center;
		z-index: 100;
		padding: 16rpx 24rpx;
		box-sizing: border-box;
		transition: background 0.18s ease;
	}

	.nav-bar--popup-open {
		z-index: 90;
	}

	.radio-check {
		background: linear-gradient(90deg, #e3ff96, #a6ffea);
		width: 42rpx;
		height: 42rpx;
		border-radius: 42rpx;
		text-align: center;
		line-height: 42rpx;
		margin: 0 18rpx 0 0;
		box-shadow: 0 6rpx 16rpx rgba(49, 224, 183, 0.22);
	}

	.radio-no-check {
		width: 42rpx;
		height: 42rpx;
		border-radius: 42rpx;
		border: 2rpx solid #e8eeee;
		margin: 0 18rpx 0 0;
		background: #fff;
	}

	.pack-options {
		display: flex;
		align-items: center;
		margin-top: 22rpx;
	}

	.pack-option {
		display: flex;
		align-items: center;
		color: #00231C;
		font-size: 28rpx;
		font-weight: 800;
		margin-right: 40rpx;
	}

	.title-search {
		display: flex;
		flex: 1;
		width: 60%;
		background: #fff;
		height: 54rpx;
		margin-left: 20rpx;
		border-radius: 54rpx;
		position: relative;
		z-index: 1;
		overflow: hidden;
		box-shadow: 0 6rpx 18rpx rgba(99, 49, 13, 0.08);

		input {
			height: 54rpx;
			width: 60%;
			line-height: 54rpx;
		}
	}

	.back-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 60rpx;
		height: 60rpx;
		border-radius: 50%;
	}

	/* content 上移，叠在背景图下方，减少头部空白 */
	.content {
		margin-top: -155rpx;
		position: relative;
		z-index: 1;
		height: auto;
	}

	.shop-img {
		width: 160rpx;
		height: 160rpx;
		position: relative;

		img {
			width: 100%;
			background-size: 100%;
			height: 100%;
			border-radius: 20rpx;
		}
	}

	.shop-top {
		display: flex;
	}

	.shop-content {
		flex: 1;
		padding-left: 20rpx;

	}

	.shop-name {
		font-size: 32rpx;
		font-weight: 900;
	}

	.shop-content-center {
		display: flex;
		margin: 20rpx 0;
	}

	.shop-rate {
		background: rgba(249, 212, 157, 0.34);
		height: 40rpx;
		display: flex;
		border-radius: 20rpx;
		padding: 0 10rpx 0 0;
	}

	.shop-rate-num {
		width: 50rpx;
		height: 100%;
		text-align: center;
		background: linear-gradient(90deg, rgba(255, 77, 0, 1), rgba(255, 184, 84, 1));
		color: #fff;
		line-height: 40rpx;
		font-size: 22rpx;
		border-bottom-left-radius: 20rpx;
		border-top-left-radius: 20rpx;
		border-bottom-right-radius: 10rpx;
		border-top-right-radius: 10rpx;
		font-weight: 700;
	}

	.shop-tag {
		flex: 1;
		line-height: 40rpx;
		text-align: right;
	}

	.shop-tag1 {
		flex: 1;
		line-height: 40rpx;
		text-align: left;
	}

	.shop-content-bottom {
		display: flex;
		align-items: center;
		margin-top: 8rpx;
	}

	.shop-deal {
		flex: 1;
	}

	.shop-action-list {
		flex: 1;
		min-width: 0;
		display: flex;
		align-items: center;
		gap: 8rpx;
	}

	.shop-action-btn {
		height: 48rpx;
		padding: 0 12rpx;
		border-radius: 999rpx;
		background: rgba(246, 255, 252, 0.86);
		border: 1rpx solid rgba(166, 255, 234, 0.62);
		color: #52625d;
		font-size: 22rpx;
		font-weight: 800;
		line-height: 48rpx;
		white-space: nowrap;
		box-shadow: inset 0 0 0 1rpx rgba(255, 255, 255, 0.72);
	}

	.shop-action-btn:active {
		transform: scale(0.96);
		opacity: 0.86;
	}

	.shop-deal1 {
		flex-shrink: 0;
		margin-left: 10rpx;
		color: #87938f;
		font-size: 22rpx;
		font-weight: 700;
		white-space: nowrap;
	}

	.shop-bottom {
		margin-top: 20rpx;
		line-height: 40rpx;
		font-weight: 700;
	}

	.pintuan {
		background: #fff;
		padding: 20rpx;
		width: 95%;
		margin: 0 auto;
		border-radius: 20rpx;
	}

	.pintuan-left {
		display: flex;
		padding: 20rpx;
		flex: 1;
	}

	.pintuan-left-img {
		width: 90rpx;
		height: 90rpx;

		img {
			width: 100%;
			height: 100%;
			background-size: 100%;
			border-radius: 20rpx;
		}
	}

	.pintuan-left-box {
		flex: 1;
		padding-left: 20rpx;
	}

	.pintuan-right {
		display: flex;
		margin-top: 50rpx;
		width: 30%;
	}

	.pintuan-right-img {
		height: 40rpx;
		display: flex;

		img {
			width: 40rpx;
			height: 40rpx;
			z-index: 98;
			margin-right: 16rpx;
			background-size: 100%;
		}
	}

	.pintuan-left-name {
		font-weight: 700;
		margin-bottom: 20rpx;
	}

	.pintuan-left-price {
		display: inline;
		padding: 10rpx;
		background: rgba(255, 57, 57, 0.1);
		border-radius: 10rpx;
	}

	.weipincheng {
		width: 40rpx;
		height: 40rpx;
		background: rgba(166, 255, 234, 1);
		border-radius: 40rpx;
		text-align: center;
		font-size: 28rpx;
		font-weight: 700;
		margin-left: -6rpx;
		z-index: 97;
	}

	.pintuan-right-cha {
		line-height: 40rpx;
		padding-left: 10rpx;
	}

	.goods-member {
		padding-bottom: 20rpx;
		margin: 0 0 20rpx;
		background: #fff;
		position: relative;
	}

	.goods-list {
		flex: 1;
		min-height: 0;
		border-radius: 20rpx;
		overflow: hidden;
	}

	.fee-value {
		color: #00231C;
		font-weight: 800;
	}


	.goods-top {
		padding: 20rpx;
		display: flex;
	}

	.goods-content {
		flex: 1;
		padding-left: 20rpx;
	}

	.goods-name {
		font-size: 32rpx;
		font-weight: 900;
	}

	.goods-content-center {
		display: flex;
		margin: 16rpx 0;
	}

	.goods-rate {
		background: rgba(249, 212, 157, 0.34);
		height: 40rpx;
		display: flex;
		border-radius: 20rpx;
	}

	.goods-rate-num {
		width: 50rpx;
		height: 100%;
		text-align: center;
		background: linear-gradient(90deg, rgba(255, 77, 0, 1), rgba(255, 184, 84, 1));
		color: #fff;
		line-height: 40rpx;
		font-size: 22rpx;
		border-bottom-left-radius: 20rpx;
		border-top-left-radius: 20rpx;
		border-bottom-right-radius: 10rpx;
		border-top-right-radius: 10rpx;
	}

	.goods-deal1 {
		width: 60%;
	}

	.goods-tag {
		display: flex;
		margin: 0;
		width: 100%;
	}

	.goods-content-bottom {
		display: flex;
	}

	.goods-deal {
		flex: 1;
	}

	.goods-img {
		width: 160rpx;
		height: 160rpx;
		position: relative;

		img {
			width: 100%;
			background-size: 100%;
			height: 100%;
		}
	}

	.group-corner-badge {
		position: absolute;
		top: -1rpx;
		left: -1rpx;
		z-index: 2;
		height: 34rpx;
		line-height: 34rpx;
		padding: 0 12rpx;
		border-radius: 18rpx 18rpx 18rpx 6rpx;
		background: linear-gradient(90deg, #ff6a2a, #ffb854);
		color: #fff;
		font-size: 18rpx;
		font-weight: 900;
		box-shadow: 0 8rpx 16rpx rgba(255, 106, 42, 0.28);
		border: 2rpx solid rgba(255, 255, 255, 0.9);
	}

	.goods-bottom {
		width: 95%;
		margin: 0 auto;
		height: 70rpx;
		line-height: 70rpx;
	}

	.goods-btn {
		background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));
		width: 47%;
		text-align: center;
		font-size: 28rpx;
		font-weight: 700;
		border-radius: 20rpx;
		float: right;
	}

	.bottom {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		display: flex;
		background: #fff;
		z-index: 98;
		box-shadow: 0 -10rpx 10rpx rgba(0, 0, 0, 0.3);
	}

	.bottom-left {
		flex: 1;
		display: flex;
		padding: 20rpx;

		img {
			width: 60rpx;
			height: 80rpx;
			background-size: 100%;
		}
	}

	.bottom-price {
		margin-left: 40rpx;
		font-size: 40rpx;
		color: red;
		font-weight: 700;
		line-height: 110rpx;
	}

	.bottom-right {
		padding-top: 20rpx;
		flex: 1;

		img {
			width: 360rpx;
			height: 100rpx;
			background-size: 100%;
		}
	}

	.bottom-dot {
		position: absolute;
		top: 0;
		right: -20rpx;
		background: red;
		color: #fff;
		width: 32rpx;
		height: 32rpx;
		border-radius: 32rpx;
		text-align: center;
		line-height: 32rpx;
	}

	.car-content {
		position: relative;
		height: auto;
		max-height: 1200rpx;
		width: 100%;
		border-top-left-radius: 20rpx;
		border-top-right-radius: 20rpx;
		padding: 20rpx;
		overflow: scroll;
	}

	.car-close {
		width: 60rpx;
		height: 60rpx;
		position: absolute;
		top: -80rpx;
		right: 20rpx;
	}

	.car-title {
		height: 96rpx;
		line-height: 60rpx;
		margin: 0 auto;
		font-size: 28rpx;
		font-weight: 700;
	}

	.select-goods-popup {
		position: relative;
		width: 580rpx;
		padding: 58rpx 44rpx 46rpx;
		box-sizing: border-box;
		border-radius: 44rpx;
		background:
			radial-gradient(circle at 18% 12%, rgba(166, 255, 234, 0.42) 0, rgba(166, 255, 234, 0) 128rpx),
			radial-gradient(circle at 82% 22%, rgba(216, 255, 122, 0.38) 0, rgba(216, 255, 122, 0) 150rpx),
			linear-gradient(180deg, #ffffff 0%, #f6fffb 100%);
		text-align: center;
		box-shadow: 0 28rpx 80rpx rgba(0, 35, 28, 0.18);
		overflow: hidden;
	}

	.select-goods-close {
		position: absolute;
		top: 22rpx;
		right: 22rpx;
		width: 52rpx;
		height: 52rpx;
		border-radius: 50%;
		background: rgba(244, 251, 249, 0.95);
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 2;
	}

	.select-goods-decor {
		position: absolute;
		border-radius: 999rpx;
		background: linear-gradient(135deg, rgba(216, 255, 122, 0.68), rgba(166, 255, 234, 0.72));
		filter: blur(1rpx);
	}

	.decor-left {
		width: 150rpx;
		height: 46rpx;
		top: 22rpx;
		left: -44rpx;
		transform: rotate(-18deg);
	}

	.decor-right {
		width: 190rpx;
		height: 54rpx;
		right: -62rpx;
		bottom: 118rpx;
		transform: rotate(-22deg);
	}

	.select-goods-icon {
		width: 108rpx;
		height: 108rpx;
		margin: 0 auto 22rpx;
		border-radius: 36rpx;
		background: linear-gradient(135deg, #e3ff96 0%, #a6ffea 100%);
		display: flex;
		align-items: center;
		justify-content: center;
		box-shadow: 0 16rpx 32rpx rgba(98, 229, 190, 0.25);
		transform: rotate(-6deg);
	}

	.select-goods-title {
		color: #153a35;
		font-size: 34rpx;
		font-weight: 900;
		line-height: 48rpx;
	}

	.select-goods-text {
		margin-top: 18rpx;
		color: #334943;
		font-size: 32rpx;
		font-weight: 900;
		line-height: 46rpx;
	}

	.select-goods-btn {
		width: 320rpx;
		height: 82rpx;
		margin: 42rpx auto 0;
		border-radius: 999rpx;
		background: linear-gradient(90deg, #d8ff7a 0%, #8ff5d8 100%);
		color: #153a35;
		font-size: 28rpx;
		font-weight: 900;
		line-height: 82rpx;
		box-shadow: 0 16rpx 34rpx rgba(98, 229, 190, 0.28);
	}

	.num-plus {
		width: 56rpx;
		height: 56rpx;
		font-size: 36rpx;
		text-align: center;
		font-weight: 700;
		line-height: 48rpx;
		border-radius: 10rpx;

		background: linear-gradient(135deg, #d8ff7a 0%, #8ff5d8 100%);
		color: #153a35;
		box-shadow: 0 8rpx 18rpx rgba(98, 229, 190, 0.22);

	}

	.num {
		width: 80rpx;
		height: 56rpx;
		text-align: center;
		line-height: 56rpx;
		font-size: 28rpx;
	}

	.goods-num {
		display: flex;
		height: 56rpx;
		flex: 1;
		margin-left: 40rpx;
	}

	.pintuan0 {
		width: 90%;
		height: 100rpx;
		border-radius: 100rpx;
		background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));
		text-align: center;
		font-size: 26rpx;
		font-weight: 700;
		line-height: 100rpx;
		margin: auto;
	}

	.pintuan1 {
		width: 90%;
		height: 100rpx;
		line-height: 100rpx;
		display: flex;
		gap: 18rpx;
		text-align: center;
		margin: auto;
		font-size: 26rpx;
		font-weight: 700;
	}

	.pintuan2 {
		flex: 1;
		background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));
		border-radius: 100rpx;
		overflow: hidden;
	}

	.spec11 {
		height: 96rpx;
		line-height: 96rpx;
		font-size: 28rpx;
		font-weight: 700;
	}

	.spec22 {
		display: flex;
		white-space: nowrap;
		overflow-x: scroll;
	}

	.spec222 {
		display: inline-block;
		padding: 0 20rpx;
		background: rgba(247, 248, 248, 0.6);
		color: #777;
		height: 72rpx;
		line-height: 72rpx;
		text-align: center;
		border-radius: 20rpx;
		margin-right: 20rpx;
	}

	.spec-check {
		display: inline-block;
		padding: 0 20rpx;
		background: rgba(166, 255, 234, 1);
		height: 72rpx;
		line-height: 72rpx;
		text-align: center;
		border-radius: 20rpx;
		margin-right: 20rpx;
	}

	.team1 {
		width: 154rpx;
		background: rgba(247, 248, 248, 0.6);
		border-radius: 20rpx;
		font-size: 26rpx;
		text-align: center;
		line-height: 40rpx;
		float: left;
		margin-right: 40rpx;
		font-weight: 700;
		padding: 10px;
	}

	.team2 {
		width: 190rpx;
		height: 270rpx;
		background: rgba(247, 248, 248, 0.6);
		border-radius: 10px;
		float: left;
		text-align: center;
		margin: 10px 20px 0 0;
		padding: 10px 10px 0;
		position: relative;
	}

	.team-check1 {
		width: 190rpx;
		height: 270rpx;
		background: rgba(166, 255, 234, 1);
		border-radius: 10px;
		float: left;
		text-align: center;
		margin: 10px 20px 0 0;
		padding: 10px 10px 0;
		position: relative;
	}

	.team-check {
		width: 154rpx;
		height: auto;
		background: rgba(166, 255, 234, 1);
		border-radius: 20rpx;
		font-size: 26rpx;
		text-align: center;
		line-height: 40rpx;
		float: left;
		margin-right: 40rpx;
		position: relative;
		padding: 10px;
	}

	.zaixian-swiper {
		flex: 1;
		height: 126rpx;
	}

	.zaixian-item {
		height: 126rpx;
		line-height: 126rpx;
		font-size: 24rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.team11 {
		height: 35rpx;
		margin-top: 18rpx;
	}

	.goods-team {
		width: 100%;
		min-height: 130rpx;
		display: flex;
		white-space: nowrap;
		overflow-x: scroll;
	}

	.list-right {
		display: flex;
		width: 100%;
		padding: 30rpx 0 30rpx 30rpx;
		flex: 1;
	}

	.jiaobiao {
		position: absolute;
		top: -16rpx;
		right: -12rpx;
		width: 40rpx;
		height: 40rpx;
		border-radius: 40rpx;
		background: red;
		color: #fff;
		text-align: center;
		line-height: 40rpx;
		font-size: 20rpx;
	}

	.list-right-img {
		height: 80rpx;
		display: flex;

		img {
			width: 80rpx;
			height: 80rpx;
			z-index: 98;
			margin-right: 16rpx;
			background-size: 100%;
		}
	}

	.list-weipincheng {
		width: 80rpx;
		height: 80rpx;
		background: #a6ffea;
		border-radius: 80rpx;
		text-align: center;
		font-size: 28rpx;
		font-weight: 700;
		margin-left: -6rpx;
		z-index: 97;
		line-height: 80rpx;
	}

	.goods-center {
		width: 100%;
		margin: 0 auto 20rpx;
		background: #f5f8f5;
		height: 140rpx;
		border-radius: 20rpx;
		overflow: hidden;
		display: flex;
	}

	.list-right-cha {
		margin-left: 20rpx;
	}

	.list-right-price {
		flex: 1;
		text-align: right;
		line-height: 80rpx;
		color: red;
		font-size: 28rpx;
		font-weight: 700;
	}

	.list-btn {
		background: linear-gradient(90deg, #e3ff96, #a6ffea);
		width: 130rpx;
		text-align: center;
		font-size: 28rpx;
		font-weight: 600;
		border-radius: 60rpx;
		height: 60rpx;
		line-height: 60rpx;
		margin: 40rpx;
	}

	.cha11 {
		font-size: 22rpx;
		background: rgba(255, 57, 57, 0.2);
		color: red;
		display: inline-block;
		padding: 6rpx;
		border-radius: 10rpx;
		margin-bottom: 10rpx;
	}

	.checked-img {
		width: 180rpx;
		height: 20rpx;
		position: absolute;
		bottom: 0;
		left: 0;
	}

	.menu1 {
		width: 160rpx;
		height: 90rpx;
		position: relative;
		text-align: center;
		line-height: 90rpx;
	}

	.hero-spark {
		position: absolute;
		border-radius: 999rpx;
		background: rgba(255, 255, 255, 0.78);
		box-shadow: 0 0 22rpx rgba(255, 244, 183, 0.9);
		animation: sparkFloat 3.2s ease-in-out infinite;
	}

	.spark-a {
		width: 18rpx;
		height: 18rpx;
		top: 110rpx;
		left: 80rpx;
	}

	.tishi-popup {
		background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/629843c61a014d69bf3a1195f51a898b.png') no-repeat;
		width: 300px;
		height: 285px;
		box-sizing: border-box;
		background-size: 100% 100%;
		position: relative;
		text-align: center;
	}

	.tishi-copy {
		position: absolute;
		top: 72px;
		left: 46px;
		width: 194px;
	}

	.tishi-copy-title {
		color: #21443c;
		font-size: 16px;
		font-weight: 900;
		line-height: 23px;
		letter-spacing: 0.2px;
		text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
	}

	.tishi-copy-desc {
		margin-top: 13px;
		color: #6d7d78;
		font-size: 14px;
		font-weight: 700;
		line-height: 21px;
		letter-spacing: 0.1px;
	}

	.tishi-copy-highlight {
		color: #ff7043;
		font-weight: 900;
	}

	.group-face-tip-popup {
		width: 560rpx;
		padding: 54rpx 42rpx 40rpx;
		box-sizing: border-box;
		border-radius: 34rpx;
		background: linear-gradient(180deg, #fff8ec 0%, #ffffff 58%, #fff3e6 100%);
		box-shadow: 0 18rpx 60rpx rgba(130, 75, 28, 0.22);
		position: relative;
		text-align: center;
		overflow: hidden;
	}

	.group-face-tip-popup::before {
		content: '';
		position: absolute;
		top: -90rpx;
		right: -70rpx;
		width: 220rpx;
		height: 220rpx;
		border-radius: 50%;
		background: rgba(255, 190, 96, 0.18);
	}

	.group-face-tip-close {
		position: absolute;
		top: 22rpx;
		right: 24rpx;
		width: 48rpx;
		height: 48rpx;
		line-height: 48rpx;
		border-radius: 50%;
		background: rgba(255, 236, 214, 0.9);
	}

	.group-face-tip-title {
		color: #9a4f17;
		font-size: 38rpx;
		font-weight: 900;
		line-height: 52rpx;
	}

	.group-face-tip-text {
		margin-top: 26rpx;
		color: #2c3f38;
		font-size: 30rpx;
		font-weight: 700;
		line-height: 44rpx;
	}

	.group-face-tip-btn {
		margin: 42rpx auto 0;
		width: 300rpx;
		height: 76rpx;
		line-height: 76rpx;
		border-radius: 999rpx;
		color: #fff;
		font-size: 28rpx;
		font-weight: 800;
		background: linear-gradient(90deg, #f28b38, #c96f1e);
		box-shadow: 0 10rpx 24rpx rgba(207, 112, 30, 0.25);
	}

	.spark-b {
		width: 24rpx;
		height: 24rpx;
		top: 190rpx;
		right: 110rpx;
		animation-delay: 0.6s;
	}

	.spark-c {
		width: 14rpx;
		height: 14rpx;
		top: 82rpx;
		right: 250rpx;
		animation-delay: 1.1s;
	}

	.group-hero-card,
	.group-live-card,
	.goods-card {
		position: relative;
		overflow: hidden;
		border: 1px solid rgba(255, 255, 255, 0.9);
		box-shadow: 0 18rpx 42rpx rgba(0, 35, 28, 0.08);
	}

	.group-hero-card {
		background:
			radial-gradient(circle at 88% 8%, rgba(255, 216, 133, 0.44) 0, rgba(255, 216, 133, 0) 190rpx),
			linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 255, 248, 0.95) 48%, rgba(233, 255, 247, 0.98) 100%);
		animation: cardFloatIn 0.32s ease both;
	}

	.group-card-glow,
	.goods-card-shine {
		position: absolute;
		width: 280rpx;
		height: 240rpx;
		top: -120rpx;
		right: -150rpx;
		border-radius: 50%;
		background: rgba(166, 255, 234, 0.26);
		pointer-events: none;
	}

	.shop-rally-badge {
		display: inline-flex;
		align-items: center;
		height: 42rpx;
		margin-bottom: 18rpx;
		padding: 0 18rpx;
		border-radius: 999rpx;
		background: linear-gradient(90deg, #fff2c6 0%, #a6ffea 100%);
		color: #123d35;
		font-size: 22rpx;
		font-weight: 900;
		box-shadow: 0 8rpx 18rpx rgba(0, 35, 28, 0.06);
		position: relative;
		z-index: 1;
	}

	.shop-rally-dot {
		width: 8rpx;
		height: 8rpx;
		margin: 0 12rpx;
		border-radius: 50%;
		background: #ff7a4f;
		box-shadow: 0 0 16rpx rgba(255, 122, 79, 0.7);
	}

	.shop-subtitle {
		margin-top: 8rpx;
		color: #6b7c77;
		font-size: 22rpx;
		font-weight: 700;
		line-height: 32rpx;
	}

	.notice-label {
		display: inline-block;
		height: 34rpx;
		line-height: 34rpx;
		margin-right: 12rpx;
		padding: 0 12rpx;
		border-radius: 999rpx;
		background: rgba(255, 117, 88, 0.12);
		color: #ff5b36;
		font-size: 20rpx;
		font-weight: 900;
	}

	.group-live-card {
		display: block !important;
		padding: 12rpx 16rpx !important;
		background:
			radial-gradient(circle at 92% 0, rgba(166, 255, 234, 0.42) 0, rgba(166, 255, 234, 0) 150rpx),
			linear-gradient(135deg, #f8fffb 0%, #fff7dc 48%, #eafff8 100%);
		color: #123d35;
		border: 1px solid rgba(166, 255, 234, 0.72);
		border-radius: 26rpx;
		box-shadow: 0 12rpx 28rpx rgba(0, 35, 28, 0.08);
	}

	.group-live-card-empty {
		padding-bottom: 10rpx !important;
	}

	.group-live-card::after {
		content: '';
		position: absolute;
		width: 300rpx;
		height: 520rpx;
		top: -150rpx;
		left: -340rpx;
		background: linear-gradient(110deg, rgba(255, 255, 255, 0) 0%, rgba(255, 196, 102, 0.28) 46%, rgba(255, 255, 255, 0) 100%);
		transform: rotate(18deg);
		animation: lightSweep 3.8s ease-in-out infinite;
	}

	.live-card-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		position: relative;
		z-index: 1;
		margin-bottom: 6rpx;
	}

	.live-title-wrap {
		display: flex;
		align-items: center;
		min-width: 0;
	}

	.live-title-gif {
		width: 42rpx;
		height: 42rpx;
		margin-right: 8rpx;
		flex-shrink: 0;
	}

	.live-title {
		font-size: 24rpx;
		font-weight: 900;
		line-height: 34rpx;
	}

	.live-subtitle {
		color: #6d7c77;
		font-size: 20rpx;
		line-height: 26rpx;
	}

	.live-pill {
		height: 48rpx;
		line-height: 48rpx;
		padding: 0 22rpx;
		border-radius: 999rpx;
		background: linear-gradient(90deg, #e3ff96, #a6ffea);
		color: #00231c;
		font-size: 22rpx;
		font-weight: 900;
		animation: ctaBreath 1.8s ease-in-out infinite;
	}

	.live-swiper-item {
		display: flex;
		align-items: center;
		position: relative;
		z-index: 1;
		height: 92rpx;
		border-radius: 22rpx;
		background: rgba(255, 255, 255, 0.74);
		border: 1px solid rgba(166, 255, 234, 0.46);
	}

	.group-live-card .pintuan-left {
		min-width: 0;
		padding: 8rpx 10rpx;
	}

	.group-live-card .pintuan-right {
		width: 214rpx;
		flex-shrink: 0;
		align-items: center;
		justify-content: flex-end;
		margin-top: 0;
		color: #123d35;
	}

	.group-live-card .pintuan-left-img {
		width: 70rpx;
		height: 70rpx;
	}

	.group-live-card .pintuan-left-name {
		margin-bottom: 8rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.group-live-card .pintuan-left-price {
		padding: 6rpx 10rpx;
		font-size: 20rpx;
	}

	.group-live-card .pintuan-right-cha {
		padding-left: 6rpx;
		font-size: 20rpx;
		line-height: 34rpx;
		white-space: nowrap;
	}

	.group-live-card .pintuan-right-img {
		height: 36rpx;
	}

	.group-live-card .pintuan-right-img img,
	.group-live-card .weipincheng {
		width: 36rpx;
		height: 36rpx;
	}

	.group-live-card .weipincheng {
		line-height: 36rpx;
		font-size: 24rpx;
	}

	.group-live-card .zaixian-swiper {
		height: 92rpx;
		margin-top: 10px;
	}

	.missing-count {
		color: #ff5938;
		font-size: 22rpx;
		font-weight: 900;
		padding: 0 4rpx;
		animation: pricePop 1.5s ease-in-out infinite;
	}

	.goods-panel {
		border-radius: 34rpx 34rpx 0 0;
		overflow: hidden;
		box-shadow: 0 -8rpx 28rpx rgba(0, 35, 28, 0.04);
	}

	/* 单一 page-scroll 结构下的目录布局：左侧分类条 sticky，右侧商品跟随页面滚动 */
	.catalog-row {
		display: flex;
		align-items: flex-start;
		margin-top: 20rpx;
		background: transparent;
	}

	.catalog-menu-wrap {
		position: sticky;
		z-index: 50;
		flex-shrink: 0;
		width: 160rpx;
		background: rgba(247, 255, 251, 0.95);
		border-right: 1rpx solid #eee;
		border-top-left-radius: 34rpx;
	}

	.catalog-goods {
		flex: 1;
		min-width: 0;
		padding-left: 4rpx;
	}

	.menu-scroll {
		background: rgba(247, 255, 251, 0.9);
		border-right: 0 !important;
		flex-shrink: 0;
		width: 160rpx;
		font-weight: 700;
		font-size: 28rpx;
	}

	.menu1 {
		font-weight: 900;
		transition: transform 0.18s ease, background 0.18s ease;
	}

	.menu1:active {
		transform: scale(0.96);
	}

	.menu-active-dot {
		position: absolute;
		left: 6rpx;
		top: 27rpx;
		width: 36rpx;
		height: 36rpx;
	}

	.goods-card {
		width: 96%;
		margin: 0 auto 22rpx;
		border-radius: 30rpx;
		background:
			radial-gradient(circle at 92% 6%, rgba(255, 237, 176, 0.34) 0, rgba(255, 237, 176, 0) 150rpx),
			#fff;
		animation: cardFloatIn 0.28s ease both;
	}

	.goods-card:active {
		transform: scale(0.985);
	}

	.goods-card .goods-img img:first-child {
		box-shadow: 0 12rpx 22rpx rgba(0, 35, 28, 0.1);
	}

	.goods-vibe {
		margin-top: 10rpx;
		display: flex;
		align-items: center;
	}

	.goods-vibe-tag {
		height: 34rpx;
		line-height: 34rpx;
		padding: 0 12rpx;
		border-radius: 999rpx;
		background: linear-gradient(90deg, #fff2c6, #a6ffea);
		color: #0f554a;
		font-size: 20rpx;
		font-weight: 900;
	}

	.goods-vibe-copy {
		margin-left: 10rpx;
		color: #88928f;
		font-size: 20rpx;
		font-weight: 700;
	}

	.goods-card .goods-deal1 {
		color: #71817c;
		font-weight: 700;
	}

	.group-buy-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 70rpx;
		border-radius: 999rpx;
		background: linear-gradient(90deg, #a6ffea 0%, #fff2a8 46%, #ff855d 100%) !important;
		color: #0d332c;
		box-shadow: 0 12rpx 24rpx rgba(255, 133, 93, 0.24);
		animation: ctaBreath 1.35s ease-in-out infinite;
	}

	.btn-spark {
		width: 36rpx;
		height: 36rpx;
		margin-right: 8rpx;
		position: relative;
	}

	.btn-spark::before {
		content: '';
		position: absolute;
		left: 4rpx;
		width: 30rpx;
		height: 30rpx;
		border-radius: 50% 50% 50% 8rpx;
		background: linear-gradient(135deg, #ff4d38 0%, #ffbd49 62%, #fff2a8 100%);
		transform: rotate(-35deg);
		box-shadow: 0 0 14rpx rgba(255, 120, 56, 0.5);
		animation: flamePulse 1.2s ease-in-out infinite;
	}

	.spark-dot {
		position: absolute;
		width: 6rpx;
		height: 6rpx;
		border-radius: 50%;
		background: #fff1a6;
		box-shadow: 0 0 10rpx rgba(255, 193, 74, 0.8);
		animation: sparkBurst 1.1s ease-in-out infinite;
	}

	.spark-dot-1 {
		top: 0;
		left: 14rpx;
	}

	.spark-dot-2 {
		top: 10rpx;
		right: 0;
		animation-delay: 0.22s;
	}

	.spark-dot-3 {
		left: 0;
		bottom: 8rpx;
		animation-delay: 0.42s;
	}

	.solo-buy-btn {
		border-radius: 999rpx !important;
		color: #1f685d;
		box-shadow: inset 0 0 0 1px rgba(166, 255, 234, 0.36);
	}

	.checkout-bar {
		left: 2.5%;
		bottom: 18rpx;
		width: 95%;
		border-radius: 42rpx;
		background: rgba(255, 255, 255, 0.96);
		box-shadow: 0 -8rpx 34rpx rgba(0, 35, 28, 0.16);
		overflow: hidden;
	}

	.cart-bag-wrap {
		animation: bagBounce 2.2s ease-in-out infinite;
	}

	.checkout-bar .bottom-left {
		align-items: center;
		padding: 14rpx 22rpx;
	}

	.checkout-bar .bottom-price {
		margin-left: 28rpx;
		line-height: 42rpx;
		color: #ff3d2e;
	}

	.checkout-bar .bottom-right,
	.car-content .bottom-right {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		padding: 16rpx 18rpx 16rpx 0;
		box-sizing: border-box;
	}

	.checkout-text-btn {
		width: 318rpx;
		height: 92rpx;
		border-radius: 999rpx;
		background: linear-gradient(90deg, #d8ff7a 0%, #8ff5d8 100%);
		color: #153a35;
		font-size: 30rpx;
		font-weight: 900;
		line-height: 92rpx;
		text-align: center;
		position: relative;
		overflow: hidden;
		box-shadow: 0 16rpx 34rpx rgba(98, 229, 190, 0.26);
		border: 2rpx solid rgba(255, 255, 255, 0.68);
	}

	.checkout-text-btn text {
		position: relative;
		z-index: 2;
		letter-spacing: 2rpx;
	}

	.checkout-text-shine {
		position: absolute;
		left: -120rpx;
		top: -40rpx;
		width: 120rpx;
		height: 180rpx;
		background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
		transform: rotate(18deg);
		animation: checkoutTextShine 2.8s ease-in-out infinite;
	}

	.group-submit-btn {
		background: linear-gradient(90deg, #a6ffea 0%, #fff2a8 46%, #ff855d 100%) !important;
		color: #0d332c !important;
		box-shadow: 0 12rpx 24rpx rgba(255, 133, 93, 0.24);
		font-weight: 900;
		animation: ctaBreath 1.35s ease-in-out infinite;
	}

	.group-face-btn {
		background: linear-gradient(90deg, #d8ff7a 0%, #8ff5d8 100%) !important;
		color: #153a35 !important;
		box-shadow: 0 12rpx 24rpx rgba(98, 229, 190, 0.22);
		font-weight: 900;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 38rpx;
		line-height: normal;
	}

	.group-face-text {
		line-height: 1;
	}

	@keyframes checkoutTextShine {

		0%,
		40% {
			transform: translateX(0) rotate(18deg);
		}

		100% {
			transform: translateX(480rpx) rotate(18deg);
		}
	}

	.bottom-price-label {
		color: #7c8b86;
		font-size: 20rpx;
		font-weight: 700;
		line-height: 26rpx;
	}

	.package-fee-tip {
		margin-top: 2rpx;
		color: #7c8b86;
		font-size: 20rpx;
		font-weight: 700;
		line-height: 24rpx;
	}

	.cart-item-price {
		flex: 1;
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		gap: 10rpx;
		margin-right: 20rpx;
		color: #ff4d38;
		font-size: 28rpx;
		font-weight: 900;
		line-height: 54rpx;
	}

	.package-fee-pill {
		display: inline-flex;
		align-items: center;
		height: 34rpx;
		line-height: 34rpx;
		padding: 0 12rpx;
		border-radius: 999rpx;
		background: rgba(255, 244, 232, 0.92);
		border: 1rpx solid rgba(255, 180, 118, 0.54);
		color: #b4572d;
		font-size: 20rpx;
		font-weight: 800;
		white-space: nowrap;
	}

	.goods-detail-popup {
		border-top-left-radius: 40rpx;
		border-top-right-radius: 40rpx;
		background:
			radial-gradient(circle at 92% 0, rgba(166, 255, 234, 0.28) 0, rgba(166, 255, 234, 0) 220rpx),
			linear-gradient(180deg, #ffffff 0%, #f7fffb 100%);
		padding-bottom: 30rpx;
	}

	.detail-popup-title {
		position: sticky;
		top: 0;
		z-index: 2;
		height: 76rpx;
		line-height: 76rpx;
		text-align: center;
		color: #102f29;
		font-size: 32rpx;
		font-weight: 900;
		background: rgba(255, 255, 255, 0.94);
		border-radius: 40rpx 40rpx 0 0;
	}

	.detail-cover {
		width: 100%;
		border-radius: 30rpx;
		overflow: hidden;
		background: #f4f7f6;
		box-shadow: 0 14rpx 30rpx rgba(0, 35, 28, 0.08);
	}

	.detail-cover-img {
		width: 100%;
		display: block;
	}

	.detail-info {
		padding: 24rpx 4rpx 18rpx;
	}

	.detail-name {
		color: #102f29;
		font-size: 34rpx;
		font-weight: 900;
		line-height: 46rpx;
	}

	.detail-meta {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		gap: 14rpx;
		margin-top: 14rpx;
	}

	.detail-price {
		color: #ff4d38;
		font-size: 34rpx;
		font-weight: 900;
	}

	.detail-group-price,
	.detail-fee {
		height: 38rpx;
		line-height: 38rpx;
		padding: 0 14rpx;
		border-radius: 999rpx;
		font-size: 22rpx;
		font-weight: 800;
		white-space: nowrap;
	}

	.detail-group-price {
		background: rgba(255, 57, 57, 0.1);
		color: #ff4d38;
	}

	.detail-sale {
		margin-left: auto;
		color: #7c8b86;
		font-size: 22rpx;
		font-weight: 700;
	}

	.detail-fee {
		display: inline-block;
		margin-top: 16rpx;
		background: rgba(255, 244, 232, 0.92);
		border: 1rpx solid rgba(255, 180, 118, 0.54);
		color: #b4572d;
	}

	.detail-section {
		margin-top: 10rpx;
		padding: 22rpx;
		border-radius: 28rpx;
		background: rgba(255, 255, 255, 0.82);
		border: 1rpx solid rgba(166, 255, 234, 0.36);
	}

	.detail-section-title {
		margin-bottom: 16rpx;
		color: #102f29;
		font-size: 30rpx;
		font-weight: 900;
	}

	.detail-rich {
		color: #3a4b46;
		font-size: 26rpx;
		line-height: 44rpx;
		width: 100%;
		overflow: hidden;
		word-break: break-all;
	}

	.detail-rich rich-text,
	.detail-rich img,
	.detail-rich image {
		max-width: 100% !important;
	}

	.detail-empty {
		color: #9aa5a1;
		font-size: 26rpx;
		line-height: 44rpx;
	}

	.checkout-btn:active,
	.group-buy-btn:active,
	.solo-buy-btn:active,
	.list-btn:active,
	.pintuan2:active {
		transform: scale(0.96);
	}

	.group-order-popup,
	.join-team-popup {
		border-top-left-radius: 40rpx;
		border-top-right-radius: 40rpx;
		background:
			radial-gradient(circle at 92% 0, rgba(166, 255, 234, 0.34) 0, rgba(166, 255, 234, 0) 210rpx),
			linear-gradient(180deg, #ffffff 0%, #f7fffb 100%);
	}

	.popup-rally-title,
	.join-popup-title {
		padding: 8rpx 20rpx 22rpx;
		text-align: center;
	}

	.popup-rally-main,
	.join-popup-main {
		color: #103a32;
		font-size: 28rpx;
		font-weight: 900;
		line-height: 34rpx;
	}

	.fee-label {
		flex: 1;
		color: #6f7f79;
		font-weight: 700;
	}

	.popup-rally-sub,
	.join-popup-sub {
		margin-top: 6rpx;
		color: #74817d;
		font-size: 24rpx;
		font-weight: 700;
		line-height: 34rpx;
	}

	.popup-product-card {
		margin: 0 0 18rpx;
		border-radius: 28rpx;
		background: rgba(255, 255, 255, 0.82);
		border: 1px solid rgba(166, 255, 234, 0.42);
		box-shadow: 0 12rpx 26rpx rgba(0, 35, 28, 0.06);
	}

	.popup-origin-price {
		color: #ff4d38;
		font-weight: 900;
	}

	.popup-package-fee {
		margin-left: 12rpx;
		vertical-align: middle;
	}

	.team-rule-card {
		box-shadow: 0 10rpx 20rpx rgba(0, 35, 28, 0.05);
		transition: transform 0.18s ease;
	}

	.team-check.team-rule-card {
		background: linear-gradient(135deg, #fff2c6, #a6ffea);
		box-shadow: 0 12rpx 28rpx rgba(0, 35, 28, 0.1);
		animation: cardPulse 1.8s ease-in-out infinite;
	}

	.coupon-row {
		margin-top: 28rpx !important;
		padding: 0 18rpx;
		border: 1px solid rgba(255, 216, 133, 0.44) !important;
		border-radius: 22rpx;
		background: rgba(255, 248, 224, 0.64);
	}

	.pay-popup {
		height: auto;
		background: #fff;
		border-radius: 40rpx 40rpx 0 0;
		padding-top: 34rpx;
		padding-bottom: calc(30rpx + env(safe-area-inset-bottom));
	}

	.pay-popup-content {
		height: 100%;
		margin-top: 0;
	}

	.pay-summary-card {
		padding: 28rpx 30rpx 24rpx;
	}

	.pay-more-buy-card {
		padding: 20rpx 30rpx 28rpx;
	}

	.pay-more-buy-title {
		height: 78rpx;
		line-height: 78rpx;
	}

	.pay-more-buy-scroll {
		width: 100%;
		white-space: nowrap;
	}

	.pay-more-buy-list {
		display: inline-flex;
	}

	.pay-more-buy-item {
		float: none;
		flex-shrink: 0;
	}

	.pay-countdown {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 54rpx;
		color: #586963;
		font-size: 26rpx;
	}

	.pay-amount {
		margin-top: 8rpx;
		text-align: center;
		font-size: 30rpx;
		font-weight: 800;
		line-height: 84rpx;
		color: #00231C;
	}

	.pay-amount text {
		font-size: 62rpx;
	}

	.minimum-pay-tip {
		width: 86%;
		min-height: 42rpx;
		margin: -2rpx auto 12rpx;
		padding: 6rpx 18rpx;
		border-radius: 999rpx;
		background: rgba(255, 245, 236, 0.96);
		border: 1rpx solid rgba(255, 112, 67, 0.24);
		color: #f0441f;
		font-size: 22rpx;
		font-weight: 800;
		line-height: 32rpx;
		text-align: center;
		box-sizing: border-box;
	}

	.pay-fee-list {
		margin-top: 14rpx;
		padding: 18rpx 22rpx;
		border-radius: 22rpx;
		background: #f8fbf9;
		border: 1rpx solid #edf3f0;
	}

	.pay-fee-row {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: 44rpx;
		color: #65756f;
		font-size: 24rpx;
		line-height: 34rpx;
	}

	.pay-fee-row + .pay-fee-row {
		margin-top: 8rpx;
	}

	.pay-fee-row text:last-child {
		margin-left: 20rpx;
		color: #243a34;
		font-weight: 800;
	}

	.pay-fee-discount text {
		color: #ff5722 !important;
	}

	.pay-coupon-entry {
		transition: transform 0.18s ease;
	}

	.pay-coupon-entry:active {
		transform: scale(0.98);
	}

	.pay-coupon-value {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		color: #0b9b73;
		font-weight: 800;
	}

	.pay-coupon-value text:first-child {
		margin-right: 8rpx;
		color: inherit;
	}

	.pay-refund-tip {
		margin-top: 16rpx;
		text-align: center;
		color: #f0441f;
		font-size: 24rpx;
		line-height: 36rpx;
	}

	.pay-confirm-btn {
		background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));
		width: 90%;
		height: 100rpx;
		border-radius: 100rpx;
		text-align: center;
		font-size: 28rpx;
		font-weight: 700;
		line-height: 100rpx;
		margin: 40rpx auto;
	}

	.popup-bottom-bar {
		background: rgba(255, 255, 255, 0.98);
		box-shadow: 0 -12rpx 28rpx rgba(0, 35, 28, 0.1);
	}

	.popup-bottom-bar .pintuan2 {
		transition: transform 0.18s ease;
	}

	.popup-bottom-bar .pintuan2:last-child {
		box-shadow: 0 12rpx 24rpx rgba(0, 35, 28, 0.18);
		animation: ctaBreath 1.9s ease-in-out infinite;
	}

	.team-wait-card {
		height: 156rpx;
		border-radius: 30rpx;
		background:
			radial-gradient(circle at 90% 8%, rgba(255, 226, 142, 0.34) 0, rgba(255, 226, 142, 0) 130rpx),
			#fff;
		border: 1px solid rgba(166, 255, 234, 0.42);
		box-shadow: 0 12rpx 26rpx rgba(0, 35, 28, 0.06);
	}

	.team-wait-card .list-btn {
		background: linear-gradient(90deg, #ff855d, #ffd76d);
		color: #fff;
		box-shadow: 0 10rpx 18rpx rgba(255, 133, 93, 0.22);
	}

	@keyframes sparkFloat {

		0%,
		100% {
			opacity: 0.5;
			transform: translateY(0) scale(1);
		}

		50% {
			opacity: 1;
			transform: translateY(-22rpx) scale(1.25);
		}
	}

	@keyframes lightSweep {
		0% {
			left: -360rpx;
			opacity: 0;
		}

		28% {
			opacity: 1;
		}

		64%,
		100% {
			left: 760rpx;
			opacity: 0;
		}
	}

	@keyframes ctaBreath {

		0%,
		100% {
			transform: scale(1);
			box-shadow: 0 12rpx 24rpx rgba(255, 133, 93, 0.22);
		}

		50% {
			transform: scale(1.075);
			box-shadow: 0 18rpx 34rpx rgba(255, 133, 93, 0.42);
		}
	}

	@keyframes pricePop {

		0%,
		100% {
			transform: scale(1);
		}

		50% {
			transform: scale(1.16);
		}
	}

	@keyframes flamePulse {

		0%,
		100% {
			opacity: 0.92;
			transform: rotate(-35deg) scale(1);
		}

		50% {
			opacity: 1;
			transform: rotate(-30deg) scale(1.14);
		}
	}

	@keyframes sparkBurst {

		0%,
		100% {
			opacity: 0.35;
			transform: translateY(0) scale(0.8);
		}

		50% {
			opacity: 1;
			transform: translateY(-8rpx) scale(1.2);
		}
	}

	@keyframes bagBounce {

		0%,
		100% {
			transform: translateY(0);
		}

		50% {
			transform: translateY(-8rpx);
		}
	}

	@keyframes cardFloatIn {
		0% {
			opacity: 0;
			transform: translateY(16rpx);
		}

		100% {
			opacity: 1;
			transform: translateY(0);
		}
	}

	@keyframes cardPulse {

		0%,
		100% {
			transform: scale(1);
		}

		50% {
			transform: scale(1.03);
		}
	}

	.free-order-mask {
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		z-index: 9999;
		display: flex;
		align-items: center;
		justify-content: center;
		background:
			radial-gradient(circle at 20% 18%, rgba(255, 139, 197, 0.34), rgba(255, 139, 197, 0) 280rpx),
			radial-gradient(circle at 78% 22%, rgba(166, 255, 234, 0.4), rgba(166, 255, 234, 0) 300rpx),
			radial-gradient(circle at 50% 70%, rgba(255, 243, 178, 0.28), rgba(255, 243, 178, 0) 360rpx),
			linear-gradient(180deg, rgba(8, 20, 28, 0.62), rgba(18, 22, 34, 0.82));
		backdrop-filter: blur(10rpx);
		-webkit-backdrop-filter: blur(10rpx);
		animation: freeMaskFade 0.22s ease both;
	}

	.free-order-card {
		position: relative;
		width: 630rpx;
		min-height: 700rpx;
		padding: 54rpx 42rpx 46rpx;
		box-sizing: border-box;
		overflow: hidden;
		text-align: center;
		border-radius: 56rpx;
		background:
			linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.34)),
			radial-gradient(circle at 16% 10%, rgba(255, 243, 178, 0.56), rgba(255, 243, 178, 0) 190rpx),
			radial-gradient(circle at 88% 12%, rgba(255, 139, 197, 0.34), rgba(255, 139, 197, 0) 220rpx),
			radial-gradient(circle at 50% 100%, rgba(166, 255, 234, 0.48), rgba(166, 255, 234, 0) 320rpx);
		border: 2rpx solid rgba(255, 255, 255, 0.72);
		box-shadow: 0 38rpx 110rpx rgba(10, 19, 35, 0.34), inset 0 0 46rpx rgba(255, 255, 255, 0.28);
		backdrop-filter: blur(24rpx) saturate(1.28);
		-webkit-backdrop-filter: blur(24rpx) saturate(1.28);
		animation: freeCardPop 0.56s cubic-bezier(0.18, 1.35, 0.28, 1) both;
	}

	.free-order-rays {
		position: absolute;
		left: 50%;
		top: -210rpx;
		width: 680rpx;
		height: 680rpx;
		margin-left: -340rpx;
		border-radius: 50%;
		background:
			conic-gradient(from 20deg, rgba(255, 255, 255, 0), rgba(255, 243, 178, 0.36), rgba(166, 255, 234, 0), rgba(255, 139, 197, 0.3), rgba(255, 122, 73, 0.26), rgba(255, 255, 255, 0));
		opacity: 0.72;
		filter: blur(1rpx);
		animation: freeRaysSpin 9s linear infinite;
	}

	.free-order-orb {
		position: absolute;
		z-index: 1;
		border-radius: 50%;
		filter: blur(1rpx);
		animation: orbFloat 4.6s ease-in-out infinite;
	}

	.orb-1 {
		width: 150rpx;
		height: 150rpx;
		left: -44rpx;
		top: 180rpx;
		background: rgba(166, 255, 234, 0.42);
	}

	.orb-2 {
		width: 118rpx;
		height: 118rpx;
		right: -26rpx;
		bottom: 190rpx;
		background: rgba(255, 139, 197, 0.36);
		animation-delay: 0.8s;
	}

	.free-order-badge,
	.free-order-title,
	.free-order-subtitle,
	.free-order-amount,
	.free-order-note,
	.free-order-btn {
		position: relative;
		z-index: 3;
	}

	.free-order-badge {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		height: 54rpx;
		padding: 0 30rpx;
		border-radius: 999rpx;
		color: #143a36;
		font-size: 23rpx;
		font-weight: 900;
		letter-spacing: 1rpx;
		background: linear-gradient(100deg, rgba(166, 255, 234, 0.86), rgba(255, 243, 178, 0.9), rgba(255, 183, 218, 0.78));
		box-shadow: 0 12rpx 30rpx rgba(116, 242, 210, 0.22), inset 0 0 18rpx rgba(255, 255, 255, 0.42);
	}

	.free-order-title {
		margin-top: 40rpx;
		color: #252232;
		font-size: 76rpx;
		font-weight: 900;
		letter-spacing: 5rpx;
		text-shadow: 0 10rpx 28rpx rgba(255, 132, 189, 0.26);
		animation: freeTitlePop 1.35s ease-in-out infinite;
	}

	.free-order-subtitle {
		margin-top: 12rpx;
		color: rgba(37, 34, 50, 0.72);
		font-size: 28rpx;
		font-weight: 800;
	}

	.free-order-amount {
		display: flex;
		align-items: baseline;
		justify-content: center;
		width: 500rpx;
		height: 170rpx;
		margin: 50rpx auto 0;
		padding: 0 30rpx;
		box-sizing: border-box;
		border-radius: 46rpx;
		color: #fff;
		font-weight: 900;
		background: linear-gradient(110deg, #ff7a49 0%, #fff0a8 22%, #c8ff5d 45%, #72f7df 68%, #ff8bc5 100%);
		background-size: 260% 100%;
		box-shadow: 0 24rpx 58rpx rgba(255, 132, 80, 0.28), 0 0 54rpx rgba(166, 255, 234, 0.24);
		border: 2rpx solid rgba(255, 255, 255, 0.72);
		animation: freeAmountAura 2.8s linear infinite, freeAmountBeat 1.35s ease-in-out infinite;
	}

	.amount-label {
		margin-right: 28rpx;
		font-size: 34rpx;
		letter-spacing: 2rpx;
		text-shadow: 0 8rpx 18rpx rgba(0, 0, 0, 0.14);
	}

	.amount-number {
		font-size: 76rpx;
		letter-spacing: 1rpx;
		text-shadow: 0 10rpx 22rpx rgba(0, 0, 0, 0.18);
	}

	.amount-unit {
		margin-left: 14rpx;
		font-size: 30rpx;
	}

	.free-order-note {
		margin-top: 30rpx;
		color: #54706a;
		font-size: 25rpx;
		font-weight: 800;
		line-height: 38rpx;
	}

	.free-order-btn {
		width: 380rpx;
		height: 96rpx;
		margin: 54rpx auto 0;
		line-height: 96rpx;
		border-radius: 999rpx;
		color: #1e2430;
		font-size: 32rpx;
		font-weight: 900;
		letter-spacing: 2rpx;
		background: linear-gradient(100deg, #fff1a8 0%, #c9ff64 35%, #85ffe8 72%, #ffc1dd 100%);
		box-shadow: 0 18rpx 42rpx rgba(125, 255, 228, 0.28), inset 0 0 22rpx rgba(255, 255, 255, 0.42);
		border: 2rpx solid rgba(255, 255, 255, 0.7);
		animation: rewardBtnFloat 1.8s ease-in-out infinite;
	}

	.free-order-confetti {
		position: absolute;
		z-index: 1;
		width: 16rpx;
		height: 34rpx;
		border-radius: 8rpx;
		opacity: 0.86;
		animation: confettiFloat 4.2s ease-in-out infinite;
	}

	.confetti-1 {
		left: 78rpx;
		top: 128rpx;
		background: #ff8bc5;
	}

	.confetti-2 {
		left: 172rpx;
		top: 78rpx;
		background: #85ffe8;
		animation-delay: 0.4s;
	}

	.confetti-3 {
		right: 96rpx;
		top: 154rpx;
		background: #fff1a8;
		animation-delay: 0.8s;
	}

	.confetti-4 {
		right: 178rpx;
		top: 82rpx;
		background: #ff8a5c;
		animation-delay: 1.1s;
	}

	.confetti-5 {
		left: 300rpx;
		top: 116rpx;
		background: #c9ff64;
		animation-delay: 1.4s;
	}

	.free-order-star {
		position: absolute;
		z-index: 2;
		width: 16rpx;
		height: 16rpx;
		border-radius: 50%;
		background: #fffdf0;
		box-shadow: 0 0 26rpx rgba(255, 246, 179, 0.92);
		animation: starTwinkle 1.8s ease-in-out infinite;
	}

	.star-1 {
		left: 120rpx;
		top: 264rpx;
	}

	.star-2 {
		right: 118rpx;
		top: 236rpx;
		animation-delay: 0.44s;
	}

	.star-3 {
		left: 442rpx;
		bottom: 190rpx;
		animation-delay: 0.82s;
	}

	@keyframes freeMaskFade {
		0% {
			opacity: 0;
		}

		100% {
			opacity: 1;
		}
	}

	@keyframes freeCardPop {
		0% {
			opacity: 0;
			transform: translateY(54rpx) scale(0.78);
		}

		64% {
			transform: translateY(-10rpx) scale(1.06);
		}

		100% {
			opacity: 1;
			transform: translateY(0) scale(1);
		}
	}

	@keyframes freeRaysSpin {
		0% {
			transform: rotate(0deg) scale(1);
		}

		100% {
			transform: rotate(360deg) scale(1.06);
		}
	}

	@keyframes freeTitlePop {

		0%,
		100% {
			transform: scale(1);
		}

		50% {
			transform: scale(1.025);
		}
	}

	@keyframes freeAmountBeat {

		0%,
		100% {
			transform: scale(1);
		}

		50% {
			transform: scale(1.045);
		}
	}

	@keyframes freeAmountAura {
		0% {
			background-position: 0% 50%;
		}

		100% {
			background-position: 260% 50%;
		}
	}

	@keyframes rewardBtnFloat {

		0%,
		100% {
			transform: translateY(0) scale(1);
		}

		50% {
			transform: translateY(-8rpx) scale(1.025);
		}
	}

	@keyframes orbFloat {

		0%,
		100% {
			transform: translateY(0) scale(1);
			opacity: 0.72;
		}

		50% {
			transform: translateY(-24rpx) scale(1.08);
			opacity: 1;
		}
	}

	@keyframes confettiFloat {

		0%,
		100% {
			transform: translateY(0) rotate(0deg);
			opacity: 0.4;
		}

		50% {
			transform: translateY(44rpx) rotate(150deg);
			opacity: 1;
		}
	}

	@keyframes starTwinkle {

		0%,
		100% {
			transform: scale(0.6);
			opacity: 0.35;
		}

		50% {
			transform: scale(1.45);
			opacity: 1;
		}
	}

	.store-group-page {
		background:
			radial-gradient(circle at 85% 90rpx, rgba(255, 228, 177, 0.58), transparent 260rpx),
			linear-gradient(180deg, #fff3e5 0%, #fff8f1 44%, #fffaf6 100%);
		color: #3f2618;
	}

	.store-group-page .title {
		background:
			radial-gradient(circle at 76% 22%, rgba(255, 245, 218, 0.72), transparent 230rpx),
			linear-gradient(135deg, #ff9569 0%, #ffc47d 52%, #ffe8c6 100%);
	}

	.store-group-page .group-hero-card,
	.store-group-page .goods-card {
		background:
			radial-gradient(circle at 92% 6%, rgba(255, 210, 138, 0.34) 0, rgba(255, 210, 138, 0) 150rpx),
			#fff;
		border-color: rgba(255, 218, 183, 0.82);
		box-shadow: 0 18rpx 42rpx rgba(178, 102, 48, 0.12);
	}

	.store-group-page .group-hero-card {
		background:
			radial-gradient(circle at 92% 0, rgba(255, 235, 198, 0.95) 0, rgba(255, 235, 198, 0) 190rpx),
			linear-gradient(135deg, #ffffff 0%, #fff8f1 52%, #fff1df 100%);
		border: 2rpx solid rgba(255, 116, 68, 0.18);
	}

	.store-group-page .group-card-glow,
	.store-group-page .goods-card-shine {
		background: rgba(255, 196, 126, 0.32);
	}

	.store-group-page .shop-name {
		color: #3f2618;
	}

	.store-group-page .shop-subtitle,
	.store-group-page .shop-deal {
		color: #8f684c !important;
	}

	.store-group-page .shop-rate {
		background: rgba(255, 240, 220, 0.92);
		box-shadow: inset 0 0 0 1rpx rgba(255, 190, 130, 0.26);
	}

	.store-group-page .shop-tag text {
		background: #fff0dc !important;
		color: #d65f2c !important;
	}

	.store-group-page .shop-bottom {
		color: #8f684c;
		border-top: 1rpx solid rgba(255, 126, 39, 0.1);
	}

	.store-group-page .notice-label {
		background: rgba(255, 116, 68, 0.12);
		color: #f0642f;
	}

	.store-group-page .catalog-menu-wrap,
	.store-group-page .menu-scroll {
		background: linear-gradient(180deg, #fff3e7 0%, #fffaf6 100%) !important;
		border-right: 1rpx solid rgba(255, 190, 130, 0.22);
	}

	.store-group-page .menu1 {
		color: #9b6a4c;
	}

	.store-group-page .menu-active-dot {
		filter: hue-rotate(148deg) saturate(1.5);
		opacity: 0.9;
	}

	.store-group-page .group-live-card {
		background:
			radial-gradient(circle at 92% 0, rgba(255, 209, 110, 0.34) 0, rgba(255, 209, 110, 0) 150rpx),
			linear-gradient(135deg, #fff9f2 0%, #fff0dc 48%, #fff7ee 100%);
		border-color: rgba(255, 194, 132, 0.72);
		color: #4f311f;
	}

	.store-group-page .goods-vibe-tag,
	.store-group-page .live-pill,
	.store-group-page .pintuan0,
	.store-group-page .pintuan2,
	.store-group-page .list-btn {
		background: linear-gradient(90deg, #ff7444, #ffb35e) !important;
		color: #fff !important;
	}

	.store-group-page .group-buy-btn {
		background: linear-gradient(90deg, #ff7444 0%, #ffb35e 62%, #ffe0a8 100%) !important;
		color: #fff;
		box-shadow: 0 12rpx 26rpx rgba(255, 126, 39, 0.26);
	}

	.store-group-page .solo-buy-btn {
		color: #b4572d !important;
		border-color: rgba(255, 180, 118, 0.5) !important;
		background: rgba(255, 244, 232, 0.72) !important;
	}

	.store-group-page .checkout-bar,
	.store-group-page .popup-bottom-bar {
		box-shadow: 0 -8rpx 34rpx rgba(178, 102, 48, 0.16);
	}

	.store-checkout-btn {
		background: linear-gradient(100deg, #ff7444 0%, #ff9f38 52%, #ffd16e 100%);
		color: #fff;
		box-shadow: 0 16rpx 34rpx rgba(255, 126, 39, 0.34);
	}
</style>