* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #fff;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    background-image:
        radial-gradient(circle at top right, rgba(0, 255, 127, 0.12), transparent 28%),
        radial-gradient(circle at bottom left, rgba(0, 170, 255, 0.12), transparent 22%);
}

#terminal {
    padding: 10px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#output {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
}

.output-line {
    margin-bottom: 6px;
    word-wrap: break-word;
}

.output-line.command {
    color: #c9d1d9;
}

.output-line.error {
    color: #ff4444;
}

.output-line.success {
    color: #44ff44;
}

.output-line.info {
    color: #4444ff;
}

.output-line.warning {
    color: #ffff44;
}

#input-line {
    display: flex;
    align-items: center;
}

#prompt {
    color: #00ff00;
    margin-right: 5px;
    white-space: nowrap;
}

#command-input {
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 14px;
    outline: none;
    flex: 1;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #1a1a1a;
    padding: 20px;
    border: 1px solid #444;
    border-radius: 5px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-content h3 {
    color: #00ff00;
    margin-bottom: 15px;
}

#multiline-textarea {
    flex: 1;
    background: #000;
    color: #fff;
    border: 1px solid #444;
    padding: 10px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 14px;
    resize: none;
    min-height: 200px;
}

.modal-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-buttons button {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 5px 15px;
    cursor: pointer;
    font-family: 'Courier New', Consolas, monospace;
}

.modal-buttons button:hover {
    background: #444;
}

.terminal-block {
    white-space: pre-wrap;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(126, 231, 135, 0.15);
    border-radius: 10px;
    padding: 10px 12px;
    overflow-x: auto;
}

.terminal-llm {
    border-color: rgba(88, 166, 255, 0.35);
    background: rgba(88, 166, 255, 0.07);
}

.terminal-markdown {
    color: #dbe7ff;
    line-height: 1.7;
}

.terminal-markdown > :first-child {
    margin-top: 0;
}

.terminal-markdown > :last-child {
    margin-bottom: 0;
}

.terminal-markdown h1,
.terminal-markdown h2,
.terminal-markdown h3,
.terminal-markdown h4,
.terminal-markdown h5,
.terminal-markdown h6 {
    color: #9ecbff;
    margin: 0.9em 0 0.45em;
    line-height: 1.3;
}

.terminal-markdown p,
.terminal-markdown ul,
.terminal-markdown ol,
.terminal-markdown blockquote {
    margin: 0.7em 0;
}

.terminal-markdown ul,
.terminal-markdown ol {
    padding-left: 1.5em;
}

.terminal-markdown li + li {
    margin-top: 0.2em;
}

.terminal-markdown a {
    color: #7ee787;
}

.terminal-markdown strong {
    color: #ffffff;
}

.terminal-markdown code {
    font-family: 'Courier New', Consolas, monospace;
    background: rgba(0, 0, 0, 0.28);
    color: #ffd580;
    padding: 0.12em 0.35em;
    border-radius: 6px;
}

.terminal-markdown pre {
    margin: 0.8em 0;
    padding: 10px 12px;
    overflow-x: auto;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.36);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-markdown pre code {
    display: block;
    padding: 0;
    background: transparent;
    color: #dbe7ff;
}

.terminal-markdown blockquote {
    padding-left: 1em;
    border-left: 3px solid rgba(126, 231, 135, 0.35);
    color: #aab8d0;
}

.terminal-kv {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
}

.terminal-kv-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
    padding-bottom: 6px;
}

.terminal-kv-key {
    width: 96px;
    color: #7ee787;
    flex-shrink: 0;
}

.terminal-kv-value {
    color: #c9d1d9;
    word-break: break-all;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 文件列表样式 */
.file-list {
    margin: 5px 0;
}

.file-item {
    display: flex;
    align-items: center;
    margin: 2px 0;
}

.file-icon {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.file-name {
    color: #fff;
}

.dir-name {
    color: #44ff44;
}

.file-size {
    color: #888;
    margin-left: 10px;
    font-size: 12px;
}

/* 树形结构样式 */
.tree {
    margin-left: 10px;
}

.tree-item {
    margin: 2px 0;
}

.tree-line {
    display: flex;
    align-items: center;
}

.tree-indent {
    margin-right: 10px;
    color: #555;
}

.tree-branch {
    margin-right: 5px;
    color: #555;
}

.shutdown-screen,
#destruction-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.shutdown-screen {
    background: #000;
    flex-direction: column;
    color: #7ee787;
    gap: 14px;
}

.shutdown-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(255, 255, 255, 0.16);
    border-top-color: #7ee787;
    border-radius: 50%;
    animation: terminal-spin 1s linear infinite;
}

.destruction-inner {
    max-width: 620px;
    padding: 28px;
    border: 1px solid rgba(255, 95, 86, 0.5);
    border-radius: 18px;
    background: rgba(255, 0, 0, 0.08);
    text-align: center;
}

.destruction-skull {
    font-size: 88px;
    margin-bottom: 18px;
}

.destruction-title {
    font-size: 28px;
    color: #ff5f56;
    margin-bottom: 10px;
}

.destruction-subtitle,
.destruction-help {
    color: #ffb4b0;
    white-space: pre-line;
}

@keyframes terminal-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
