<template>
	<view class="settings-page">
		<view class="settings-card">
			<view class="setting-row" v-for="item in settings" :key="item.title">
				<view class="icon-wrap" :style="{ backgroundColor: item.bg }">
					<TnIcon :name="item.icon" :size="34" :color="item.color" />
				</view>
				<view class="setting-main">
					<text class="setting-title">{{ item.title }}</text>
					<text class="setting-desc">{{ item.desc }}</text>
				</view>
				<TnSwitch v-model="item.enabled" active-color="#F97316" />
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
import { reactive } from 'vue'
import TnIcon from '@/uni_modules/tuniaoui-vue3/components/icon/src/icon.vue'
import TnSwitch from '@/uni_modules/tuniaoui-vue3/components/switch/src/switch.vue'

const settings = reactive([
	{ title: '提醒通知', desc: '接收疫苗、驱虫和体检提醒', icon: 'notice-fill', color: '#F97316', bg: '#FFF7ED', enabled: true },
	{ title: '云端备份', desc: '自动保存重要健康档案', icon: 'cloud-fill', color: '#2563EB', bg: '#EFF6FF', enabled: true },
	{ title: '数据统计', desc: '在首页显示健康管理摘要', icon: 'data-fill', color: '#14B8A6', bg: '#F0FDFA', enabled: true },
])
</script>

<style lang="scss" scoped>
.settings-page {
	min-height: 100vh;
	background: #F8FAFC;
	padding: 28rpx;
	box-sizing: border-box;
}

.settings-card {
	background: #FFFFFF;
	border-radius: 24rpx;
	box-shadow: 0 8rpx 24rpx rgba(15, 23, 42, 0.06);
	padding: 0 24rpx;
}

.setting-row {
	display: flex;
	align-items: center;
	gap: 18rpx;
	min-height: 110rpx;
	padding: 22rpx 0;
	border-bottom: 1rpx solid #F1F5F9;
}

.setting-row:last-child {
	border-bottom: 0;
}

.icon-wrap {
	width: 66rpx;
	height: 66rpx;
	border-radius: 18rpx;
	display: flex;
	align-items: center;
	justify-content: center;
}

.setting-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6rpx;
}

.setting-title {
	font-size: 29rpx;
	font-weight: 800;
	color: #0F172A;
}

.setting-desc {
	font-size: 23rpx;
	color: #64748B;
}
</style>
