<template>
  <div class="app-shell">
    <router-view />
    <SessionTimeoutPrompt />
  </div>
  <!-- TODO: 预留聚合接口页面：/study/{id}/overview /subjects/{id}/detail /sites/{id}/summary -->
</template>

<script setup lang="ts">
import { initSessionManager } from "./session/sessionManager";
import { initDesktopNotificationManager } from "./session/desktopNotificationManager";
import { initDesktopUpdateManager } from "./session/desktopUpdateManager";
import { applyDesktopThemePreference, isTauriRuntime } from "./runtime";
import SessionTimeoutPrompt from "./components/SessionTimeoutPrompt.vue";

const isDesktopRuntime = isTauriRuntime();

if (isDesktopRuntime) {
  applyDesktopThemePreference();
  document.body.classList.add("is-desktop-runtime");
} else {
  document.body.classList.remove("is-desktop-runtime");
}
initSessionManager();
initDesktopNotificationManager();
initDesktopUpdateManager();
</script>

<style scoped>
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ctms-bg-base);
}
</style>
