Files
eth_hedge_sim/frontend/src/styles/app.css
T
2026-07-27 06:54:42 +08:00

1041 lines
16 KiB
CSS

:root {
--bg: #0b0e11;
--bg-elev: #12161c;
--bg-panel: #151a21;
--line: #1e2630;
--text: #eaecef;
--muted: #848e9c;
--accent: #f0b90b;
--up: #0ecb81;
--down: #f6465d;
--input: #0f141a;
--danger: #f6465d;
font-family: "IBM Plex Sans", sans-serif;
color: var(--text);
background: var(--bg);
}
* {
box-sizing: border-box;
}
html,
body,
#root {
margin: 0;
min-height: 100%;
}
body {
background:
radial-gradient(1200px 600px at 10% -10%, rgba(240, 185, 11, 0.08), transparent 55%),
radial-gradient(900px 500px at 100% 0%, rgba(14, 203, 129, 0.05), transparent 50%),
var(--bg);
}
button,
input {
font: inherit;
}
.mono {
font-family: "IBM Plex Mono", monospace;
}
.app-shell {
min-height: 100vh;
display: grid;
grid-template-rows: auto 1fr;
}
.topnav {
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
gap: 8px;
padding: 10px 16px;
border-bottom: 1px solid var(--line);
background: rgba(11, 14, 17, 0.92);
backdrop-filter: blur(8px);
position: sticky;
top: 0;
z-index: 10;
}
.topnav-side {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.topnav-side.right {
justify-content: flex-end;
}
.topnav-center {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
}
.brand {
display: inline-flex;
align-items: center;
gap: 8px;
font-weight: 700;
letter-spacing: 0.02em;
color: var(--accent);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
min-width: 0;
}
.brand-mark,
.login-brand-mark {
flex-shrink: 0;
border-radius: 6px;
object-fit: cover;
background: #1a1a1a;
}
.login-brand-mark {
border-radius: 10px;
}
@media (max-width: 900px) {
.topnav-side.left .brand span {
max-width: 9em;
overflow: hidden;
text-overflow: ellipsis;
}
}
.topnav a {
color: var(--muted);
text-decoration: none;
padding: 8px 12px;
border-radius: 6px;
white-space: nowrap;
}
.topnav a.active {
color: var(--text);
background: var(--bg-panel);
}
.tabs {
display: flex;
gap: 4px;
margin-bottom: 12px;
border-bottom: 1px solid var(--line);
padding-bottom: 0;
}
.tab {
background: transparent;
border: 0;
color: var(--muted);
padding: 10px 14px;
cursor: pointer;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
}
.tab.active {
color: var(--text);
border-bottom-color: var(--accent);
}
.status-running {
color: #0ecb81 !important;
font-weight: 700;
}
.status-stopped {
color: var(--muted) !important;
}
.topnav .spacer {
flex: 1;
}
.topnav .meta {
color: var(--muted);
font-size: 12px;
margin-right: 8px;
}
.page {
padding: 16px 20px 28px;
max-width: min(1680px, 100%);
margin: 0 auto;
width: 100%;
}
@media (min-width: 1800px) {
.page {
max-width: 1760px;
padding-left: 28px;
padding-right: 28px;
}
}
.brand-short {
display: none;
}
.nav-label-short {
display: none;
}
.bottom-nav {
display: none;
}
.plan-mobile-hero {
display: none;
}
.plan-actions {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 12px;
}
@media (max-width: 900px) {
.page {
padding: 12px 14px calc(72px + env(safe-area-inset-bottom, 0px));
}
.topnav {
grid-template-columns: 1fr auto;
gap: 8px;
}
.topnav-center {
display: none;
}
.topnav-side.left {
min-width: 0;
}
.topnav-side.right {
justify-content: flex-end;
}
.brand-full {
display: none;
}
.brand-short {
display: inline;
}
.nav-label-full {
display: none;
}
.nav-label-short {
display: inline;
}
.bottom-nav {
display: grid;
grid-template-columns: repeat(4, 1fr);
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 30;
border-top: 1px solid var(--line);
background: rgba(11, 14, 17, 0.96);
backdrop-filter: blur(10px);
padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.bottom-nav-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 48px;
text-decoration: none;
color: var(--muted);
font-size: 13px;
font-weight: 600;
border-radius: 8px;
}
.bottom-nav-item.active {
color: var(--accent);
background: rgba(240, 185, 11, 0.08);
}
.plan-desktop-head {
display: none;
}
.plan-mobile-hero {
display: block;
margin: 0 0 12px;
padding: 14px 14px 12px;
border-radius: 12px;
border: 1px solid var(--line);
background:
linear-gradient(160deg, rgba(240, 185, 11, 0.08), transparent 55%),
var(--bg-panel);
}
.plan-mobile-hero-top {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px;
margin-bottom: 12px;
}
.plan-pill {
display: inline-flex;
align-items: center;
padding: 3px 8px;
border-radius: 999px;
font-size: 12px;
font-weight: 700;
border: 1px solid var(--line);
}
.plan-pill-on {
color: #0ecb81;
border-color: rgba(14, 203, 129, 0.45);
background: rgba(14, 203, 129, 0.12);
}
.plan-pill-off {
color: var(--muted);
}
.plan-pill-pause {
color: #f0b90b;
border-color: rgba(240, 185, 11, 0.45);
background: rgba(240, 185, 11, 0.12);
}
.plan-pill-muted {
color: var(--muted);
font-weight: 600;
}
.plan-mobile-phase {
margin-left: auto;
color: var(--text);
font-size: 13px;
}
.plan-mobile-hero-pnl {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.plan-mobile-pnl-block {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.plan-mobile-label {
color: var(--muted);
font-size: 12px;
}
.plan-mobile-pnl-num {
font-size: 28px;
font-weight: 700;
line-height: 1.15;
letter-spacing: -0.02em;
}
.plan-mobile-countdown {
font-size: 18px;
font-weight: 700;
line-height: 1.25;
}
.plan-mobile-sub {
color: var(--muted);
font-size: 12px;
}
.plan-mobile-err {
margin-top: 10px;
font-size: 12px;
color: var(--danger);
line-height: 1.4;
word-break: break-word;
}
.plan-actions {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.plan-actions .btn {
min-height: 44px;
width: 100%;
}
.plan-actions .btn.danger {
grid-column: 1 / -1;
}
.plan-actions .meta {
grid-column: 1 / -1;
}
.topnav-user {
max-width: 6em;
overflow: hidden;
text-overflow: ellipsis;
}
.topnav-logout {
padding: 8px 10px;
min-height: 40px;
}
.tabs {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
flex-wrap: nowrap;
}
.tab {
flex: 0 0 auto;
padding: 10px 12px;
min-height: 44px;
}
.settings-subtabs {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
flex-wrap: nowrap;
}
.settings-actions .btn {
min-height: 44px;
}
}
.card {
background: var(--bg-panel);
border: 1px solid var(--line);
border-radius: 10px;
padding: 16px;
}
.grid-2 {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
@media (max-width: 800px) {
.grid-2 {
grid-template-columns: 1fr;
}
}
.kv {
display: flex;
justify-content: space-between;
align-items: baseline;
gap: 12px;
padding: 8px 0;
border-bottom: 1px solid var(--line);
font-size: 14px;
}
.kv:last-child {
border-bottom: 0;
}
.kv > span:first-child {
color: var(--muted);
flex: 0 0 auto;
min-width: 5.5em;
}
.kv > span:last-child {
text-align: right;
min-width: 0;
}
/* 计划页:上排策略|持仓顶底对齐;下排行情同列宽对齐 */
.plan-shell {
--plan-cols: minmax(280px, 1fr) minmax(320px, 1.15fr);
--plan-gap: 12px;
display: flex;
flex-direction: column;
gap: var(--plan-gap);
margin-bottom: 12px;
}
.plan-board,
.plan-market {
display: grid;
grid-template-columns: var(--plan-cols);
gap: var(--plan-gap);
min-width: 0;
}
.plan-board {
align-items: stretch;
}
.plan-panel-title {
margin: 0 0 10px;
font-size: 14px;
font-weight: 600;
color: var(--muted);
}
.plan-strategy {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
box-sizing: border-box;
}
.plan-metrics {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
}
.plan-metrics .kv {
min-width: 0;
}
.plan-positions {
display: flex;
flex-direction: column;
gap: var(--plan-gap);
height: 100%;
min-height: 0;
min-width: 0;
}
.plan-positions .pos-card,
.plan-positions .pos-empty {
flex: 1 1 0;
display: flex;
flex-direction: column;
min-height: 0;
box-sizing: border-box;
}
.pos-countdown {
flex: 0 0 auto;
font-size: 0.82rem;
font-weight: 600;
color: #e8ecf4;
white-space: nowrap;
margin-left: auto;
}
@media (max-width: 960px) {
.plan-shell {
--plan-cols: 1fr;
}
.plan-positions .pos-card,
.plan-positions .pos-empty {
flex: 0 0 auto;
}
.pos-countdown {
margin-left: 0;
width: 100%;
}
}
.login-wrap {
min-height: 100vh;
display: grid;
place-items: center;
padding: 24px;
}
.login-box {
width: min(420px, 100%);
background: var(--bg-elev);
border: 1px solid var(--line);
border-radius: 14px;
padding: 28px 24px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.login-box h1 {
margin: 0;
font-size: 20px;
line-height: 1.35;
}
.login-title-row {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 20px;
}
.login-box p {
margin: 0 0 20px;
color: var(--muted);
font-size: 13px;
}
.login-box .err {
margin-bottom: 14px;
}
.field {
display: grid;
gap: 6px;
margin-bottom: 14px;
}
.field label {
font-size: 12px;
color: var(--muted);
}
.field input,
.field select {
background: var(--input);
border: 1px solid var(--line);
color: var(--text);
border-radius: 8px;
padding: 10px 12px;
outline: none;
width: 100%;
min-height: 42px;
}
.field input:focus,
.field select:focus {
border-color: rgba(240, 185, 11, 0.55);
}
/* Settings: ultrawide + tablet */
.settings-page {
width: 100%;
max-width: 1200px;
}
.settings-card {
width: 100%;
}
.settings-card-narrow {
max-width: 640px;
}
.settings-lead {
color: var(--muted);
margin: 0 0 16px;
line-height: 1.5;
font-size: 13px;
}
.settings-subtabs {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin: 0 0 18px;
padding-bottom: 12px;
border-bottom: 1px solid var(--line);
}
.settings-subtab {
appearance: none;
border: 1px solid var(--line);
background: var(--input);
color: var(--muted);
border-radius: 6px;
padding: 6px 12px;
font-size: 13px;
cursor: pointer;
}
.settings-subtab:hover {
color: var(--text);
border-color: #2a3441;
}
.settings-subtab.active {
color: #111;
background: var(--accent);
border-color: var(--accent);
font-weight: 600;
}
.settings-ok {
color: var(--up);
margin-bottom: 12px;
}
.settings-section {
margin-bottom: 8px;
padding-bottom: 8px;
border-bottom: 1px solid var(--line);
}
.settings-section:last-of-type {
border-bottom: 0;
}
.settings-section h3 {
margin: 0 0 12px;
font-size: 13px;
font-weight: 600;
color: var(--muted);
letter-spacing: 0.04em;
text-transform: none;
}
.settings-fields {
display: grid;
grid-template-columns: 1fr;
gap: 0 18px;
}
.settings-fields .field {
margin-bottom: 12px;
}
.settings-hint {
margin: 6px 0 0;
font-size: 12px;
color: var(--muted);
line-height: 1.4;
}
.settings-rules {
margin: 4px 0 12px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--input);
}
.settings-rules-toggle {
appearance: none;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
border: 0;
background: transparent;
color: var(--muted);
padding: 10px 12px;
font-size: 13px;
font-weight: 600;
cursor: pointer;
text-align: left;
}
.settings-rules-toggle:hover {
color: var(--text);
}
.settings-rules.open .settings-rules-toggle {
color: var(--text);
border-bottom: 1px solid var(--line);
}
.settings-rules-chevron {
color: var(--muted);
font-size: 12px;
}
.settings-rules-body {
padding: 10px 12px 12px;
}
.settings-rules-list {
margin: 0;
padding-left: 18px;
color: var(--muted);
font-size: 12px;
line-height: 1.55;
}
.settings-rules-list li + li {
margin-top: 6px;
}
.settings-actions {
margin-top: 8px;
display: flex;
flex-wrap: wrap;
gap: 10px;
}
@media (min-width: 700px) {
.settings-fields {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (min-width: 1100px) {
.settings-page {
max-width: 1320px;
}
.settings-fields {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
@media (max-width: 699px) {
.settings-fields .field {
margin-bottom: 14px;
}
.field input,
.field select {
min-height: 44px;
font-size: 16px; /* 避免 iOS 自动缩放 */
}
}
.btn {
border: 0;
border-radius: 8px;
padding: 10px 14px;
cursor: pointer;
background: var(--accent);
color: #111;
font-weight: 600;
}
.btn.ghost {
background: transparent;
color: var(--muted);
border: 1px solid var(--line);
}
.btn.danger {
background: transparent;
color: var(--danger);
border: 1px solid var(--danger);
}
.btn.danger:hover:not(:disabled) {
background: rgba(246, 70, 93, 0.12);
}
.btn.btn-running,
.btn.btn-running:disabled {
background: rgba(14, 203, 129, 0.16);
color: #0ecb81;
border: 1px solid #0ecb81;
opacity: 1;
cursor: default;
}
.btn.block {
width: 100%;
}
.err {
color: var(--danger);
font-size: 13px;
margin: 0 0 12px;
}
.hint {
margin-top: 12px;
color: var(--muted);
font-size: 12px;
line-height: 1.5;
}
.tag {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 999px;
font-size: 11px;
border: 1px solid var(--line);
color: var(--muted);
}
.tag.up {
color: var(--up);
border-color: rgba(14, 203, 129, 0.35);
}
.tag.down {
color: var(--down);
border-color: rgba(246, 70, 93, 0.35);
}
/* OKX-style position cards (copied/adapted from crypto_monitor instance_page) */
.pos-embed-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin-top: 14px;
padding-top: 14px;
border-top: 1px solid var(--line);
}
@media (max-width: 800px) {
.pos-embed-grid {
grid-template-columns: 1fr;
}
}
.pos-card {
background: #141923;
border: 1px solid #2a3348;
border-radius: 10px;
padding: 12px 14px;
}
.pos-card-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-bottom: 10px;
}
.pos-card-symbol {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
min-width: 0;
}
.pos-card-symbol strong {
font-size: 0.95rem;
color: #fff;
font-weight: 600;
word-break: break-all;
}
.pos-side-badge {
padding: 3px 8px;
border-radius: 6px;
font-size: 0.72rem;
font-weight: 500;
line-height: 1.2;
}
.pos-side-long {
background: #253a6e;
color: #6eb5ff;
}
.pos-side-short {
background: #4a2230;
color: #ff8a8a;
}
.pos-meta {
font-size: 0.74rem;
color: #8b95a8;
line-height: 1.45;
margin-bottom: 12px;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 4px 0;
}
.pos-meta-item {
display: inline-flex;
align-items: center;
}
.pos-meta-item:not(:last-child)::after {
content: "|";
margin: 0 8px;
color: #3d4659;
}
.pos-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px 14px;
}
.pos-cell-wide {
grid-column: 1 / -1;
}
.pos-countdown-urgent {
color: #ffb020 !important;
}
@media (max-width: 520px) {
.pos-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (min-width: 1400px) {
.pos-embed-grid {
gap: 14px;
}
}
.pos-cell {
display: flex;
flex-direction: column;
gap: 4px;
min-width: 0;
}
.pos-label {
font-size: 0.72rem;
color: #7d8799;
}
.pos-value {
font-size: 0.88rem;
color: #e8ecf4;
font-weight: 500;
line-height: 1.25;
}
.pos-empty {
padding: 18px;
text-align: center;
color: #8892b0;
font-size: 0.85rem;
background: #141923;
border: 1px dashed #2a3348;
border-radius: 10px;
}
.pos-pnl-profit {
color: #7ee787 !important;
}
.pos-pnl-loss {
color: #ff8b8b !important;
}