/* styles.css */

:root {
    --top-margin: 68px;             /* 顶部固定区域的高度 */
    --ico-width: 40px;              /* 图标的宽度 */
    --sidebar-width: 50px;          /* 侧边栏收起时的宽度 */
    --sidebar-width-expand: 160px;  /* 侧边栏展开时的宽度 */
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
}

/* 顶部固定区域 */
#header {
    position: fixed;        /* 使头部固定在页面顶部，即使滚动页面，头部也不会移动。 */
    top: 0;
    left: 0;
    right: 0;
    background: #333;
    color: white;
    padding: 8px;
    text-align: center;
    z-index: 10;
    display: flex;          /* 采用 Flexbox 布局 */ 
    flex-direction: column; /* 使子元素垂直排列  */
    align-items: center;
    /*margin-left: 60px;  留出左侧可伸缩栏的空间 */
}
/* 侧边栏拉伸按钮 */
#header #toggleSidebarBtn {
    background-color: #333;
    color: white;
    border: none;
    font-size: 30px;
    height: var(--top-margin);
    width: var(--sidebar-width);
    cursor: pointer;
    z-index: 15;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease; /* 添加平滑过渡 */
}
/* 添加类来实现按钮的左右镜像 */
#header #toggleSidebarBtn.mirrored {
    transform: scaleX(-1); /* 镜像反转按钮 */
}

#spaceInfo {
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#spaceInfo span {
    margin: 0 5px;
}

#separator {
    margin: 0 10px;
}

#buttons {
    margin-top: 10px;
}

/* 侧边栏 */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background-color: #222;
    color: white;
    transition: width 0.3s;     /* 宽度变化时会有平滑的过渡效果 */
    overflow-x: hidden;       /* 如果侧边栏内容超出高度，会显示垂直滚动条 */
    overflow-y: auto;       /* 如果侧边栏内容超出高度，会显示垂直滚动条 */
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* 侧边栏打开 */
#sidebar.open {
    width: var(--sidebar-width-expand);
}
/* 侧边栏中存放图标的区域排列 */
#sidebar #platformIcons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);      /* 设置三列的网格布局，每列宽度相等 */
    gap: 10px;
    padding: 10px;
    margin-top: var(--top-margin);       /* 将图标与按钮分开 */
}
/* 侧边栏收起时图标添加左边距 */
#sidebar:not(.open) #platformIcons {
    /* margin-left: 10px;   当侧边栏收起时，图标距离左侧 px */
    display: grid;
    grid-template-columns: 1fr;  /* 只显示一列 */
    /*gap: 10px;
    padding: 10px;*/
    margin-top: var(--top-margin);       /* 将图标与按钮分开 */
    margin-right: 5px;       /* 将图标与按钮分开 */
}
/* 侧边栏收起时显示的图标 */
#sidebar:not(.open) #platformIcons .platform-icon-container {
    display: none;  /* 默认隐藏所有图标 */
}

/* 显示当前选中的图标 */
#sidebar:not(.open) #platformIcons .platform-icon-container.selected {
    display: block;  /* 仅显示当前选中的图标 */
}
/* 侧边栏中图标 */
#sidebar img {
    width: var(--ico-width);
    height: var(--ico-width);
    cursor: pointer;
    transition: margin-left 0.3s;  /* 添加平滑过渡效果 */
}

/* 为平台图标的容器添加相对定位 */
#sidebar .platform-icon-container {
    position: relative;
    width: var(--ico-width);
    height: var(--ico-width);
}

/* 显示当前选中的图标 */
#sidebar .platform-icon-container.selected {
    /*border: 3px solid white;   添加选中时的边框 */
    /*box-sizing: border-box;   确保边框不影响元素尺寸 */
    outline: 3px solid white;  /* 使用 outline 而不是 border，确保边框绘制在外部 */
    /*outline-offset: 2px;   给 outline 增加偏移，使其不贴着图标 */
}

/* 灰色半透明层 */
#sidebar .platform-icon-container .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* 去除黑色背景 */
    /*display: none;  默认隐藏，只有当平台未选择时才显示 */
    justify-content: center;
    align-items: center;
    text-align: center;
    pointer-events: none; /* 确保不阻挡点击事件 */
}

/* 画叉号 */
#sidebar .platform-icon-container .overlay .cross {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* 防止干扰图标的点击 */
}

#sidebar .platform-icon-container .overlay .cross::before,
#sidebar .platform-icon-container .overlay .cross::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px; /* 设置较细的线条 */
    height: 100%;
    background-color: rgba(233, 233, 233, 0.4);
    transform-origin: center;
    transform: translate(-50%, -50%);
}

#sidebar .platform-icon-container .overlay .cross::before {
    transform: translate(-50%, -50%) rotate(45deg); /* 画第一条对角线 */
}

#sidebar .platform-icon-container .overlay .cross::after {
    transform: translate(-50%, -50%) rotate(-45deg); /* 画第二条对角线 */
}

#mainContent {
    margin-left: var(--sidebar-width); /* 保持主内容区域与左侧面板对齐 */
    padding-top: var(--top-margin);  /* 留出顶部空间 */
    overflow-y: auto;
    transition: margin-left 0.3s;
}

#mainContent.expanded {
    margin-left: var(--sidebar-width-expand); /* 侧边栏展开时，调整主区域的左边距 */
}

#gameList {
    padding-left: 2px;     /* 左侧 */
    padding-top: 2px;     /* 上方 */
    padding-right: 20px;   /* 右侧 */
    padding-bottom: 20px;  /* 下方 */
}

#gameList label {
    display: block;
    margin: 5px 0;
}

/* 帮助按钮 
#helpBtn {
    background-color: #4CAF50;  绿色按钮 
    color: white;
    padding: 10px 15px;
    margin-left: 10px;
    border: none;
    cursor: pointer;
}

#helpBtn:hover {
    background-color: #45a049;  鼠标悬停时的颜色 
}
*/

/* 帮助弹出框样式 */
.modal {
    display: none; /* 初始时隐藏 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明背景 */
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.modal-content {
    background-color: white;
    padding: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 80%;
    overflow-y: auto; /* 内容过多时，允许垂直滚动 */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content ul {
    list-style-type: decimal;
    margin: 0;
    padding-left: 20px;
}

.modal-content button {
    background-color: #007BFF;
    color: white;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    margin-top: 20px;
}

.modal-content button:hover {
    background-color: #0056b3;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

th, td {
    padding: 4px;
    text-align: center;
    border: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 帮助标题 */
/* 设置 .header 为 Flexbox 布局 */
.help-header {
    display: flex;
    justify-content: space-between; /* 使子元素（h2 和 h6）在两端对齐 */
    align-items: center; /* 垂直居中对齐 */
    width: 100%; /* 确保其宽度为100% */
}

/* 调整 h6 的样式 */
.update-date {
    font-size: 0.8rem; /* 可以根据需要调整大小 */
    text-align: right; /* 确保更新日期文本右对齐 */
}