/* --- 全局变量与基础设置 --- */
:root {
    --bg-dark: #121212; --bg-card: #1e1e2d; --bg-sidebar: #1a1a27;
    --text-primary: #ffffff; --text-secondary: #a2a2b5;
    --accent-blue: #00d4ff; --accent-purple: #9d00ff;
    --nav-height: 60px; --sidebar-width: 240px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background-color: var(--bg-dark); color: var(--text-primary);
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- 导航栏 (Flex布局修正) --- */
.navbar {
    height: var(--nav-height); background-color: var(--bg-card);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px; position: fixed; top: 0; left: 0; right: 0;
    z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* 关键修正：确保头像和名字同行 */
.nav-left {
    display: flex; align-items: center; gap: 5px;
}

.avatar {
    width: 40px; height: 40px; min-width: 40px; /* 防止挤压 */
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 300; font-size: 1.2rem; cursor: pointer;
    transition: transform 0.2s; user-select: none; z-index: 101;
}
.avatar:hover { transform: scale(1.1); }

.nav-right { display: flex; gap: 15px; font-size: 0.9rem; color: var(--text-secondary); align-items: center;}
.status-item { display: flex; align-items: center; gap: 5px; white-space: nowrap;}
.icon-small { font-size: 16px; }

/* 退出按钮样式 */
.logout-btn {
    color: #ff5555; cursor: pointer; padding: 5px; border-radius: 5px; transition: 0.2s;
}
.logout-btn:hover { background: rgba(255, 85, 85, 0.1); }

/* 侧边栏 & 推移逻辑 */
.sidebar-container { position: fixed; top: var(--nav-height); left: 0; bottom: 0; z-index: 90; pointer-events: none; }
.sidebar {
    width: var(--sidebar-width); height: 100%; background-color: var(--bg-sidebar);
    padding-top: 20px; position: fixed; left: calc(var(--sidebar-width) * -1); top: var(--nav-height);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2); z-index: 99;
}
.sidebar-overlay {
    position: fixed; top: var(--nav-height); left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.5); opacity: 0; pointer-events: none;
    transition: opacity 0.3s; z-index: 98; display: none;
}
.menu-list li a { display: flex; align-items: center; gap: 15px; padding: 15px 25px; color: var(--text-secondary); transition: all 0.2s; border-left: 3px solid transparent; }
.menu-list li a:hover, .menu-list li a.active { background-color: rgba(255,255,255,0.05); color: var(--text-primary); }
.menu-list li a.active { border-left-color: var(--accent-blue); }

.main-content {
    margin-top: var(--nav-height); padding: 30px; min-height: calc(100vh - var(--nav-height));
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1); width: 100%;
}
body.sidebar-open .sidebar { left: 0; }
body.sidebar-open .main-content { margin-left: var(--sidebar-width); }

/* 移动端适配 */
@media (max-width: 768px) {
    body.sidebar-open .main-content { margin-left: 0; }
    .sidebar-overlay { display: block; }
    body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .main-content { padding: 15px; }
    .hide-mobile { display: none; } /* 隐藏不重要的状态信息 */
    .nav-right { gap: 10px; }
}

/* Bento 仪表盘 & 游戏 & 监控 页样式 (保持原样) */
.bento-wrapper { max-width: 1200px; margin: 0 auto; padding: 10px 0; }
.bento-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, minmax(180px, auto)); gap: 20px; }
.bento-card { background: var(--bg-card); border-radius: 24px; padding: 25px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,0.05); transition: transform 0.3s, box-shadow 0.3s; display: flex; flex-direction: column; justify-content: space-between; }
.bento-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); border-color: rgba(255,255,255,0.1); }
.card-welcome { grid-column: span 2; background: linear-gradient(135deg, #1e1e2d 0%, #2a2a3d 100%); }
.card-welcome h2 { font-size: 2rem; margin-bottom: 10px; background: linear-gradient(to right, #fff, #aaa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.card-welcome p { color: var(--text-secondary); }
.quick-actions { margin-top: 20px; display: flex; gap: 10px; }
.chip { background: rgba(255,255,255,0.1); padding: 8px 15px; border-radius: 20px; font-size: 0.9rem; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 5px;}
.chip:hover { background: var(--accent-blue); color: #000; }
.card-time { background: linear-gradient(135deg, var(--accent-blue), #0077ff); color: #fff; align-items: center; justify-content: center; text-align: center; }
.clock-time { font-size: 3.5rem; font-weight: bold; line-height: 1; }
.clock-date { font-size: 1rem; opacity: 0.8; margin-top: 5px; }
.card-cpu { align-items: flex-start; }
.cpu-header { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); margin-bottom: 10px; width: 100%; justify-content: space-between;}
.cpu-number { font-size: 2.5rem; font-weight: bold; color: var(--accent-purple); }
.mini-chart { width: 100%; height: 60px; margin-top: auto; }
.card-game { background: linear-gradient(135deg, #ffcc00, #ffaa00); color: #121212; cursor: pointer; }
.card-game .icon-large { font-size: 4rem; opacity: 0.8; margin-bottom: auto;}
.card-game h3 { font-size: 1.5rem; font-weight: bold; }
.card-todo { grid-column: span 2; }
.todo-header { font-weight: bold; margin-bottom: 15px; display: flex; align-items: center; gap: 8px;}
.todo-input { width: 100%; background: rgba(0,0,0,0.2); border: none; padding: 10px; border-radius: 8px; color: #fff; margin-bottom: 10px; }
.todo-list { max-height: 100px; overflow-y: auto; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.todo-check { accent-color: var(--accent-blue); }
.todo-text { flex: 1; font-size: 0.9rem; }
.todo-del { color: #555; cursor: pointer; font-size: 1rem; }
.todo-del:hover { color: #ff5555; }
.card-admin { background: #2a2a3d; align-items: center; justify-content: center; cursor: pointer; }
.card-admin:hover .icon-admin { color: var(--accent-purple); transform: rotate(90deg); }
.icon-admin { font-size: 3rem; color: #555; transition: 0.3s; }
@media (max-width: 1024px) { .bento-grid { grid-template-columns: repeat(2, 1fr); } .card-welcome { grid-column: span 2; } .card-todo { grid-column: span 2; } }
@media (max-width: 600px) { .bento-grid { grid-template-columns: 1fr; } .card-welcome, .card-todo { grid-column: span 1; } }
.content-header h2 { margin-bottom: 25px; font-weight: 300; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.game-card { background-color: var(--bg-card); border-radius: 15px; overflow: hidden; transition: transform 0.3s; border: 1px solid rgba(255,255,255,0.05); }
.game-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 212, 255, 0.1); }
.game-icon { height: 150px; display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: bold; color: #776e65;}
.game-info { padding: 20px; } .game-info h3 { margin-bottom: 10px; } .game-info p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 15px; }
.btn-play { display: block; width: 100%; padding: 10px; text-align: center; background-color: var(--accent-blue); border-radius: 8px; font-weight: bold; transition: background 0.2s; color: #000; }
.btn-play:hover { background-color: #00b8e6; }
.monitor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.monitor-card { background-color: var(--bg-card); padding: 20px; border-radius: 15px; border: 1px solid rgba(255,255,255,0.05); }
.card-header { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); margin-bottom: 10px; }
.card-value { font-size: 2rem; font-weight: bold; margin-bottom: 15px; }
.card-value-small { font-size: 1rem; color: var(--text-secondary); margin-bottom: 15px; }
.chart-container { height: 200px; position: relative; }
.icon-cpu { color: var(--accent-blue); } .icon-ram { color: var(--accent-purple); } .icon-disk { color: var(--accent-purple); } .icon-net { color: var(--accent-blue); }