:root {
    /* =========================================
       配色调整区域
       ========================================= */
    
    /* 页面背景：工业灰渐变 (#545050 -> #9A9898) */
    --page-bg-start: #545050;
    --page-bg-end: #9A9898;

    /* 终端窗口背景：RGB 31, 31, 31 (#313131) */
    --term-bg: #313131;
    /* 标题栏颜色：比背景稍深一点 */
    --term-header-bg: #252525;
    
    /* 字体颜色 */
    --text-main: #e0e0e0;     
    --text-green: #a6e22e;    
    --text-yellow: #e6db74;   
    --text-blue: #66d9ef;     
    --text-purple: #ae81ff;   
    --text-time: #888888;     
    
    --badge-bg: #66d9ef;      
    --badge-text: #222222;    
    --cursor-color: #e0e0e0;
}

* { box-sizing: border-box; }

body {
    background: linear-gradient(135deg, var(--page-bg-start), var(--page-bg-end));
    color: var(--text-main);
    font-family:'Consolas', 'Lucida Console', 'Menlo', monospace;
    font-size: 16px;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Toast */
#toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95); color: #333;
    padding: 12px 24px; border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500;
    z-index: 9999; opacity: 0; pointer-events: none;
    transition: opacity 0.3s, top 0.3s;
}
#toast.show { opacity: 1; top: 40px; }
.toast-icon { border: 2px solid #333; border-radius: 50%; width: 20px; height: 20px; display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 14px; }

/* Window Container */
.window-container {
    width: 95%; 
    max-width: 1000px; /* 宽一点 */
    height: 85vh;      
    background-color: var(--term-bg);
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6); 
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid rgba(0,0,0,0.2);
    position: relative;
    transition: height 0.3s ease;
}
@media (max-height: 500px) {
    .window-container { width: 100%; height: 100vh; border-radius: 0; border: none; }
}

/* Header */
.window-header {
    background-color: var(--term-header-bg); height: 38px; display: flex; align-items: center; padding: 0 16px;
    border-bottom: 1px solid rgba(0,0,0,0.3); flex-shrink: 0; position: relative;
}
.traffic-lights { display: flex; gap: 8px; z-index: 10; }
.traffic-light { width: 12px; height: 12px; border-radius: 50%; }
.traffic-light.red { background-color: #ff5f56; }
.traffic-light.yellow { background-color: #ffbd2e; }
.traffic-light.green { background-color: #27c93f; }
.window-title { position: absolute; left: 0; right: 0; text-align: center; color: #888; font-size: 13px; font-family: -apple-system, sans-serif; font-weight: 500; }

/* Terminal Body */
#terminal-body {
    flex-grow: 1; padding: 25px; 
    overflow-y: auto; scroll-behavior: smooth; cursor: text;
}
#terminal-body::-webkit-scrollbar { width: 8px; }
#terminal-body::-webkit-scrollbar-thumb { background-color: #444; border-radius: 4px; }
#terminal-body::-webkit-scrollbar-track { background-color: transparent; }

/* Lines */
.line { margin-bottom: 6px; line-height: 1.6; word-break: break-all; display: flex; align-items: flex-start; flex-wrap: wrap; }

.timestamp { color: var(--text-time); margin-right: 12px; font-size: 14px; flex-shrink: 0; padding-top: 2px; }
.badge-sys { background-color: var(--badge-bg); color: var(--badge-text); padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 800; margin-right: 12px; text-transform: uppercase; flex-shrink: 0; margin-top: 1px; }

.highlight { color: var(--text-green); font-weight: bold; }
.command-txt { color: var(--text-yellow); }
.path { color: var(--text-blue); }
.error { color: #f92672; } 
.arrow { color: var(--text-purple); font-weight: bold; margin-right: 10px; }
.tilde { color: var(--text-blue); margin-right: 10px; }

/* Input Area */
.input-wrapper { position: relative; display: flex; align-items: center; margin-top: 10px; min-height: 24px; visibility: hidden; }
.input-wrapper.visible { visibility: visible; }
#cli-input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; z-index: 10; border: none; outline: none; cursor: text; padding-left: 55px; font-size: 16px; }
.visual-layer { display: flex; align-items: center; width: 100%; pointer-events: none; z-index: 1; }
#input-display { white-space: pre; }
.cursor-block { display: inline-block; width: 10px; height: 19px; background-color: var(--cursor-color); vertical-align: text-bottom; margin-left: 1px; }
.cursor-block.blink { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }