<!doctype html>
<html lang="ko">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Proof - <%= service.name %></title>
    <link rel="stylesheet" href="/css/admin.css">
  </head>
  <body>
    <main class="shell explorer-shell">
      <header class="topbar explorer-topbar">
        <div>
          <p class="eyebrow"><%= service.mode %></p>
          <h1>Proof Detail</h1>
        </div>
        <div class="top-actions">
          <a class="nav-button subtle" href="https://aisfor.kr/chain-wallet?next=/wallet">Wallet</a>
          <a class="nav-button subtle" href="/explorer">Explorer</a>
          <a class="nav-button subtle" href="/admin">Admin</a>
        </div>
      </header>

      <% if (!proof) { %>
        <section class="panel"><h2>Proof not found</h2><p class="empty">요청한 proof를 찾을 수 없습니다.</p></section>
      <% } else { %>
        <section class="panel explorer-detail-hero">
          <div>
            <p class="eyebrow"><%= proof.sourceService || 'AISFOR' %></p>
            <h2><%= proof.proofType || 'PROOF' %></h2>
            <code class="hash-block"><%= proof.id || proof.proofHash || '-' %></code>
          </div>
          <div class="detail-status-stack">
            <span class="badge badge-ok"><%= proof.status || 'recorded' %></span>
            <% if (block) { %><a class="nav-button" href="/explorer/block/<%= encodeURIComponent(block.height) %>">Block #<%= block.height %></a><% } %>
            <% if (chainTx) { %><a class="nav-button subtle" href="/explorer/tx/<%= encodeURIComponent(chainTx.txHash || chainTx.id) %>">Tx 보기</a><% } %>
          </div>
        </section>

        <section class="grid detail-grid">
          <article class="panel">
            <div class="panel-title"><h2>Proof Summary</h2><span>ledger</span></div>
            <div class="stat-list compact">
              <div class="stat-row"><span>Actor</span><code><%= proof.actorId || '-' %></code></div>
              <div class="stat-row"><span>Target</span><code><%= proof.targetId || '-' %></code></div>
              <div class="stat-row"><span>Node</span><code><%= proof.nodeId || '-' %></code></div>
              <div class="stat-row"><span>Device</span><code><%= proof.deviceId || '-' %></code></div>
              <div class="stat-row"><span>Created</span><strong><%= proof.createdAt || '-' %></strong></div>
              <div class="stat-row"><span>Mined</span><strong><%= proof.minedAt || '-' %></strong></div>
            </div>
          </article>
          <article class="panel">
            <div class="panel-title"><h2>Hashes</h2><span>privacy-safe</span></div>
            <div class="stat-list compact">
              <div class="stat-row"><span>Proof Hash</span><code><%= proof.proofHash || '-' %></code></div>
              <div class="stat-row"><span>Content Hash</span><code><%= proof.contentHash || '-' %></code></div>
              <div class="stat-row"><span>Chunk Hash</span><code><%= proof.chunkHash || '-' %></code></div>
              <div class="stat-row"><span>Payload Hash</span><code><%= proof.payloadHash || '-' %></code></div>
              <div class="stat-row"><span>Merkle Root</span><code><%= proof.merkleRoot || '-' %></code></div>
            </div>
          </article>
        </section>
      <% } %>
    </main>
  </body>
</html>

