<template>
  <div id="app">
    <el-container style="min-height: 100vh">
      <el-header class="app-header">
        <div class="header-left">
          <el-icon :size="24"><Link /></el-icon>
          <span class="header-title">AutoSSL 证书管理</span>
        </div>
        <div class="header-right">
          <el-tag type="success" size="small">运行中</el-tag>
        </div>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
            :default-active="route.path"
            router
            background-color="#001529"
            text-color="#ffffffb3"
            active-text-color="#fff"
          >
            <el-menu-item index="/">
              <el-icon><HomeFilled /></el-icon>
              <span>仪表盘</span>
            </el-menu-item>
            <el-menu-item index="/certificates">
              <el-icon><Document /></el-icon>
              <span>证书列表</span>
            </el-menu-item>
            <el-menu-item index="/create">
              <el-icon><Plus /></el-icon>
              <span>申请证书</span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import { useRoute } from 'vue-router'
const route = useRoute()
</script>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f0f2f5;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1890ff, #096dd9);
  color: white;
  padding: 0 24px;
  height: 60px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
}

.el-aside {
  background-color: #001529;
  min-height: calc(100vh - 60px);
}

.el-menu {
  border-right: none;
}

.el-main {
  background-color: #f0f2f5;
  padding: 24px;
}
</style>
