+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 首页
+ 群组
+ 游戏
+ 通知
+ 我的
+
+
+
+
+
+```
+
+- [ ] **Step 2: 提交**
+
+```cmd
+git add frontend/src/mobile/MobileLayout.vue
+git -c user.name="zcode" -c user.email="zcode@local" commit -m "feat(mobile): add MobileLayout with navbar and tabbar"
+```
+
+---
+
+## Task 7: 改造路由实现设备分流
+
+**Files:**
+- Modify: `frontend/src/router/index.ts`
+
+这是本阶段核心。改造路由:同一 URL,根据 `isMobile()` 动态 import 桌面或手机视图。手机端用 `MobileLayout` 作为布局容器(替代桌面的 `Layout.vue`),子路由指向手机视图(本阶段除 Home 外先用 Placeholder 占位)。
+
+- [ ] **Step 1: 重写 router/index.ts**
+
+将 `frontend/src/router/index.ts` 完整替换为:
+
+```ts
+// src/router/index.ts
+import { createRouter, createWebHistory } from 'vue-router'
+import type { RouteRecordRaw } from 'vue-router'
+import { isAuthenticated } from '@/api/pocketbase'
+import { isMobile } from '@/mobile/useDevice'
+
+// 动态选择布局:手机端用 MobileLayout,桌面端用 Layout
+const LayoutComponent = () =>
+ isMobile()
+ ? import('@/mobile/MobileLayout.vue')
+ : import('@/views/Layout.vue')
+
+// 动态选择视图:同一路由名,根据设备加载桌面/手机视图
+function view(desktop: () => Promise