<!doctype html>
<html lang="{{ html_lang|default('en') }}">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="robots" content="noindex, nofollow, noarchive, nosnippet" />
    <meta name="googlebot" content="noindex, nofollow, noarchive, nosnippet" />
    <meta name="bingbot" content="noindex, nofollow, noarchive, nosnippet" />
    <title>{{ title }}</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="/static/css/main.css" />
    {% block extra_head %}{% endblock %}
  </head>
  <body{% if pdf_url %} data-pdf-url="{{ pdf_url }}"{% endif %} class="{{ body_class|default('font-hei') }}">
    {% if not embed %}
    {# Normal mode: show header #}
    {% if header_title %}
    <header class="detail-header">
      <div class="header-row">
        <a class="header-back" href="/">← Papers</a>
        <span class="header-title" title="{{ header_title }}">{{ header_title }}</span>
        <div class="header-right">
          <a class="header-link" href="/stats">Stats</a>
          <a class="header-link" href="{{ repo_url }}" target="_blank" rel="noreferrer">GitHub</a>
          <span class="header-version">v{{ app_version }}</span>
        </div>
      </div>
    </header>
    {% else %}
    <header>
      <a href="/">Papers</a>
      <a href="/stats">Stats</a>
      <a href="{{ repo_url }}" target="_blank" rel="noreferrer">GitHub</a>
      <span class="header-version">v{{ app_version }}</span>
    </header>
    {% endif %}
    {% endif %}
    <div class="container{% if embed %} embed{% endif %}{% if container_class %} {{ container_class }}{% endif %}">
      {% block content %}{% endblock %}
    </div>
    {% block extra_scripts %}{% endblock %}
  </body>
</html>
