/* ========================================
   公共导航样式 - 所有页面共享
   ======================================== */

/* 导航栏容器 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
  padding: 0 5%;
  box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

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

/* Logo */
.logo {
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
}

/* 右侧导航组（链接+按钮） */
.nav-right-group {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

/* 导航链接容器 */
#nav-links-container {
  display: flex;
  align-items: center;
}

/* 导航链接列表 */
.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-size: 1rem;
  font-weight: 500;
  color: #333333;  /* 固定深色，不受主题切换影响 */
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* 导航CTA按钮 */
.nav-cta {
  background: var(--gradient);
  color: white;
  padding: 10px 24px;
  border-radius: 25px;
  font-weight: 500;
  transition: var(--transition);
  margin-left: 32px;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255,107,53,0.3);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 10px;
  z-index: 200;
}

.mobile-menu-btn span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* 移动端抽屉菜单 */
.mobile-nav {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  z-index: 99;
  padding: 10px 0;
  transform: translateY(-10px);
  opacity: 0;
  transition: all 0.3s ease;
}

.mobile-nav.open {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav ul {
  list-style: none;
  padding: 0 5%;
}

.mobile-nav li {
  border-bottom: 1px solid #f0f0f0;
}

.mobile-nav li:last-child {
  border-bottom: none;
  padding-top: 10px;
}

.mobile-nav a {
  display: block;
  padding: 14px 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.mobile-nav .menu-cta {
  background: var(--gradient);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  text-align: center;
  margin-top: 10px;
}

/* 移动端主题切换器 */
.mobile-theme-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 5%;
  background: rgba(0,0,0,0.03);
  border-bottom: 1px solid #f0f0f0;
}

.mobile-theme-label {
  font-weight: 500;
  color: var(--text-primary);
}

.mobile-theme-btns {
  display: flex;
  gap: 10px;
}

.mobile-theme-btns .theme-btn {
  width: 30px;
  height: 30px;
}

/* ========================================
   主题切换器样式 - 所有页面共享
   ======================================== */

.theme-switcher {
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.95);
  padding: 6px 10px;
  border-radius: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.theme-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.theme-btn:hover {
  transform: scale(1.1);
}

.theme-btn.active {
  border-color: var(--text-primary);
}

.theme-btn.light {
  background: linear-gradient(135deg, #ff6b35, #ffcc02);
}

.theme-btn.dark {
  background: linear-gradient(135deg, #1e3a5f, #0f172a);
}

.theme-btn.purple {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

/* ========================================
   响应式适配
   ======================================== */

@media (max-width: 1024px) {
  .nav-links {
    gap: 16px;
  }

  .nav-links a {
    font-size: 0.9rem;
  }
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  #theme-switcher-container {
    display: none;
  }

  .nav-right-group .theme-switcher {
    display: none;
  }

  .nav-cta {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .navbar {
    padding: 0 4%;
  }
}

/* ========================================
   深色/紫色主题下导航栏适配
   ======================================== */

/* 深色主题 */
[data-theme="dark"] .navbar {
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

[data-theme="dark"] .nav-links a {
  color: rgba(255,255,255,0.85);
}

[data-theme="dark"] .nav-links a:hover {
  color: #fff;
}

[data-theme="dark"] .mobile-menu-btn span {
  background: rgba(255,255,255,0.9);
}

[data-theme="dark"] .mobile-nav {
  background: rgba(15, 23, 42, 0.98);
}

[data-theme="dark"] .mobile-nav li {
  border-bottom-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .mobile-nav a {
  color: rgba(255,255,255,0.85);
}

[data-theme="dark"] .mobile-theme-switcher {
  background: rgba(0,0,0,0.3);
  border-bottom-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .mobile-theme-label {
  color: rgba(255,255,255,0.85);
}

[data-theme="dark"] .theme-switcher {
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* 紫色渐变主题 */
[data-theme="purple"] .navbar {
  background: rgba(10, 10, 26, 0.95);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

[data-theme="purple"] .nav-links a {
  color: rgba(255,255,255,0.85);
}

[data-theme="purple"] .nav-links a:hover {
  color: #fff;
}

[data-theme="purple"] .mobile-menu-btn span {
  background: rgba(255,255,255,0.9);
}

[data-theme="purple"] .mobile-nav {
  background: rgba(10, 10, 26, 0.98);
}

[data-theme="purple"] .mobile-nav li {
  border-bottom-color: rgba(255,255,255,0.1);
}

[data-theme="purple"] .mobile-nav a {
  color: rgba(255,255,255,0.85);
}

[data-theme="purple"] .mobile-theme-switcher {
  background: rgba(0,0,0,0.3);
  border-bottom-color: rgba(255,255,255,0.1);
}

[data-theme="purple"] .mobile-theme-label {
  color: rgba(255,255,255,0.85);
}

[data-theme="purple"] .theme-switcher {
  background: rgba(26, 26, 46, 0.95);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
