Files
my_one_web/static/css/dashboard.css

456 lines
8.3 KiB
CSS
Raw Normal View History

/**
* OpenClaw Mission Control - Dashboard Styles
* 作者小白 🐶
*/
/* CSS 变量 */
:root {
--primary-color: #667eea;
--primary-dark: #5a67d8;
--success-color: #48bb78;
--warning-color: #ed8936;
--danger-color: #f56565;
--bg-color: #f7fafc;
--card-bg: #ffffff;
--text-primary: #2d3748;
--text-secondary: #718096;
--border-color: #e2e8f0;
--sidebar-width: 240px;
--topnav-height: 60px;
}
[data-theme="dark"] {
--primary-color: #a78bfa;
--primary-dark: #8b5cf6;
--bg-color: #1a1a2e;
--card-bg: #16213e;
--text-primary: #e2e8f0;
--text-secondary: #a0aec0;
--border-color: #2d3748;
}
/* 重置 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
background: var(--bg-color);
color: var(--text-primary);
min-height: 100vh;
transition: background 0.3s ease, color 0.3s ease;
}
/* 顶部导航 */
.top-nav {
position: fixed;
top: 0;
left: 0;
right: 0;
height: var(--topnav-height);
background: var(--card-bg);
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
z-index: 100;
}
.nav-brand {
display: flex;
align-items: center;
gap: 10px;
}
.nav-brand .logo {
font-size: 24px;
}
.nav-brand .title {
font-size: 18px;
font-weight: 600;
color: var(--text-primary);
}
/* 快捷导航栏 */
.quick-nav {
display: flex;
align-items: center;
gap: 8px;
}
.nav-btn {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 14px;
background: rgba(255, 255, 255, 0.9);
border: none;
border-radius: 20px;
font-size: 14px;
font-weight: 500;
color: #333;
text-decoration: none;
transition: all 0.3s ease;
}
[data-theme="dark"] .nav-btn {
background: rgba(45, 55, 72, 0.9);
color: #e2e8f0;
}
.nav-btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.nav-user {
display: flex;
align-items: center;
gap: 15px;
}
.nav-user .username {
color: var(--text-secondary);
font-size: 14px;
}
.btn-logout {
padding: 6px 12px;
background: var(--danger-color);
color: white;
border-radius: 6px;
text-decoration: none;
font-size: 14px;
transition: opacity 0.3s;
}
.btn-logout:hover {
opacity: 0.8;
}
/* 主题按钮 */
.theme-toggle {
width: 40px;
height: 40px;
border-radius: 50%;
border: none;
background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
color: white;
font-size: 20px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.3s ease;
}
.theme-toggle:hover {
transform: rotate(20deg) scale(1.1);
}
/* 侧边栏 */
.sidebar {
position: fixed;
top: var(--topnav-height);
left: 0;
bottom: 0;
width: var(--sidebar-width);
background: var(--card-bg);
border-right: 1px solid var(--border-color);
overflow-y: auto;
padding: 20px 0;
}
.sidebar-nav {
padding: 0 10px;
}
.nav-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 15px;
color: var(--text-secondary);
text-decoration: none;
border-radius: 8px;
margin-bottom: 5px;
transition: all 0.3s ease;
}
.nav-item:hover {
background: var(--bg-color);
color: var(--text-primary);
}
.nav-item.active {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
color: white;
}
.nav-item .icon {
font-size: 20px;
}
.nav-item .text {
font-size: 14px;
font-weight: 500;
}
.quick-links {
padding: 20px 15px;
border-top: 1px solid var(--border-color);
margin-top: 20px;
}
.quick-links .section-title {
font-size: 12px;
color: var(--text-secondary);
text-transform: uppercase;
margin-bottom: 15px;
}
.link-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 10px;
color: var(--text-secondary);
text-decoration: none;
font-size: 13px;
border-radius: 6px;
transition: all 0.3s ease;
}
.link-item:hover {
background: var(--bg-color);
color: var(--primary-color);
}
/* 主内容区 */
.main-content {
margin-left: var(--sidebar-width);
margin-top: var(--topnav-height);
padding: 30px;
min-height: calc(100vh - var(--topnav-height));
}
.page {
display: none;
}
.page.active {
display: block;
}
.page-title {
font-size: 24px;
font-weight: 600;
margin-bottom: 25px;
color: var(--text-primary);
}
/* 状态卡片 */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.stat-card {
background: var(--card-bg);
border-radius: 12px;
padding: 20px;
border: 1px solid var(--border-color);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.stat-card .stat-icon {
font-size: 32px;
margin-bottom: 10px;
}
.stat-card .stat-label {
font-size: 14px;
color: var(--text-secondary);
margin-bottom: 5px;
}
.stat-card .stat-value {
font-size: 24px;
font-weight: 600;
color: var(--text-primary);
}
.stat-card .progress-bar {
height: 6px;
background: var(--border-color);
border-radius: 3px;
margin-top: 15px;
overflow: hidden;
}
.stat-card .progress {
height: 100%;
border-radius: 3px;
transition: width 0.5s ease;
}
.stat-card.cpu .progress { background: var(--primary-color); }
.stat-card.memory .progress { background: var(--success-color); }
.stat-card.disk .progress { background: var(--warning-color); }
/* 服务状态 */
.section {
margin-bottom: 30px;
}
.section-title {
font-size: 18px;
font-weight: 600;
margin-bottom: 15px;
color: var(--text-primary);
}
.services-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 15px;
}
.service-card {
background: var(--card-bg);
border-radius: 10px;
padding: 15px;
border: 1px solid var(--border-color);
display: flex;
align-items: center;
gap: 12px;
}
.service-card .icon {
font-size: 24px;
}
.service-card .info {
flex: 1;
}
.service-card .name {
font-size: 14px;
font-weight: 500;
color: var(--text-primary);
}
.service-card .port {
font-size: 12px;
color: var(--text-secondary);
}
.service-card .status-badge {
padding: 3px 8px;
border-radius: 12px;
font-size: 11px;
font-weight: 500;
}
.status-badge.running {
background: rgba(72, 187, 120, 0.2);
color: var(--success-color);
}
.status-badge.stopped {
background: rgba(245, 101, 101, 0.2);
color: var(--danger-color);
}
/* 快捷操作 */
.actions-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 15px;
}
.action-btn {
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 10px;
padding: 15px;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
cursor: pointer;
transition: all 0.3s ease;
color: var(--text-primary);
}
.action-btn:hover {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
color: white;
border-color: transparent;
}
.action-btn .icon {
font-size: 24px;
}
.action-btn span:last-child {
font-size: 13px;
font-weight: 500;
}
/* 开发中提示 */
.coming-soon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 60px 20px;
color: var(--text-secondary);
}
.coming-soon .icon {
font-size: 48px;
margin-bottom: 15px;
}
.coming-soon p {
font-size: 16px;
}
/* 加载动画 */
.loading {
text-align: center;
padding: 20px;
color: var(--text-secondary);
}
/* 响应式 */
@media (max-width: 768px) {
.sidebar {
width: 60px;
padding: 10px 0;
}
.sidebar .nav-item .text,
.sidebar .quick-links {
display: none;
}
.main-content {
margin-left: 60px;
padding: 20px;
}
}