/* Kali Linux Terminal UI Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

/* 顶部状态栏 */
.status-bar {
    background: rgba(0, 0, 0, 0.8);
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    font-size: 12px;
    border-bottom: 1px solid #333;
}

.status-left, .status-right {
    display: flex;
    gap: 15px;
}

.user {
    color: #00ff00;
    font-weight: bold;
}

.time {
    color: #ffffff;
}

.network-status, .battery {
    color: #00aaff;
}

/* 主桌面容器 */
.desktop {
    display: flex;
    height: calc(100vh - 60px);
    position: relative;
}

/* 左侧应用程序菜单 */
.sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.9);
    border-right: 1px solid #333;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    margin-bottom: 10px;
}

.kali-logo {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.sidebar-header h3 {
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
}

.menu-section {
    margin-bottom: 5px;
}

.menu-title {
    color: #888;
    font-size: 11px;
    padding: 8px 20px 5px;
    text-transform: uppercase;
    font-weight: bold;
    border-bottom: 1px solid #333;
    margin-bottom: 5px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 13px;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item .icon {
    margin-right: 10px;
    font-size: 16px;
    width: 20px;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    position: relative;
    padding: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="%23ffffff" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>') repeat;
}

/* 窗口样式 */
.window {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid #555;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    min-width: 600px;
    min-height: 400px;
    backdrop-filter: blur(10px);
}

#network-window {
    top: 50px;
    left: 50px;
    width: 700px;
    height: 500px;
}

#msf-window {
    top: 100px;
    left: 200px;
    width: 800px;
    height: 600px;
    z-index: 10;
}

.window-header {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #666;
    border-radius: 8px 8px 0 0;
    cursor: move;
}

.window-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.window-controls button {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: opacity 0.2s;
}

.minimize {
    background: #ffbd2e;
    color: #000;
}

.maximize {
    background: #28ca42;
    color: #000;
}

.close {
    background: #ff5f56;
    color: #000;
}

.window-controls button:hover {
    opacity: 0.8;
}

.window-content {
    padding: 0;
    height: calc(100% - 45px);
    overflow: hidden;
}

.window-body.terminal {
    background-color: #1e1e1e; /* 深色终端背景 */
    color: #00ff00; /* 绿色文字 */
    font-family: 'Courier New', Courier, monospace;
    padding: 10px;
    overflow-y: auto; /* 如果内容过多则显示滚动条 */
    height: calc(100% - 30px); /* 减去头部高度 */
    border: 2px solid #0078D4; /* 窗口边框，匹配头部颜色 */
    border-top: none;
    box-sizing: border-box;
}

.terminal-output {
    white-space: pre-wrap; /* 保留空白符和换行符 */
    word-wrap: break-word; /* 长单词换行 */
    /* max-height: 200px; */ /* 移除高度限制 */
    /* overflow-y: auto; */ /* 移除滚动条 */
}

.terminal-output pre {
    white-space: pre-wrap;       /* Since CSS 2.1 */
    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
    white-space: -pre-wrap;      /* Opera 4-6 */
    white-space: -o-pre-wrap;    /* Opera 7 */
    word-wrap: break-word;       /* Internet Explorer 5.5+ */
    font-size: 1.0em; /* Increased font size for readability */
    line-height: 1.6;
    color: #e0e0e0;
}

/* Styles for the new article format */
.article-content {
    padding: 15px;
    overflow-y: auto; /* Add scroll for long articles */
    max-height: calc(100% - 40px); /* Adjust based on header height */
}

.article-title-bar {
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.article-title-bar h1 {
    font-size: 1.5em;
    color: #ffffff;
    font-weight: bold;
}

.article-body h2 {
    font-size: 1.2em;
    color: #00ff00; /* Kali green for headings */
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: bold;
    border-bottom: 1px dashed #555;
    padding-bottom: 5px;
}

.article-body p {
    font-size: 1em;
    line-height: 1.7;
    color: #cccccc;
    margin-bottom: 15px;
    text-align: justify;
}

.command-line {
    display: flex;
    align-items: center;
    margin-top: 10px; /* 与输出内容隔开一些距离 */
}

.prompt {
    /* 颜色将由内联样式设置 */
    margin-right: 5px;
    font-weight: bold;
}

.cursor {
    background-color: #00ff00; /* 光标颜色 */
    width: 8px;
    height: 1.2em;
    display: inline-block;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to { background-color: transparent; }
    50% { background-color: #00ff00; }
}

/* 特定于文章终端的样式 */
.article-terminal .window-header {
    color: white; /* 确保标题在彩色背景下可见 */
}

.article-terminal .window-body.terminal {
    color: #f0f0f0; /* 文章内容使用浅灰色，而不是纯绿色 */
}

/* Metasploit Banner Specific Styles */
.msf-banner pre {
    color: #FF6B6B; /* MSF Banner的特定颜色 */
    font-weight: bold;
    white-space: pre-wrap; 
    word-wrap: break-word;
}

/* 响应式设计：小屏幕下的布局调整 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
        padding-top: 20px;
    }

    .window {
        width: 90%;
        left: 5% !important; /* 居中显示 */
        top: auto !important; /* 移除绝对定位的top */
        margin-bottom: 20px;
    }

    .status-bar-item, .status-bar-time {
        font-size: 0.8em;
    }
}