/* ============================================
   Tab Bar - 底部导航
   ============================================ */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tabbar-height);
  background: var(--tabbar-bg);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-tabbar);
  padding-bottom: var(--safe-bottom);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background var(--duration-normal) var(--ease-out), border-color var(--duration-normal) var(--ease-out);
}

.tabbar-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.tabbar-brand {
  display: none;
}

.tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  min-height: 44px;
  cursor: pointer;
  position: relative;
  transition: color var(--duration-fast);
  color: var(--text-muted);
  padding: 2px 0 3px;
}

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

.tab-icon {
  width: 21px;
  height: 21px;
  margin-bottom: 2px;
  object-fit: contain;
  transition: transform var(--duration-normal) var(--ease-out);
}

/* 默认 & 选中图标切换 */
.tab-icon-active { display: none; }

.tabbar-item.active .tab-icon-default { display: none; }
.tabbar-item.active .tab-icon-active { display: inline; }

.tabbar-item.active .tab-icon {
  transform: scale(1.08);
}

/* 推荐Tab 中间指示器 */
.tab-indicator {
  position: absolute;
  bottom: -2px;
  width: 20px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.tabbar-item[data-tab="foryou"].active .tab-indicator {
  opacity: 1;
}

.tab-label {
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  line-height: 1.1;
}

/* For You 模式移动端智能底栏 (与 Home/Profile 样式完全一致，仅做平滑淡入淡出) */
#app.is-tab-foryou .tabbar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

#app.is-tab-foryou .tabbar.tabbar--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .tabbar,
  #app.is-tab-foryou .tabbar {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    height: 64px;
    padding-bottom: 0;
    border-top: 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--tabbar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 0;
    box-shadow: none;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 100;
  }

  .tabbar.tabbar--transparent .tab-icon,
  .tabbar.tabbar--transparent .tab-label,
  #app.is-tab-foryou .tabbar .tab-icon,
  #app.is-tab-foryou .tabbar .tab-label {
    filter: none;
  }

  .tabbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    justify-content: flex-end;
    gap: 4px;
  }

  .tabbar-brand {
    display: block;
    margin-right: auto;
    color: #fff;
    font-size: 21px;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.4px;
  }

  .tabbar-item {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 16px;
    flex-direction: row;
    gap: 8px;
    border-radius: 10px;
  }

  .tabbar-item:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  .tab-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 0;
  }

  .tab-label {
    font-size: 14px;
  }

  .tab-indicator {
    display: none;
  }
}
