:root {
    --nav: #fff;
    --body: linear-gradient(to right, #f9d423 0%, #ff4e50 100%);
    --font: #eee;
    --footer: rgba(0, 0, 0, 0.3);
    --a: #fff;
    --heading-bg: rgba(0, 0, 0, 0.2);
    --footer-text: #f5f5f5;
    --footer-link-hover: #ffd700;
    --bottom-nav-bg: rgba(255, 255, 255, 0.95);
    --bottom-nav-text: #333;
    --bottom-nav-active: #ff416c;
}

* {
    box-sizing: border-box;
}

body {
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
    margin: 0;
    color: var(--font);
    background: var(--body);
    background-size: contain;
}

html {
    font-size: 16px;
}

a {
    line-height: 20px;
    text-decoration: none;
    color: var(--a);
}

a:hover,
a:active {
    text-decoration: none;
}

strong {
    font-weight: bolder;
}

img {
    object-fit: cover;
}

.fx-r {
    display: flex;
    flex-direction: row;
}

.fx-h {
    display: flex;
    flex-direction: column;
}

.fx-ac {
    justify-content: center;
}

.fx-bc {
    align-items: center;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    border-radius: 4px;
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: #c1c1c1;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

#back-to-top {
    font-size: 24px;
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: opacity 0.3s;
    color: white;
    border: none;
    border-radius: 50%;
    background-color: #007bff;
}

#back-to-top:hover {
    opacity: 0.8;
}


main {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.navLogo {
    width: 160px;
    aspect-ratio: 16/5;
}

.navtitle {
    font-size: 24px;
}

.section-heading {
    background: var(--heading-bg);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    margin: 0.2rem 0;
    display: flex;
    justify-content: space-between;
    align-items:center;
    flex-wrap: nowrap;
    overflow: hidden;
    gap: .8rem;
    overflow-x: auto;
}

.section-heading::-webkit-scrollbar {
    display: none;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--font);
}

.section-heading img {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

footer {
    margin: 2rem 0;
    padding: 1rem 0;
    width: 100%;
    position: relative;
    clear: both;
    background: rgb(0 0 0 / 30%);
}


.container {
    max-width: 1200px;
}

#bestLikeGames,
#hotPicks,
#popular {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.75rem 0;
    min-height: 200px;
}

.gamecards {
    aspect-ratio: 4/2.5 !important;
    width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    background-color: #f0f0f0; /* 加载前显示背景色 */
}

.gamecards img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
}

.gamecards img.loaded {
    opacity: 1;
}

footer ul {
    list-style: none;
    padding: 0;
}

footer a {
    color: var(--a);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 2px;
}

footer a:hover {
    color: var(--footer-link-hover);
}

footer a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--footer-link-hover);
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}

.navbar {
    cursor: pointer;
}

@media (max-width: 768px) {
    nav {
        left: 0;
    }

    #bestLikeGames {
        grid-template-columns: repeat(3, 1fr);
    }

    #hotPicks {
        grid-template-columns: repeat(2, 1fr);
    }

    #popular {
        grid-template-columns: 1fr;
    }
}


.fx-ac {
    max-width: 576px;
    margin: auto;
}

.font-bold {
    font-weight: bold;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.items-center {
    align-items: center;
}

.gap-1 {
    gap: 1rem;
}

.flex {
    display:flex;
}

.navbar {
    padding: 1rem;
}

.mar-auto {
    margin: auto;
}

@media screen and (max-width: 768px) {
    .p-5 {
        padding: 1.25rem;
    }
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.gap-3 {
    gap: 0.75rem;
}

.grid {
    display:grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.bg-white {
    --tw-bg-opacity: 1;
    background-color: rgb(255 255 255 / 0.2);
}

.load-more-btn {
    padding: .75rem 1.5rem;
    background-color: rgb(255 255 255 / 0.2);
    border-radius: 9999px;
    font-weight: bold;
    color: #fff;
    border: none;
    font-size: 16px;
}

.active {
    background-color: #ff416c;
    color: white;
    font-weight: bold;
    padding: .5rem 1rem;
    border-radius: 50px;
}

.cate-item {
    color: #eee;
    font-weight: bold;
}


.aspect-img {
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    width: 100%;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.btn-primary {
    border-radius: 8px;
    color: #fff;
    background: #3F28CCFF;
    font-size: 20px;
    font-weight: bold;
    width: 100%;
    padding: .5rem 0;
}

.game-title {
    margin-bottom: .8rem;
}

.detail-desc {
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}


.desc_btn {
    border: solid 1px #00add7;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 8px;
    background: #00add7;
    font-size: 1rem;
    margin-bottom: .5rem;
    max-width: 105px;
}

@media screen and (min-width: 768px) {
    .desc_btn {
        display: none !important;
    }
    #description_view {
        -webkit-line-clamp: 100 !important;
    }
}

@media screen and (max-width: 768px) {
    .desc_btn {
        display: block;
    }
}