<template>
  <div id="app">
    <!-- 添加全局导航栏 -->
    <nav class="global-nav">
      <div class="nav-container">
        FLV 视频播放器
        <div class="nav-links">
          <router-link to="/" exact class="nav-link">首页</router-link>
          <router-link to="/player" class="nav-link">播放器</router-link>
          <router-link to="/about" class="nav-link">关于我们</router-link>
        </div>
      </div>
    </nav>

    <main class="main-content">
      <router-view />
    </main>
    
    <footer class="app-footer">
      <p>基于 Vue.js 和 flv.js 构建的 Material Design 风格视频播放器</p>
    </footer>
  </div>
</template>

<script>
export default {
  name: 'App'
}
</script>

<style>
body {
  margin: 0;
  padding: 0;
  background-color: #f5f5f7;
  color: #1d1d1f;
}

#app {
  font-family: 'Roboto', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
}

/* 全局导航栏样式 */
.global-nav {
  background-color: #1976d2;
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
}

.nav-logo {
  font-size: 20px;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.nav-links {
  display: flex;
}

.nav-link {
  color: white;
  text-decoration: none;
  margin-left: 20px;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* 修改选中样式，使用 router-link-exact-active 替代或配合 router-link-active */
.router-link-exact-active {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 500;
}

/* 可以保留原来的样式，但调整权重较低 */
.router-link-active:not(.router-link-exact-active) {
  color: rgba(255, 255, 255, 0.9);
}

/* 主内容区域 */
.main-content {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
}

.app-footer {
  margin-top: 30px;
  padding: 20px;
  font-size: 14px;
  color: #86868b;
  text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    height: auto;
    padding: 10px;
  }
  
  .nav-links {
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-link {
    margin: 5px;
  }
}
</style>
