<script setup>
// 全局注册u-toast组件
import { useToast } from 'uview-plus'
const toast = useToast()

// 挂载到全局
uni.$u = {
  toast,
  showModal: useToast().showModal
}
</script>

<script>
export default {
  onLaunch: function() {
    console.log('App Launch')
  },
  onShow: function() {
    console.log('App Show')
  },
  onHide: function() {
    console.log('App Hide')
  }
}
</script>

<template>
  <view>
    <router-view />
    <!-- 全局toast组件 -->
    <u-toast ref="uToast" />
    <!-- 全局modal组件 -->
    <u-modal ref="uModal" />
  </view>
</template>

<style>
/* 每个页面公共css */
page {
  background-color: #F3F4F6;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  --brand-color: #064e3b;
  --brand-light: #10B981;
}

/* 通用工具类 */
.bg-white { background-color: #ffffff; }
.rounded-2xl { border-radius: 32rpx; }
.shadow-sm { box-shadow: 0 2rpx 6rpx rgba(0,0,0,0.05); }
.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
</style>
