<template>
	<view class="artisan-detail-page">
		<!-- 自定义导航栏 -->
		<custom-navbar title="员工详情" :show-back="true" backgroundColor="#fff"></custom-navbar>

		<!-- 页面内容 -->
		<scroll-view class="detail-scroll" scroll-y="true" :style="{height: scrollViewHeight + 'px'}"
			@scrolltolower="loadMoreComments">
			<!-- 手艺人信息卡片 -->
			<view class="artisan-info-card">
				<view class="artisan-header">
					<!-- 左侧头像 -->
					<view class="artisan-avatar-container">
						<image :src="artisanInfo.head_photo || defaultAvatar" class="artisan-avatar" mode="aspectFill">
						</image>
					</view>

					<!-- 右侧信息 -->
					<view class="artisan-info">
						<!-- 第一行：名字和距离 -->
						<view class="name-row">
							<text class="artisan-name">{{ artisanInfo.name}}</text>
							<view class="distance-section">
								<image src="/static/images/icons/address_icon.png" class="distance-icon"></image>
								<text class="distance-text">{{ formatDistance(artisanInfo.distance) }}</text>
							</view>
						</view>

						<!-- 第二行：从业经历 -->
						<view class="experience-row">
							<text class="experience-text">从业经历</text>
							<image
								src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/0a9bcad4-a3b2-457f-bdfd-d659d6b1b084.png"
								class="experience-icon" @click="goQualification"></image>
							<text class="vertical-divider">|</text>
							<text class="join-text">入驻{{ formatWorkingYears(artisanInfo.working_years) }}</text>
						</view>

						<!-- 第三行：服务时间 -->
						<view class="service-time-row">
							<text class="service-time-label">服务时间:</text>
							<text class="service-time-value">{{ artisanInfo.default_times}}</text>
						</view>
					</view>
				</view>
			</view>

			<!-- 评价部分 - 使用服务详情页的样式 -->
			<!-- <view class="comments-section" v-if="artisanId"> -->
			<!-- <view class="section-title">
					<text class="section-num">评价({{ commentCount || 0 }})</text>
					<view class="look-all" @click="goCommentList">
						<text class="look">查看全部</text>
						<image src="/static/images/arrow_right.png" class="enter-icon" mode="aspectFit"></image>
					</view>
				</view> -->

			<!-- 模拟评论数据展示 -->
			<!-- <view class="comment-list" v-if="showMockComments">
					<view class="comment-item" v-for="(comment, index) in mockComments" :key="index">
						<view class="comment-left">
							<view class="comment-header">
								<image :src="comment.avatar" class="user-avatar"></image>
								<view class="comment-user-info">
									<text class="user-name">{{comment.userName}}</text>
									<view class="user-two">
										<text class="comment-tab">{{comment.tab}}</text>
										<text class="comment-type">{{comment.type}}</text>
									</view>
								</view>
							</view>
							<text class="comment-content text-overflow">{{comment.content}}</text>
						</view>
						<view class="comment-images" v-if="comment.images && comment.images.length">
							<image 
								:src="comment.images[0]" 
								mode="aspectFill"
								class="comment-image"
							></image>
						</view>
					</view>
				</view> -->

			<!-- 	<evaluationList 
					:order_shop_id="parseInt(artisanId)" 
					:order_shop_type="3" 
					@count-change="handleCommentCountChange"
					@goList="goCommentList"
					:showHeader="false"
					:limit="3"
				></evaluationList> -->
			<evaluationList :evaluated_id="artisanInfo.id" :evaluated_type="1" v-if="artisanInfo.id" @goList="goList">
			</evaluationList>
			<!-- </view> -->

			<!-- 作品部分 等接口出来完善-->
			<!-- <view class="works-section">
				<view class="section-header">
					<text class="section-title">作品 ({{ worksList.length || 0 }})</text>
				</view> -->

			<!-- 作品网格 -->
			<!-- <view class="works-grid" v-if="worksList.length > 0">
					<view 
						v-for="(work, index) in worksList" 
						:key="work.id || index" 
						class="work-item"
						@click="previewWorkImage(work, index)"
					>
						<image 
							:src="work.image || work.url" 
							class="work-image"
							mode="aspectFill"
						></image>
					</view>
				</view> -->

			<!-- 空状态 -->
			<!-- <view v-if="!loadingWorks && worksList.length === 0" class="empty-works">
					<image 
						src="/static/images/common/empty.png" 
						class="empty-image"
					></image>
					<text class="empty-text">暂无作品</text>
				</view>
			</view> -->

			<!-- 加载状态 -->
			<!-- <view class="loading-status">
				<text v-if="loadingComments" class="loading-text">加载中...</text>
				<text v-if="commentsFinished && commentList.length > 0" class="no-more-text">~ 暂时只有这些了 ~</text>
			</view> -->
			<view class="album">
				<view class="tab-bar">
					<view class="tab-item" :class="{active: activeTab === 'image'}" @click="switchTab('image')">
						<text class="tab-text">图片作品</text>
						<view class="tab-underline" v-if="activeTab === 'image'"></view>
					</view>
					<view class="tab-item" :class="{active: activeTab === 'video'}" @click="switchTab('video')">
						<text class="tab-text">视频作品</text>
						<view class="tab-underline" v-if="activeTab === 'video'"></view>
					</view>
				</view>
				
				<view class="album-num">{{ activeTab === 'image'?"图片作品":"视频作品"  }}{{`(${activeTab === 'image'?imageList.length:videoList.length})`}}</view>

				<!-- 内容区域 -->
				<view class="album-content">
					<!-- 图片作品列表 -->
					<view class="grid-list" v-if="activeTab === 'image'">
						<view class="grid-item" v-for="(item, index) in imageList" :key="index">
							<image class="grid-img" :src="item.url" mode="aspectFill"></image>
						</view>
					</view>

					<!-- 视频作品列表 -->
					<view class="grid-list" v-if="activeTab === 'video'">
						<view class="grid-item video-item" v-for="(item, index) in videoList" :key="index"
							@click="goVideo(item)">
							<image class="grid-img"
								:src="item.url+`?x-oss-process=video/snapshot,t_1000,m_fast,f_jpg,w_600,ar_auto`"
								mode="aspectFill"></image>
							<!-- 视频播放图标 -->
							<view class="play-icon">
								<image src="/static/images/icons/play.png" mode="widthFix"></image>
							</view>
						</view>
					</view>
				</view>
			</view>

		</scroll-view>

		<!-- 底部电话咨询按钮 -->
		<!-- 		<view class="bottom-bar">
			<view class="phone-consult-btn" @click="callArtisan">
				<text class="phone-text">电话咨询</text>
			</view>
		</view> -->

		<video v-show="videoPlay" :src="videoUrl" controls id="myvideo"
			style="height: 0; width: 0; position: absolute; top: -999rpx; left: -999rpx;"
			@fullscreenchange="screenChange"></video>
		<uv-divider></uv-divider>
	</view>
</template>

<script>
	import request from "@/utils/request";
	import evaluationList from '@/pages/evaluate/components/evaluationList.vue';

	export default {
		components: {
			evaluationList
		},

		data() {
			return {
				videoContext: null,
				videoPlay: false,
				videoUrl: "",
				activeTab: 'image', // 默认激活图片标签
				// 模拟图片作品数据
				imageList: [],
				// 模拟视频作品数据
				videoList: [],
				artisanId: null, // 手艺人ID
				artisanInfo: {}, // 手艺人信息
				scrollViewHeight: 0, // 滚动区域高度

				// 默认头像
				defaultAvatar: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png?x-oss-process=image/resize,p_40",

				// 评价相关
				commentCount: 0, // 评价总数
				commentList: [], // 评价列表
				loadingComments: false, // 评论加载状态
				commentsFinished: false, // 评论是否加载完毕
				commentPage: 1, // 评论当前页码
				commentLimit: 10, // 评论每页数量

				// 作品相关
				worksList: [], // 作品列表
				loadingWorks: false, // 作品加载状态
				worksFinished: false, // 作品是否加载完毕
				workPage: 1, // 作品当前页码
				workLimit: 12, // 作品每页数量

				// 模拟评论数据
				showMockComments: true, // 是否显示模拟评论数据
				mockComments: [{
						userName: '七喜',
						avatar: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png?x-oss-process=image/resize,p_40',
						time: '2025年9月12日',
						content: '上周去家附近的"甜糯美甲"做款式，体验感远超预期！店面不大但收拾得很整洁，浅橙色墙面绿植...',
						tab: '购买 #小蛮腰小蛮腰小蛮腰小蛮腰...',
						type: '还可以 4.0分'
					},
					{
						userName: '默认名称默认头像',
						avatar: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png?x-oss-process=image/resize,p_40',
						time: '2025年8月20日',
						content: '我带了张碎钻法式甲的网图，美甲师静静看了会儿没直接说"做不了"，而是建议："你指甲偏短..."',
						tab: '购买 #小蛮腰',
						type: '一般 3.0分'
					},
					{
						userName: '用户123',
						avatar: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png?x-oss-process=image/resize,p_40',
						time: '2025年7月15日',
						content: '服务态度特别好，技术也很专业，做出来的效果和我想象中的一模一样，下次还会再来！',
						tab: '购买 #法式美甲',
						type: '非常满意 5.0分'
					},
					{
						userName: '美甲爱好者',
						avatar: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png?x-oss-process=image/resize,p_40',
						time: '2025年6月28日',
						content: '颜色搭配得很漂亮，细节处理得很到位，整个美甲过程非常舒适，强烈推荐！',
						tab: '购买 #渐变美甲',
						type: '超出期待 4.5分'
					}
				]
			};
		},

		onLoad(options) {
			// 从路由参数获取手艺人ID
			if (options.id) {
				this.artisanId = options.id;
				this.getImgList()
				this.getVideoList()
			}

			console.log("接收到的员工ID:", this.artisanId, "类型:", typeof this.artisanId);

			// 计算滚动区域高度
			this.calculateScrollHeight();

			// 获取手艺人详情
			this.getArtisanDetail();

			// 获取作品列表
			this.getWorksList();

			// 设置模拟评论数量
			this.commentCount = 4; // 根据图片显示的数量
		},

		onReady() {
			// 页面加载完成后再计算一次高度，确保准确
			setTimeout(() => {
				this.calculateScrollHeight();
			}, 100);
		},

		methods: {
			screenChange(e) {
				
				let fullScreen = e.detail.fullScreen; // 值true为进入全屏，false为退出全屏
				console.log(e, "全屏");
				if (!fullScreen) {
					//退出全屏
					this.videoContext.pause()
					plus.screen.lockOrientation('portrait-primary');
					this.videoPlay = false; // 隐藏播放盒子
				}
			},
			goVideo(item) {
				this.videoPlay = true; // 显示播放盒子
				this.videoContext = uni.createVideoContext("myvideo", this); // this这个是实例对象 必传
				this.videoUrl = item.url;
				this.videoContext.requestFullScreen({
					direction: 90
				});
				this.videoContext.play();


			},
			switchTab(tab) {
				this.activeTab = tab
				// 如果是真实项目，这里可以触发对应类型的列表请求
				// 例如：this.getList(tab)
			},
			getImgList() {
				request.post("/user/imgVideo/list", {
					user_id: this.artisanId,
					user_type: 1,
					type: 1
				}).then(res => {
					if (res.code == 200) {
						let all = []
						for (let key in res.data.list[1]) {
							all = [...all, ...res.data.list[1][key]]
						}
						this.imageList = all
					}
				})
			},
			getVideoList() {
				request.post("/user/imgVideo/list", {
					user_id: this.artisanId,
					user_type: 1,
					type: 2
				}).then(res => {
					if (res.code == 200) {
						for (let key in res.data.list[2]) {
							this.videoList = [...this.videoList, ...res.data.list[2][key]]
						}
					}
				})
			},
			goList() {
				uni.navigateTo({
					url: `/pages/evaluate/evaluationList?evaluated_id=${this.artisanInfo.id}&evaluated_type=1`
				})
			},
			// 计算滚动区域高度
			calculateScrollHeight() {
				const systemInfo = uni.getSystemInfoSync();
				// 获取导航栏高度，假设为44px（可以根据实际情况调整）
				const navBarHeight = 44;
				// 状态栏高度
				const statusBarHeight = systemInfo.statusBarHeight || 0;
				// 底部栏高度
				const bottomBarHeight = 100;
				// 计算可用高度
				this.scrollViewHeight = systemInfo.windowHeight - (navBarHeight + statusBarHeight + bottomBarHeight);
			},

			// 获取手艺人详情
			getArtisanDetail() {
				if (!this.artisanId) {
					console.error("手艺人ID为空");
					return;
				}

				// 获取用户位置信息
				let addressRes = {};
				let userAdrees = uni.getStorageSync("userAdrees");
				if (userAdrees) {
					addressRes = userAdrees.addressRes;
				} else {
					addressRes = getApp().globalData.addressRes;
				}
				let userLat = addressRes?.latitude;
				let userLngz = addressRes?.longitude;

				console.log("用户位置信息:", {
					userLat,
					userLngz
				});

				const params = {
					id: this.artisanId,
					userLat,
					userLngz
				};

				console.log("请求参数:", params);

				request
					.post("/user/syrdetail", params)
					.then((res) => {
						console.log("手艺人详情接口返回:", res);

						if (res.state === 1) {
							this.artisanInfo = res.data || {};

							// 格式化距离
							if (this.artisanInfo.distance) {
								this.artisanInfo.distance = parseFloat(this.artisanInfo.distance).toFixed(2);
								console.log("格式化后的距离:", this.artisanInfo.distance);
							} else {
								console.log("接口没有返回distance字段");
							}

							// 使用default_times作为服务时间
							if (this.artisanInfo.default_times && this.artisanInfo.default_times.trim() !== '') {
								this.artisanInfo.service_time = this.artisanInfo.default_times;
								console.log("使用default_times作为服务时间:", this.artisanInfo.service_time);
							} else {
								this.artisanInfo.service_time = '09:00-21:00';
								console.log("未找到服务时间，使用默认值");
							}

							// 处理从业年限
							if (this.artisanInfo.working_years && this.artisanInfo.working_years !== "0年1个月") {
								console.log("使用接口返回的从业年限:", this.artisanInfo.working_years);
							} else {
								if (this.artisanInfo.applyyes_time) {
									// 处理日期字符串：将空格替换为T，兼容所有浏览器的Date解析
									const timeStr = this.artisanInfo.applyyes_time.replace(' ', 'T');
									const createdDate = new Date(timeStr);

									// 增加日期合法性校验，避免解析失败导致的计算错误
									if (isNaN(createdDate.getTime())) {
										this.artisanInfo.working_years = "0年0个月";
										console.log("日期格式解析失败，从业年限默认0年0个月");
										return;
									}

									const now = new Date();

									// 计算年数和月数差值
									const years = now.getFullYear() - createdDate.getFullYear();
									const months = now.getMonth() - createdDate.getMonth();

									// 总月数（处理负数情况，比如创建日期还没到当前月/年）
									let totalMonths = years * 12 + months;
									if (totalMonths <= 0) totalMonths = 1;

									// 格式化成年和月的展示形式
									const formattedYears = Math.floor(totalMonths / 12);
									const formattedMonths = totalMonths % 12;

									this.artisanInfo.working_years = `${formattedYears}年${formattedMonths}个月`;
									console.log("重新计算的从业年限:", this.artisanInfo.working_years);
								} else {
									this.artisanInfo.working_years = "0年1个月";
								}
							}

							console.log("处理后的手艺人信息:", this.artisanInfo);
						} else {
							console.error("获取手艺人详情失败:", res);
							uni.showToast({
								title: res.msg || '获取手艺人详情失败',
								icon: 'none'
							});
						}
					})
					.catch((err) => {
						console.error("获取手艺人详情失败:", err);
						uni.showToast({
							title: '网络错误，请重试',
							icon: 'none'
						});
					});
			},

			// 获取作品列表
			getWorksList() {
				if (this.loadingWorks || this.worksFinished || !this.artisanId) {
					return;
				}

				this.loadingWorks = true;

				const params = {
					artisan_id: this.artisanId,
					page: this.workPage,
					limit: this.workLimit
				};

				console.log("请求作品列表参数:", params);

				setTimeout(() => {
					// 模拟数据
					const mockWorks = [{
							id: 1,
							image: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png"
						},
						{
							id: 2,
							image: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png"
						},
						{
							id: 3,
							image: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png"
						},
						{
							id: 4,
							image: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png"
						},
						{
							id: 5,
							image: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png"
						},
						{
							id: 6,
							image: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png"
						},
						{
							id: 7,
							image: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png"
						},
						{
							id: 8,
							image: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png"
						},
						{
							id: 9,
							image: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png"
						},
						{
							id: 10,
							image: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/yh/1756713709528-717.png"
						},
					];

					// 如果是第一页，直接赋值；否则追加数据
					if (this.workPage === 1) {
						this.worksList = mockWorks;
					} else {
						this.worksList = [...this.worksList, ...mockWorks];
					}

					// 判断是否已加载完毕
					if (mockWorks.length < this.workLimit) {
						this.worksFinished = true;
					} else {
						this.workPage += 1;
					}

					this.loadingWorks = false;

					// 实际接口调用示例（注释掉，用的时候打开）：
					// request
					// 	.post("/user/syrWorksList", params)
					// 	.then((res) => {
					// 		console.log("作品列表接口返回:", res);
					// 		
					// 		if (res.state === 1 || res.code === 200) {
					// 			const resultData = res.data || {};
					// 			const list = resultData.list || [];
					// 			const total = resultData.count || list.length || 0;
					// 			
					// 			// 格式化作品数据
					// 			const formattedList = this.formatWorksList(list);
					// 			
					// 			// 如果是第一页，直接赋值；否则追加数据
					// 			if (this.workPage === 1) {
					// 				this.worksList = formattedList;
					// 			} else {
					// 				this.worksList = [...this.worksList, ...formattedList];
					// 			}
					// 			
					// 			// 判断是否已加载完毕
					// 			if (list.length < this.workLimit) {
					// 				this.worksFinished = true;
					// 			} else {
					// 				this.workPage += 1;
					// 			}
					// 		} else {
					// 			console.error("获取作品列表失败:", res);
					// 		}
					// 	})
					// 	.catch((err) => {
					// 		console.error("获取作品列表失败:", err);
					// 	})
					// 	.finally(() => {
					// 		this.loadingWorks = false;
					// 	});
				}, 500);
			},

			// 格式化作品列表数据
			formatWorksList(list) {
				if (!list || list.length === 0) {
					return [];
				}

				return list.map(item => {
					return {
						id: item.id || '',
						image: item.image_url || item.image || item.url,
						title: item.title || item.name || '作品',
						time: item.create_time || item.created_at || item.time,
						description: item.description || item.content || ''
					};
				});
			},

			// 加载更多评论
			loadMoreComments() {
				// 如果evaluationList组件有加载更多功能，这里可以触发
				// 由于evaluationList组件内部已经处理了加载更多，这里可以不做处理
			},

			// 处理评论数量变化
			handleCommentCountChange(count) {
				this.commentCount = count;
			},

			// 跳转到评论列表页面
			goCommentList() {
				uni.navigateTo({
					url: `/pages/evaluate/evaluationList?order_shop_id=${this.artisanId}&order_shop_type=3`
				});
			},

			// 格式化距离显示
			formatDistance(distance) {
				if (!distance && distance !== 0) {
					return "距离未知";
				}

				// 如果是字符串，尝试转换为数字
				const numDistance = typeof distance === 'string' ? parseFloat(distance) : distance;

				if (isNaN(numDistance)) {
					return distance;
				}

				// 保留两位小数
				return `${numDistance.toFixed(2)}Km`;
			},

			// 格式化从业年限显示
			formatWorkingYears(yearsStr) {
				// 如果已经是格式化好的字符串，直接返回
				if (typeof yearsStr === 'string') {
					return yearsStr;
				}

				// 否则尝试转换
				try {
					// 假设是月份数
					const months = parseInt(yearsStr);
					if (!isNaN(months)) {
						const y = Math.floor(months / 12);
						const m = months % 12;
						return `${y}年${m}个月`;
					}
				} catch (e) {
					console.error("格式化从业年限失败:", e);
				}

				return "0年0个月";
			},

			// 格式化作品时间
			formatWorkTime(timeStr) {
				if (!timeStr) return "";

				// 如果是时间戳，转换为日期
				if (typeof timeStr === 'number') {
					const date = new Date(timeStr * 1000);
					return `${date.getMonth() + 1}月${date.getDate()}日`;
				}

				// 如果是日期字符串，提取月日
				const match = timeStr.match(/(\d{1,2})月(\d{1,2})日/);
				if (match) {
					return `${match[1]}月${match[2]}日`;
				}

				// 如果是完整日期，提取月日
				const dateMatch = timeStr.match(/(\d{4})-(\d{1,2})-(\d{1,2})/);
				if (dateMatch) {
					return `${parseInt(dateMatch[2])}月${parseInt(dateMatch[3])}日`;
				}

				return timeStr;
			},

			// 跳转到资质页面
			goQualification() {
				// 跳转到资质页面，传递手艺人ID
				uni.navigateTo({
					url: `/pages/user/qualifications?id=${this.artisanId}`
				});
			},

			// 预览作品图片
			previewWorkImage(work, index) {
				// 提取所有作品图片URL
				const imageUrls = this.worksList
					.filter(item => item.image || item.url)
					.map(item => item.image || item.url);

				if (imageUrls.length > 0) {
					uni.previewImage({
						urls: imageUrls,
						current: index
					});
				}
			},

			// 电话咨询
			callArtisan() {
				if (this.artisanInfo.account || this.artisanInfo.second_phone) {
					const phoneNumber = this.artisanInfo.account || this.artisanInfo.second_phone;
					uni.makePhoneCall({
						phoneNumber: phoneNumber.toString()
					});
				} else {
					uni.showToast({
						title: '暂无联系电话',
						icon: 'none'
					});
				}
			},

			// 下拉刷新
			onPullDownRefresh() {
				// 重置状态
				this.workPage = 1;
				this.worksFinished = false;
				this.worksList = [];

				// 重新加载数据
				this.getArtisanDetail();
				this.getWorksList();

				// 停止下拉刷新
				uni.stopPullDownRefresh();
			}
		}
	};
</script>

<style lang="less">
	.artisan-detail-page {
		background-color: #f5f5f5;
		min-height: 100vh;

		.detail-scroll {
			width: 95%;
			padding: 20rpx;

			/* 手艺人信息卡片 */
			.artisan-info-card {
				background-color: #fff;
				border-radius: 20rpx;
				padding: 30rpx;
				margin-bottom: 20rpx;
				box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);

				.artisan-header {
					display: flex;
					align-items: flex-start;

					.artisan-avatar-container {
						margin-right: 30rpx;

						.artisan-avatar {
							width: 150rpx;
							height: 150rpx;
							border-radius: 50%;
							background-color: #f0f0f0;
						}
					}

					.artisan-info {
						flex: 1;

						.name-row {
							display: flex;
							justify-content: space-between;
							align-items: center;
							margin-bottom: 20rpx;

							.artisan-name {
								font-family: PingFangSC, PingFang SC;
								font-weight: 500;
								font-size: 34rpx;
								color: #333333;
								line-height: 48rpx;
								text-align: left;
								font-style: normal;
							}

							.distance-section {
								display: flex;
								align-items: center;

								.distance-icon {
									width: 20rpx;
									height: 23rpx;
									margin-right: 6rpx;
								}

								.distance-text {
									font-family: PingFangSC, PingFang SC;
									font-weight: 400;
									font-size: 24rpx;
									color: #999999;
									line-height: 33rpx;
								}
							}
						}

						.experience-row {
							display: flex;
							align-items: center;
							margin-bottom: 15rpx;

							.experience-text {
								font-family: PingFangSC, PingFang SC;
								font-weight: 400;
								font-size: 26rpx;
								color: #000000;
								line-height: 37rpx;
								margin-right: 10rpx;
							}

							.experience-icon {
								width: 68rpx;
								height: 24rpx;
								margin-right: 10rpx;
							}

							.vertical-divider {
								font-family: PingFangSC, PingFang SC;
								font-weight: 400;
								font-size: 26rpx;
								color: #E9E9E9;
								line-height: 37rpx;
								border-radius: 1rpx;
								margin: 0 10rpx;
							}

							.join-text {
								font-family: PingFangSC, PingFang SC;
								font-weight: 400;
								font-size: 24rpx;
								color: #999999;
								line-height: 33rpx;
								text-align: left;
								font-style: normal;
							}
						}

						.service-time-row {
							display: flex;
							align-items: center;

							.service-time-label {
								margin-right: 10rpx;
								font-family: PingFangSC, PingFang SC;
								font-weight: 400;
								font-size: 26rpx;
								color: #666666;
								line-height: 37rpx;
								text-align: left;
								font-style: normal;
							}

							.service-time-value {
								font-family: PingFangSC, PingFang SC;
								font-weight: 400;
								font-size: 26rpx;
								color: #666666;
								line-height: 37rpx;
							}
						}
					}
				}
			}

			/* 评价部分 - 采用服务详情页样式 */
			.comments-section {
				background-color: #fff;
				border-radius: 20rpx;
				padding: 24rpx;
				margin-bottom: 20rpx;
				box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);

				.section-title {
					display: flex;
					flex-flow: row nowrap;
					justify-content: space-between;
					align-items: center;
					margin-bottom: 20rpx;


					.section-num {
						font-family: PingFangSC, PingFang SC;
						font-weight: 500;
						font-size: 30rpx;
						color: #333333;
						line-height: 42rpx;
						text-align: left;
						font-style: normal;
					}

					.look-all {
						display: flex;
						flex-flow: row nowrap;
						justify-content: flex-end;
						align-items: center;

						.look {
							font-family: PingFangSC, PingFang SC;
							font-weight: 400;
							font-size: 24rpx;
							color: #333333;
							line-height: 33rpx;
							text-align: left;
							font-style: normal;
						}

						.enter-icon {
							width: 10rpx;
							height: 19rpx;
							margin-left: 8rpx;
							margin-top: 2rpx;
						}
					}
				}

				/* 模拟评论样式 */
				.comment-list {
					.comment-item {
						padding: 24rpx 0;
						display: flex;
						flex-flow: row nowrap;
						justify-content: space-between;
						align-items: flex-start;

						&:last-child {
							padding-bottom: 0rpx;
						}

						.comment-left {
							flex: 1;
							margin-right: 20rpx;

							.comment-header {
								display: flex;
								align-items: center;
								margin-bottom: 14rpx;

								.user-avatar {
									width: 64rpx;
									height: 64rpx;
									border-radius: 32rpx;
									margin-right: 14rpx;
									background-color: #f0f0f0;
								}

								.comment-user-info {
									flex: 1;

									.user-name {
										font-size: 28rpx;
										color: #3D3D3D;
										margin-bottom: 8rpx;
										display: block;
									}

									.user-two {
										display: flex;
										align-items: center;

										.comment-tab {
											font-size: 20rpx;
											color: #666666;
											margin-right: 8rpx;
										}

										.comment-type {
											font-size: 20rpx;
											color: #999999;
										}
									}
								}
							}

							.comment-content {
								font-size: 24rpx;
								color: #333333;
								line-height: 1.5;
								display: -webkit-box;
								-webkit-box-orient: vertical;
								-webkit-line-clamp: 2;
								overflow: hidden;
								text-overflow: ellipsis;
							}
						}

						.comment-images {
							width: 154rpx;
							height: 154rpx;
							background-color: #f0f0f0;
							border-radius: 8rpx;
							overflow: hidden;

							.comment-image {
								width: 100%;
								height: 100%;
							}
						}
					}
				}

				::v-deep .evaluation-list-container {
					padding: 0;

					.section-header {
						// display: none; /* 隐藏evaluationList组件的标题，因为外部标题了 */
					}
				}
			}

			/* 作品部分 */
			.works-section {
				background-color: #fff;
				border-radius: 20rpx;
				padding: 30rpx;
				margin-bottom: 40rpx;
				box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);

				.section-header {
					margin-bottom: 20rpx;

					.section-title {
						font-family: PingFangSC, PingFang SC;
						font-weight: 500;
						font-size: 30rpx;
						color: #333333;
						line-height: 42rpx;
						text-align: left;
						font-style: normal;
					}
				}

				.works-grid {
					display: grid;
					grid-template-columns: repeat(3, 1fr);
					gap: 20rpx;

					.work-item {
						.work-image {
							border-radius: 20rpx;
							width: 190rpx;
							height: 257rpx;
							background-color: #f0f0f0;
						}
					}
				}

				.empty-works {
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					padding: 60rpx 0;

					.empty-image {
						width: 150rpx;
						height: 150rpx;
						margin-bottom: 20rpx;
					}

					.empty-text {
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						font-size: 26rpx;
						color: #999999;
						line-height: 37rpx;
					}
				}
			}

			/* 加载状态 */
			.loading-status {
				padding: 40rpx 0;
				text-align: center;

				.loading-text {
					font-size: 26rpx;
					color: #999;
				}

				.no-more-text {
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #CECECE;
					line-height: 33rpx;
				}
			}
		}

		/* 底部电话咨询按钮 */
		.bottom-bar {
			position: fixed;
			left: 0;
			right: 0;
			bottom: 0;
			height: 100rpx;
			background-color: #FFFFFF;
			display: flex;
			align-items: center;
			justify-content: center;
			padding: 30rpx 0rpx;
			border-top: 1rpx solid rgba(0, 0, 0, 0.1);

			.phone-consult-btn {
				width: 448rpx;
				height: 86rpx;
				margin-left: 240rpx;
				background: #E8101E;
				border-radius: 43rpx;
				display: flex;
				align-items: center;
				justify-content: center;

				.phone-icon {
					width: 36rpx;
					height: 36rpx;
					margin-right: 15rpx;
				}

				.phone-text {
					font-family: PingFangSC, PingFang SC;
					font-weight: 500;
					font-size: 32rpx;
					color: #FFFFFF;
					line-height: 45rpx;
				}
			}
		}
	}

	.album {
		background: #fff;
		border-radius: 20rpx;

		// 顶部标签栏
		.tab-bar {
			display: flex;
			justify-content: center;
			margin-bottom: 2rpx;
			padding: 10rpx 0;
			border-bottom: 1rpx solid #f1f1f1;

			.tab-item {
				flex: 1;
				display: flex;
				flex-direction: column;
				align-items: center;
				padding: 15rpx 0;
				position: relative;

				.tab-text {
					font-weight: 400;
					font-size: 30rpx;
					color: #333333;
					line-height: 42rpx;
				}

				.tab-underline {
					width: 56rpx;
					height: 6rpx;
					background: #E8101E;
					border-radius: 3rpx;
					margin-top: 4rpx;
				}

				&.active .tab-text {
					font-weight: 500;
				}
			}


		}
		
		.album-num{
			font-weight: 500;
			font-size: 28rpx;
			color: #333333;
			line-height: 40rpx;
			text-align: left;
			font-style: normal;
			margin: 30rpx 20rpx 0 20rpx;
		}

		.album-content {
			padding: 20rpx 20rpx;

			// 网格列表
			.grid-list {
				display: grid;
				grid-template-columns: repeat(2, 1fr);
				gap: 20rpx;
			}

			.grid-item {
				width: 324rpx;
				height: 324rpx;
			}

			.grid-img {
				width: 324rpx;
				height: 324rpx;
				border-radius: 20rpx;
			}

			// 视频项额外样式
			.video-item {
				position: relative;

				.play-icon {
					position: absolute;
					top: 50%;
					left: 50%;
					transform: translate(-50%, -50%);
					width: 80rpx;
					height: 80rpx;
					background: rgba(0, 0, 0, 0.5);
					border-radius: 50%;
					display: flex;
					align-items: center;
					justify-content: center;

					image {
						width: 40rpx;
						height: 40rpx;
					}
				}
			}
		}
	}


	.evaluationList {
		margin: 0 0 20rpx 0 !important;
	}
</style>