/* ==========================================
   全局重置与基础设置
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none; /* 防止双击选中文字影响操作 */
}

body {
    background-color: #05050a; /* 深邃宇宙底色 */
    color: #ffffff;
    font-family: 'Consolas', 'Courier New', monospace; /* 终端机等宽字体 */
    overflow: hidden; /* 防止出现滚动条 */
    width: 100vw;
    height: 100vh;
}

/* 核心画布全屏，层级最低 */
#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* ==========================================
   通用组件与按钮
   ========================================== */
.hidden {
    display: none !important;
}

.btn {
    background-color: #333;
    color: white;
    border: 1px solid #555;
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.btn:hover {
    background-color: #444;
    border-color: #00ffc8;
    box-shadow: 0 0 8px rgba(0, 255, 200, 0.4);
}

.btn-red { background-color: #c85032; border-color: #c85032; }
.btn-darkred { background-color: #8a2020; border-color: #8a2020; }
.btn-large { padding: 10px 20px; font-size: 16px; width: 200px; margin-top: 10px; }

.separator {
    color: #555;
    margin: 0 5px;
}

select, input[type="range"], input[type="text"] {
    background: #111;
    color: #00ffc8;
    border: 1px solid #333;
    padding: 4px;
    font-family: inherit;
    outline: none;
    border-radius: 3px;
}

select:focus, input[type="text"]:focus {
    border-color: #00ffc8;
}

/* ==========================================
   底部控制栏 (BottomBar)
   ========================================== */
#bottomBar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(15, 15, 20, 0.85);
    border-top: 1px solid #222;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    z-index: 10;
    backdrop-filter: blur(5px); /* 磨砂玻璃效果 */
}

#bottomBar label {
    font-size: 13px;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ==========================================
   悬浮遮罩层 (用于设置菜单和弹窗)
   ========================================== */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50; /* 盖住底部 UI */
}

/* ==========================================
   设置菜单 (SettingsMenu)
   ========================================== */
.settings-box {
    background: rgba(25, 25, 30, 0.95);
    border: 2px solid #00aaff;
    padding: 40px 60px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.2);
}

.settings-box h2 {
    color: #00ffff;
    margin-bottom: 30px;
    font-size: 28px;
    letter-spacing: 2px;
}

.setting-item {
    margin-bottom: 20px;
    font-size: 16px;
}

.setting-item label {
    cursor: pointer;
}

/* ==========================================
   天体创建弹窗 (BodyCreatorDialog)
   ========================================== */
/* 最高层级遮罩，绝对吃掉所有点击事件 */
#bodyCreatorDialog {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.dialog-box {
    background: rgba(20, 20, 25, 0.95);
    border: 2px solid #00ffc8;
    padding: 30px;
    border-radius: 8px;
    min-width: 450px;
    box-shadow: 0 0 25px rgba(0, 255, 200, 0.3);
}

.dialog-box h3 {
    color: #00ffc8;
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
}

.dialog-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.dialog-form label {
    color: #aaa;
    font-size: 14px;
    margin-bottom: -5px; /* 让 label 贴近输入框 */
}

.dialog-form input {
    background: #0a0a0f;
    border: 1px solid #333;
    color: #00ffc8;
    padding: 10px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
}

.dialog-actions {
    display: flex;
    justify-content: space-around;
}

/* ==========================================
   观测站面板 (ObservatoryPanel)
   ========================================== */
#observatoryPanel {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 340px;
    height: 440px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #00ffc8;
    z-index: 20; /* 比底部栏高，比遮罩低 */
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 15px rgba(0, 255, 200, 0.15);
}

.obs-header {
    padding: 10px;
    border-bottom: 1px solid #333;
    color: #00ffc8;
    font-weight: bold;
    font-size: 14px;
}

.obs-tabs {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.tab-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    padding: 0;
}

.tab-btn:hover { color: #ccc; }
.tab-btn.active { color: #00ffc8; text-shadow: 0 0 5px #00ffc8; }

.obs-content {
    flex: 1;
    padding: 15px 10px;
    overflow-y: auto;
    font-size: 12px;
    color: #eee;
    line-height: 1.6;
}

/* 自定义滚动条 */
.obs-content::-webkit-scrollbar { width: 6px; }
.obs-content::-webkit-scrollbar-track { background: #111; }
.obs-content::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.obs-content::-webkit-scrollbar-thumb:hover { background: #00ffc8; }