<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} · {{ .Site.Title }}{{ end }}</title>
  <meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
  <link rel="stylesheet" href="{{ "css/site.css" | relURL }}">
  <link rel="icon" href="{{ "favicon.ico" | relURL }}" type="image/x-icon">
  <link rel="apple-touch-icon" href="{{ "logo.png" | relURL }}">
  <!-- 学术手稿字体 -->
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&display=swap" rel="stylesheet">
</head>
<body>
  <header class="site-header">
    <div class="wrap header-inner">
      <div>
        <a class="site-title" href="{{ "/" | relURL }}">
          <img src="{{ "logo.png" | relURL }}" alt="Logo" class="site-logo">
          {{ .Site.Title }}
        </a>
        <p class="site-tagline">{{ .Site.Params.description }}</p>
      </div>
      <button class="menu-toggle" aria-label="菜单" aria-expanded="false">
        <span></span>
        <span></span>
        <span></span>
      </button>
      <nav class="site-nav">
        {{ range .Site.Menus.main }}
          <a href="{{ .URL }}">{{ .Name }}</a>
        {{ end }}
      </nav>
    </div>
  </header>

  <main class="wrap">
    {{ block "main" . }}{{ end }}
  </main>

  <footer class="site-footer wrap">
    <p>© {{ now.Format "2006" }} {{ .Site.Params.owner }} · Hugo personal site for AI briefs / blog / resume.</p>
  </footer>

  <script>
    document.addEventListener('DOMContentLoaded', function() {
      const toggle = document.querySelector('.menu-toggle');
      const nav = document.querySelector('.site-nav');

      toggle.addEventListener('click', function() {
        const isActive = toggle.classList.toggle('active');
        nav.classList.toggle('active');
        toggle.setAttribute('aria-expanded', isActive);
      });
    });
  </script>
</body>
</html>
