/* 基础重置与全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: #000000;
    color: #00FF00;
    font-family: 'Courier New', Courier, Consolas, monospace;
    font-size: 16px;
    line-height: 1.5;
    overflow: hidden;
}

/* 终端主容器 */
#terminal-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 输出区域 - 可滚动，占据剩余空间 */
#output-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: #444 #111;
    padding: 10px 10px 4px 10px;
}

/* 输出区域滚动条样式 - 始终可见 */
#output-area::-webkit-scrollbar {
    width: 8px;
}
#output-area::-webkit-scrollbar-track {
    background: #111;
}
#output-area::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
#output-area::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.output-line {
    margin-bottom: 2px;
}

/* 输入行 - 固定在最底部 */
#input-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding: 6px 10px;
    border-top: 1px solid #222;
    background-color: #0a0a0a;
}

#prompt {
    color: #00FF00;
    margin-right: 8px;
    white-space: nowrap;
}

#input-text {
    white-space: pre-wrap;
    word-break: break-all;
}

/* 光标样式与动画 */
#cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background-color: #00FF00;
    vertical-align: bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 隐藏的输入框，用于捕获焦点和移动端键盘 */
#hidden-input {
    position: absolute;
    top: -1000px;
    left: -1000px;
    opacity: 0;
}

/* ANSI 颜色映射类 */
.ansi-black { color: #000000; }
.ansi-red { color: #FF0000; }
.ansi-green { color: #00FF00; }
.ansi-yellow { color: #FFFF00; }
.ansi-blue { color: #0000FF; }
.ansi-magenta { color: #FF00FF; }
.ansi-cyan { color: #00FFFF; }
.ansi-white { color: #FFFFFF; }

.ansi-bg-black { background-color: #000000; }
.ansi-bg-red { background-color: #FF0000; }
.ansi-bg-green { background-color: #00FF00; }
.ansi-bg-yellow { background-color: #FFFF00; }
.ansi-bg-blue { background-color: #0000FF; }
.ansi-bg-magenta { background-color: #FF00FF; }
.ansi-bg-cyan { background-color: #00FFFF; }
.ansi-bg-white { background-color: #FFFFFF; }

#autocomplete-hint {
    color: #555555;
    font-style: italic;
    padding: 2px 10px;
    min-height: 1.5em;
    white-space: pre-wrap;
    flex-shrink: 0;
    background-color: #0a0a0a;
}

#autocomplete-hint .hint-cmd {
    color: #888888;
    margin-right: 12px;
}

#autocomplete-hint .hint-active {
    color: #00FF00;
    background-color: #1a1a1a;
    padding: 0 4px;
}

#autocomplete-hint .hint-desc {
    color: #666666;
    font-size: 0.85em;
}
