Files
dekun f7ce6f1058 feat: 侧边栏分组图标与导航样式优化
- 分组支持 icon 字段,可按名称自动匹配或手动选择
- 左侧导航与总览卡片显示彩色 SVG 图标
- 优化侧栏链接圆角与选中态样式

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 18:06:42 +08:00

690 lines
12 KiB
CSS

:root {
--bg: #0f1419;
--panel: #1a2332;
--border: #2d3a4d;
--text: #e8eef5;
--muted: #8b9cb3;
--accent: #3d8bfd;
--accent-dim: #2563c7;
--danger: #e05252;
--success: #3ecf8e;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
}
a {
color: var(--accent);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.65rem 1.25rem;
background: var(--panel);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.topbar h1 {
margin: 0;
font-size: 1.05rem;
font-weight: 600;
letter-spacing: 0.02em;
}
.topbar nav {
display: flex;
gap: 1rem;
align-items: center;
font-size: 0.9rem;
}
.topbar .user {
color: var(--muted);
font-size: 0.85rem;
}
.app-shell {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.layout-main {
display: flex;
flex: 1;
min-height: 0;
}
.sidebar {
width: 280px;
min-width: 240px;
max-width: 40vw;
background: var(--panel);
border-right: 1px solid var(--border);
overflow-y: auto;
padding: 0 0 0.75rem;
flex-shrink: 0;
transition:
width 0.22s ease,
min-width 0.22s ease,
max-width 0.22s ease,
opacity 0.18s ease,
padding 0.22s ease,
border-color 0.22s ease;
}
.layout-main.sidebar-collapsed .sidebar {
width: 0;
min-width: 0;
max-width: 0;
padding: 0;
overflow: hidden;
opacity: 0;
pointer-events: none;
border-right-color: transparent;
}
.sidebar-toolbar {
display: flex;
justify-content: flex-end;
align-items: center;
padding: 0.45rem 0.5rem 0.35rem;
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.btn-sidebar-toggle {
display: inline-flex;
align-items: center;
justify-content: center;
width: 2rem;
height: 2rem;
padding: 0;
border-radius: 6px;
border: 1px solid var(--border);
background: rgba(255, 255, 255, 0.04);
color: var(--muted);
font: inherit;
font-size: 1rem;
line-height: 1;
cursor: pointer;
transition:
color 0.15s ease,
border-color 0.15s ease,
background 0.15s ease;
}
.btn-sidebar-toggle:hover {
color: var(--text);
border-color: var(--muted);
background: rgba(61, 139, 253, 0.1);
}
.btn-sidebar-expand {
flex-shrink: 0;
align-self: stretch;
width: 2rem;
min-height: 0;
margin: 0;
padding: 0;
border: none;
border-right: 1px solid var(--border);
background: var(--panel);
color: var(--muted);
font: inherit;
font-size: 1.05rem;
line-height: 1;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition:
color 0.15s ease,
background 0.15s ease,
border-color 0.15s ease;
}
.btn-sidebar-expand:hover {
color: var(--text);
background: rgba(61, 139, 253, 0.08);
}
.btn-sidebar-expand[hidden] {
display: none;
}
.sidebar-section {
margin-bottom: 0.35rem;
padding: 0 0.55rem;
}
.sidebar-group-title {
display: flex;
align-items: center;
gap: 0.55rem;
margin: 0.85rem 0 0.45rem;
padding: 0.35rem 0.5rem;
font-size: 0.78rem;
font-weight: 600;
letter-spacing: 0.02em;
color: var(--text);
text-transform: none;
}
.sidebar-group-name {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.sidebar-group-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.75rem;
height: 1.75rem;
border-radius: 8px;
flex-shrink: 0;
}
.sidebar-group-icon svg {
width: 1rem;
height: 1rem;
}
.sidebar-group-icon--order {
background: rgba(59, 130, 246, 0.16);
color: #60a5fa;
}
.sidebar-group-icon--trade {
background: rgba(16, 185, 129, 0.16);
color: #34d399;
}
.sidebar-group-icon--review {
background: rgba(168, 85, 247, 0.16);
color: #c084fc;
}
.sidebar-group-icon--api {
background: rgba(245, 158, 11, 0.16);
color: #fbbf24;
}
.sidebar-group-icon--gate {
background: rgba(236, 72, 153, 0.16);
color: #f472b6;
}
.sidebar-group-icon--chart {
background: rgba(45, 212, 191, 0.16);
color: #2dd4bf;
}
.sidebar-group-icon--server {
background: rgba(99, 102, 241, 0.16);
color: #818cf8;
}
.sidebar-group-icon--folder {
background: rgba(148, 163, 184, 0.14);
color: #94a3b8;
}
.sidebar-links {
display: flex;
flex-direction: column;
gap: 0.12rem;
}
.sidebar-empty {
padding: 0.35rem 0.65rem 0.5rem;
font-size: 0.82rem;
}
.nav-link {
display: flex;
align-items: center;
margin: 0;
padding: 0.52rem 0.7rem 0.52rem 0.85rem;
color: var(--text);
cursor: pointer;
border-left: none;
border-radius: 8px;
font-size: 0.88rem;
text-decoration: none;
transition:
background 0.15s ease,
color 0.15s ease,
box-shadow 0.15s ease;
}
.nav-link-text {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.nav-link:hover {
background: rgba(61, 139, 253, 0.1);
text-decoration: none;
}
.nav-link.active {
background: rgba(61, 139, 253, 0.18);
box-shadow: inset 3px 0 0 var(--accent);
text-decoration: none;
}
.content-column {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
min-height: 0;
}
.service-dashboard {
flex: 1;
overflow-y: auto;
padding: 1.25rem 1.5rem 2rem;
background: linear-gradient(165deg, #0c1016 0%, var(--bg) 42%, #0a0d12 100%);
}
.service-dashboard[hidden] {
display: none !important;
}
.dash-section {
margin-bottom: 1.75rem;
}
.dash-section:last-child {
margin-bottom: 0;
}
.dash-section-title {
display: flex;
align-items: center;
gap: 0.55rem;
margin: 0 0 0.85rem;
font-size: 0.95rem;
font-weight: 600;
letter-spacing: 0.02em;
color: var(--text);
text-transform: none;
}
.dash-section-title .sidebar-group-icon {
width: 2rem;
height: 2rem;
}
.dash-section-title .sidebar-group-icon svg {
width: 1.05rem;
height: 1.05rem;
}
.service-card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
gap: 1rem;
}
.service-card {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 0.4rem;
margin: 0;
padding: 1.05rem 1.15rem;
border: 1px solid var(--border);
border-radius: 12px;
background: linear-gradient(145deg, rgba(26, 35, 50, 0.95), rgba(18, 24, 34, 0.98));
color: var(--text);
font: inherit;
text-align: left;
cursor: pointer;
transition:
border-color 0.18s ease,
box-shadow 0.18s ease,
transform 0.18s ease;
}
.service-card:hover {
border-color: rgba(61, 139, 253, 0.5);
box-shadow:
0 0 0 1px rgba(61, 139, 253, 0.12),
0 12px 28px rgba(0, 0, 0, 0.35);
transform: translateY(-2px);
}
.service-card:active {
transform: translateY(0);
}
.service-card-title {
font-size: 1rem;
font-weight: 600;
letter-spacing: 0.02em;
}
.service-card-group {
font-size: 0.78rem;
color: var(--muted);
}
.dash-empty {
padding: 2rem 1rem;
text-align: center;
max-width: 28rem;
margin: 0 auto;
}
.frame-stack {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
min-width: 0;
}
.frame-stack[hidden] {
display: none !important;
}
.frame-toolbar {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.75rem;
padding: 0.5rem 0.9rem;
background: #0e141c;
border-bottom: 1px solid var(--border);
}
.frame-toolbar-left {
display: flex;
align-items: center;
gap: 0.65rem;
min-width: 0;
}
.btn-frame-back {
flex-shrink: 0;
padding: 0.32rem 0.55rem;
border-radius: 6px;
border: 1px solid var(--border);
background: rgba(255, 255, 255, 0.04);
color: var(--muted);
font: inherit;
font-size: 0.8rem;
cursor: pointer;
transition:
color 0.15s ease,
border-color 0.15s ease,
background 0.15s ease;
}
.btn-frame-back:hover {
color: var(--text);
border-color: var(--muted);
background: rgba(61, 139, 253, 0.1);
}
#frame-back-hub {
color: #9ecbff;
border-color: rgba(61, 139, 253, 0.45);
background: rgba(61, 139, 253, 0.12);
font-weight: 600;
}
#frame-back-hub:hover {
color: #fff;
border-color: #3d8bfd;
background: rgba(61, 139, 253, 0.22);
}
.frame-title {
font-size: 0.92rem;
font-weight: 600;
color: var(--text);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.frame-toolbar-actions {
display: flex;
align-items: center;
gap: 0.45rem;
flex-shrink: 0;
}
.btn-toolbar-refresh {
flex-shrink: 0;
padding: 0.38rem 0.85rem;
font-size: 0.82rem;
}
.frame-wrap {
position: relative;
flex: 1;
min-width: 0;
min-height: 0;
background: #0a0e12;
}
.frame-wrap iframe {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
border: none;
background: #0a0e12;
}
/* 登录页 */
.login-page {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 1.5rem;
}
.login-card {
width: 100%;
max-width: 380px;
background: var(--panel);
border: 1px solid var(--border);
border-radius: 10px;
padding: 1.75rem 1.5rem;
}
.login-card h1 {
margin: 0 0 1.25rem;
font-size: 1.25rem;
text-align: center;
}
.form-row {
margin-bottom: 1rem;
}
.form-row label {
display: block;
margin-bottom: 0.35rem;
font-size: 0.85rem;
color: var(--muted);
}
.form-row input,
.form-row select {
width: 100%;
padding: 0.55rem 0.65rem;
border-radius: 6px;
border: 1px solid var(--border);
background: var(--bg);
color: var(--text);
font-size: 0.95rem;
}
.btn {
display: inline-block;
padding: 0.5rem 1rem;
border-radius: 6px;
border: none;
font-size: 0.9rem;
cursor: pointer;
font-family: inherit;
text-align: center;
text-decoration: none;
}
.btn-primary {
background: var(--accent);
color: #fff;
width: 100%;
}
.btn-primary:hover {
background: var(--accent-dim);
}
.btn-secondary {
background: transparent;
color: var(--muted);
border: 1px solid var(--border);
}
.btn-secondary:hover {
color: var(--text);
border-color: var(--muted);
}
.btn-danger {
background: rgba(224, 82, 82, 0.2);
color: var(--danger);
border: 1px solid var(--danger);
font-size: 0.8rem;
padding: 0.25rem 0.5rem;
}
.flash-wrap {
max-width: 960px;
margin: 0 auto 1rem;
padding: 0 1rem;
}
.flash {
padding: 0.5rem 0.75rem;
border-radius: 6px;
margin-bottom: 0.35rem;
font-size: 0.88rem;
}
.flash.error {
background: rgba(224, 82, 82, 0.15);
color: #f0a8a8;
}
.flash.success {
background: rgba(62, 207, 142, 0.12);
color: var(--success);
}
.flash.info {
background: rgba(61, 139, 253, 0.12);
color: #9ec5ff;
}
/* 后台表格 */
.page-wrap {
max-width: 960px;
margin: 0 auto;
padding: 1.25rem 1rem 2rem;
}
.page-wrap h1 {
margin: 0 0 1rem;
font-size: 1.35rem;
}
.toolbar {
display: flex;
flex-wrap: wrap;
gap: 0.75rem;
align-items: center;
margin-bottom: 1rem;
}
.table-wrap {
overflow-x: auto;
border: 1px solid var(--border);
border-radius: 8px;
}
table.data {
width: 100%;
border-collapse: collapse;
font-size: 0.9rem;
}
table.data th,
table.data td {
padding: 0.55rem 0.75rem;
text-align: left;
border-bottom: 1px solid var(--border);
}
table.data th {
background: var(--panel);
color: var(--muted);
font-weight: 600;
font-size: 0.78rem;
text-transform: uppercase;
letter-spacing: 0.04em;
}
table.data tr:last-child td {
border-bottom: none;
}
table.data tr:hover td {
background: rgba(255, 255, 255, 0.02);
}
.inline-form {
display: inline;
}
.hint {
font-size: 0.82rem;
color: var(--muted);
margin-top: 0.35rem;
}
.errors {
color: var(--danger);
font-size: 0.8rem;
margin-top: 0.25rem;
}