:root {
    --main-bg-color: #ffffff;
    --header-bg-color: #1e3a8a;
    --header-color: white;
    --block-title-color: #1f2937;
    --block-title-bg-color: #f8fafc;
    --block-title-border-color: #e2e8f0;
    --hover-color: #f97316;
    --footer-bg-color: #f1f5f9;
    --detail-bg-color: #f8fafc;
    --detail-info-bg-color: #ffffff;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
}

body, main {
    background-color: #f8fafc;
    min-height: 400px;
    color: var(--text-primary);
}

i.score {
    width: 1rem;
    height: 1rem;
    margin-top: 5px;
    display: inline-block;
    background-image: url("/static/images/score.svg");
    background-size: cover; /* 背景图片大小覆盖整个容器 */
    background-position: center; /* 背景图片居中显示 */
    background-repeat: repeat-x; /* 防止背景图片重复 */
}

.navbar {
    color: var(--header-color);
    background-color: var(--header-bg-color);
}

.navbar-brand, .nav-link {
    color: var(--header-color);
}

.nav-link:focus, .nav-link:hover, .navbar-brand:hover {
    color: #fbbf24;
    text-shadow: none;
    transition: color 0.3s ease;
}
.navbar .menuBtn{
    width: 1.5rem;
}

.container {
    max-width: 1200px;
}

.game-block {
    margin: 20px 0;
    color: var(--block-title-color);
}


/* 标题 */
.block-title {
    display: flex;
    flex-direction: row;
    width: 100%;
    margin-bottom: 10px;
    justify-content: space-between;
}

.block-title:before, .block-title:after {
    content: '';
    height: 36px;
    background-color: var(--block-title-bg-color);
    border: 3px solid var(--block-title-border-color);
}

.block-title div {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 6px;
    padding: 0 5px;
    font-size: 1.2rem;
    font-weight: 600;
    background-color: var(--block-title-bg-color);
    border: 1px solid var(--block-title-border-color);
}

/* 游戏区域 */
.game-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.game-card-big {
    width: 350px;
    display: inline-block;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--main-bg-color);
    cursor: pointer;
    overflow: hidden;
    margin: 8px 0;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.game-card-big a {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    text-decoration: none;
}

.game-card-big .cover {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.game-card-big img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center; /* 图片显示在容器中心 */
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
}

.game-card-big img:hover {
    transform: scale(1.1);
}

.game-card-big .game-name {
    bottom: 0;
    width: 100%;
    text-align: center;
    line-height: 1.5rem;
    color: var(--block-title-color);
    text-wrap: nowrap;
    text-overflow: ellipsis;
}

.game-card-big:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
}

.game-card-big:hover .game-name {
    color: var(--hover-color);
}

@media (max-width: 476px) {
    .game-card-big {
        width: 49%;
    }

    .game-card-big .cover {
        height: 100px;
    }
}

/* 游戏方块 */
.game-card-middle {
    width: 125px;
    display: inline-block;
    position: relative;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    margin: 5px 0;
    background-color: var(--main-bg-color);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.game-card-middle a {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    text-decoration: none;
}

.game-card-middle .cover {
    width: 100%;
    height: 100%;
    overflow: hidden;

}

.game-card-middle img {
    width: 100%;
    object-fit: cover;
    overflow: hidden;
    object-position: center; /* 图片显示在容器中心 */
    transition: transform 0.3s ease-in-out;
}

.game-card-middle img:hover {
    transform: scale(1.1);
}

.game-card-middle .game-name {
    width: 100%;
    margin-top: 5px;
    font-size: .8rem;
    text-align: center;
    color: var(--block-title-color);
    display: inline-block; /* 或使用 `block` 模式的布局方式 */
    white-space: normal; /* 允许文本换行 */
    overflow: hidden; /* 隐藏超出部分 */
    text-overflow: ellipsis; /* 显示省略号 */
    max-height: 2em; /* 设置最大高度，根据字体大小以适应两行文本。2.2em 相当于两倍行高 */
    line-height: 1em; /* 设置行高 */
}

.game-card-middle:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}

.game-card-middle:hover .game-name {
    color: var(--hover-color);
}

@media (max-width: 476px) {
    .game-card-middle{
        width: 32%;
    }
}

/* 左右布局 */
.game-card-lr {
    width: 20%;
    padding-right: 5px;
    overflow: hidden;
    margin: 5px 0
}

.game-card-lr a {
    display: flex;
    flex-direction: row;
    text-decoration: none;
}

.game-card-lr img {
    width: 5rem;
    height: 5rem;
    overflow: hidden;
    margin-right: 10px;
    border-radius: 5px;
    transition: transform 0.3s ease-in-out;
}

.game-card-lr img:hover {
    transform: scale(1.1);
}

.game-card-lr .desc {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    color: var(--text-primary);
}

.game-card-lr .game-name {
    white-space: wrap; /* 允许文本换行 */
    overflow: hidden; /* 隐藏超出部分 */
    text-overflow: ellipsis; /* 显示省略号 */
    max-height: 2em; /* 设置最大高度，根据字体大小以适应两行文本。2.2em 相当于两倍行高 */
    line-height: 1em; /* 设置行高 */
}

@media (max-width: 476px) {
    .game-card-lr{
        width: 50%;
        font-size: .8rem;
    }
    .game-card-lr img{
        width: 4rem;
        height: 4rem;
    }
}

/* 小方块游戏 */
.game-card-small {
    width: 150px;
    height: 150px;
    display: inline-block;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    margin: 8px 0;
    box-shadow: var(--card-shadow);
    z-index: 100;
    background-color: var(--main-bg-color);
    transition: all 0.3s ease;
}

.game-card-small:hover {
    transform: scale(1.05);
    z-index: 1000;
    box-shadow: var(--card-hover-shadow);
}

.game-card-small a {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    text-decoration: none;
}

.game-card-small .cover {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.game-card-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center; /* 图片显示在容器中心 */
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
}

.game-card-small .game-name {
    position: absolute;
    bottom: 0;
    height: 0;
    width: 100%;
    text-align: center;
    color: var(--text-primary);
    text-wrap: nowrap;
    text-overflow: ellipsis;
    transition: all 0.3s ease-out;
}

.game-card-small:hover .game-name {
    height: 1.5rem;
    background-color: rgba(255, 255, 255, 0.95);
    opacity: 1;
    color: var(--text-primary);
}

@media (max-width: 476px) {
    .game-card-small {
        width: 30%;
    }
}


footer{
    padding-top: 3rem;
    background-color: var(--footer-bg-color);
}
footer .about{
    margin: 1rem;
    padding: 2rem;
    background-color: var(--main-bg-color);
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}
footer .about p{
    text-align: left;
    margin-top: 1rem;
}

footer .copyright{
    margin-top: 1rem;
    font-size: .8rem;
}

/* 现代化按钮样式 */
.btn-modern {
    background: linear-gradient(135deg, var(--header-bg-color), #3b82f6);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

.btn-modern:hover {
    background: linear-gradient(135deg, var(--hover-color), #ea580c);
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
    color: white;
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card-big,
.game-card-middle,
.game-card-small {
    animation: fadeInUp 0.6s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--footer-bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--header-bg-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hover-color);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .game-card-big {
        width: 100%;
        margin: 10px 0;
    }
    
    .game-card-middle {
        width: 48%;
    }
    
    .game-card-small {
        width: 48%;
        height: 120px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --main-bg-color: #1f2937;
        --header-bg-color: #111827;
        --block-title-bg-color: #374151;
        --block-title-border-color: #4b5563;
        --footer-bg-color: #111827;
        --detail-bg-color: #374151;
        --detail-info-bg-color: #1f2937;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --border-color: #4b5563;
    }
    
    body, main {
        background-color: #111827;
    }
}