<template>
  <div class="mobile-dashboard">
    <div class="mobile-header">
      <div class="brand">
        <img src="/logo.png" alt="Logo" class="logo-img" />
        <span class="logo-text">统一登录平台</span>
      </div>
      <el-button type="danger" link @click="handleLogout">
        退出
      </el-button>
    </div>

    <div class="mobile-content">
      <PlatformLaunchpad />
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { useAuthStore } from '../../store/auth'
import PlatformLaunchpad from '../PlatformLaunchpad.vue'

const router = useRouter()
const authStore = useAuthStore()

const handleLogout = () => {
  authStore.logout()
  router.push('/mobile/login')
}
</script>

<style scoped>
.mobile-dashboard {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f0f2f5;
}

.mobile-header {
  height: 50px;
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 30px;
}

.logo-text {
  font-weight: bold;
  font-size: 16px;
  color: #333;
}

.mobile-content {
  flex: 1;
  overflow-y: auto;
  /* PlatformLaunchpad has its own padding, but we might want to adjust */
}

/* Adjust PlatformLaunchpad styles for mobile if needed */
:deep(.launchpad-container) {
  padding: 15px;
}

:deep(.header) {
  margin-bottom: 20px;
}

:deep(.apps-grid) {
  justify-content: center;
  gap: 20px;
}
</style>

