<!doctype html>
<html lang="en" data-theme="auto">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="color-scheme" content="light dark" />
    <title>
      {% if page.url == "/" %}{{ site.title }}{% else %}{{ page.title | default: page.path | split: "/" | last | replace: ".md", "" }} · {{ site.title }}{% endif %}
    </title>

    <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=Pixelify+Sans:wght@400..700&family=Fragment+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap"
      rel="stylesheet"
    />
    <script>
      (() => {
        try {
          const stored = localStorage.getItem("moltbot:theme");
          if (stored === "light" || stored === "dark") document.documentElement.dataset.theme = stored;
        } catch {
          // ignore
        }
      })();
    </script>
    <link rel="stylesheet" href="{{ "/assets/terminal.css" | relative_url }}" />
    <link rel="stylesheet" href="{{ "/assets/markdown.css" | relative_url }}" />
    <script defer src="{{ "/assets/theme.js" | relative_url }}"></script>
  </head>

  <body>
    <a class="skip-link" href="#content">Skip to content</a>

    <header class="shell">
      <div class="shell__frame" role="banner">
        <div class="shell__titlebar">
          <div class="brand" aria-label="Moltbot docs terminal">
            <img
              class="brand__logo"
              src="{{ "/assets/pixel-lobster.svg" | relative_url }}"
              alt=""
              width="40"
              height="40"
              decoding="async"
            />
            <div class="brand__text">
              <div class="brand__name">Moltbot</div>
              <div class="brand__hint">docs // moltbot-cn 中文文档</div>
            </div>
          </div>

          <div class="titlebar__actions">
            <a class="titlebar__cta" href="https://github.com/jiulingyun/moltbot-cn">
              <span class="titlebar__cta-label">GitHub</span>
              <span class="titlebar__cta-meta">repo</span>
            </a>
            <a class="titlebar__cta titlebar__cta--accent" href="https://github.com/jiulingyun/moltbot-cn/releases/latest">
              <span class="titlebar__cta-label">下载</span>
              <span class="titlebar__cta-meta">最新版</span>
            </a>
          </div>
        </div>

        <div class="shell__nav" aria-label="Primary">
          <nav class="nav">
            {% assign nav = site.nav | default: empty %}
            {% for item in nav %}
              {% assign item_url = item.url | relative_url %}
              <a class="nav__link" href="{{ item_url }}">
                <span class="nav__chev">›</span>{{ item.title }}
              </a>
            {% endfor %}
          </nav>

          <div class="shell__status" aria-hidden="true">
            <span class="status__dot"></span>
            <span class="status__text">
              {% if page.url == "/" %}
                ready
              {% else %}
                viewing: {{ page.path }}
              {% endif %}
            </span>
          </div>
        </div>
      </div>
    </header>

    <main id="content" class="content" role="main">
      <div class="terminal">
        <div class="terminal__prompt" aria-hidden="true">
          <span class="prompt__user">molt</span>@<span class="prompt__host">moltbot</span>:<span class="prompt__path">~/docs</span>$<span class="prompt__cmd">
            {% if page.url == "/" %}cat index.md{% else %}less {{ page.path }}{% endif %}
          </span>
        </div>

        {% if page.summary %}
          <p class="terminal__summary">{{ page.summary }}</p>
        {% endif %}

        {% if page.read_when %}
          <details class="terminal__meta">
            <summary>Read when…</summary>
            <ul>
              {% for hint in page.read_when %}
                <li>{{ hint }}</li>
              {% endfor %}
            </ul>
          </details>
        {% endif %}

        <article class="markdown">
          {{ content }}
        </article>

        <footer class="terminal__footer" role="contentinfo">
          <div class="footer__line">
            <span class="footer__sig">moltbot-cn</span>
            <span class="footer__sep">·</span>
            <a href="https://github.com/jiulingyun/moltbot-cn">source</a>
            <span class="footer__sep">·</span>
            <a href="https://github.com/jiulingyun/moltbot-cn/releases">releases</a>
          </div>
          <div class="footer__hint" aria-hidden="true">
            提示：按 <kbd>F2</kbd>（Mac：<kbd>fn</kbd>+<kbd>F2</kbd>）切换主题
          </div>
          <div class="footer__actions">
            <button
              class="theme-toggle"
              type="button"
              data-theme-toggle
              aria-label="Toggle theme (F2; on Mac: fn+F2)"
              aria-pressed="false"
            >
              <span class="theme-toggle__key">F2</span>
              <span class="theme-toggle__label" data-theme-label>theme</span>
            </button>
          </div>
	        </footer>
	      </div>
	    </main>
	  </body>
</html>
