Files
ssw-mvp/demo/_shared/demo.css
T
admin a602e0cc0b feat(demo): 尚数网算子集市 — 12 个 nax 算子可视化(PSI/SCQL/PIR/LR/FedAvg/MLP/binning/audit/hello/dry_run/k8s)
- `demo/` 统一入口:server.py (Flask 30000→18850) + index.html (导航页 + 尚数网 logo + 3 段 L1/L2/L3/L4 卡片)
- 12 个子模块:psi / scql / pir / vertical_lr / horizontal_fedavg / dp_fedavg / secure_mlp / hetero_binning / policy_audit / hello / dry_run / k8s_two_party
  - 每个子模块 `{__init__.py, app.py, index.html}` 蓝图模式
  - 共享 `_shared/demo.css` 暗色主题
- 八大算子用 nax 真接口(Crypto PSI / Lattice PIR / Paillier 等)跑,跨三方不直接给用户看的中间数据
- PSI 重点演示:7 阶段动画 (hash → 自盲 → 传输 → 重盲 → 比较 → 求交 → 输出) + 6 列状态表 + manual/nax_data/compare 3 路径
- 场景:两家银行 VIP 客户姓名 + 存款场景,A 行 + B 行存款相加 = 共同客户总存款
- 启动:cd demo && python server.py  → http://0.0.0.0:18850/

gitignore: 过滤 demo/**/screenshots/(playwright 验证产物)
2026-08-11 10:26:46 +08:00

112 lines
5.8 KiB
CSS

/* 尚数网算子集市 · 共享样式 */
:root {
--bg:#0e1116; --panel:#161b24; --panel-2:#1d2330;
--text:#e6e9ef; --text-dim:#8b94a7; --text-faint:#5b6577;
--border:#2a3142;
--alice:#4d8bff; --alice-bg:rgba(77,139,255,0.10); --alice-edge:rgba(77,139,255,0.45);
--bob:#ffb13b; --bob-bg:rgba(255,177,59,0.10);
--ok:#4ade80; --warn:#f87171; --mute:#636b80;
--mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
margin:0; background:var(--bg); color:var(--text);
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
font-size: 12px;
}
a { color: var(--alice); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); color: var(--alice); }
button {
background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
padding: 6px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; font-family: inherit;
}
button:hover:not(:disabled) { border-color: var(--alice); color: var(--alice); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--alice); border-color: var(--alice); color: #fff; }
button.primary:hover:not(:disabled) { background: #3a78ee; }
textarea, input[type="number"], input[type="text"], select {
width:100%; background:var(--bg); border:1px solid var(--border); border-radius:4px;
padding:8px 10px; color:var(--text); font-family:var(--mono); font-size:12px;
}
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--alice); }
label { display:block; font-size:11px; color:var(--text-dim); margin-bottom:4px; text-transform:uppercase; letter-spacing:0.5px; }
.topbar {
display:flex; align-items:center; gap:14px; padding:14px 24px;
border-bottom:1px solid var(--border);
background: linear-gradient(180deg, rgba(77,139,255,0.04), transparent);
}
.topbar img { height: 28px; }
.topbar h1 { margin: 0; font-size: 15px; font-weight: 600; }
.topbar h1 small { color: var(--text-dim); font-weight: 400; margin-left: 8px; }
.topbar a.back { color: var(--text-dim); font-size: 12px; }
.topbar a.back:hover { color: var(--alice); text-decoration: none; }
main { padding: 24px; max-width: 1480px; margin: 0 auto; }
.row { display:grid; grid-template-columns: 1fr 1fr; gap:16px; margin-bottom:16px; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
.panel {
background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
padding: 14px 16px;
}
.panel h2 {
margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px;
color: var(--text-dim); font-weight: 600;
}
.panel h2 .hint {
text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 11px;
margin-left: 8px; color: var(--text-faint);
}
table.psi { width:100%; border-collapse:collapse; font-family:var(--mono); font-size:12px; }
table.psi thead th {
text-align:left; padding:8px 10px; font-weight:500; color:var(--text-dim); font-size:11px;
background:var(--panel-2); border-bottom:1px solid var(--border); white-space:nowrap;
}
table.psi tbody td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
table.psi tbody tr:hover td { background: var(--panel-2); }
table.psi td.secret { color: var(--bob); font-weight: 600; }
table.psi td.bit-1 { color: var(--ok); font-weight: 600; }
table.psi td.bit-0 { color: var(--warn); }
table.psi td.ok { color: var(--ok); }
table.psi td.alice { color: var(--alice); font-weight: 600; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.summary .stat { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
.summary .stat .label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.summary .stat .value { font-size: 14px; font-weight: 600; margin-top: 3px; font-family: var(--mono); }
.summary .stat .sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .alice { color: var(--alice); } .bob { color: var(--bob); }
.stage-banner {
display: flex; gap: 6px; align-items: center; padding: 8px 14px;
background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
margin-bottom: 14px; font-family: var(--mono);
}
.stage-banner .step {
font-size: 11px; color: var(--text-faint);
padding: 2px 8px; border-radius: 3px; border: 1px solid var(--border);
}
.stage-banner .step.active { color: var(--alice); border-color: var(--alice); background: rgba(77,139,255,0.12); }
.stage-banner .label { font-size: 12px; color: var(--text); }
.step-controls { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.step-controls .label { font-size: 11px; color: var(--text-dim); margin-right: 4px; }
.button-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.small-note { font-size: 11px; color: var(--text-faint); margin-top: 8px; line-height: 1.5; }
.small-note code { font-family: var(--mono); color: var(--alice); }
.flow-svg { width: 100%; height: 220px; }
.flow-node-bg { transition: fill 0.3s, stroke 0.3s; }
.flow-edge { fill: none; stroke-dasharray: 200; stroke-dashoffset: 200; transition: stroke-dashoffset 0.7s cubic-bezier(.4,0,.2,1); }
.flow-edge.active { stroke-dashoffset: 0; }
.flow-edge.flow-alice { stroke-dasharray: 6 5; animation: flow-alice 0.85s linear infinite; }
.flow-edge.flow-bob { stroke-dasharray: 6 5; animation: flow-bob 0.85s linear infinite; }
@keyframes flow-alice { to { stroke-dashoffset: -22; } }
@keyframes flow-bob { to { stroke-dashoffset: -22; } }
.flow-label { fill: var(--text); font: 600 12px var(--mono); }
.flow-sub { fill: var(--text-faint); font: 10px var(--mono); }
.l1-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }