示例工程 60-ship-and-review
60-ship-and-review/demo-02-budget/style.css
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
:root {
--ink: #0f172a;
--muted: #64748b;
--border: #e2e8f0;
--success: #15803d;
--danger: #b91c1c;
}
body {
margin: 0;
padding: 32px;
background: #f8fafc;
color: var(--ink);
font-family: system-ui, sans-serif;
line-height: 1.7;
}
h1 { margin: 0 0 4px; font-size: 28px; }
p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.budgets {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
max-width: 720px;
}
.budget {
padding: 14px;
border: 1px solid var(--border);
border-radius: 10px;
background: #ffffff;
}
.head {
display: flex;
justify-content: space-between;
gap: 8px;
font-size: 12px;
}
.head span { color: var(--muted); font-family: ui-monospace, monospace; }
.track {
height: 8px;
margin-top: 8px;
overflow: hidden;
border-radius: 999px;
background: var(--border);
}
.fill {
display: block;
width: var(--value);
height: 100%;
border-radius: inherit;
background: var(--success);
}
.fill--over { background: var(--danger); }
@media (max-width: 640px) {
.budgets { grid-template-columns: minmax(0, 1fr); }
}