/* ===== 导航栏样式 ===== */
.navbar {
  background: white;
  color: #333;
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e5e5;
  transition: all 0.3s ease;
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.navbar-brand {
  display: flex;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #333;
  font-weight: 700;
  font-size: 1.5rem;
  transition: color 0.3s ease;
}

.brand-link:hover {
  color: #007bff;
}

.brand-icon {
  font-size: 1.8rem;
  margin-right: 10px;
}

.brand-text {
  color: #333;
  transition: color 0.3s ease;
}

.navbar-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 20px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  padding: 8px 16px;
  color: #666;
  text-decoration: none;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: #333;
  background: #f8f9fa;
  transform: translateY(-1px);
}

.nav-link.active {
  color: #007bff;
  background: #e3f2fd;
  font-weight: 600;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-toggle {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: #e9ecef;
  border-color: #007bff;
  transform: scale(1.05);
}

.theme-icon {
  font-size: 1.2rem;
  transition: all 0.3s ease;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* 修正：白色主题时显示月亮图标 */
.dark-icon {
  opacity: 1;
  transform: rotate(0deg);
}

.light-icon {
  opacity: 0;
  transform: rotate(180deg);
}

/* 暗色主题导航栏 - 修改为body选择器 */
body.dark-theme .navbar {
  background: #1a1a1a;
  color: #e0e0e0;
  border-bottom-color: #333;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .brand-link,
body.dark-theme .brand-text {
  color: #e0e0e0;
}

body.dark-theme .brand-link:hover {
  color: #4dabf7;
}

body.dark-theme .nav-link {
  color: #b0b0b0;
}

body.dark-theme .nav-link:hover {
  color: #e0e0e0;
  background: #2a2a2a;
}

body.dark-theme .nav-link.active {
  color: #4dabf7;
  background: #1e3a5f;
}

body.dark-theme .theme-toggle {
  background: #2a2a2a;
  border-color: #404040;
}

body.dark-theme .theme-toggle:hover {
  background: #404040;
  border-color: #4dabf7;
}

body.dark-theme .theme-icon {
  color: #e0e0e0;
}

body.dark-theme .theme-toggle:hover .theme-icon {
  color: #4dabf7;
}

/* 修正：暗色主题时显示太阳图标 */
body.dark-theme .dark-icon {
  opacity: 0;
  transform: rotate(-180deg);
}

body.dark-theme .light-icon {
  opacity: 1;
  transform: rotate(0deg);
}

/* 响应式导航栏 */
@media (max-width: 768px) {
  .navbar-container {
    padding: 0 15px;
  }

  .brand-link {
    font-size: 1.3rem;
  }

  .brand-icon {
    font-size: 1.6rem;
    margin-right: 8px;
  }

  .nav-list {
    gap: 15px;
  }

  .nav-link {
    padding: 6px 12px;
    font-size: 0.9rem;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
  }

  .theme-icon {
    font-size: 1.3rem;
  }
}

@media (max-width: 640px) {
  .nav-list {
    gap: 10px;
  }

  .nav-link {
    padding: 5px 10px;
    font-size: 0.85rem;
  }

  .brand-link {
    font-size: 1.2rem;
  }

  .brand-icon {
    font-size: 1.4rem;
    margin-right: 6px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .theme-icon {
    font-size: 1.2rem;
  }
}