/* 含章心理 - 全站统一导航栏样式
 * 含 #hz-navbar 容器 + nav-inner/logo/links/right/search 全部组件
 * 配合 nav HTML（静态写死或 nav.js 注入）使用
 * 单一来源：以后改导航样式只改这一个文件
 * v20260612i —— 视觉对齐精华页/专题页旧样式（max-width 960 + 橙下划线）+ 保留移动端适配
 */

/* === 顶部固定栏 === */
#hz-navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: rgba(255,253,245,.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(230,81,0,.1);
  padding: 0 20px; height: 52px;
  display: flex; align-items: center;
}

/* === 内部容器 === */
.nav-inner {
  width: 100%; max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

/* === 左侧 logo + 菜单 === */
.nav-left { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.nav-logo {
  font-size: 1.05rem; font-weight: 800; color: #E65100; text-decoration: none;
  letter-spacing: -.02em; white-space: nowrap;
}
.nav-logo:hover { color: #FF9A5C; }

.nav-links { display: flex; gap: 14px; }
.nav-links a {
  font-size: .82rem; font-weight: 500; color: #6B5B5E; text-decoration: none;
  padding: 4px 0; border-bottom: 2px solid transparent; transition: all .15s;
  white-space: nowrap;
}
.nav-links a:hover { color: #E65100; border-bottom-color: #FFC857; }
.nav-links a.active { color: #E65100; border-bottom-color: #E65100; }

/* === 右侧搜索 === */
.nav-right { flex: 1; max-width: 280px; }
.nav-search { position: relative; width: 100%; }
.nav-search input {
  width: 100%; padding: 7px 14px 7px 34px; border: 1.5px solid #FFC857;
  border-radius: 20px; font-size: .82rem; background: #fff; color: #3D2C2E;
  outline: none; transition: border-color .2s;
}
.nav-search input:focus { border-color: #E65100; }
.nav-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: #E65100; opacity: .45;
  pointer-events: none;
}

/* === 搜索结果下拉（基础定位） === */
#hz-search-results {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(61,44,46,.15);
  max-height: 420px; overflow-y: auto; border: 1px solid rgba(230,81,0,.1);
  z-index: 10000;
}

/* === 移动端适配（保留） === */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-right { max-width: 200px; }
  .nav-inner { gap: 10px; }
}


/* === sidebar/essence 卡片标准样式（从首页抽出）===
 * 历史：6/11 V6 改造时 sidebar 渲染需要的 CSS 都散在每个 HTML 的行内 <style> 里
 * 6/13 02:23+ 抽出到 nav.css 做单一来源——essence.html 缺这些规则导致 sidebar 视觉格式跟首页不一致
 * 73+ 个 HTML 行内 <style> 里也有这些规则（跟这里完全一样），加在这里不会冲突
 * 以后改 sidebar 卡片样式只改 nav.css 这一个文件
 */
.sidebar-card { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 2px 12px rgba(61,44,46,.06); margin-bottom: 18px; }
.sc-title { font-size: .98rem; font-weight: 700; color: #3D2C2E; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid #F5F0E8; padding-bottom: 10px; }
.sc-title a { color: inherit; text-decoration: none; }
.essence-card { background: #FFF8E1; padding: 18px 18px 22px; overflow: hidden; }
.essence-item { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.essence-item:last-child { margin-bottom: 0; }
.essence-num { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: #FFC857; color: #3D2C2E; font-weight: 700; font-size: .78rem; display: flex; align-items: center; justify-content: center; }
.essence-body { flex: 1; min-width: 0; }
.essence-body .e-title { font-weight: 700; font-size: .85rem; color: #3D2C2E; line-height: 1.4; word-break: break-word; }
.essence-body .e-tag { display: inline-block; font-size: .68rem; padding: 1px 5px; border-radius: 3px; margin-top: 3px; margin-right: 4px; }
.essence-body .e-tag.psy { background: #FFF3E0; color: #E65100; }
.essence-body .e-tag.tech { background: #E3F2FD; color: #1565C0; }
.essence-body .e-tag.econ { background: #E8F8E8; color: #2E7D32; }
.essence-body .e-summary { font-size: .76rem; color: #6B5B5E; margin-top: 2px; line-height: 1.35; word-break: break-word; }
.back-home { color: #E65100 !important; text-decoration: none; font-weight: 600; }
.back-home:hover { color: #FF9A5C; }
.timeline-item { position: relative; padding-left: 20px; margin-bottom: 12px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: 3px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: #FFC857; }
.timeline-item::after { content: ''; position: absolute; left: 6px; top: 16px; width: 2px; height: calc(100% - 2px); background: #FFE0B2; }
.timeline-item:last-child::after { display: none; }
.timeline-item a { font-size: .85rem; color: #3D2C2E; font-weight: 500; display: block; }
.timeline-item a:hover { color: #E65100; }
.sc-title-link { color: #3D2C2E; text-decoration: none; transition: color .2s; }
.sc-title-link:hover { color: #E65100; }
.sc-subtitle { font-size: .76rem; color: #9E9E9E; margin: 6px 0 10px; padding-left: 20px; font-weight: 500; letter-spacing: .04em; }
.timeline-list { margin-top: 2px; }
.timeline-ellipsis a { color: #E65100; font-weight: 600; }
.timeline-ellipsis a:hover { color: #FF9A5C; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud .tag { display: inline-block; padding: 3px 10px; border-radius: 14px; font-size: .78rem; cursor: pointer; transition: all .2s; font-weight: 500; }
.tag-cloud .tag:hover { transform: scale(1.08); }
.tag-cloud .tag.t1 { background: #FFF3E0; color: #E65100; }
.tag-cloud .tag.t2 { background: #E3F2FD; color: #1565C0; }
.tag-cloud .tag.t3 { background: #E8F8E8; color: #2E7D32; }
.tag-cloud .tag.t4 { background: #FCE4EC; color: #C62828; }
.tag-cloud .tag.t5 { background: #F3E5F5; color: #6A1B9A; }
.tag-cloud .tag.t6 { background: #E0F7FA; color: #00695C; }

/* card-grid-N 自适应（仅桌面 ≥769px 生效，手机由 HTML 内联 CSS 1 列规则接管）
 * 6/14 08:18 治本：之前没在 @media 里，手机端 nav.css 的 2 列规则会覆盖 HTML 内联 CSS 的 1 列规则
 * 包到 @media (min-width: 769px) 里，桌面行为不变（2 张→2 列 / 1 张→1 列 / 3 张→3 列），手机端不再被覆盖
 * 同步加 .card-grid-2 单张时 1 列（防御性）
 */
@media (min-width: 769px) {
  .card-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid-3:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }
  .card-grid-3:has(> :last-child:nth-child(1)) { grid-template-columns: 1fr; }
  .card-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .card-grid-2:has(> :last-child:nth-child(1)) { grid-template-columns: 1fr; }
}
