/* ================================================================
   Earth API - 统一顶部导航
   基于模型市场顶栏风格，通用于所有页面
   全部使用 px 单位 + 显式 font-family/line-height，
   确保各页面根字号不同时顶栏仍完全一致
   ================================================================ */

:root {
  --sh-bg: rgba(255, 255, 255, 0.98);
  --sh-border: #e2e8f0;
  --sh-text: #0f172a;
  --sh-text-secondary: #475569;
  --sh-primary: rgb(37, 99, 235);
  --sh-primary-soft: rgba(37, 99, 235, 0.08);
  --sh-radius: 10px;
  --sh-transition: cubic-bezier(0.22, 1, 0.36, 1);
  --sh-font: 'Outfit', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--sh-border);
  background: var(--sh-bg);
  box-sizing: border-box;
  font-family: var(--sh-font);
  font-size: 14px;
  line-height: 1.5;
  transform: translateZ(0);
}

.site-header-container {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 0 28px;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.site-header-brand,
.site-header-brand:link,
.site-header-brand:visited,
.site-header-brand:hover,
.site-header-brand:focus,
.site-header-brand:active {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sh-font);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--sh-text);
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  transition: transform 0.3s var(--sh-transition), opacity 0.3s ease;
}

.site-header-brand:hover,
.site-header-brand:focus {
  color: var(--sh-text);
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  transform: scale(1.03);
}

.site-header-brand span,
.site-header-brand:hover span,
.site-header-brand:focus span,
.site-header-brand:active span {
  font-family: var(--sh-font);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

.site-header-brand img {
  width: 32px;
  height: 32px;
  display: block;
}

.site-header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-header-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--sh-radius);
  font-family: var(--sh-font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--sh-text-secondary);
  text-decoration: none;
  transition: color 0.25s var(--sh-transition), background-color 0.25s var(--sh-transition), transform 0.25s var(--sh-transition);
}

.site-header-nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--sh-primary);
  transition: transform 0.3s var(--sh-transition);
}

.site-header-nav a:hover {
  color: var(--sh-text);
  background: rgba(37, 99, 235, 0.06);
  transform: translateY(-1px);
}

.site-header-nav a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.site-header-nav a.active {
  color: var(--sh-primary);
  background: var(--sh-primary-soft);
}

.site-header-nav a.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* 暗色变体：用于主页等深色背景页面 */
.site-header-dark {
  --sh-bg: rgba(7, 10, 18, 0.85);
  --sh-border: rgba(255, 255, 255, 0.08);
  --sh-text: #ffffff;
  --sh-text-secondary: rgba(255, 255, 255, 0.7);
  --sh-primary: #60a5fa;
  --sh-primary-soft: rgba(96, 165, 250, 0.12);
  backdrop-filter: blur(12px);
}

.site-header-dark .site-header-nav a:hover {
  background: rgba(96, 165, 250, 0.12);
}

/* 移动端 */
@media (max-width: 900px) {
  .site-header-container {
    padding: 0 18px;
  }

  .site-header-inner {
    height: 60px;
  }

  .site-header-brand,
  .site-header-brand span {
    font-size: 18px;
  }

  .site-header-brand img {
    width: 28px;
    height: 28px;
  }

  .site-header-nav {
    gap: 2px;
  }

  .site-header-nav a {
    padding: 6px 10px;
    font-size: 13px;
  }
}

@media (max-width: 680px) {
  .site-header-nav {
    display: none;
  }
}
