/* 右上角菜单按钮 */
.menu-toggle-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(78, 146, 255, 0.45);
    border-radius: 999px;
    background: rgba(20, 20, 20, 0.88);
    color: #e8e8e8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.menu-toggle-btn:hover {
    background: rgba(40, 40, 40, 0.95);
    border-color: rgba(78, 146, 255, 0.75);
}

.menu-toggle-btn:active {
    transform: scale(0.97);
}

.menu-toggle-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 16px;
    height: 14px;
}

.menu-toggle-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: #4e92ff;
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle-icon.is-open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle-icon.is-open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle-icon.is-open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.menu-toggle-label {
    line-height: 1;
    user-select: none;
}

/* 游戏状态 overlay */
.radar-status-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    pointer-events: none;
    background: rgba(18, 18, 18, 0.55);
}

.radar-status-card {
    pointer-events: auto;
    text-align: center;
    padding: 32px 40px;
    border-radius: 16px;
    background: rgba(20, 20, 20, 0.92);
    border: 1px solid rgba(78, 146, 255, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    max-width: 420px;
}

.radar-status-icon {
    font-size: 36px;
    color: #4e92ff;
    margin-bottom: 12px;
    opacity: 0.9;
}

.radar-status-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.radar-status-message {
    font-size: 14px;
    color: #b0b0b0;
    line-height: 1.6;
    margin: 0;
}

/* 使地图容器正常显示 */
#map {
    position: relative;
    height: 100vh;
    background-color: #121212;
    transition: margin-left 0.3s ease;
}

/* 菜单的样式 */
.sidenav {
    position: absolute; /* 保持绝对定位 */
    top: 100px; /* 菜单距离顶部的距离 */
    left: 20px; /* 菜单距离左边的距离 */
    width: 600px; /* 菜单宽度 */
    background-color: rgba(20, 20, 20, 0.9); /* 更深的半透明背景，增强对比度 */
    border-radius: 15px; /* 圆角 */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7); /* 更柔和的阴影 */
    padding: 20px;
    z-index: 10; /* 保证菜单在地图上方 */
    transition: all 0.3s ease; /* 优化过渡效果，涵盖所有属性变化 */

    max-height: 75vh; /* 稍微增加最大高度限制 */
    overflow-y: auto; /* 启用垂直滚动条 */
}

/* 菜单文字样式优化 */
.sidenav h4 {
    margin-bottom: 15px;
    color: #4e92ff;
    text-align: center;
    font-weight: bold;
    font-size: 20px; /* 增大字体以提高可读性 */
}

.sidenav label,
.sidenav .checkbox input,
.sidenav .input {
    color: #e0e0e0; /* 文字颜色保持亮度一致 */
    font-size: 14px; /* 调整字体大小 */
}

.sidenav .checkbox input:checked {
    accent-color: #4e92ff;
}

/* 输入框、选择框、按钮样式优化 */
.input, .select, .button {
    border-radius: 8px; /* 增大圆角 */
    margin-bottom: 12px;
    background-color: #2c2c2c; /* 更深的背景色，与整体一致 */
    color: #fff;
    border: 1px solid #444;
    padding: 8px 10px; /* 增加内边距，提高舒适度 */
    font-size: 14px; /* 调整字体大小 */
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.input:focus, .select:focus {
    background-color: #444;
    border-color: #4e92ff;
}

/* 去除下拉框背景宽度和高度的异常 */
.sidenav .select {
    position: relative; /* 使下拉框容器定位 */
    width: 100%; /* 保证下拉框的宽度和父容器一致 */
    padding: 0; /* 去除默认的 padding */
    background-color: transparent; /* 背景透明，使用原生下拉框的背景 */
    border: 1px solid #444; /* 边框颜色 */
    border-radius: 8px; /* 圆角 */
}

.sidenav .select select {
    width: 100%; /* 保证 select 的宽度和父容器一致 */
    padding: 8px; /* 设置适当的内边距 */
    font-size: 14px; /* 设置字体大小 */
    background-color: #2c2c2c; /* 设置背景颜色 */
    color: #fff; /* 设置文字颜色 */
    border: none; /* 去掉下拉框的默认边框 */
    border-radius: 8px; /* 圆角 */
}

.sidenav .select select:focus {
    outline: none; /* 去掉聚焦时的默认边框 */
    background-color: #444; /* 设置聚焦时的背景颜色 */
    border-color: #4e92ff; /* 设置聚焦时的边框颜色 */
}

/* 滚动条样式优化 */
.sidenav::-webkit-scrollbar {
    width: 10px; /* 略增滚动条宽度 */
    background-color: rgba(0, 0, 0, 0.1); /* 背景更浅 */
}

.sidenav::-webkit-scrollbar-thumb {
    background-color: rgba(100, 100, 100, 0.5); /* 更深的灰色滚动条 */
    border-radius: 5px;
}

.sidenav::-webkit-scrollbar-thumb:hover {
    background-color: rgba(100, 100, 100, 0.8); /* 悬停时滚动条更深 */
}

/* 响应式布局优化 */
@media (max-width: 1024px) {
    /* 平板设备布局调整 */
    .sidenav {
        width: 80%; /* 使用更宽的百分比宽度 */
        left: 10%; /* 居中对齐 */
        top: 20px; /* 更紧凑的顶部间距 */
        max-height: 70vh; /* 调整高度限制 */
    }

    .sidenav h4 {
        font-size: 18px; /* 调整标题字体大小 */
    }

    .select, .input {
        width: 100%; /* 保持输入框宽度自适应 */
    }

    .scoreboard {
        width: 80%; /* 使计分板在平板设备上自适应 */
        top: 72px; /* 计分板距离顶部调整 */
        left: 10%; /* 计分板居中 */
    }
}

@media (max-width: 768px) {
    /* 手机设备布局调整 */
    .sidenav {
        width: 90%; /* 使用更宽的百分比宽度 */
        left: 5%; /* 居中对齐 */
        top: 20px; /* 更紧凑的顶部间距 */
        max-height: 60vh; /* 调整高度限制 */
    }

    .sidenav h4 {
        font-size: 16px; /* 调整标题字体大小 */
    }

    .select, .input {
        width: 100%; /* 保持输入框宽度自适应 */
    }

    .scoreboard {
        width: 90%; /* 使计分板在手机设备上自适应 */
        top: 80px; /* 调整计分板距离顶部的间距 */
        left: 5%; /* 计分板居中 */
        max-height: 60vh; /* 限制计分板的最大高度 */
    }

    .scoreboard table {
        font-size: 14px; /* 调整表格字体大小 */
    }

    .scoreboard th, .scoreboard td {
        padding: 10px; /* 调整表格单元格的内边距 */
    }
}

/* 右上角计分板样式 */
.scoreboard {
    position: fixed;
    top: 64px;
    right: 20px;
    border-radius: 15px;
    padding: 20px;
    z-index: 20;
    width: auto; /* 宽度根据内容自动调整 */
    max-height: 500px; /* 增加最大高度 */
    overflow-y: auto;
    overflow-x: hidden; /* 防止水平滚动 */
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* 添加柔和阴影 */
}

.scoreboard table {
    width: auto; /* 表格宽度根据内容自动调整 */
    color: #ffffff; /* 使整个表格的字体颜色为白色 */
    border-collapse: collapse;
    font-size: 16px; /* 增加字体大小 */
    margin-top: 10px;
    background-color: rgba(0, 0, 0, 0.6); /* 表格的半透明黑色背景 */
    border-radius: 10px; /* 表格边框圆角 */
    overflow: hidden; /* 防止内容溢出表格圆角 */
}

.scoreboard th {
    background-color: rgba(0, 0, 0, 0.8); /* 表头更深的半透明黑色背景 */
    font-weight: bold;
    font-size: 18px; /* 增加表头字体大小 */
    color: #ffffff; /* 表头文字颜色 */
    padding: 15px 20px;
    white-space: nowrap; /* 禁止换行 */
    text-align: center; /* 表头文字居中对齐 */
}

.scoreboard td {
    font-size: 16px;
    color: #ffffff; /* 字体颜色为白色 */
    background-color: rgba(0, 0, 0, 0.6); /* 单元格半透明黑色背景 */
    white-space: nowrap; /* 禁止换行 */
    text-align: center; /* 单元格文字居中对齐 */
    padding: 10px 15px; /* 单元格内间距 */
}

/* 鼠标悬停效果 */
.scoreboard tr:hover {
    background-color: rgba(255, 255, 255, 0.1); /* 悬停时的轻微高亮 */
    cursor: pointer;
}

/* 滚动条样式 */
.scoreboard::-webkit-scrollbar {
    width: 8px;
    background-color: transparent; /* 滚动条背景透明 */
}

.scoreboard::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3); /* 滚动条样式，半透明 */
    border-radius: 5px;
}

.scoreboard::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5); /* 悬停时滚动条样式 */
}
