<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 class="pet-favorite" @click.stop="toggleFavorite(pet)">
							<text class="favorite-icon">{{ pet.isFavorite ? '❤️' : '🤍' }}</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">
								<text class="detail-icon">{{ pet.gender === 'male' ? '♂️' : '♀️' }}</text>
								<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 class="pet-stats">
							<view class="stat-item">
								<text class="stat-icon">👁️</text>
								<text class="stat-count">{{ pet.views }}</text>
							</view>
							<view class="stat-item">
								<text class="stat-icon">❤️</text>
								<text class="stat-count">{{ pet.favorites }}</text>
							</view>
							<view class="contact-type">
								<text class="contact-icon">{{ pet.contact.type === 'organization' ? '🏢' : '👤' }}</text>
								<text class="contact-text">{{ pet.contact.type === 'organization' ? '机构' : '个人' }}</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: 10,
			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() {
			this.allPets = adoptionManager.getAdoptionPets()
			this.applyFiltersAndSearch()
		},

		applyFiltersAndSearch() {
			let filteredPets = [...this.allPets]

			// 应用搜索
			if (this.searchKeyword) {
				filteredPets = adoptionManager.searchPets(this.searchKeyword, filteredPets)
			}

			// 应用筛选
			const filters = this.buildFilters()
			filteredPets = adoptionManager.filterPets(filters, filteredPets)

			// 排序（按发布时间倒序）
			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
		},

		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() {
			this.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) {
			// 增加浏览量
			adoptionManager.incrementViews(pet.id)

			uni.navigateTo({
				url: `/pages/adoption/adoption-detail?petId=${pet.id}`
			})
		},

		toggleFavorite(pet) {
			pet.isFavorite = !pet.isFavorite
			adoptionManager.toggleFavorite(pet.id, pet.isFavorite)

			uni.showToast({
				title: pet.isFavorite ? '已收藏' : '已取消收藏',
				icon: 'success',
				duration: 1000
			})
		}
	}
}
</script>

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

/* 头部搜索栏 */
.header-section {
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(20rpx);
	padding: 24rpx 32rpx;
	border-bottom: 1rpx solid rgba(255, 255, 255, 0.3);

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

		.search-input-container {
			flex: 1;
			position: relative;
			background: rgba(255, 138, 128, 0.05);
			border-radius: 20rpx;
			padding: 0 20rpx;
			display: flex;
			align-items: center;

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

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

			.search-clear {
				width: 32rpx;
				height: 32rpx;
				background: #CCCCCC;
				border-radius: 50%;
				display: flex;
				align-items: center;
				justify-content: center;
				margin-left: 12rpx;

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

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

			&:active {
				transform: scale(0.95);
				background: rgba(255, 138, 128, 0.2);
			}

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

			.filter-text {
				font-size: 22rpx;
				color: #666666;
				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);

	.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 - 200rpx);
	padding: 0 20rpx;
}

.pets-list {
	padding-bottom: 120rpx;
}

.result-summary {
	text-align: center;
	padding: 24rpx 0;

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

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

	&:active {
		transform: scale(0.98);
		box-shadow: 0 2rpx 8rpx rgba(255, 138, 128, 0.2);
	}

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

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

		.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-favorite {
			position: absolute;
			top: 16rpx;
			right: 16rpx;
			width: 56rpx;
			height: 56rpx;
			background: rgba(255, 255, 255, 0.9);
			border-radius: 50%;
			display: flex;
			align-items: center;
			justify-content: center;
			transition: all 0.3s ease;

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

			.favorite-icon {
				font-size: 24rpx;
			}
		}
	}

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

			.pet-name {
				font-size: 32rpx;
				font-weight: bold;
				color: #333333;
				margin-bottom: 8rpx;
				display: block;
			}

			.pet-tags {
				display: flex;
				gap: 8rpx;

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

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

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

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

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

		.pet-personality {
			display: flex;
			flex-wrap: wrap;
			gap: 8rpx;
			margin-bottom: 16rpx;

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

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

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

			.stat-item {
				display: flex;
				align-items: center;
				gap: 6rpx;

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

				.stat-count {
					font-size: 18rpx;
					color: #999999;
				}
			}

			.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;

	.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;

	.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>
