<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Garden Compose Demo</title>
    <link>https://garden-compose-demo.pages.dev</link>
    <atom:link href="https://garden-compose-demo.pages.dev/rss.xml" rel="self" type="application/rss+xml" />
    <description>用已发布 hd-garden 演示 Garden Compose 的布局与示意图能力。</description>
    <language>zh-CN</language>
    <lastBuildDate>Sun, 08 Nov 2026 16:00:00 GMT</lastBuildDate>
    <item>
      <title>四种机制的直观区别</title>
      <link>https://garden-compose-demo.pages.dev/blog/compose-demo/four-mechanisms/</link>
      <guid isPermaLink="true">https://garden-compose-demo.pages.dev/blog/compose-demo/four-mechanisms/</guid>
      <pubDate>Sun, 08 Nov 2026 16:00:00 GMT</pubDate>
      <description></description>
      <category>compose</category><category>demo</category><category>cryptography</category>
      <content:encoded><![CDATA[<p>这是 Garden Compose Demo 的示例文章。第一张图用 <code>sandbox</code>（按 iframe 内容宽切 2×2/单列，节点用 HTML 字号）；第二张用原生布局加安全 HTML 局部块。都经 hd-garden 渲染。</p>
<figure><p>（网页中可交互：四种机制的直观区别）</p><figcaption>四种密码学机制的直观区别。列数按 sandbox iframe 内容宽切换，不按外层窗口猜测。 · <a href="https://garden-compose-demo.pages.dev/blog/compose-demo/four-mechanisms/#ui-four-mechanisms-diagram">在网页中交互</a></figcaption></figure>

<h2>同一条消息，经过四种处理</h2>
<p>原生 <code>grid</code> / <code>card</code>，标题行与代码框用安全 HTML 局部组合（标题左、图标右；浅灰代码底；算法标签灰色小字）。</p>
<figure class="g-compose"><div class="g-compose-body"><div class="g-compose-figure" data-gap="2" style="--gc-gap:8px"><p class="g-compose-h" data-align="center">同一条消息，经过四种处理</p><div class="g-compose-stack" data-gap="2" data-align="center" style="--gc-gap:8px"><p class="g-compose-h" data-align="center">Hello World</p><p class="g-compose-text" data-align="center" data-tone="muted">原始消息</p></div><div class="g-compose-grid" data-cols="2" data-gap="3" style="--gc-gap:12px"><div class="g-compose-card" data-tone="plain" data-pad="4" data-gap="3" data-radius="lg" style="--gc-pad:16px;--gc-gap:12px;background-color:#eff6ff;"><div class="g-compose-row" data-gap="2" data-align="center" data-wrap="nowrap" style="--gc-gap:8px"><p class="g-compose-h" style="--compose-color:#1e3a8a;color:#1e3a8a;" data-custom-color="true">编码</p><div class="g-compose-spacer" data-gap="2" aria-hidden="true"></div><svg class="g-compose-icon" data-name="braces" data-size="lg" viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"/><path d="M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"/></svg></div><p class="g-compose-text" data-tone="muted" data-size="sm">Base64</p><div class="g-compose-content"><div style="background:#f3f4f6;color:#111827;border:1px solid #e5e7eb;border-radius:8px;padding:10px 12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:0.92em;line-height:1.45;overflow-wrap:anywhere">SGVsbG8gV29ybGQ=</div></div><p class="g-compose-text" style="--compose-color:#1e3a8a;color:#1e3a8a;" data-custom-color="true">任何人都能解码</p></div><div class="g-compose-card" data-tone="plain" data-pad="4" data-gap="3" data-radius="lg" style="--gc-pad:16px;--gc-gap:12px;background-color:#f5f3ff;"><div class="g-compose-row" data-gap="2" data-align="center" data-wrap="nowrap" style="--gc-gap:8px"><p class="g-compose-h" style="--compose-color:#5b21b6;color:#5b21b6;" data-custom-color="true">哈希</p><div class="g-compose-spacer" data-gap="2" aria-hidden="true"></div><svg class="g-compose-icon" data-name="fingerprint" data-size="lg" viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4"/><path d="M14 13.12c0 2.38 0 6.38-1 8.88"/><path d="M17.29 21.02c.12-.6.43-2.3.5-3.02"/><path d="M2 12a10 10 0 0 1 18-6"/><path d="M2 16h.01"/><path d="M21.8 16c.2-2 .131-5.354 0-6"/><path d="M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2"/><path d="M8.65 22c.21-.66.45-1.32.57-2"/><path d="M9 6.8a6 6 0 0 1 9 5.2v2"/></svg></div><p class="g-compose-text" data-tone="muted" data-size="sm">SHA-256（截断展示）</p><div class="g-compose-content"><div style="background:#f3f4f6;color:#111827;border:1px solid #e5e7eb;border-radius:8px;padding:10px 12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:0.92em;line-height:1.45;overflow-wrap:anywhere">a591a6d40bf42040...</div></div><p class="g-compose-text" style="--compose-color:#5b21b6;color:#5b21b6;" data-custom-color="true">生成固定长度摘要</p></div><div class="g-compose-card" data-tone="plain" data-pad="4" data-gap="3" data-radius="lg" style="--gc-pad:16px;--gc-gap:12px;background-color:#ecfdf5;"><div class="g-compose-row" data-gap="2" data-align="center" data-wrap="nowrap" style="--gc-gap:8px"><p class="g-compose-h" style="--compose-color:#065f46;color:#065f46;" data-custom-color="true">加密</p><div class="g-compose-spacer" data-gap="2" aria-hidden="true"></div><svg class="g-compose-icon" data-name="lock" data-size="lg" viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg></div><p class="g-compose-text" data-tone="muted" data-size="sm">AES-GCM（示意）</p><div class="g-compose-content"><div style="background:#f3f4f6;color:#111827;border:1px solid #e5e7eb;border-radius:8px;padding:10px 12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:0.92em;line-height:1.45;overflow-wrap:anywhere">8f 32 a1 0c 7b ...</div></div><p class="g-compose-text" style="--compose-color:#065f46;color:#065f46;" data-custom-color="true">需要密钥才能解密</p></div><div class="g-compose-card" data-tone="plain" data-pad="4" data-gap="3" data-radius="lg" style="--gc-pad:16px;--gc-gap:12px;background-color:#fff7ed;"><div class="g-compose-row" data-gap="2" data-align="center" data-wrap="nowrap" style="--gc-gap:8px"><p class="g-compose-h" style="--compose-color:#9a3412;color:#9a3412;" data-custom-color="true">签名</p><div class="g-compose-spacer" data-gap="2" aria-hidden="true"></div><svg class="g-compose-icon" data-name="file-check" data-size="lg" viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="m9 15 2 2 4-4"/></svg></div><p class="g-compose-text" data-tone="muted" data-size="sm">Ed25519（示意）</p><div class="g-compose-content"><div style="background:#f3f4f6;color:#111827;border:1px solid #e5e7eb;border-radius:8px;padding:10px 12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:0.92em;line-height:1.45;overflow-wrap:anywhere">b2 4d 77 1e 9a ...</div></div><p class="g-compose-text" style="--compose-color:#9a3412;color:#9a3412;" data-custom-color="true">用公钥验证签名</p></div></div><p class="g-compose-caption-inline" data-align="center" data-tone="muted">图中的加密结果和签名结果仅用于示意；实际输出取决于密钥、算法参数等。</p></div></div></figure>

<p>完整哈希（未截断，便于核对）：<code>a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e</code>。</p>
<blockquote>
<p>实现说明：图 1 列切换基于 sandbox iframe 内容宽度（ResizeObserver，阈值约 560px）；流程图改为 HTML 节点 + CSS 虚线，手机端保持 rem 字号。图 2 标题行用安全 HTML <code>space-between</code>；算法标签 <code>tone=&quot;muted&quot;</code>；代码框浅灰底深字。标题行用 <code>row</code> + <code>spacer</code> + 真实 <code>icon</code>；算法标签 <code>tone=&quot;muted&quot;</code>；代码框为安全 HTML 浅灰底。</p>
</blockquote>
]]></content:encoded>
    </item>
  </channel>
</rss>
