/* 六智宝库 - 共享导航栏样式（所有页面通过 <link> 引入） */

/* ---- 跳到主内容（键盘 Tab 首次可达，平时藏在视口外）----
   位置 fixed 以保证任意滚动位置聚焦都能看见；z-index 需高于 .site-nav 的 50 */
.skip-link {
  position: fixed;
  top: -70px; left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: .68rem 1.15rem;
  border-radius: 0 0 10px 10px;
  background: var(--primary);
  color: #FFF9EF;
  font-family: var(--font-sans);
  font-size: .88rem; font-weight: 600;
  text-decoration: none;
  box-shadow: 0 12px 26px -14px rgba(44, 31, 18, .6);
  transition: top .2s var(--ease, ease);
}
.skip-link:focus { top: 0; outline: 2px solid var(--fg); outline-offset: 2px; }

/* ---- 无 JS 兜底导航 ----
   仅存在于 <noscript> 内。浏览器开启 JS 时会整体不渲染（UA 样式表 noscript{display:none}），
   且 include.js 注入共享导航时会用 outerHTML 替换占位符，这段内容连 DOM 都不会留下。
   作用是让不执行 JS 的搜索引擎 / AI 抓取器仍能读到站内链接。 */
.noscript-nav {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .35rem 1.1rem;
  max-width: 1200px; margin: 0 auto;
  padding: .85rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
}
.noscript-nav .noscript-nav-brand {
  font-weight: 700; color: var(--fg); margin-right: .4rem;
}
.noscript-nav a {
  color: var(--muted); text-decoration: none;
  font-size: .9rem; font-weight: 500;
}
.noscript-nav a:hover { color: var(--primary); }

.site-nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
  animation: navSlideDown .5s cubic-bezier(.22, .61, .36, 1) both;
  will-change: transform;
}
@keyframes navSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.site-nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  height: 60px; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}

.site-logo {
  color: var(--fg); font-weight: 700; font-size: 1.05rem;
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
  letter-spacing: -.01em;
  transition: transform .2s ease, color .15s;
  display: flex; align-items: baseline; gap: .5em;
}
.site-logo:hover { transform: scale(1.04); color: var(--primary); }

.site-logo-tagline {
  font-size: .75rem; font-weight: 400;
  color: var(--muted); letter-spacing: 0;
}

.site-nav-links { display: flex; align-items: center; gap: .25rem; }

.nav-item {
  color: var(--muted); text-decoration: none; font-size: .9rem;
  font-weight: 500; padding: .4rem .75rem; border-radius: 6px;
  transition: color .15s, background .15s, transform .15s;
  white-space: nowrap;
}
.nav-item:hover {
  color: var(--fg); background: rgba(44, 31, 18, .06);
  transform: translateY(-1px);
}
.nav-item.active { color: var(--primary); font-weight: 600; }

.site-nav-toggle {
  display: none; background: none; border: none;
  font-size: 22px; cursor: pointer; color: var(--fg);
  padding: 4px 8px; border-radius: 4px;
  transition: background .2s;
}
.site-nav-toggle:hover { background: rgba(44, 31, 18, .06); }
.site-nav-toggle.is-active { background: rgba(199, 62, 42, .08); }

@media (max-width: 768px) {
  .site-nav-toggle { display: block; }
  .site-nav-links {
    display: none;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 12px 16px; gap: 2px;
    box-shadow: 0 8px 24px rgba(44, 31, 18, .12);
    animation: mobileNavIn .25s cubic-bezier(.22, .61, .36, 1) both;
  }
  @keyframes mobileNavIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .site-nav-links.is-open { display: flex; }
  .nav-item { width: 100%; padding: 11px 12px; }
}
