html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-y: auto;
}

body {
    background-image: url('backgroundimg/backgroundimg.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

.container {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #2c3e50; /* 添加这一行，与页脚颜色一致 */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

nav ul {
    list-style-type: none;
    padding: 0;
    display: flex;
    justify-content: center;
    margin: 0;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    text-decoration: none;
    color: #fff; /* 修改这一行，将链接颜色改为白色，以便在深色背景上更易读 */
    font-weight: bold;
    padding: 15px 0;
    display: inline-block;
}

nav ul li a:hover {
    color: #3498db; /* 可以保留这个悬停颜色，或者根据需要调整 */
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px;
}

section {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    padding: 20px;
    width: 100%;
}

.hero {
    text-align: center;
    padding: 40px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: transparent; /* 添加这一行 */
}

.hero h1 {
    font-size: 3rem;
    color: #fff; /* 改为白色，以便在背景图片上更易读 */
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); /* 添加文字阴影以增加可读性 */
}

.hero .subtitle {
    font-size: 1.5rem;
    color: #fff; /* 改为白色 */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5); /* 添加文字阴影 */
}

.hero .highlight {
    color: #ff6b6b; /* 使用更鲜艳的颜色突出显示 */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5); /* 添加文字阴影 */
}

h1 {
    font-size: 3rem;
    color: #2980b9;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.5rem;
    color: #666;
}

footer {
    background-color: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 15px 0;
    width: 100%;
    flex-shrink: 0;
    margin-top: auto;
}

.full-height {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#game-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    list-style-type: none;
    margin: 0;
}

.game-item {
    background-color: #f0f0f0; /* 这将被随机颜色覆盖 */
    border-radius: 5px;
    padding: 20px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px; /* 确保所有项目高度一致 */
}

.game-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    cursor: pointer;
}

.game-item a {
    color: inherit;
    text-decoration: none;
}

/* 在文件末添加以下样式 */
.popup {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.popup-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* 在文件末尾添加以下样式 */
.game-button, .game-item {
    color: red !important;
}

.game-button:hover, .game-item:hover {
    color: darkred !important;
}

/* 修改 .game-button, .game-item 样式 */
.game-button {
    color: red !important;
}

.game-item {
    color: black !important;
}

.game-button:hover {
    color: darkred !important;
}

.game-item:hover {
    color: #333 !important;
}

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

#search-input {
    width: 300px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.grid-item {
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.grid-item h2 {
    margin-top: 0;
    color: #333;
    margin-bottom: 10px;
}

.grid-item p {
    color: #666;
    margin-bottom: 0;
}

.highlight {
    font-size: 1.2em;
    color: red;
    font-weight: bold;
}
