<template>
  <div class="layout-container">
    <div class="header-section">
      <el-card shadow="hover" class="header-card">
        <div class="header-content">
          <UserTop 
            userName="超级管理员"
            weatherInfo="今日小雪;夜间:多云;温度:(-4.0℃ 至 2.0℃);东北风/1-3级"
          />
        </div>
      </el-card>
    </div>
    <div class="main-section">
      <div class="left-section">
        <el-card shadow="hover" class="card-item card-1">
          <NoteLeft />
        </el-card>
        <el-card shadow="hover" class="card-item card-2">
          <AlertMain />
        </el-card>
        <el-card shadow="hover" class="card-item card-3">
          <QuickLogin />
        </el-card>
      </div>
      <div class="right-section">
        <div class="right-top-section">
          <el-card class="right-card right-top-card">
            <div class="right-placeholder">上区域内容</div>
          </el-card>
        </div>
        <div class="right-bottom-section">
          <el-card class="right-card right-bottom-card">
            <div class="right-placeholder">下区域内容</div>
          </el-card>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import UserTop from './components/UserTop.vue';
import NoteLeft from './components/Note.vue'
import AlertMain from './components/Alert.vue'
import QuickLogin from './components/Quick.vue'
</script>

<style scoped>
.layout-container {
  width: 100%;
  height: 100%; 
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 8px;
  overflow: hidden;
  background-color: #f5f7fa;
  box-sizing: border-box;
}

.header-section {
  height: 10%;
  width: 100%;
  box-sizing: border-box;
}

.header-card {
  height: 100%;
  display: flex;
  align-items: stretch !important;
  justify-content: stretch !important;
  font-size: 16px;
  font-weight: 600;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.header-content {
  width: 100%;
  height: 100%;
}

.main-section {
  height: 90%;
  width: 100%;
  display: flex;
  gap: 8px;
  box-sizing: border-box;
  min-width: 0;
}

.left-section {
  width: 35%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  flex-shrink: 0;
  overflow: hidden;
}

.card-item {
  flex: 1;
  display: flex;
  align-items: stretch !important;
  justify-content: stretch !important;
  font-size: 14px;
  font-weight: 500;
  box-sizing: border-box;
  transition: all 0.3s ease;
  min-height: 80px;
}

.right-section {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  flex-shrink: 0;
  overflow: hidden;
}

.right-top-section {
  height: 50%;
  width: 100%;
  box-sizing: border-box;
}

.right-bottom-section {
  height: 50%;
  width: 100%;
  box-sizing: border-box;
}

.right-card {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 16px;
  box-sizing: border-box;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  background-color: #fff;
}

.right-card:hover {
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.right-placeholder {
  padding: 4px;
  text-align: center;
}

:deep(.el-card) {
  border-radius: 8px;
  height: 100%;
  padding: 0 !important;
  margin: 0 !important;
}

:deep(.el-card__body) {
  padding: 4px !important;
  margin: 0 !important;
  height: 100%;
  box-sizing: border-box;
}

:deep(.el-card:hover) {
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .main-section {
    flex-direction: column;
  }
  .left-section, .right-section {
    width: 100%;
    height: 50%;
    flex: none;
  }
  .left-section {
    flex-direction: row;
  }
  .card-item {
    min-width: 120px;
    min-height: auto;
  }
  
  .right-top-section, .right-bottom-section {
    height: 50%;
  }
}
</style>