body {
    margin: 0;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace; /* 终端字体 */
    background-color: #000;
    color: #0f0; /* 黑客绿 */
}

/* CRT 扫描线效果 & 复古滤镜 */
body::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: 
        /* 扫描线 */
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
        /* RGB 分离/噪点模拟 */
        linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 2;
    background-size: 100% 3px, 4px 100%;
    pointer-events: none;
    /* 屏幕暗角 (Vignette) */
    box-shadow: inset 0 0 100px rgba(0,0,0,0.9);
}

/* 屏幕闪烁动画 */
@keyframes flicker {
    0% { opacity: 0.97; }
    5% { opacity: 0.95; }
    10% { opacity: 0.9; }
    15% { opacity: 0.95; }
    20% { opacity: 0.99; }
    50% { opacity: 0.95; }
    80% { opacity: 0.9; }
    100% { opacity: 0.97; }
}

#game-canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    /* 增强亮度、对比度，加一点复古的泛黄 (sepia) */
    filter: contrast(1.1) brightness(1.3) saturate(1.2) sepia(0.1);
    animation: flicker 0.15s infinite; /* 极高频的微弱闪烁 */
}

#ui-container {
    position: absolute;
    top: 20px;
    right: 20px; /* 改到右侧 */
    left: auto;  /* 清除左侧定位 */
    background: rgba(0, 10, 0, 0.85);
    padding: 20px;
    border: 1px solid #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    border-radius: 0; /* 硬朗的边角 */
    pointer-events: auto;
    user-select: none;
    z-index: 10;
    min-width: 250px;
}

h1 {
    margin-top: 0;
    font-size: 24px;
    color: #0f0;
    text-transform: uppercase;
    text-shadow: 0 0 5px #0f0;
    border-bottom: 1px dashed #0f0;
    padding-bottom: 10px;
    letter-spacing: 2px;
}

p {
    margin: 10px 0;
    color: #0f0;
    font-size: 14px;
}

/* 强制覆盖内联样式以匹配主题 */
span[style*="color: #ff4444"] {
    color: #ff3333 !important;
    text-shadow: 0 0 5px #ff3333;
    border-color: #ff3333 !important;
    background: rgba(255, 51, 51, 0.1);
}

span[style*="color: #4444ff"] {
    color: #00ffff !important; /* 蓝色改为青色，更赛博朋克 */
    text-shadow: 0 0 5px #00ffff;
    border-color: #00ffff !important;
    background: rgba(0, 255, 255, 0.1);
}

#status {
    margin-top: 15px;
    font-weight: bold;
    font-size: 16px;
    color: #0f0;
    text-shadow: 0 0 2px #0f0;
}

#status::before {
    content: "> ";
}

#reset-btn {
    margin-top: 15px;
    padding: 8px 16px;
    background-color: #000;
    color: #0f0;
    border: 1px solid #0f0;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    transition: all 0.2s;
    width: 100%;
}

#reset-btn:hover {
    background-color: #0f0;
    color: #000;
    box-shadow: 0 0 10px #0f0;
}

select {
    background: #000;
    color: #0f0;
    border: 1px solid #0f0;
    font-family: 'Courier New', Courier, monospace;
    padding: 5px;
    outline: none;
    width: 100%;
    cursor: pointer;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    opacity: 0.8;
}

#minimap-window {
    position: absolute;
    top: 20px;
    left: 20px; /* 原来的 UI 在左边，现在把原来的 UI 移到右边或者把这个放左下？用户说"左侧以窗口栏展示"，原来的 UI 也在左侧。 */
    /* 既然原来的 UI 也在左侧 (top: 20px, left: 20px)，为了不重叠，我把原来的 UI 移到右侧，或者把小地图放在 UI 下方 */
    /* 让我们把原来的 UI 移到右侧，把左侧留给这个很酷的 2D 视图，或者把小地图放在左下角 */
    /* 考虑到用户习惯，通常 UI 在左上或右上。原来的 UI 在左上。 */
    /* 我将把原来的 UI 保持在左上，把小地图放在左侧中间或下方 */
    top: 300px; /* 放在 UI 下方 */
    left: 20px;
    background: rgba(0, 10, 0, 0.9);
    border: 1px solid #0f0;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
    z-index: 10;
    width: 200px;
}

#minimap-header {
    background: #0f0;
    color: #000;
    padding: 2px 5px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid #0f0;
}

#minimap {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
    image-rendering: pixelated; /* 保持像素风格 */
}

.blink {
    animation: blink-animation 1s steps(2, start) infinite;
}

@keyframes blink-animation {
    to {
        visibility: hidden;
    }
}

/* 终端窗口 */
#terminal-window {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 250px;
    background: rgba(0, 10, 0, 0.95);
    border: 1px solid #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', Courier, monospace;
    z-index: 20;
}

#terminal-header {
    background: #0f0;
    color: #000;
    padding: 5px 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move; /* 暗示可拖动，虽然还没实现 */
}

#help-btn {
    cursor: pointer;
    font-weight: bold;
}

#help-btn:hover {
    background: #000;
    color: #0f0;
}

#terminal-output {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 12px;
    color: #0f0;
    scrollbar-width: thin;
    scrollbar-color: #0f0 #000;
}

#terminal-output div {
    margin-bottom: 4px;
    word-wrap: break-word;
}

#terminal-input-line {
    display: flex;
    padding: 5px 10px;
    border-top: 1px solid #0f0;
    background: rgba(0, 20, 0, 0.8);
}

#terminal-input-line span {
    margin-right: 8px;
    color: #0f0;
    font-weight: bold;
}

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

/* 帮助模态框 */
#help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#help-modal.hidden {
    display: none;
}

.modal-content {
    background: #000;
    border: 2px solid #0f0;
    padding: 20px;
    width: 400px;
    box-shadow: 0 0 20px #0f0;
    color: #0f0;
}

.modal-content h3 {
    border-bottom: 1px dashed #0f0;
    padding-bottom: 10px;
    margin-top: 0;
}

.modal-content ul {
    list-style: none;
    padding: 0;
}

.modal-content li {
    margin: 10px 0;
    font-size: 14px;
}

.cmd {
    background: #0f0;
    color: #000;
    padding: 2px 4px;
    font-weight: bold;
    margin-right: 5px;
}

#close-help {
    width: 100%;
    padding: 10px;
    background: #0f0;
    color: #000;
    border: none;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

#close-help:hover {
    background: #fff;
}

/* 实时参数面板 */
#status-panel {
    position: absolute;
    top: 20px;
    left: 20px; /* 放在左上角，原来的 UI 在右侧 */
    width: 220px;
    background: rgba(0, 10, 0, 0.85);
    border: 1px solid #0f0;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
    z-index: 15;
    font-family: 'Courier New', Courier, monospace;
    pointer-events: none; /* 不阻挡鼠标点击 */
}

#status-header {
    background: #0f0;
    color: #000;
    padding: 2px 5px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid #0f0;
}

#status-content {
    padding: 10px;
    font-size: 12px;
    color: #0f0;
    line-height: 1.4;
    white-space: pre; /* 保持换行和空格 */
}