<template>
    <div class="fluid-dashboard">
        <div class="frame-top">
            <div class="title glow-text" :data-text="title">{{ title }}</div>
            <div class="top-right-actions">
                <FullscreenToggle />
            </div>
        </div>

        <div class="frame-bottom"></div>

        <slot name="background"></slot>

        <div class="ui-layer">

            <main class="main-layout" :class="layoutClass">
                <slot name="main"></slot>
            </main>
        </div>

    </div>
</template>

<script>


import FullscreenToggle from '@/components/ui/FullscreenToggle.vue';

export default {
    name: 'LoginLayout',
    mixins: [],
    components: {
        FullscreenToggle,
    },
    props: {
        // 接收外部传入的 class，用于动态切换 CSS 网格布局
        // 例如传入 "special-situation-monitoring"
        layoutClass: {
            type: String,
            default: ''
        }
    },
    data() {
        return {
            title: '灵•智交通信号控制平台',
        }
    },
    methods: {
        
    }
}
</script>

<style scoped>
/* ================= 根容器 ================= */
.fluid-dashboard {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: #050a17;
    /* 兜底深色背景 */
}

/* ================= 大屏装饰边框 ================= */
.frame-top,
.frame-left,
.frame-right,
.frame-bottom {
    position: absolute;
    pointer-events: none;
    /* 【核心】鼠标事件穿透，不挡底层交互 */
    z-index: 50;
    /* 层级高于 UI，低于弹窗 */
}

.frame-top {
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url('@/assets/images/layout-top.png') no-repeat center top;
    background-size: 100% 100%;
}

.top-right-actions {
    position: absolute;
    top: 2px;
    right: 50px;
    pointer-events: auto;
    z-index: 100;
}

.frame-top .title {
    font-family: var(--title-font-family);
    font-size: 48px;
    color: #ffffff;
    line-height: 63px;
    text-align: center;
    font-style: normal;
    text-transform: none;
}

.frame-left {
    top: 10px;
    left: 0;
    width: 16px;
    height: calc(100% - 10px - 40px);
    background: url('@/assets/images/layout-left.png') no-repeat left center;
    background-size: 100% 100%;
}

.frame-right {
    top: 10px;
    right: 0;
    width: 16px;
    height: calc(100% - 10px - 40px);
    background: url('@/assets/images/layout-right.png') no-repeat right center;
    background-size: 100% 100%;
}

.frame-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 17px;
    /* background: url('@/assets/images/layout-bottom.png') no-repeat center bottom; */ 
    background-size: 100% 100%;
}

/* ================= UI 层与网格布局 ================= */
.ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    /* 让鼠标穿透点到下层的地图 */
    display: grid;
    grid-template-rows: 80px 1fr;
    /* 头部 80px，其余给主体 */
}

/* --- 主体网格 --- */
.main-layout {
    height: 100%;
    box-sizing: border-box;
    pointer-events: none;
}

.main-layout > * {
    pointer-events: auto; 
}
</style>