/* ============================================================
 * 左侧导航栏 - 学术发现频道样式（与详情页共用）
 *
 * 提取自 discover/index.php
 * 由 Util::renderSidebar() 渲染对应 HTML 结构
 *
 * 依赖 CSS 变量:
 *   --hh-h  顶部导航高度（由各页面 :root 定义）
 *
 * HTML 结构示例:
 *   <aside class="ds-sidebar">
 *     <nav class="ds-side-nav">
 *       <a class="ds-side-item is-active" data-nav-key="discover" href="/discover/">
 *         <svg>…</svg><span>发现</span>
 *       </a>
 *       …
 *     </nav>
 *     <div class="ds-side-foot">
 *       <a class="ds-side-item" data-nav-key="user" href="/user/">…</a>
 *     </div>
 *   </aside>
 * ============================================================ */

/* ── 侧边栏容器（桌面：固定左侧 76px 宽竖向导航条）── */
.ds-sidebar {
  position: fixed; top: var(--hh-h); left: 0; bottom: 0;
  width: 76px; z-index: 50;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex; flex-direction: column;
  padding: 18px 0;
  box-shadow: 1px 0 0 rgba(15,23,42,.02);
  line-height: 1.6;
}

/* ── 主导航区（上半部分） ── */
.ds-side-nav {
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
  padding: 0 8px; overflow-y: auto;
}

/* ── 底部导航区（下半部分，与主导航有分隔线） ── */
.ds-side-foot {
  padding: 8px 8px 0;
  border-top: 1px solid #f1f5f9;
  margin: 8px 0 0;
}

/* ── 单个导航项 ── */
.ds-side-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; padding: 11px 4px;
  border-radius: 9px;
  color: #6b7280; text-align: center;
  transition: all .15s; position: relative;
  text-decoration: none;
}

/* 悬浮态 */
.ds-side-item:hover {
  background: #f8fafc; color: #1f2937;
}

/* 激活态（当前所处分类频道） */
.ds-side-item.is-active {
  color: #2563eb;
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
}

/* 激活态左侧竖向高亮条 */
.ds-side-item.is-active::before {
  content: ''; position: absolute; left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 2px 2px 0;
  background: #2563eb;
}

/* 图标 */
.ds-side-item svg { width: 20px; height: 20px; }

/* 文字标签 */
.ds-side-item span {
  font-size: 11px; font-weight: 500;
  letter-spacing: .5px;
}

/* ── 移动端（≤ 800px）：转为底部横向导航栏 ── */
@media (max-width: 800px) {
  .ds-sidebar {
    width: 100%; height: auto; bottom: 0; top: auto;
    flex-direction: row; padding: 6px 12px;
    border-right: none; border-top: 1px solid #e5e7eb;
    box-shadow: 0 -1px 3px rgba(0,0,0,.04);
  }
  .ds-side-nav {
    flex-direction: row; flex: 1; padding: 0;
    overflow-x: auto; justify-content: space-around;
  }
  .ds-side-item { padding: 6px 12px; }
  .ds-side-item.is-active::before { display: none; }
  .ds-side-foot { display: none; }
}
