/* ========================================
   组件：搜索框
   ======================================== */
.search-box {
  display: flex;
  align-items: center;
  padding: 10px var(--spacing-md);
  background: var(--color-bg-search);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}
.search-box:hover { background: var(--color-primary-hover); }

.search-box__icon {
  position: relative;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-right: var(--spacing-sm);
  color: var(--color-text-tertiary);
}
.search-box__icon::before,
.search-box__icon::after {
  content: '';
  position: absolute;
  box-sizing: border-box;
}
.search-box__icon::before {
  top: 0; left: 0;
  width: 10px; height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.search-box__icon::after {
  right: 0; bottom: 1px;
  width: 2px; height: 6px;
  background: currentColor;
  transform: rotate(-45deg);
  transform-origin: top;
}

.search-box__input {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  color: var(--color-text-primary);
}
.search-box__input::placeholder { color: var(--color-text-tertiary); }

/* ========================================
   组件：用户端主导航
   移动端：底部Tab栏 | 桌面端：左侧侧边栏
   ======================================== */
.app-navbar {
  position: fixed;
  bottom: 0; left: 0;
  z-index: 99;
  display: flex;
  width: 100%;
  height: var(--navbar-height-mobile);
  height: calc(var(--navbar-height-mobile) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--color-bg-glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--color-border-separator);
}

.app-navbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: var(--transition-base);
}
.app-navbar__item--active { color: var(--color-primary); }

.app-navbar__icon {
  position: relative;
  width: 24px;
  height: 24px;
  margin-bottom: var(--spacing-xs);
  line-height: 1;
}
.app-navbar__icon::before,
.app-navbar__icon::after {
  content: '';
  position: absolute;
  box-sizing: border-box;
}

/* 首页图标 */
.icon-home::before {
  top: 5px; left: 3px;
  width: 18px; height: 14px;
  border: 2px solid currentColor;
  border-top: none;
  border-radius: 0 0 2px 2px;
}
.icon-home::after {
  top: 2px; left: 2px;
  width: 2px; height: 8px;
  background: currentColor;
  transform: rotate(-45deg);
  transform-origin: bottom left;
  box-shadow: 16px 0 0 currentColor;
}
.icon-home i {
  position: absolute;
  bottom: 3px; left: 50%;
  transform: translateX(-50%);
  width: 6px; height: 8px;
  border: 2px solid currentColor;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  font-style: normal;
}

/* 分类图标 */
.icon-category::before {
  top: 4px; left: 3px;
  width: 18px; height: 2px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 7px 0 currentColor, 0 14px 0 currentColor;
}

/* 播放图标 */
.icon-play::before {
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 20px; height: 20px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.icon-play::after {
  top: 50%; left: 50%;
  transform: translate(-30%, -50%);
  width: 0; height: 0;
  border-left: 8px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

/* 我的图标 */
.icon-profile::before {
  top: 4px; left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.icon-profile::after {
  bottom: 3px; left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 8px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 0 0;
  border-bottom: none;
}

.app-navbar__text {
  font-size: 11px;
  font-weight: 500;
}

/* ========================================
   组件：主按钮
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-base);
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { opacity: 0.9; }
.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn-outline {
  border: 1px solid var(--color-border-separator);
  color: var(--color-text-primary);
  background: #fff;
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ========================================
   桌面端响应式适配（≥1024px）
   ======================================== */
@media (min-width: 1024px) {
  body {
    padding-left: var(--navbar-width-desktop);
    padding-bottom: var(--spacing-xl);
  }

  /* 导航改为左侧侧边栏 */
  .app-navbar {
    top: 0;
    width: var(--navbar-width-desktop);
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    padding: var(--spacing-2xl) 0;
    gap: var(--spacing-xs);
    border-top: none;
    border-right: 1px solid var(--color-border-separator);
  }
  .app-navbar__item {
    flex-direction: row;
    width: 100%;
    padding: 12px 28px;
    justify-content: flex-start;
    gap: var(--spacing-md);
  }
  .app-navbar__item--active { background: var(--color-primary-light); }
  .app-navbar__icon { margin-bottom: 0; }
  .app-navbar__text { font-size: 14px; }
}
