<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta
      name="description"
      content="Fangfei Dutch 荷兰语电子词汇书平台：按教材章节学习、刷词、搜索与收听荷兰语发音。"
    />
    <meta name="theme-color" content="#16324f" />
    <title>Fangfei Dutch · 荷兰语词汇学习平台</title>
    <link rel="icon" href="assets/brand/fangfei-school-logo-square.png" type="image/png" />
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <a class="skip-link" href="#mainContent">跳到主要内容</a>

    <header class="site-header" id="siteHeader">
      <div class="header-inner">
        <a class="brand brand--wordmark" href="#/" aria-label="Fangfei Dutch 词汇首页">
          <img
            class="brand-flower"
            src="assets/brand/fangfei-school-logo-square.png"
            width="48"
            height="48"
            alt=""
          />
          <span class="brand-copy brand-copy--wordmark">
            <strong class="brand-title">Fangfei Dutch<span class="brand-title-suffix"> · Woordenschat</span></strong>
            <small id="brandSubtitle">Contact 1 · 2 · 3 电子词汇书</small>
          </span>
        </a>

        <nav class="header-nav" aria-label="主要导航">
          <a class="nav-link" href="#/">教材</a>
          <button class="nav-action" id="searchButton" type="button" aria-label="搜索词汇">
            <i data-lucide="search" aria-hidden="true"></i>
            <span>搜索</span>
            <kbd id="searchShortcut">Ctrl K</kbd>
          </button>
          <button class="nav-action nav-action--icon" id="favoritesButton" type="button" aria-label="打开收藏">
            <i data-lucide="bookmark" aria-hidden="true"></i>
            <span class="favorite-count" id="favoriteCount">0</span>
          </button>
          <button class="nav-action nav-action--icon" id="voiceSettingsButton" type="button" aria-label="发音设置">
            <i data-lucide="audio-lines" aria-hidden="true"></i>
          </button>
        </nav>
      </div>
      <div class="mobile-book-bar" id="mobileBookBar" hidden></div>
    </header>

    <main id="mainContent" tabindex="-1">
      <div class="app-loading" id="appLoading">
        <span class="loading-mark">f</span>
        <p>正在打开词汇书...</p>
      </div>
    </main>

    <dialog class="command-dialog" id="searchDialog" aria-labelledby="searchTitle">
      <div class="command-shell">
        <div class="command-head">
          <i data-lucide="search" aria-hidden="true"></i>
          <div>
            <h2 id="searchTitle">搜索词汇</h2>
            <p>输入荷兰语或中文</p>
          </div>
          <button class="icon-button" type="button" data-close-dialog="searchDialog" aria-label="关闭搜索">
            <i data-lucide="x" aria-hidden="true"></i>
          </button>
        </div>
        <label class="search-field">
          <span class="visually-hidden">搜索荷兰语或中文词汇</span>
          <input id="searchInput" type="search" autocomplete="off" placeholder="例如：begroeten 或 问候" />
          <kbd>ESC</kbd>
        </label>
        <div class="search-hint" id="searchHint">输入关键词，直接跳到教材位置。</div>
        <div class="search-results" id="searchResults"></div>
      </div>
    </dialog>

    <dialog class="favorites-dialog" id="favoritesDialog" aria-labelledby="favoritesTitle">
      <div class="favorites-shell">
        <div class="dialog-heading">
          <div>
            <span class="eyebrow">MIJN WOORDEN</span>
            <h2 id="favoritesTitle">收藏词汇</h2>
          </div>
          <button class="icon-button" type="button" data-close-dialog="favoritesDialog" aria-label="关闭收藏">
            <i data-lucide="x" aria-hidden="true"></i>
          </button>
        </div>
        <div class="favorites-list" id="favoritesList"></div>
      </div>
    </dialog>

    <div class="settings-popover" id="settingsPopover" role="region" aria-labelledby="voiceSettingsTitle" hidden>
      <div class="popover-heading">
        <div>
          <span class="eyebrow">UITSPRAAK</span>
          <h2 id="voiceSettingsTitle">发音设置</h2>
        </div>
        <button class="icon-button icon-button--small" id="closeSettingsButton" type="button" aria-label="关闭发音设置">
          <i data-lucide="x" aria-hidden="true"></i>
        </button>
      </div>

      <fieldset class="control-group">
        <legend>荷兰语音色</legend>
        <div class="segmented-control" id="voiceControl">
          <label>
            <input type="radio" name="voice" value="fenna" checked />
            <span>Fenna<small>女声</small></span>
          </label>
          <label>
            <input type="radio" name="voice" value="maarten" />
            <span>Maarten<small>男声</small></span>
          </label>
        </div>
      </fieldset>

      <label class="range-control">
        <span>
          <strong>语速</strong>
          <output id="rateOutput">1.0×</output>
        </span>
        <input id="rateInput" type="range" min="0.6" max="1.4" step="0.1" value="1" />
        <span class="range-labels"><small>慢</small><small>自然</small><small>快</small></span>
      </label>

      <label class="switch-row switch-row--highlight">
        <span>
          <strong>自动朗读</strong>
          <small>切换词卡时自动播放当前荷兰语单词</small>
        </span>
        <input id="autoReadInput" type="checkbox" />
        <i aria-hidden="true"></i>
      </label>

      <div class="voice-status" id="voiceStatus">
        <i data-lucide="loader-circle" aria-hidden="true"></i>
        <span>正在连接 Microsoft Neural 荷兰语语音...</span>
      </div>
    </div>

    <div class="mobile-scrim" id="mobileScrim" hidden></div>
    <div class="toast-region" id="toastRegion" aria-live="polite" aria-atomic="true"></div>
    <div class="visually-hidden" id="liveRegion" aria-live="polite"></div>

    <script src="vendor/lucide.min.js"></script>
    <script src="app.js" defer></script>
  </body>
</html>
