<template>
  <el-config-provider :locale="zhCn">
    <!-- 登录/注册页面不显示布局 -->
    <template v-if="hideLayout">
      <router-view />
    </template>
    
    <!-- 正常布局：无侧边栏，编辑器全宽 -->
    <div v-else class="app-container">
      <!-- 主体区域：全宽编辑器 -->
      <div class="app-body">
        <main class="app-main">
          <router-view />
        </main>
      </div>

      <!-- 任务中心面板 -->
      <TaskCenterPanel />
    </div>
  </el-config-provider>
</template>

<script setup>
import { computed } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { ElMessage, ElMessageBox } from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import TaskCenterPanel from '@/components/TaskCenter/TaskCenterPanel.vue'

const router = useRouter()
const route = useRoute()

const hideLayout = computed(() => route.meta.hideLayout === true)
</script>

<style lang="scss">
.app-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

// ==========================================
// 主体区域：全宽
// ==========================================
.app-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.app-main {
  flex: 1;
  overflow: hidden;
  background: var(--bg);
}
</style>
