Files
ssw-mvp/demo/_shared/demo.css
T
admin 960b2d7301 demo: 批量重做 button 样式,按钮与底色不再混在一起
用户反馈:之前多个页面运行按钮跟底色几乎同色,看不见,要鼠标移上去才变色才发现。

根因:
- demo.css 原 button 规则:bg=#1d2330 (--panel-2) + border=#2a3142 (--border),与 controls 区背景差异极小
- 多页面 .controls button.primary 用 var(--accent),但 --accent 从未定义,fallback 到透明
- 多个内联 button 样式覆盖共享样式,统一性差

修法(统一设计):
- button: bg=--bg (#0e1116 深底) + border=1.5px solid --text-faint (#5b6577 亮灰) + box-shadow 微立体 + transition 0.15s + font-weight: 500 + padding 7×14
- hover: bg=--alice-bg + border/text=--alice
- disabled: opacity 0.4 + border=--border
- primary: bg=--alice 实色 + font-weight 600 + 白色文字 + hover 加深
- 批量修复 11 个页面的内联 button 规则 + 共享 demo.css + 替换 var(--accent) → var(--alice)

Playwright 实测 7 个代表性页面:
- 普通按钮(📦 加载示例 / 🎯 跑样例):bg=#0e1116 + border=#5b6577 亮灰边框 ✓
- primary 按钮(▶ 跑 / ▶ 运行 / ▶ 开始 PSI):bg=#4d8bff alice 蓝实色 + 同色边框 ✓
- 所有页面无 JS 报错

覆盖页面:secure_compare / secure_metrics / secure_stats / dp_primitives / aggregator_chain / ole_paillier / scql / scql_explain / psi / vframe_hframe + demo.css 共享样式
2026-08-11 21:18:30 +08:00

141 lines
6.1 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(--bg);
border: 1.5px solid var(--text-faint);
color: var(--text);
padding: 7px 14px;
border-radius: 5px;
font-size: 12px;
font-weight: 500;
cursor: pointer;
font-family: inherit;
transition: all 0.15s ease;
box-shadow: 0 1px 0 rgba(255,255,255,0.03), inset 0 1px 0 rgba(255,255,255,0.04);
}
button:hover:not(:disabled) {
background: var(--alice-bg);
border-color: var(--alice);
color: var(--alice);
}
button:active:not(:disabled) {
transform: translateY(1px);
}
button:disabled {
opacity: 0.4;
cursor: not-allowed;
border-color: var(--border);
}
button.primary {
background: var(--alice);
border-color: var(--alice);
color: #fff;
font-weight: 600;
}
button.primary:hover:not(:disabled) {
background: #3a78ee;
border-color: #3a78ee;
color: #fff;
}
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; }