/* ===== Navigation Styles ===== */

/* 顶部栏 */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; margin-bottom: 8px;
  position: relative;
}
.top-bar::after {
  content: ''; position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
  border-radius: 1px; opacity: 0.5;
}
.top-bar-title-wrap { display: flex; align-items: center; gap: 6px; }
.top-bar-title { font-size: 20px; font-weight: 700; }
.top-bar-sparkle { display: inline-flex; width: 18px; height: 18px; }
.top-bar-sparkle svg { width: 100%; height: 100%; }
.top-bar-badge {
  font-size: 12px;
  background: var(--primary-muted); color: var(--primary);
  padding: 4px 10px; border-radius: 20px;
  font-weight: 500; animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0); }
}

/* ============================================================
   底部Tab - Floating Pill Nav Bar v2
   ============================================================ */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 16px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.78);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.06);
  transition: background 0.3s ease;
}

@media (prefers-color-scheme: dark) {
  .tab-bar {
    background: rgba(15, 15, 26, 0.88);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
  }
}

/* Tab Item */
.tab-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
  margin: 0 4px;
  border-radius: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: var(--text-muted);
  transition: color 0.3s ease, background 0.3s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 背景指示器（选中时展开） */
.tab-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(139, 92, 246, 0.06));
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.tab-item:active {
  transform: scale(0.88);
}

.tab-item.active {
  color: var(--primary);
}

.tab-item.active::before {
  opacity: 1;
  transform: scale(1);
}

/* 顶部活跃指示条 */
.tab-item::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
}

.tab-item.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* 图标 */
.tab-icon {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  transition: stroke-width 0.2s ease, filter 0.3s ease;
}

.tab-item.active .tab-icon {
  transform: translateY(-1px);
}

.tab-item.active .tab-icon svg {
  stroke-width: 2.3;
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.45));
}

/* 标签文字 */
.tab-label {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  transition: transform 0.3s ease, font-weight 0.2s ease;
}

.tab-item.active .tab-label {
  transform: translateY(-1px);
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.20);
}

/* 小红点（保留但默认隐藏） */
.tab-glow-dot {
  display: none;
}
