<template>
	<view class="adoption-container">
		<!-- 头部搜索栏 -->
		<view class="header-section">
			<view class="search-wrapper">
				<view class="search-input-container">
					<text class="search-icon">🔍</text>
					<input
						class="search-input"
						v-model="searchKeyword"
						placeholder="搜索宠物名称、品种..."
						@input="onSearchInput"
						@confirm="performSearch"
					/>
					<view class="search-clear" v-if="searchKeyword" @click="clearSearch">
						<text class="clear-icon">✕</text>
					</view>
				</view>
				<view class="filter-btn" @click="toggleFilter">
					<text class="filter-icon">🔧</text>
					<text class="filter-text">筛选</text>
				</view>
			</view>
		</view>

		<!-- 筛选面板 -->
		<view class="filter-panel" v-if="showFilter">
			<!-- 地区筛选 -->
			<view class="filter-section">
				<view class="filter-title">
					<text class="title-text">📍 地区</text>
				</view>
				<view class="region-selectors">
					<view class="region-selector">
						<picker
							:value="selectedProvinceIndex"
							:range="provinceOptions"
							range-key="name"
							@change="onProvinceChange"
						>
							<view class="selector-display">
								<text class="selector-text">{{ selectedProvince ? selectedProvince.name : '选择省份' }}</text>
								<text class="selector-arrow">▼</text>
							</view>
						</picker>
					</view>
					<view class="region-selector" v-if="cityOptions.length > 0">
						<picker
							:value="selectedCityIndex"
							:range="cityOptions"
							range-key="name"
							@change="onCityChange"
						>
							<view class="selector-display">
								<text class="selector-text">{{ selectedCity ? selectedCity.name : '选择城市' }}</text>
								<text class="selector-arrow">▼</text>
							</view>
						</picker>
					</view>
					<view class="region-selector" v-if="districtOptions.length > 0">
						<picker
							:value="selectedDistrictIndex"
							:range="districtOptions"
							range-key="name"
							@change="onDistrictChange"
						>
							<view class="selector-display">
								<text class="selector-text">{{ selectedDistrict ? selectedDistrict.name : '选择区县' }}</text>
								<text class="selector-arrow">▼</text>
							</view>
						</picker>
					</view>
				</view>
			</view>

			<!-- 宠物类型筛选 -->
			<view class="filter-section">
				<view class="filter-title">
					<text class="title-text">🐾 宠物类型</text>
				</view>
				<view class="type-filters">
					<view
						class="type-filter"
						:class="{ active: selectedType === 'all' }"
						@click="selectType('all')"
					>
						<text class="type-text">全部</text>
					</view>
					<view
						class="type-filter"
						:class="{ active: selectedType === type.key }"
						v-for="type in petTypeOptions"
						:key="type.key"
						@click="selectType(type.key)"
					>
						<text class="type-icon">{{ type.icon }}</text>
						<text class="type-text">{{ type.name }}</text>
					</view>
				</view>
			</view>

			<!-- 品种筛选 -->
			<view class="filter-section" v-if="selectedType !== 'all' && breedOptions.length > 0">
				<view class="filter-title">
					<text class="title-text">🏷️ 品种</text>
				</view>
				<view class="breed-filters">
					<view
						class="breed-filter"
						:class="{ active: selectedBreed === 'all' }"
						@click="selectBreed('all')"
					>
						<text class="breed-text">全部</text>
					</view>
					<view
						class="breed-filter"
						:class="{ active: selectedBreed === breed.key }"
						v-for="breed in breedOptions"
						:key="breed.key"
						@click="selectBreed(breed.key)"
					>
						<text class="breed-text">{{ breed.name }}</text>
					</view>
				</view>
			</view>

			<!-- 其他筛选 -->
			<view class="filter-section">
				<view class="filter-title">
					<text class="title-text">⚙️ 其他条件</text>
				</view>
				<view class="other-filters">
					<view class="filter-row">
						<text class="filter-label">状态：</text>
						<view class="status-filters">
							<view
								class="status-filter"
								:class="{ active: selectedStatus === 'all' }"
								@click="selectStatus('all')"
							>
								<text class="status-text">全部</text>
							</view>
							<view
								class="status-filter"
								:class="{ active: selectedStatus === 'available' }"
								@click="selectStatus('available')"
							>
								<text class="status-text">可领养</text>
							</view>
						</view>
					</view>
					<view class="filter-row">
						<text class="filter-label">性别：</text>
						<view class="gender-filters">
							<view
								class="gender-filter"
								:class="{ active: selectedGender === 'all' }"
								@click="selectGender('all')"
							>
								<text class="gender-text">全部</text>
							</view>
							<view
								class="gender-filter"
								:class="{ active: selectedGender === 'male' }"
								@click="selectGender('male')"
							>
								<text class="gender-text">公</text>
							</view>
							<view
								class="gender-filter"
								:class="{ active: selectedGender === 'female' }"
								@click="selectGender('female')"
							>
								<text class="gender-text">母</text>
							</view>
						</view>
					</view>
				</view>
			</view>

			<!-- 筛选操作按钮 -->
			<view class="filter-actions">
				<view class="filter-reset" @click="resetFilters">
					<text class="reset-text">重置</text>
				</view>
				<view class="filter-apply" @click="applyFilters">
					<text class="apply-text">应用筛选</text>
				</view>
			</view>
		</view>

		<!-- 宠物列表 -->
		<scroll-view
			class="pets-scroll"
			scroll-y
			@scrolltolower="loadMorePets"
			@refresherrefresh="onRefresh"
			:refresher-enabled="true"
			:refresher-triggered="refreshing"
		>
			<view class="pets-list">
				<!-- 结果统计 - 已隐藏 -->
				<!-- <view class="result-summary" v-if="displayPets.length > 0">
					<text class="summary-text">找到 {{ totalPets }} 只可爱的小伙伴</text>
				</view> -->

				<!-- 宠物卡片 -->
				<view
					class="pet-card"
					v-for="pet in displayPets"
					:key="pet.id"
					@click="viewPetDetail(pet)"
				>
					<view class="pet-image-container">
						<image class="pet-image" :src="pet.photos[0]" mode="aspectFill" />
						<view class="pet-status" :class="pet.status">
							<text class="status-icon">{{ getStatusIcon(pet.status) }}</text>
							<text class="status-text">{{ getStatusText(pet.status) }}</text>
						</view>

					</view>

					<view class="pet-info">
						<view class="pet-basic">
							<text class="pet-name">{{ pet.name }}</text>
							<view class="pet-tags">
								<text class="pet-type">{{ getPetTypeName(pet.type) }}</text>
								<text class="pet-breed">{{ getPetBreedName(pet.type, pet.breed) }}</text>
							</view>
						</view>

						<view class="pet-details">
							<view class="detail-item">
								<text class="detail-icon">🎂</text>
								<text class="detail-text">{{ pet.age }}岁</text>
							</view>
							<view class="detail-item">
								<u-icon
									:name="pet.gender === 'male' ? 'man' : 'woman'"
									:color="pet.gender === 'male' ? '#4A90E2' : '#FF69B4'"
									size="16"
								></u-icon>
								<text class="detail-text">{{ pet.gender === 'male' ? '公' : '母' }}</text>
							</view>
							<view class="detail-item">
								<text class="detail-icon">📍</text>
								<text class="detail-text">{{ getLocationText(pet.location) }}</text>
							</view>
						</view>

						<view class="pet-personality">
							<view
								class="personality-tag"
								v-for="trait in pet.personality.slice(0, 3)"
								:key="trait"
							>
								<text class="trait-text">{{ trait }}</text>
							</view>
						</view>
					</view>
				</view>

				<!-- 加载更多 -->
				<view class="load-more" v-if="hasMorePets && !refreshing">
					<view class="loading-indicator" v-if="loadingMore">
						<text class="loading-text">加载中...</text>
					</view>
					<view class="load-more-tip" v-else>
						<text class="tip-text">上拉加载更多</text>
					</view>
				</view>

				<!-- 空状态 -->
				<view class="empty-state" v-if="displayPets.length === 0 && !loadingMore && !refreshing">
					<text class="empty-icon">🐾</text>
					<text class="empty-title">{{ getEmptyTitle() }}</text>
					<text class="empty-subtitle">{{ getEmptySubtitle() }}</text>
					<view class="empty-action" @click="resetFilters">
						<text class="action-text">重新搜索</text>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
import adoptionManager from '@/utils/adoptionManager.js'

export default {
	data() {
		return {
			// 搜索
			searchKeyword: '',

			// 筛选面板
			showFilter: false,

			// 地区筛选
			selectedProvince: null,
			selectedCity: null,
			selectedDistrict: null,
			selectedProvinceIndex: 0,
			selectedCityIndex: 0,
			selectedDistrictIndex: 0,

			// 宠物类型筛选
			selectedType: 'all',
			selectedBreed: 'all',

			// 其他筛选
			selectedStatus: 'all',
			selectedGender: 'all',

			// 数据
			allPets: [],
			displayPets: [],
			totalPets: 0,

			// 分页
			page: 1,
			pageSize: 20,
			hasMorePets: true,
			loadingMore: false,
			refreshing: false
		}
	},

	computed: {
		// 省份选项
		provinceOptions() {
			return Object.keys(adoptionManager.regions).map(key => ({
				key: key,
				name: adoptionManager.regions[key].name
			}))
		},

		// 城市选项
		cityOptions() {
			if (!this.selectedProvince) return []
			const cities = adoptionManager.regions[this.selectedProvince.key]?.cities || {}
			return Object.keys(cities).map(key => ({
				key: key,
				name: cities[key].name
			}))
		},

		// 区县选项
		districtOptions() {
			if (!this.selectedProvince || !this.selectedCity) return []
			const districts = adoptionManager.regions[this.selectedProvince.key]?.cities[this.selectedCity.key]?.districts || {}
			return Object.keys(districts).map(key => ({
				key: key,
				name: districts[key]
			}))
		},

		// 宠物类型选项
		petTypeOptions() {
			return Object.keys(adoptionManager.petTypes).map(key => ({
				key: key,
				name: adoptionManager.petTypes[key].name,
				icon: adoptionManager.petTypes[key].icon
			}))
		},

		// 品种选项
		breedOptions() {
			if (this.selectedType === 'all') return []
			const breeds = adoptionManager.petTypes[this.selectedType]?.breeds || {}
			return Object.keys(breeds).map(key => ({
				key: key,
				name: breeds[key]
			}))
		}
	},

	onLoad() {
		this.loadPets()
	},

	methods: {
		loadPets() {
			console.log('loadPets called')
			// 强制清除本地存储，重新初始化数据
			uni.removeStorageSync('adoption_pets')
			this.allPets = adoptionManager.getAdoptionPets()
			console.log('allPets loaded:', this.allPets.length, this.allPets)
			this.applyFiltersAndSearch()
		},

		applyFiltersAndSearch() {
			console.log('applyFiltersAndSearch called, allPets:', this.allPets.length)
			let filteredPets = [...this.allPets]

			// 应用搜索
			if (this.searchKeyword) {
				console.log('applying search:', this.searchKeyword)
				filteredPets = adoptionManager.searchPets(this.searchKeyword, filteredPets)
			}

			// 应用筛选
			const filters = this.buildFilters()
			console.log('applying filters:', filters)
			filteredPets = adoptionManager.filterPets(filters, filteredPets)
			console.log('filtered pets:', filteredPets.length)

			// 排序（按发布时间倒序）
			filteredPets.sort((a, b) => new Date(b.publishTime) - new Date(a.publishTime))

			this.totalPets = filteredPets.length
			this.displayPets = filteredPets.slice(0, this.page * this.pageSize)
			this.hasMorePets = filteredPets.length > this.displayPets.length
			console.log('final displayPets:', this.displayPets.length)
		},

		buildFilters() {
			const filters = {}

			if (this.selectedType !== 'all') {
				filters.type = this.selectedType
			}

			if (this.selectedBreed !== 'all') {
				filters.breed = this.selectedBreed
			}

			if (this.selectedProvince) {
				filters.province = this.selectedProvince.key
			}

			if (this.selectedCity) {
				filters.city = this.selectedCity.key
			}

			if (this.selectedDistrict) {
				filters.district = this.selectedDistrict.key
			}

			if (this.selectedStatus !== 'all') {
				filters.status = this.selectedStatus
			}

			if (this.selectedGender !== 'all') {
				filters.gender = this.selectedGender
			}

			return filters
		},

		// 搜索功能
		onSearchInput() {
			// 实时搜索
			this.page = 1
			this.applyFiltersAndSearch()
		},

		performSearch() {
			this.page = 1
			this.applyFiltersAndSearch()
		},

		clearSearch() {
			this.searchKeyword = ''
			this.page = 1
			this.applyFiltersAndSearch()
		},

		// 筛选面板
		toggleFilter() {
			console.log('toggleFilter clicked, current showFilter:', this.showFilter)
			this.showFilter = !this.showFilter
			console.log('toggleFilter after, new showFilter:', this.showFilter)
		},

		// 地区筛选
		onProvinceChange(e) {
			const index = e.detail.value
			this.selectedProvinceIndex = index
			this.selectedProvince = this.provinceOptions[index]
			this.selectedCity = null
			this.selectedDistrict = null
			this.selectedCityIndex = 0
			this.selectedDistrictIndex = 0
		},

		onCityChange(e) {
			const index = e.detail.value
			this.selectedCityIndex = index
			this.selectedCity = this.cityOptions[index]
			this.selectedDistrict = null
			this.selectedDistrictIndex = 0
		},

		onDistrictChange(e) {
			const index = e.detail.value
			this.selectedDistrictIndex = index
			this.selectedDistrict = this.districtOptions[index]
		},

		// 宠物类型筛选
		selectType(type) {
			this.selectedType = type
			this.selectedBreed = 'all'
		},

		selectBreed(breed) {
			this.selectedBreed = breed
		},

		// 其他筛选
		selectStatus(status) {
			this.selectedStatus = status
		},

		selectGender(gender) {
			this.selectedGender = gender
		},

		// 筛选操作
		resetFilters() {
			this.selectedProvince = null
			this.selectedCity = null
			this.selectedDistrict = null
			this.selectedProvinceIndex = 0
			this.selectedCityIndex = 0
			this.selectedDistrictIndex = 0
			this.selectedType = 'all'
			this.selectedBreed = 'all'
			this.selectedStatus = 'all'
			this.selectedGender = 'all'
			this.searchKeyword = ''
			this.page = 1
			this.applyFiltersAndSearch()
		},

		applyFilters() {
			this.showFilter = false
			this.page = 1
			this.applyFiltersAndSearch()
		},

		// 分页和刷新
		loadMorePets() {
			if (this.hasMorePets && !this.loadingMore) {
				this.loadingMore = true

				setTimeout(() => {
					this.page += 1
					this.applyFiltersAndSearch()
					this.loadingMore = false
				}, 500)
			}
		},

		onRefresh() {
			this.refreshing = true

			setTimeout(() => {
				this.loadPets()
				this.refreshing = false
			}, 1000)
		},

		// 工具方法
		getPetTypeName(type) {
			return adoptionManager.getPetTypeName(type)
		},

		getPetBreedName(type, breed) {
			return adoptionManager.getPetBreedName(type, breed)
		},

		getLocationText(location) {
			return adoptionManager.getLocationName(location.province, location.city, location.district)
		},

		getStatusIcon(status) {
			return adoptionManager.getStatusInfo(status).icon
		},

		getStatusText(status) {
			return adoptionManager.getStatusInfo(status).name
		},

		getEmptyTitle() {
			if (this.searchKeyword) {
				return '没有找到相关宠物'
			} else {
				return '暂无宠物信息'
			}
		},

		getEmptySubtitle() {
			if (this.searchKeyword) {
				return '试试其他关键词或调整筛选条件'
			} else {
				return '请稍后再来看看，或者联系我们添加更多宠物信息'
			}
		},

		// 页面跳转
		viewPetDetail(pet) {
			uni.navigateTo({
				url: `/pages/adoption/adoption-detail?petId=${pet.id}`
			})
		}
	}
}
</script>

<style lang="scss" scoped>
.adoption-container {
	background: linear-gradient(135deg, #FF8A80 0%, #FFB6C1 25%, #FECFEF 50%, #F8BBD9 100%);
	min-height: 100vh;
	overflow-x: hidden;
	width: 100vw;
}

/* 头部搜索栏 */
.header-section {
	background: transparent;
	padding: 24rpx 32rpx;

	.search-wrapper {
		display: flex;
		align-items: center;
		gap: 16rpx;

		.search-input-container {
			flex: 1;
			position: relative;
			background: transparent;
			border: 2rpx solid rgba(255, 255, 255, 0.6);
			border-radius: 24rpx;
			padding: 0 20rpx;
			display: flex;
			align-items: center;
			box-shadow: 0 2rpx 12rpx rgba(255, 255, 255, 0.1);

			.search-icon {
				font-size: 24rpx;
				margin-right: 12rpx;
				color: #ffffff;
			}

			.search-input {
				flex: 1;
				height: 72rpx;
				font-size: 24rpx;
				color: #ffffff;
				background: transparent;
				border: none;
				outline: none;

				&::placeholder {
					color: #ffffff;
				}
			}

			.search-clear {
				width: 32rpx;
				height: 32rpx;
				background: rgba(255, 255, 255, 0.3);
				border-radius: 50%;
				display: flex;
				align-items: center;
				justify-content: center;
				margin-left: 12rpx;
				transition: all 0.3s ease;

				&:active {
					background: rgba(255, 255, 255, 0.5);
				}

				.clear-icon {
					font-size: 16rpx;
					color: #ffffff;
				}
			}
		}

		.filter-btn {
			display: flex;
			align-items: center;
			gap: 8rpx;
			background: transparent;
			border: 2rpx solid rgba(255, 255, 255, 0.4);
			border-radius: 16rpx;
			padding: 16rpx 20rpx;
			transition: all 0.3s ease;

			&:active {
				transform: scale(0.95);
				background: rgba(255, 255, 255, 0.1);
				border-color: rgba(255, 255, 255, 0.6);
			}

			.filter-icon {
				font-size: 20rpx;
				color: #ffffff;
			}

			.filter-text {
				font-size: 22rpx;
				color: #ffffff;
				font-weight: 500;
			}
		}
	}
}

/* 筛选面板 */
.filter-panel {
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(20rpx);
	padding: 24rpx 32rpx;
	border-bottom: 1rpx solid rgba(255, 255, 255, 0.3);
	position: relative;
	z-index: 10;
	width: 100%;
	box-sizing: border-box;

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

		&:last-child {
			margin-bottom: 0;
		}

		.filter-title {
			margin-bottom: 16rpx;

			.title-text {
				font-size: 26rpx;
				font-weight: bold;
				color: #333333;
			}
		}
	}

	/* 地区选择器 */
	.region-selectors {
		display: flex;
		gap: 12rpx;

		.region-selector {
			flex: 1;

			.selector-display {
				background: rgba(255, 138, 128, 0.05);
				border-radius: 12rpx;
				padding: 16rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;

				.selector-text {
					font-size: 22rpx;
					color: #666666;
				}

				.selector-arrow {
					font-size: 16rpx;
					color: #999999;
				}
			}
		}
	}

	/* 宠物类型筛选 */
	.type-filters {
		display: flex;
		flex-wrap: wrap;
		gap: 12rpx;

		.type-filter {
			display: flex;
			align-items: center;
			gap: 8rpx;
			background: rgba(255, 138, 128, 0.05);
			border-radius: 16rpx;
			padding: 12rpx 20rpx;
			transition: all 0.3s ease;

			&.active {
				background: #FF8A80;

				.type-text {
					color: white;
				}

				.type-icon {
					color: white;
				}
			}

			&:active {
				transform: scale(0.95);
			}

			.type-icon {
				font-size: 20rpx;
			}

			.type-text {
				font-size: 22rpx;
				color: #666666;
				font-weight: 500;
			}
		}
	}

	/* 品种筛选 */
	.breed-filters {
		display: flex;
		flex-wrap: wrap;
		gap: 8rpx;

		.breed-filter {
			background: rgba(255, 138, 128, 0.05);
			border-radius: 12rpx;
			padding: 8rpx 16rpx;
			transition: all 0.3s ease;

			&.active {
				background: rgba(255, 138, 128, 0.2);

				.breed-text {
					color: #FF8A80;
					font-weight: bold;
				}
			}

			&:active {
				transform: scale(0.95);
			}

			.breed-text {
				font-size: 20rpx;
				color: #666666;
			}
		}
	}

	/* 其他筛选 */
	.other-filters {
		.filter-row {
			display: flex;
			align-items: center;
			margin-bottom: 16rpx;

			&:last-child {
				margin-bottom: 0;
			}

			.filter-label {
				font-size: 22rpx;
				color: #666666;
				min-width: 80rpx;
				margin-right: 16rpx;
			}
		}

		.status-filters,
		.gender-filters {
			display: flex;
			gap: 8rpx;

			.status-filter,
			.gender-filter {
				background: rgba(255, 138, 128, 0.05);
				border-radius: 12rpx;
				padding: 8rpx 16rpx;
				transition: all 0.3s ease;

				&.active {
					background: rgba(255, 138, 128, 0.2);

					.status-text,
					.gender-text {
						color: #FF8A80;
						font-weight: bold;
					}
				}

				&:active {
					transform: scale(0.95);
				}

				.status-text,
				.gender-text {
					font-size: 20rpx;
					color: #666666;
				}
			}
		}
	}

	/* 筛选操作按钮 */
	.filter-actions {
		display: flex;
		gap: 16rpx;
		margin-top: 32rpx;

		.filter-reset,
		.filter-apply {
			flex: 1;
			text-align: center;
			padding: 16rpx;
			border-radius: 16rpx;
			transition: all 0.3s ease;

			&:active {
				transform: scale(0.95);
			}
		}

		.filter-reset {
			background: rgba(153, 153, 153, 0.1);

			.reset-text {
				font-size: 24rpx;
				color: #666666;
				font-weight: 500;
			}
		}

		.filter-apply {
			background: linear-gradient(135deg, #FF8A80, #FFB6C1);

			.apply-text {
				font-size: 24rpx;
				color: white;
				font-weight: 500;
			}
		}
	}
}

/* 宠物列表区域 */
.pets-scroll {
	height: calc(100vh - 100rpx);
	padding: 0 16rpx;
	overflow-x: hidden;
	width: 100%;
	box-sizing: border-box;
}

.pets-list {
	padding-bottom: 60rpx;
	width: 100%;
	box-sizing: border-box;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16rpx;
}

.result-summary {
	text-align: center;
	padding: 24rpx 0;
	grid-column: 1 / -1;

	.summary-text {
		font-size: 24rpx;
		color: #666666;
	}
}

/* 宠物卡片 */
.pet-card {
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(20rpx);
	border-radius: 12rpx;
	padding: 12rpx;
	box-shadow: 0 2rpx 12rpx rgba(255, 138, 128, 0.08);
	border: 1rpx solid rgba(255, 255, 255, 0.3);
	transition: all 0.3s ease;
	box-sizing: border-box;

	&:active {
		transform: scale(0.98);
		box-shadow: 0 1rpx 6rpx rgba(255, 138, 128, 0.15);
	}

	.pet-image-container {
		position: relative;
		width: 100%;
		height: 200rpx;
		border-radius: 12rpx;
		overflow: hidden;
		margin-bottom: 8rpx;

		.pet-image {
			width: 100%;
			height: 100%;
			object-fit: cover;
		}

		.pet-status {
			position: absolute;
			top: 16rpx;
			left: 16rpx;
			display: flex;
			align-items: center;
			gap: 6rpx;
			background: rgba(0, 0, 0, 0.7);
			border-radius: 12rpx;
			padding: 8rpx 12rpx;

			&.available {
				background: rgba(76, 175, 80, 0.9);
			}

			&.reserved {
				background: rgba(255, 152, 0, 0.9);
			}

			&.adopted {
				background: rgba(158, 158, 158, 0.9);
			}

			.status-icon {
				font-size: 16rpx;
			}

			.status-text {
				font-size: 18rpx;
				color: white;
				font-weight: 500;
			}
		}


	}

	.pet-info {
		.pet-basic {
			margin-bottom: 12rpx;

			.pet-name {
				font-size: 26rpx;
				font-weight: bold;
				color: #333333;
				margin-bottom: 6rpx;
				display: block;
				line-height: 1.2;
			}

			.pet-tags {
				display: flex;
				gap: 6rpx;
				flex-wrap: wrap;

				.pet-type,
				.pet-breed {
					background: rgba(255, 138, 128, 0.1);
					border-radius: 8rpx;
					padding: 2rpx 8rpx;
					font-size: 18rpx;
					color: #FF8A80;
				}
			}
		}

		.pet-details {
			display: flex;
			gap: 16rpx;
			margin-bottom: 12rpx;
			flex-wrap: wrap;

			.detail-item {
				display: flex;
				align-items: center;
				gap: 4rpx;

				.detail-icon {
					font-size: 14rpx;
				}

				.detail-text {
					font-size: 18rpx;
					color: #666666;
				}
			}
		}

		.pet-personality {
			display: flex;
			flex-wrap: wrap;
			gap: 6rpx;
			margin-bottom: 12rpx;

			.personality-tag {
				background: rgba(255, 138, 128, 0.05);
				border-radius: 8rpx;
				padding: 4rpx 8rpx;

				.trait-text {
					font-size: 16rpx;
					color: #666666;
				}
			}
		}

		.pet-stats {
			display: flex;
			justify-content: flex-end;
			align-items: center;

			.contact-type {
				display: flex;
				align-items: center;
				gap: 6rpx;

				.contact-icon {
					font-size: 16rpx;
				}

				.contact-text {
					font-size: 18rpx;
					color: #666666;
				}
			}
		}
	}
}

/* 加载更多和空状态 */
.load-more {
	text-align: center;
	padding: 40rpx 0;
	grid-column: 1 / -1;

	.loading-indicator {
		.loading-text {
			font-size: 24rpx;
			color: #999999;
		}
	}

	.load-more-tip {
		.tip-text {
			font-size: 24rpx;
			color: #CCCCCC;
		}
	}
}

.empty-state {
	text-align: center;
	padding: 120rpx 40rpx;
	grid-column: 1 / -1;

	.empty-icon {
		font-size: 120rpx;
		margin-bottom: 32rpx;
		display: block;
	}

	.empty-title {
		font-size: 32rpx;
		font-weight: bold;
		color: #333333;
		margin-bottom: 16rpx;
		display: block;
	}

	.empty-subtitle {
		font-size: 26rpx;
		color: #999999;
		margin-bottom: 40rpx;
		display: block;
		line-height: 1.5;
	}

	.empty-action {
		background: linear-gradient(135deg, #FF8A80, #FFB6C1);
		border-radius: 20rpx;
		padding: 16rpx 32rpx;
		display: inline-block;
		transition: all 0.3s ease;

		&:active {
			transform: scale(0.95);
		}

		.action-text {
			font-size: 24rpx;
			color: white;
			font-weight: 500;
		}
	}
}
</style>
