<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
</script>

<template>
  <div class="app-container">
    <header class="app-header">
      <div class="header-content">
        <div class="logo">Crypto.AI</div>
        <nav class="main-nav">
          <RouterLink to="/" class="nav-link">首页</RouterLink>
          <RouterLink to="/ai-agent" class="nav-link">AI Agent</RouterLink>
          <RouterLink to="/tools" class="nav-link">工具集合</RouterLink>
        </nav>
        <div class="user-actions">
          <button class="btn-connect">连接钱包</button>
        </div>
      </div>
    </header>

    <main class="app-content">
      <div class="content-container">
        <RouterView />
      </div>
    </main>

    <footer class="app-footer">
      <div class="footer-content">
        <p>&copy; 2024 Crypto.AI - 加密货币AI服务平台</p>
      </div>
    </footer>
  </div>
</template>

<style>
:root {
  --color-bg-primary: #000000;
  --color-bg-secondary: #111111;
  --color-bg-elevated: #1a1a1a;
  --color-bg-card: #0a0a0a;

  --color-text-primary: rgba(255, 255, 255, 1);
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-text-tertiary: rgba(255, 255, 255, 0.5);
  --color-text-disabled: rgba(255, 255, 255, 0.3);

  --color-divider: rgba(255, 255, 255, 0.1);
  --color-border: rgba(255, 255, 255, 0.15);
  --color-border-hover: rgba(255, 255, 255, 0.25);

  --color-accent: rgba(255, 255, 255, 0.9);
  --color-accent-hover: rgba(255, 255, 255, 1);
  --color-accent-light: rgba(255, 255, 255, 0.1);

  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  --header-height: 70px;
  --border-radius: 8px;
  --max-content-width: 1280px;
  --content-padding: 1rem;
}

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

html,
body,
#app {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  box-sizing: border-box;
  font-weight: var(--font-weight-regular);
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  box-sizing: border-box;
  position: relative;
}

.app-header {
  background-color: var(--color-bg-secondary);
  box-shadow: 0 1px 0 var(--color-divider);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  width: 100vw;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  left: 0;
  right: 0;
  position: relative;
}

.header-content {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: 1.8rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  letter-spacing: 0.5px;
}

.main-nav {
  display: flex;
  gap: 2rem;
  height: 100%;
}

.nav-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
  padding: 0 0.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

.nav-link:hover {
  color: var(--color-text-primary);
}

.router-link-active {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-bold);
}

.router-link-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-accent);
}

.user-actions {
  display: flex;
  align-items: center;
}

.btn-connect {
  background-color: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  padding: 0.7rem 1.4rem;
  border-radius: var(--border-radius);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-connect:hover {
  background-color: var(--color-bg-secondary);
  border-color: var(--color-border-hover);
}

.app-content {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0;
}

.content-container {
  width: 100%;
  max-width: var(--max-content-width);
  padding: 0 var(--content-padding);
  display: flex;
  flex-direction: column;
}

.app-footer {
  background-color: var(--color-bg-secondary);
  border-top: 1px solid var(--color-divider);
  font-size: 0.9rem;
  width: 100vw;
  margin: 0;
  padding: 1.5rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  left: 0;
  right: 0;
  position: relative;
}

.footer-content {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
  text-align: center;
  color: var(--color-text-tertiary);
}

/* 全局按钮样式 */
.btn {
  padding: 0.8rem 1.6rem;
  border-radius: var(--border-radius);
  font-weight: var(--font-weight-medium);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background-color: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-primary:hover {
  background-color: var(--color-bg-secondary);
  border-color: var(--color-border-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

/* 全局卡片样式 */
.card {
  background-color: var(--color-bg-card);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--color-border-hover);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* 响应式设计 */
@media (max-width: 1280px) {
  :root {
    --content-padding: 2rem;
  }

  .content-container,
  .header-content,
  .footer-content {
    width: 100%;
    max-width: var(--max-content-width);
  }
}

@media (max-width: 768px) {
  :root {
    --content-padding: 1rem;
  }

  .header-content {
    flex-direction: column;
    height: auto;
    padding: 1rem var(--content-padding);
  }

  .app-header {
    height: auto;
    position: relative;
  }

  .main-nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 1rem 0;
    height: auto;
  }

  .nav-link {
    padding: 0.75rem 0;
    height: auto;
  }

  .user-actions {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
  }

  .app-content {
    padding: 1rem 0;
  }
}
</style>
