/* =====================================================
   layout.css — 头部 / 搜索区 / 主内容 / 页脚布局
   ===================================================== */

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.site-header.scrolled {
  border-bottom-color: var(--card-border);
  box-shadow: 0 4px 20px rgba(15, 23, 42, .05);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
}

.logo { flex-shrink: 0; display: block; }
.logo-img { height: 40px; width: auto; }
.logo-dark-img { display: none; }
html.dark .logo-dark-img { display: block; }
html.dark .logo-light { display: none; }

/* 主导航 */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }

.nav-link {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--text-2);
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--primary); background: rgba(99, 102, 241, .08); }
.nav-link.active { color: var(--primary); background: rgba(99, 102, 241, .1); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  color: var(--text-2);
  transition: background .2s, color .2s, transform .2s;
}
.icon-btn:hover { background: rgba(99, 102, 241, .1); color: var(--primary); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }

.icon-sun { display: none; }
html.dark .icon-sun { display: block; }
html.dark .icon-moon { display: none; }

.menu-btn { display: none; }

/* ---------- 搜索区（Hero） ---------- */
.hero {
  position: relative;
  padding: 88px 0 64px;
  text-align: center;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
  animation: float 12s ease-in-out infinite;
}
.blob-1 { width: 420px; height: 420px; background: #818cf8; top: -140px; left: 8%; }
.blob-2 { width: 360px; height: 360px; background: #38bdf8; top: -60px; right: 6%; animation-delay: -4s; }
.blob-3 { width: 280px; height: 280px; background: #f0abfc; bottom: -140px; left: 42%; animation-delay: -8s; }
html.dark .blob { opacity: .18; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(28px) scale(1.06); }
}

.hero-inner { position: relative; z-index: 1; }

.hero-greeting {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(99, 102, 241, .1);
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 主内容 ---------- */
.main-content { padding: 16px 32px 72px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--card-border);
  background: var(--bg-soft);
  transition: background .3s;
}
.footer-inner {
  padding: 36px 32px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}
.footer-logo { height: 34px; width: auto; margin: 0 auto 12px; }
html.dark .footer-logo.logo-light { display: none; }
html:not(.dark) .footer-logo.logo-dark-img { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .menu-btn { display: inline-flex; }

  /* 移动端抽屉导航 */
  .main-nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--card-border);
    box-shadow: var(--shadow-md);
    padding: 12px 16px 16px;
    gap: 4px;
    overflow: visible;
  }
  .main-nav.open .nav-link { padding: 12px 14px; font-size: 15px; }
}

@media (max-width: 768px) {
  .container { padding: 0 18px; }
  .main-content { padding: 8px 18px 56px; }
  .hero { padding: 56px 0 44px; }
  .header-inner { height: 64px; gap: 16px; }
  .main-nav.open { top: 64px; }
  .logo-img { height: 34px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 26px; }
  .container { padding: 0 14px; }
  .main-content { padding: 8px 14px 48px; }
}
