<template>
  <div class="app-container">
    <!-- Animated Background -->
    <div class="bg-mesh">
      <div class="mesh-gradient mesh-1"></div>
      <div class="mesh-gradient mesh-2"></div>
      <div class="mesh-gradient mesh-3"></div>
      <div class="noise-overlay"></div>
    </div>

    <!-- Main Content -->
    <div class="app-content">
      <router-view v-slot="{ Component }">
        <transition name="page" mode="out-in">
          <component :is="Component" />
        </transition>
      </router-view>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

const locale = ref(zhCn)
</script>

<style>
/* ========================
   Design System: Neural Flow
   ======================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Core Colors - Deep Space */
  --bg-primary: #030407;
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #12121a;
  --bg-elevated: #1a1a24;
  --bg-hover: #22222e;

  /* Accent - Cyan Violet */
  --accent-primary: #00d4ff;
  --accent-primary-hover: #00b8dc;
  --accent-primary-muted: rgba(0, 212, 255, 0.12);
  --accent-secondary: #7c3aed;
  --accent-tertiary: #06b6d4;

  /* Text */
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-muted: #52525b;

  /* Status Colors */
  --success: #34d399;
  --success-muted: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --warning-muted: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-muted: rgba(248, 113, 113, 0.12);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.15);

  /* Effects */
  --glow-primary: 0 0 30px rgba(0, 212, 255, 0.25);
  --glow-secondary: 0 0 30px rgba(124, 58, 237, 0.25);
  --glass-bg: rgba(18, 18, 26, 0.6);
  --glass-border: rgba(255, 255, 255, 0.06);

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body, #app {
  height: 100%;
  font-family: var(--font-display);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================
   Background Mesh Animation
   ======================== */
.app-container {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mesh-gradient {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  animation: float 25s ease-in-out infinite;
}

.mesh-1 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.35) 0%, transparent 70%);
  top: -250px;
  right: -150px;
  animation-delay: 0s;
}

.mesh-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.3) 0%, transparent 70%);
  bottom: -200px;
  left: -150px;
  animation-delay: -8s;
}

.mesh-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
  top: 40%;
  left: 30%;
  animation-delay: -16s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -40px) scale(1.08); }
  50% { transform: translate(-30px, 30px) scale(0.95); }
  75% { transform: translate(-40px, -25px) scale(1.03); }
}

.noise-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.025;
}

.app-content {
  position: relative;
  z-index: 1;
}

/* ========================
   Page Transitions
   ======================== */
.page-enter-active,
.page-leave-active {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-enter-from {
  opacity: 0;
  transform: translateY(15px) scale(0.98);
}

.page-leave-to {
  opacity: 0;
  transform: translateY(-15px) scale(0.98);
}

/* ========================
   Scrollbar
   ======================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ========================
   Element Plus Overrides
   ======================== */
.el-button--primary {
  --el-button-bg-color: var(--accent-primary);
  --el-button-border-color: var(--accent-primary);
  --el-button-text-color: #030407;
  --el-button-hover-bg-color: var(--accent-primary-hover);
  --el-button-hover-border-color: var(--accent-primary-hover);
  --el-button-hover-text-color: #030407;
  font-weight: 500;
}

.el-card {
  --el-card-bg-color: var(--bg-secondary);
  --el-card-border-color: var(--border-subtle);
  border-radius: var(--radius-lg);
}

.el-dialog {
  --el-dialog-bg-color: var(--bg-elevated);
  --el-dialog-border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
}

.el-input__wrapper {
  background: var(--bg-tertiary) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: none !important;
  border: 1px solid var(--border-subtle) !important;
}

.el-input__wrapper:hover {
  border-color: var(--border-default) !important;
}

.el-input__wrapper.is-focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1) !important;
}

.el-select .el-input__wrapper {
  background: var(--bg-tertiary);
}

.el-textarea__inner {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
}

.el-textarea__inner:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1) !important;
}

.el-table {
  --el-table-bg-color: transparent;
  --el-table-tr-bg-color: transparent;
  --el-table-header-bg-color: var(--bg-tertiary);
  --el-table-row-hover-bg-color: var(--bg-hover);
  --el-table-border-color: var(--border-subtle);
}

.el-tabs__item {
  color: var(--text-secondary) !important;
  font-weight: 500;
}

.el-tabs__item.is-active {
  color: var(--accent-primary) !important;
}

.el-tabs__active-bar {
  background-color: var(--accent-primary);
}

.el-tag {
  border-radius: var(--radius-sm);
}

.el-tag--dark {
  background: var(--accent-primary-muted) !important;
  border-color: transparent !important;
  color: var(--accent-primary) !important;
}

.el-message {
  --el-message-bg-color: var(--bg-elevated);
  --el-message-border-color: var(--border-subtle);
  border-radius: var(--radius-md);
}

.el-popconfirm__main {
  color: var(--text-primary);
}

.el-form-item__label {
  color: var(--text-secondary) !important;
  font-weight: 500;
}

/* ========================
   Utility Classes
   ======================== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

.glow-text {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow-primary);
}

/* Selection */
::selection {
  background: var(--accent-primary-muted);
  color: var(--text-primary);
}
</style>
