Files
eth_hedge_sim/control/frontend/src/styles.css
T

613 lines
9.4 KiB
CSS

:root {
--bg: #0f1419;
--panel: #1a222c;
--line: #2a3542;
--text: #e8eef4;
--muted: #8b9aab;
--accent: #3d9cf0;
--ok: #3cb371;
--bad: #e35d5d;
--pnl-pos: #2ee59a;
--pnl-neg: #ff5c5c;
--radius: 10px;
font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
color: var(--text);
background: radial-gradient(1200px 600px at 10% -10%, #1a3048, var(--bg));
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
}
.shell {
max-width: 1200px;
margin: 0 auto;
padding: 16px 20px 40px;
}
.header {
display: flex;
align-items: center;
gap: 20px;
margin-bottom: 20px;
flex-wrap: wrap;
}
.brand {
font-weight: 700;
letter-spacing: 0.02em;
font-size: 1.15rem;
}
.nav {
display: flex;
gap: 8px;
}
.nav a {
color: var(--muted);
text-decoration: none;
padding: 8px 12px;
border-radius: 8px;
}
.nav a.active,
.nav a:hover {
color: var(--text);
background: var(--panel);
}
.header-right {
margin-left: auto;
display: flex;
align-items: center;
gap: 10px;
}
.main h2 {
margin: 0 0 8px;
font-size: 1.25rem;
}
.page-pane.hidden {
display: none;
}
.meta {
color: var(--muted);
font-size: 0.9rem;
}
.mono {
font-family: ui-monospace, Consolas, monospace;
font-size: 0.85rem;
}
.btn {
border: 0;
background: var(--accent);
color: #fff;
padding: 8px 12px;
border-radius: 8px;
cursor: pointer;
font: inherit;
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn.ghost {
background: transparent;
color: var(--text);
border: 1px solid var(--line);
}
.err {
background: rgba(227, 93, 93, 0.15);
color: #ffb4b4;
padding: 10px 12px;
border-radius: 8px;
margin: 10px 0;
}
.err.soft {
font-size: 0.85rem;
}
.ok {
background: rgba(60, 179, 113, 0.15);
color: #9df0c9;
padding: 10px 12px;
border-radius: 8px;
margin: 10px 0;
}
.login-wrap {
min-height: 100vh;
display: grid;
place-items: center;
padding: 20px;
}
.login-box {
width: min(380px, 100%);
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
padding: 24px;
display: flex;
flex-direction: column;
gap: 12px;
}
.login-box h1 {
margin: 0;
font-size: 1.3rem;
}
.login-box label,
.add-form label {
display: flex;
flex-direction: column;
gap: 6px;
font-size: 0.9rem;
color: var(--muted);
}
input {
background: #10161d;
border: 1px solid var(--line);
color: var(--text);
border-radius: 8px;
padding: 10px 12px;
font: inherit;
}
.toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 12px;
}
.toolbar-actions {
display: flex;
gap: 8px;
align-items: center;
flex-wrap: wrap;
}
.live-pill {
font-size: 0.82rem;
color: var(--muted);
border: 1px solid var(--line);
border-radius: 999px;
padding: 4px 10px;
white-space: nowrap;
}
.live-pill.ok {
color: var(--pnl-pos);
border-color: rgba(46, 229, 154, 0.45);
font-weight: 600;
}
.live-pill.bad {
color: var(--pnl-neg);
border-color: rgba(255, 92, 92, 0.45);
font-weight: 600;
}
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 14px;
}
.node-card {
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
padding: 14px;
display: flex;
flex-direction: column;
gap: 10px;
cursor: pointer;
transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.node-card:hover {
border-color: #3d5a73;
}
.node-card.offline {
opacity: 0.85;
}
.node-card.running {
background: linear-gradient(160deg, rgba(46, 140, 90, 0.28), rgba(26, 34, 44, 0.95));
border-color: rgba(60, 179, 113, 0.65);
box-shadow: 0 0 0 1px rgba(60, 179, 113, 0.15);
}
.btn-running {
background: rgba(60, 179, 113, 0.85) !important;
cursor: default;
}
.node-card-head {
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
}
.check {
display: flex;
align-items: center;
gap: 8px;
}
.pill {
font-size: 0.75rem;
padding: 3px 8px;
border-radius: 999px;
border: 1px solid var(--line);
}
.pill.ok {
color: var(--ok);
border-color: rgba(60, 179, 113, 0.4);
}
.pill.bad {
color: var(--bad);
border-color: rgba(227, 93, 93, 0.4);
}
.kv {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
margin: 0;
}
.kv dt {
color: var(--muted);
font-size: 0.75rem;
}
.kv dd {
margin: 2px 0 0;
font-size: 0.92rem;
}
.risk-box {
border: 1px solid rgba(46, 229, 154, 0.45);
background: rgba(46, 229, 154, 0.08);
border-radius: 8px;
padding: 10px 12px;
}
.risk-box-title {
font-size: 0.78rem;
color: var(--pnl-pos);
font-weight: 700;
margin-bottom: 6px;
letter-spacing: 0.02em;
}
.risk-kv {
margin: 0;
}
.risk-kv dd {
color: var(--pnl-pos);
font-weight: 700;
}
.node-actions {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.add-form {
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
padding: 16px;
display: grid;
gap: 10px;
margin: 16px 0;
width: 100%;
box-sizing: border-box;
}
.table-wrap {
overflow: auto;
border: 1px solid var(--line);
border-radius: var(--radius);
}
table {
width: 100%;
border-collapse: collapse;
background: var(--panel);
}
th,
td {
text-align: left;
padding: 10px 12px;
border-bottom: 1px solid var(--line);
vertical-align: top;
}
.row-actions {
display: flex;
gap: 6px;
flex-wrap: wrap;
}
.token-box {
background: #132033;
border: 1px solid var(--accent);
border-radius: var(--radius);
padding: 12px;
display: grid;
gap: 8px;
margin: 12px 0;
word-break: break-all;
width: 100%;
box-sizing: border-box;
}
.token-box code {
user-select: all;
display: block;
padding: 8px;
background: #0d1520;
border-radius: 6px;
}
.settings-tabs {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin: 12px 0 16px;
}
.settings-tabs .tab {
border: 1px solid var(--line);
background: transparent;
color: var(--muted);
padding: 8px 12px;
border-radius: 8px;
cursor: pointer;
font: inherit;
}
.settings-tabs .tab.active,
.settings-tabs .tab:hover {
color: var(--text);
background: var(--panel);
border-color: #3d5a73;
}
.switch-row {
display: flex !important;
flex-direction: row !important;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 10px 0;
border-bottom: 1px solid var(--line);
margin-bottom: 8px;
}
.switch-hint {
display: block;
margin-top: 4px;
font-weight: 400;
}
.switch {
position: relative;
width: 48px;
height: 28px;
border-radius: 999px;
border: 0;
background: #3a4654;
cursor: pointer;
flex-shrink: 0;
padding: 0;
}
.switch.on {
background: var(--ok);
}
.switch-knob {
position: absolute;
top: 3px;
left: 3px;
width: 22px;
height: 22px;
border-radius: 50%;
background: #fff;
transition: transform 0.15s ease;
}
.switch.on .switch-knob {
transform: translateX(20px);
}
.modal-backdrop {
position: fixed;
inset: 0;
background: rgba(4, 8, 14, 0.88);
display: flex;
align-items: center;
justify-content: center;
padding: 16px;
z-index: 50;
overflow: auto;
}
.modal-panel {
width: min(920px, 100%);
max-height: calc(100vh - 32px);
overflow: auto;
background: var(--panel);
border: 1px solid var(--line);
border-radius: 12px;
padding: 16px 18px 18px;
display: flex;
flex-direction: column;
gap: 12px;
margin: auto;
}
.modal-panel.running {
border-color: rgba(60, 179, 113, 0.65);
box-shadow: 0 0 0 1px rgba(60, 179, 113, 0.2);
}
.modal-grid-2 {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
@media (max-width: 760px) {
.modal-grid-2 {
grid-template-columns: 1fr;
}
}
.pager {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-top: 8px;
}
.pager-meta {
color: var(--muted);
font-size: 0.8rem;
font-variant-numeric: tabular-nums;
}
.pager-actions {
display: flex;
gap: 8px;
}
.modal-head {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 12px;
flex-shrink: 0;
}
.modal-head h3 {
margin: 0 0 2px;
}
.modal-section h4 {
margin: 0 0 6px;
font-size: 0.9rem;
}
.kv-table-wrap {
border: 1px solid var(--line);
border-radius: 8px;
overflow: hidden;
}
.kv-table {
width: 100%;
border-collapse: collapse;
font-size: 0.82rem;
}
.kv-table th {
width: 38%;
background: rgba(255, 255, 255, 0.03);
color: var(--muted);
font-weight: 500;
text-align: left;
padding: 6px 10px;
border-bottom: 1px solid var(--line);
white-space: nowrap;
}
.kv-table td {
padding: 6px 10px;
border-bottom: 1px solid var(--line);
text-align: left;
font-variant-numeric: tabular-nums;
}
.kv-table tr:last-child th,
.kv-table tr:last-child td {
border-bottom: none;
}
.detail-kv {
grid-template-columns: 1fr 1fr;
}
.detail-kv .span-2 {
grid-column: 1 / -1;
}
.legs-table-wrap {
overflow: auto;
border: 1px solid var(--line);
border-radius: 8px;
}
.legs-table {
width: 100%;
border-collapse: collapse;
font-size: 0.85rem;
}
.legs-table th,
.legs-table td {
padding: 8px 10px;
border-bottom: 1px solid var(--line);
text-align: left;
white-space: nowrap;
}
.pnl-pos {
color: var(--pnl-pos);
font-weight: 700;
font-variant-numeric: tabular-nums;
}
.pnl-neg {
color: var(--pnl-neg);
font-weight: 700;
font-variant-numeric: tabular-nums;
}
.pnl-flat {
color: var(--muted);
font-weight: 700;
font-variant-numeric: tabular-nums;
}