/* dashboard-style.css - Commander Theme (V2 - Optimized) */
:root {
    /* 核心配色 */
    --bg-dark: #0f172a;
    --glass-surface: rgba(30, 41, 59, 0.85);
    --glass-border: rgba(148, 163, 184, 0.1);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    
    --neon-blue: #38bdf8;
    --neon-purple: #c084fc;
    --neon-green: #4ade80;
    --neon-red: #f87171;
    --neon-gold: #facc15;
    
    --card-radius: 16px;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; /* 优化中文字体 */
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.1), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(192, 132, 252, 0.1), transparent 25%);
    color: var(--text-main);
    height: 100vh; width: 100vw; overflow: hidden;
}

/* --- 粒子特效 --- */
.particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.particle { position: absolute; bottom: -10px; background: white; border-radius: 50%; opacity: 0.3; animation: rise 15s infinite linear; }
.particle {
    position: absolute;
    bottom: -10px;
    background: white;
    border-radius: 50%;
    opacity: 0.3;
    animation: rise 15s infinite linear;
}

/* [新增] 荧光绿粒子特效 (治愈与生命力) */
.particle.green {
    background: var(--neon-green); /* 使用预设的荧光绿 */
    box-shadow: 0 0 10px var(--neon-green); /* 添加荧光辉光 */
    opacity: 0.5; /* 比白色粒子稍亮一点 */
    animation-duration: 12s; /* 稍微快一点，显得更有活力 */
}

@keyframes rise {
    /* ... 保持不变 ... */
    0% { transform: translateY(0) scale(1); opacity: 0; }
    50% { opacity: 0.5; }
    100% { transform: translateY(-100vh) scale(0); opacity: 0; }
}

@keyframes rise { 0% { transform: translateY(0) scale(1); opacity: 0; } 50% { opacity: 0.5; } 100% { transform: translateY(-100vh) scale(0); opacity: 0; } }

/* --- 登录层 --- */
#login-layer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(15px);
    display: flex; justify-content: center; align-items: center; z-index: 9999;
}
.login-card {
    background: var(--glass-surface); border: 1px solid var(--glass-border);
    border-radius: var(--card-radius); padding: 50px 40px; width: 400px; text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6); position: relative;
}
.login-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
    animation: glint 3s infinite;
}
@keyframes glint { 0% { transform: translateX(-100%); } 50%, 100% { transform: translateX(100%); } }

.login-title { font-size: 28px; font-weight: 900; margin-bottom: 5px; letter-spacing: 1px; color: #fff; }
.login-sub { font-size: 12px; color: var(--neon-blue); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 30px; opacity: 0.8; }

.input-group input {
    width: 100%; padding: 14px; background: rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border); border-radius: 8px; color: #fff; outline: none;
    font-family: 'Courier New', monospace; font-size: 16px; text-align: center; transition: 0.3s;
}
.input-group input:focus { border-color: var(--neon-blue); box-shadow: 0 0 15px rgba(56, 189, 248, 0.3); }

.btn-login {
    width: 100%; padding: 14px; margin-top: 20px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.2), transparent);
    border: 1px solid var(--neon-blue); color: var(--neon-blue);
    font-weight: 800; letter-spacing: 1px; border-radius: 8px; cursor: pointer; transition: 0.3s;
}
.btn-login:hover { background: var(--neon-blue); color: #000; box-shadow: 0 0 25px rgba(56, 189, 248, 0.5); transform: scale(1.02); }

/* --- 主界面 --- */
#app-container { display: none; height: 100%; width: 100%; display: flex; position: relative; z-index: 1; }

/* 左侧侧边栏 */
.sidebar {
    width: var(--sidebar-width); background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border); display: flex; flex-direction: column; flex-shrink: 0;
}

.brand-area { padding: 30px 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
.brand-badge {
    display: inline-block; padding: 4px 10px; border: 1px solid var(--neon-gold); color: var(--neon-gold);
    border-radius: 4px; font-size: 10px; font-weight: bold; letter-spacing: 1px;
    background: rgba(250, 204, 21, 0.1); margin-bottom: 10px;
}
.brand-name { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 1px; }

.nav-menu { flex: 1; padding: 20px; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; padding: 14px 16px; margin-bottom: 8px;
    border-radius: 10px; color: var(--text-muted); text-decoration: none;
    cursor: pointer; transition: all 0.2s; border: 1px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active {
    background: rgba(56, 189, 248, 0.15); border-color: rgba(56, 189, 248, 0.3);
    color: var(--neon-blue); box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
}
.nav-icon { margin-right: 12px; font-size: 18px; }

/* 左下角用户信息栏 (核心修改) */
.user-bar {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.3);
}

/* 美化后的 CMD 显示 */
.user-card {
    display: flex; align-items: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 12px;
    margin-bottom: 15px;
    transition: all 0.3s;
}
.user-card:hover {
    border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.15);
}
.user-avatar {
    width: 36px; height: 36px; background: var(--neon-green);
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    font-weight: bold; color: #000; margin-right: 12px;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}
.user-details { display: flex; flex-direction: column; }
.user-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.user-name { 
    font-size: 14px; font-weight: bold; color: #fff; margin-top: 2px; 
    text-shadow: 0 0 5px rgba(255,255,255,0.2);
}

.btn-logout {
    width: 100%; padding: 10px;
    background: rgba(248, 113, 113, 0.1); 
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--neon-red); border-radius: 8px; cursor: pointer;
    font-size: 12px; font-weight: 600; transition: 0.2s; display: flex; justify-content: center; align-items: center; gap: 6px;
}
.btn-logout:hover { background: var(--neon-red); color: #fff; box-shadow: 0 0 15px rgba(248, 113, 113, 0.4); }

/* 右侧内容区 */
.content-area {
    flex: 1;
    position: relative;
    /* [修改点] 这里的背景必须是透明，否则子页面透过来全是黑的 */
    background: transparent !important; 
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    /* [修改点] 确保 iframe 自身也是透明的 */
    background: transparent !important;
}

/* dashboard-style.css 底部 */
.content-area { background: transparent !important; }
iframe { background: transparent !important; }

/* [新增] 导航菜单项悬停亮光效果 */
.nav-item {
    position: relative;
    overflow: hidden; /* 裁剪掉超出边框的动画 */
    transition: all 0.3s ease;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.4) 0%, transparent 70%); /* 蓝色光晕 */
    opacity: 0;
    transform: rotate(0deg);
    transition: opacity 0.5s ease;
    z-index: 0;
}

.nav-item:hover {
    transform: translateY(-2px); /* 悬停时微微上浮 */
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.6); /* 整体发光 */
    border-color: var(--neon-blue); /* 边框高亮 */
}

.nav-item:hover::before {
    opacity: 1; /* 悬停时显示光晕 */
    animation: rotateLight 2s linear infinite; /* 旋转光晕动画 */
}

/* =================================================================
   [新增] 移动端适配 (Mobile Responsiveness)
   ================================================================= */

/* 移动端菜单按钮 (默认隐藏，手机显示) */
#mobile-menu-btn {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 100;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 20px;
    cursor: pointer;
    backdrop-filter: blur(5px);
}

/* 侧边栏内的关闭按钮 */
.mobile-close-btn {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
}

/* --- 手机屏幕断点 (<= 768px) --- */
@media (max-width: 768px) {
    /* 显示菜单按钮 */
    #mobile-menu-btn { display: block; }

    /* 侧边栏：平时隐藏，滑出显示 */
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 80%; /* 占屏幕宽度的 80% */
        max-width: 300px;
        z-index: 200;
        transform: translateX(-100%); /* 移出屏幕 */
        transition: transform 0.3s ease;
        border-right: 1px solid var(--neon-blue);
        box-shadow: 5px 0 20px rgba(0,0,0,0.5);
    }

    /* 激活状态：滑入 */
    .sidebar.mobile-active {
        transform: translateX(0);
    }

    /* 显示关闭按钮 */
    .mobile-close-btn { display: block; }

    /* 登录框适配 */
    .login-card {
        width: 90%; /* 手机上不要定宽 */
        padding: 30px 20px;
    }
    
    /* 内容区域 */
    .content-area {
        width: 100%;
    }
}