<template>
  <div class="work-layout-container">
    <div class="work-left-sidebar">
      <div class="menu-title">
        <h3>指标配置</h3>
      </div>
      <div class="menu-list">
        <div
          class="menu-item"
          :class="{ active: activeMenu === item.key }"
          v-for="item in menuList"
          :key="item.key"
          @click="activeMenu = item.key"
        >
          {{ item.label }}
        </div>
      </div>
    </div>
    <div class="work-section work-main-section">
      <div v-if="activeMenu === 1" class="menu-content">
		  <HomeIndex />
      </div>
      <div v-else-if="activeMenu === 2" class="menu-content">
		  <WorkIndex />
      </div>
      <div v-else-if="activeMenu === 3" class="menu-content">
		  <ErpIndex />
      </div>
      <div v-else-if="activeMenu === 4" class="menu-content">
		  <SysIndex />
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import HomeIndex from './components/Home.vue'
import WorkIndex from './components/Work.vue'
import ErpIndex from './components/Erp.vue'
import SysIndex from './components/Sys.vue'

const menuList = ref([
  { key: 1, label: '首页' },
  { key: 2, label: '工作' },
  { key: 3, label: '财务' },
  { key: 4, label: '系统' },
])
const activeMenu = ref(1)
</script>

<style scoped>
.work-layout-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  gap: 6px;
  padding: 8px;
  margin: 0 !important;
  box-sizing: border-box;
  background-color: transparent;
  overflow: hidden;
}

.work-left-sidebar {
  width: 15%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(26, 80, 139, 0.3);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(2px);
  box-sizing: border-box;
}

.menu-title {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: transparent;
}

.menu-title h3 {
  margin: 0;
  padding: 0 4px 8px 4px;
  color: #e0e6ff;
  font-size: 20px;
  border-bottom: 1px solid rgba(26, 80, 139, 0.5);
  line-height: 1;
  text-align: center;
  width: 100%;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
  margin-top: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.menu-list::-webkit-scrollbar {
  width: 6px;
}

.menu-list::-webkit-scrollbar-track {
  background: rgba(26, 80, 139, 0.1);
  border-radius: 3px;
}

.menu-list::-webkit-scrollbar-thumb {
  background: rgba(26, 80, 139, 0.5);
  border-radius: 3px;
}

.menu-list::-webkit-scrollbar-thumb:hover {
  background: rgba(26, 80, 139, 0.7);
}

.menu-item {
  height: 36px;
  line-height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(26, 80, 139, 0.2);
  color: #e0e6ff;
  text-align: center;
  border: none;
}

.menu-item:hover {
  background: rgba(26, 80, 139, 0.3);
  color: #fff;
  box-shadow: 0 2px 8px rgba(60, 156, 255, 0.2);
}

.menu-item.active {
  background: linear-gradient(90deg, rgba(26, 80, 139, 0.8), rgba(60, 156, 255, 0.8));
  color: #fff;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(60, 156, 255, 0.4);
}

.work-main-section {
  height: 100%;
  width: 85%;
  background: transparent;
  border: 1px solid rgba(26, 80, 139, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(2px);
  overflow: auto;
  box-sizing: border-box;
}

.menu-content {
  padding: 0 4px;
  height: 100%;
  box-sizing: border-box;
  color: #e0e6ff;
}

.menu-content h4 {
  margin: 0 0 16px 0;
  color: #fff;
  font-size: 20px;
  border-bottom: 1px solid rgba(26, 80, 139, 0.5);
  padding-bottom: 8px;
  line-height: 1;
}

.menu-content p {
  margin: 0;
  color: #e0e6ff;
  line-height: 1.6;
  font-size: 14px;
}
</style>