<script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
import { useUserStore } from './store/user';

onLaunch(() => {
  console.log('App Launch');
  const userStore = useUserStore();
  userStore.initUser();
});

onShow(() => {
  console.log('App Show');
});

onHide(() => {
  console.log('App Hide');
});
</script>

<template>
  <view id="app"></view>
</template>

<style>
/* 全局样式 */
page {
  background-color: #f9fafb;
  font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #1f2937;
  min-height: 100vh;
}

/* 主色调 */
:root {
  --primary-color: #4f46e5;
  --primary-light: #6366f1;
  --primary-lighter: #818cf8;
  --accent-color: #f97316;
  --success-color: #10b981;
  --error-color: #ef4444;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-primary: #f9fafb;
  --bg-card: #ffffff;
}

/* 禁止选择文本 */
text {
  user-select: none;
}

/* 安全区域 */
.safe-area-bottom {
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
}
</style>