 
/* 全局样式 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: #f4f4f4;
    box-sizing: border-box;
}

 
header {
    background-color: #39387a;
    color: #fff;
    padding: 5px 10px;
    text-align: center;
}

header h1 {
    padding: 5px 10px;
    text-align: center;
    font-size: 30px;
    /*margin: 0;*/
    /*cursor: pointer;  鼠标放在 h1 上时变成手形  */
}
  
/* 默认英文 */
body.en {
    font-family: Arial, sans-serif;
}

/* 中文 */
body.zh {
    font-family: "微软雅黑", sans-serif;
}

/* 语言切换容器样式 */
.language-switcher {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    text-align: right;
}

/* 当前语言按钮样式 */
.current-lang-btn {
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease-in-out;
}

/* 鼠标悬停时按钮样式 */
.current-lang-btn:hover {
    background-color: #0056b3;
}

/* 下拉菜单样式 */
.dropdown-menu {
    display: none; /* 默认隐藏 */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 100%; /* 紧贴当前语言按钮 */
    right: 0;
    margin-top: 10px;
    z-index: 1001;
    min-width: 120px;
    overflow: hidden;
}

/* 下拉菜单项样式 */
.lang-option {
    width: 100%;
    background: none;
    border: none;
    padding: 10px 16px;
    text-align: left;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

/* 鼠标悬停时菜单项样式 */
.lang-option:hover {
    background-color: #f1f1f1;
}

/* 点击外部隐藏菜单 */
body {
    position: relative;
}

/* 在小屏幕下，调整按钮的布局 */
@media (max-width: 768px) {
    .language-switcher {
        top: 10px;  /* 保持顶部间距 */
        right: 10px; /* 减小右侧间距 */
    }

    .language-switcher button {
        font-size: 10px;  /* 更小的字体 */
    }
}

/* 游戏列表容器 */
.game-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 50px;
    justify-content: center;
}

/* 单个游戏项 */
.game-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    width: calc(33.33% - 30px); /* 每行显示3个 */
    max-width: 300px;
    text-align: center;
    padding: 10px;
    background-color: #fff;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.game-item:hover {
    transform: translateY(-5px);
}



.game-item h3 {
    font-size: 18px;
    margin: 10px 0;
}

.game-item a {
    display: inline-block;
    margin: 10px 0;
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
}

.game-item a:hover {
    background-color: #0056b3;
}
/* 固定的响应式容器尺寸 */
.game-thumbnail-container {
    width: 100%; /* 宽度自动适应父容器 */
    max-width: 300px; /* 最大宽度设置为 300px，可以根据需求调整 */
    height: 0;
    padding-top: 100%; /* 保持 1:1 比例，生成正方形容器 */
    position: relative;
    overflow: hidden; /* 如果图片超出容器范围，则裁剪 */
    background-color: #f3f3f3; /* 容器背景色，可以选择适合你的主题的颜色 */
    border-radius: 10px; /* 可选，给容器添加圆角 */
}

.game-thumbnail {
    position: absolute; /* 确保图片填充容器 */
    top: 0;
    left: 0;
    width: 100%; /* 图片宽度填充容器 */
    height: 100%; /* 图片高度填充容器 */
    object-fit: cover; /* 图片填充容器，可能会被裁剪 */
    object-position: center; /* 确保图片居中 */
    border-radius: 10px; /* 可选，图片也有圆角效果 */
}

 
/* 媒体查询 */
@media (max-width: 768px) {
    .game-item {
        width: calc(50% - 20px); /* 每行显示2个 */
    }
    .game-thumbnail-container {
        max-width: 100%; /* 在较小的屏幕上容器宽度适应屏幕 */
        padding-top: 100%; /* 保持 1:1 比例 */
    }
}

@media (max-width: 480px) {
    .game-item {
        width: calc(100% - 20px); /* 每行显示1个 */
    }

    header h1 {
        font-size: 20px;
    }

    .game-item h3 {
        font-size: 16px;
    }
}



.pagination {
    text-align: center;
    margin: 20px 0;
}

.pagination a {
    display: inline-block;
    margin: 0 5px;
    padding: 8px 12px;
    text-decoration: none;
    color: #007bff;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    transition: background-color 0.3s;
}

.pagination a.active {
    background-color: #007bff;
    color: white;
    pointer-events: none;
}

.pagination a:hover {
    background-color: #0056b3;
    color: white;
} 
 
/* 激活状态，显示建议列表 */
#suggestions.active {
    display: block;
    z-index: 9999; /* 确保它在其他元素之上显示 */
}
#suggestions {
    display: none; /* 默认隐藏 */
    position: absolute;
    top: 60%; /* 如果不显示在底部，可以调整 */
    left: 23%;
    width: 30%;
    background-color: #fff;
    border: 2px solid #007bff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 300px;
    overflow-y: auto;
    /*margin-top: 8px;*/
}

/* 单个建议项的样式 */
.suggestion-item {
    padding: 12px 20px;
    font-size: 16px;
    color: #333; /* 设置字体颜色为深色 */
    background-color: #fff;
    border-bottom: 1px solid #f1f1f1; /* 每个建议项之间添加分隔线 */
    cursor: pointer;
    transition: background-color 0.3s ease, padding-left 0.3s ease; /* 添加平滑过渡 */
}

/* 鼠标悬停时改变背景色和字体颜色 */
.suggestion-item:hover {
    background-color: #f7f7f7; /* 悬停时背景色 */
    padding-left: 20px; /* 鼠标悬停时左侧内边距稍微增加 */
}


/* 搜索框容器样式 */
.search-form {
    display: flex; /* 使用Flexbox来排列子元素 */
    justify-content: center; /* 居中对齐子元素 */
    align-items: center; /* 垂直居中子元素 */
    /*margin: 5px auto;*/
     /*max-width: 600px; */
    width:100%;
    padding: 0px 0px 30px 0px;
    position: relative; /* 确保父元素有相对定位 */
    background-color:#39387a;
    height: 60px;
}

/* 搜索框样式 */
#search-input {
    width: 50%; /* 搜索框宽度占父容器的80% */
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #007bff; /* 蓝色边框 */
    border-radius:25px;
    margin-bottom: 0px;
    outline: none;
    background-color: #fff;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease; /* 平滑过渡 */
}

/* 搜索框聚焦时的样式 */
#search-input:focus {
    border-color: #0056b3; /* 聚焦时变为深蓝色 
    box-shadow: 0 0 8px rgba(0, 91, 191, 0.4); /* 添加蓝色阴影 */
}
 

 /*搜索按钮样式 */
#search-btn {
    padding: 12px 20px;
    font-size: 16px;
    color: #fff; /* 字体颜色 */
    background: linear-gradient(135deg, #007bff, #0056b3); /* 渐变背景色 */
    border: none;
    border-radius: 25px; /* 圆角 */
    cursor: pointer;
    transition: all 0.3s ease; /* 平滑过渡 */
    margin-left: 10px; /* 按钮和输入框之间的间距 */
}

 /*鼠标悬停时按钮效果 */
#search-btn:hover {
    background: linear-gradient(135deg, #0056b3, #003f8a); /* 悬停时渐变背景色 */
    transform: translateY(-2px); /* 按钮上移，模拟点击效果 */
    box-shadow: 0 4px 10px rgba(0, 91, 191, 0.3); /* 悬停时阴影 */
}

 /*鼠标点击时的效果 */
#search-btn:active {
    transform: translateY(0); /* 按钮恢复原位 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 点击时阴影减少 */
}



/* 响应式布局 - 在手机上优化显示 */
@media (max-width: 768px) {
    .search-form {
         padding: 0px 0px 20px 0px;

        width: 100%;
    }

    #search-input {
        width: 60%; /* 在手机端占据100%宽度 */
        margin-right: 10px; /* 给按钮和输入框之间留点空间 */
    }

    #search-btn {
        width: 30%; /* 按钮在手机端也占满一行 */
        margin-left: 0; /* 去除按钮和输入框之间的间距 */
    }
    #suggestions {
        top: 70%;
        left: 20px;
    }
    .suggestion-item {
        font-size: 14px;
        padding: 10px 15px;
    }
} 
