示例工程 21-data-report

21-data-report/app/index.html

html · 6.9 KB

运行:2026 年运营数据报告 · Q1–Q3

点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。

<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>2026 年运营数据报告 · Q1–Q3</title>
    <meta name="description" content="用摘要指标、可访问图表与数据表组织一份运营报告。" />
    <style>
      * { box-sizing: border-box; }
      body {
        margin: 0;
        min-height: 100vh;
        padding: 32px 20px 40px;
        background: #f8fafc;
        color: #0f172a;
        font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
        line-height: 1.7;
      }
      .page { width: min(100%, 880px); margin: 0 auto; }
      .site-header { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid #e2e8f0; }
      .brand { font-weight: 700; letter-spacing: 0.14em; font-size: 13px; }
      nav a { color: #2563eb; font-size: 13px; text-decoration: none; }
      nav a + a { margin-left: 14px; }
      main { padding: 28px 0; }
      .eyebrow { margin: 0; color: #64748b; font-size: 11px; letter-spacing: 0.18em; }
      h1 { margin: 6px 0 10px; font-size: clamp(30px, 6vw, 44px); line-height: 1.15; }
      .meta { margin: 0 0 20px; color: #64748b; font-size: 13px; }
      .lead { margin: 0 0 20px; color: #334155; font-size: 17px; }
      section { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e2e8f0; }
      h2 { margin: 0 0 10px; font-size: 22px; }
      p { margin: 0 0 12px; color: #334155; }
      ul, ol { margin: 8px 0 12px; padding-left: 24px; color: #334155; }
      li + li { margin-top: 4px; }
      .metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0; }
      .metrics div { padding: 14px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
      .metrics dt { color: #64748b; font-size: 13px; }
      .metrics dd { margin: 4px 0 0; font-size: 26px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
      figure { margin: 16px 0; padding: 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
      figure img { display: block; width: 100%; height: auto; }
      figcaption { margin-top: 8px; color: #64748b; font-size: 13px; }
      .table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
      table { width: 100%; border-collapse: collapse; font-size: 14px; }
      caption { padding: 12px 14px 6px; text-align: left; color: #475569; font-size: 13px; }
      th, td { padding: 9px 12px; border-bottom: 1px solid #e2e8f0; text-align: left; }
      thead th { background: #f1f5f9; }
      tbody th { background: #f8fafc; }
      td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
      tfoot th, tfoot td { background: #f8fafc; font-weight: 600; border-top: 2px solid #cbd5e1; }
      .note { padding: 12px 14px; border-left: 4px solid #2563eb; border-radius: 6px; background: #eff6ff; color: #1e3a8a; font-size: 14px; }
      code { padding: 1px 5px; border-radius: 4px; background: #f1f5f9; font-family: ui-monospace, Menlo, monospace; font-size: 0.92em; }
      footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid #e2e8f0; color: #64748b; font-size: 12px; }
      @media (max-width: 560px) {
        body { padding: 20px 14px 32px; }
        .site-header { flex-direction: column; }
        th, td { padding: 8px 9px; }
      }
    </style>
  </head>
  <body>
    <div class="page">
      <header class="site-header">
        <span class="brand">REPORT / 2026</span>
        <nav aria-label="页内导航">
          <a href="#summary">摘要</a>
          <a href="#chart">图表</a>
          <a href="#data">数据</a>
          <a href="#method">口径</a>
        </nav>
      </header>

      <main>
        <p class="eyebrow">QUARTERLY REPORT</p>
        <h1>2026 年运营数据报告</h1>
        <p class="meta">作者:林小满 · 更新于 <time datetime="2026-11-28">2026-11-28</time> · 数据范围 Q1–Q3</p>
        <p class="lead">
          本报告汇总 Q1–Q3 的访问、注册与转化数据。所有数字来自运营后台导出,口径见文末。
        </p>

        <section id="summary">
          <h2>1. 摘要</h2>
          <dl class="metrics">
            <div><dt>总访问量</dt><dd>45,000</dd></div>
            <div><dt>总注册数</dt><dd>4,500</dd></div>
            <div><dt>总转化数</dt><dd>1,350</dd></div>
            <div><dt>整体转化率</dt><dd>3.0%</dd></div>
          </dl>
          <p class="note">转化率 = 转化数 ÷ 访问量,保留一位小数。</p>
        </section>

        <section id="chart">
          <h2>2. 季度趋势</h2>
          <figure>
            <img
              src="assets/chart.svg"
              alt="季度访问量柱状图:Q1 到 Q4 逐季上升,Q4 最高"
              width="720"
              height="360"
              loading="lazy"
            />
            <figcaption>图 21-1:2026 年季度访问量,Q1–Q4。</figcaption>
          </figure>
          <p>图表只给趋势,具体数值见下方数据表。</p>
        </section>

        <section id="data">
          <h2>3. 数据明细</h2>
          <div class="table-wrap">
            <table>
              <caption>2026 年 Q1–Q3 运营数据</caption>
              <thead>
                <tr>
                  <th scope="col">季度</th>
                  <th scope="col" class="num">访问量</th>
                  <th scope="col" class="num">注册数</th>
                  <th scope="col" class="num">转化数</th>
                </tr>
              </thead>
              <tbody>
                <tr><th scope="row">Q1</th><td class="num">12,000</td><td class="num">1,200</td><td class="num">360</td></tr>
                <tr><th scope="row">Q2</th><td class="num">15,000</td><td class="num">1,500</td><td class="num">450</td></tr>
                <tr><th scope="row">Q3</th><td class="num">18,000</td><td class="num">1,800</td><td class="num">540</td></tr>
              </tbody>
              <tfoot>
                <tr><th scope="row">合计</th><td class="num">45,000</td><td class="num">4,500</td><td class="num">1,350</td></tr>
              </tfoot>
            </table>
          </div>
          <p><a href="assets/data.csv" download="2026-q1-q3-report.csv">下载数据(CSV)</a></p>
        </section>

        <section id="method">
          <h2>4. 口径与说明</h2>
          <ul>
            <li>访问量按独立会话去重。</li>
            <li>注册数按首次完成注册去重。</li>
            <li>转化数按完成支付去重。</li>
            <li>数据截至 <time datetime="2026-11-28">2026-11-28</time>。</li>
            <li>示例数据为虚构,仅用于教学。</li>
          </ul>
        </section>
      </main>

      <footer>
        <p>© 2026 示例报告 · 仅用于教学</p>
      </footer>
    </div>
  </body>
</html>