html, body {
    font-size: 0.8em;
    background-image: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    margin: 0;
    color: #333;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

a {
    text-decoration: none;
    color: #222;
}

/* Medium devices (tablets, 768px and up) */
@media (max-width: 768px) {
    .games .item {
        width: calc(33% - 1.2em);
        padding: 0.5em;
    }
    /* 搜索页的游戏块在移动设备上更大 */
    .games.result .item,
    .search .games.ajax .item {
        width: calc(60% - 1.2em);
        padding: 0.5em;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .games .item {
        width: calc(33% - 1.2em);
        padding: 0.5em;
    }
    /* 搜索页的游戏块在平板上更大 */
    .games.result .item,
    .search .games.ajax .item {
        width: calc(60% - 1.2em);
        padding: 0.5em;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .games .item {
        width: calc(25% - 1.2em);
        padding: 0.5em;
    }
    /* 搜索页的游戏块在桌面设备上更大 */
    .games.result .item,
    .search .games.ajax .item {
        width: calc(25% - 1.2em);
        padding: 0.5em;
    }
}

.header {
    display: flex;
    width: 100%;
    position: relative;
    background-color: #4facfe;
    background-image: linear-gradient(45deg, #4facfe 0%, #00f2fe 50%, #4facfe 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.header .logo-box {
    display: inline-flex;
    vertical-align: top;
    padding: 0.2em 1em;
}
.header .search-input {
    display: inline-flex;
    vertical-align: top;
    width: 60%;
}
.header .search-btn {
    display: inline-flex;
    vertical-align: top;
    text-align: left;
}
.header .logo {
    height: 4em;
}
.header .logo-title {
    display: inline-flex;
    width: 80%;
    font-size: 1.2em;
    font-weight: bold;
    line-height: 3.8em;
    overflow: hidden;
    white-space: nowrap;
}
.header .search-input input {
    width: calc(100% - 6em);
    margin: 0.5em 1em;
    padding: 0.5em 1.5em;
    border-radius: 1.5em;
    border: 2px solid #667eea;
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
    transition: all 0.3s ease;
}

.header .search-input input:focus {
    outline: none;
    border-color: #f093fb;
    box-shadow: 0 0 10px rgba(240, 147, 251, 0.3);
}

.header .search-btn button {
    display: inline-block;
    margin: 0.5em auto;
    background-color: #667eea;
    color: white;
    padding: 0.5em 1em;
    border-radius: 1.5em;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header .search-btn button:hover {
    background-color: #f093fb;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.footer {
    margin: 6em auto;
    font-size: 0.5em;
    line-height: 3em;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.footer a {
    color: white;
    text-decoration: underline;
}

.footer p {
    text-align: center;
}

.history {
    margin: 0.5em auto;
}

.history .item {
    margin: 0.5em;
    padding: 1em;
    border-radius: 0.5em;
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid #667eea;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.history .icon {
    width: 2em;
    height: 2em;
    border-radius: 1em;
}
.history .title {
    padding-left: 0.5em;
    display: inline-flex;
    white-space: nowrap;
    overflow: hidden;
    width: calc(100% - 4em);
    height: 2em;
    line-height: 2em;
}

.topic {
    padding: 1em 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1em;
    margin: 1em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.topic .logo {
    width: 2em;
    height: 2em;
}
.topic .title {
    padding-left: 1em;
    font-weight: bold;
    color: #667eea;
    font-size: 1.5em;
}

.games .item {
    display: inline-block;
}

.games .item  a {
    display: block;
}

.games .icon {
    width: 100%;
    height: 100%;
    border-radius: 1em;
}

.games .title {
    padding-top: 1em;
    padding-bottom: 1em;
    overflow: hidden;
    white-space: nowrap;
    color: #333;
    font-weight: bold;
}

.info {
    margin: 2em auto;
}

/* 为搜索页添加特定类，确保样式只应用于搜索页 */
.search .games.result,
.search .games.ajax {
    margin: 0 -0.5em;
}

.info .title {
    padding: 1em;
    font-weight: bold;
}
.info .play-btn {
    text-align: center;
    margin: 1em auto;
}
.info .play-btn img {
    width: 17em;
    height: 7em;
}
.info .desc {
    margin: 1em;
}