/* 基础样式 */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-control-plaintext:focus {
    box-shadow: 0 0 0 .1rem white, 0 0 0 .25rem #258cfb;
}

.navbar {
    padding: .5rem 1rem;
}

.footer {
    bottom: 0;
    width: 100%;
    /*white-space: nowrap;*/
    /*line-height: 60px;*/
}

/* 通用卡片样式 */
.card {
    transition: transform 0.2s ease;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ================= 游戏列表页样式 ================= */
.game-list-container {
    padding: 0 15px;
    margin-top: 1rem;
}

/* 分类筛选栏 */
.category-filter-container {
    background: white;
    padding: 12px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1020;
    margin-bottom: 1rem;
}

.category-scroll {
    display: flex;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-filter-btn {
    flex: 0 0 auto;
    margin-right: 8px;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    border-width: 1px;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
}

.category-filter-btn.btn-orange.active {
    background-color: #fd7e14;
    border-color: #fd7e14;
    color: white;
}

/* 游戏卡片 */
/*.game-card {*/
/*    border: none;*/
/*    border-radius: 12px;*/
/*    overflow: hidden;*/
/*    box-shadow: 0 4px 12px rgba(0,0,0,0.1);*/
/*    transition: all 0.3s ease;*/
/*    height: 100%;*/
/*    display: flex;*/
/*    flex-direction: column;*/
/*    margin-bottom: 1.5rem;*/
/*}*/

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.card-img-container {
    position: relative;
    overflow: hidden;
    height: 180px;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .card-img-top {
    transform: scale(1.05);
}

/* 图片遮罩层 */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* 播放按钮 */
.play-button {
    background: linear-gradient(135deg, #ff4d4d, #f39c12);
    border: none;
    padding: 8px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 50px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255,77,77,0.5);
}

/* 评分星星 */
.rating-stars {
    /*position: absolute;*/
    bottom: 10px;
    right: 10px;
    background: #ffffff;
    padding: 5px 8px;
    border-radius: 5px;
    backdrop-filter: blur(5px);
    border:var(--bs-border-width) solid var(--bs-border-color);
}

.rating-stars i {
    font-size: 0.9rem;
    margin: 0 1px;
}

/* 卡片内容区域 */
.card-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #2c3e50;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-text {
    color: #6c757d;
    font-size: 0.9rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

/* 卡片底部按钮 */
.card-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0 0;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.card-footer-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

.card-footer-actions .btn-outline-secondary {
    border-color: #6c757d;
}

.card-footer-actions .btn-outline-primary {
    border-color: #0d6efd;
}

/* 分页样式 */
.pagination-container {
    margin: 30px 0;
}

.pagination {
    --pagination-color: #6c757d;
    --pagination-active-bg: #fd7e14;
    --pagination-active-border-color: #fd7e14;
    --pagination-hover-color: #fd7e14;
    --pagination-focus-color: #fd7e14;
    --pagination-focus-box-shadow: 0 0 0 0.25rem rgba(253, 126, 20, 0.25);
    justify-content: center;
}

.page-item {
    margin: 0 2px;
}

.page-link {
    color: var(--pagination-color);
    border-radius: 6px !important;
    min-width: 40px;
    text-align: center;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.page-link:hover {
    color: var(--pagination-hover-color);
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    background-color: var(--pagination-active-bg);
    border-color: var(--pagination-active-border-color);
    color: white;
}

/* ================= 游戏详情页样式 ================= */
.game-header {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.game-icon {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.game-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

/* 游戏主要内容区域 */
.game-main-content {
    margin: 30px 0;
}

.game-banner-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.game-banner {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.game-banner-container:hover .game-banner {
    transform: scale(1.02);
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-banner-container:hover .banner-overlay {
    opacity: 1;
}

.btn-play-overlay {
    background: linear-gradient(135deg, #2ecc71, #3498db);
    color: white;
    font-weight: 600;
    border: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.game-banner-container:hover .btn-play-overlay {
    transform: translateY(0);
}

/* 游戏信息卡片 */
.game-info-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: none;
}

.game-rating {
    font-size: 1.1rem;
}

.game-meta {
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin: 15px 0;
}

.game-meta p {
    margin-bottom: 8px;
    color: #555;
}

.btn-play {
    background: linear-gradient(135deg, #2ecc71, #3498db);
    color: white;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
    color: white;
}

/* 游戏描述 */
.game-description .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.game-description .card-header {
    border-radius: 12px 12px 0 0 !important;
    font-size: 1.2rem;
}

/* 评论区域 */
.reviews-section .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.reviews-section .card-header {
    border-radius: 12px 12px 0 0 !important;
    font-size: 1.2rem;
}

/* 评论表单 */
#reviewForm {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.review-rating-stars {
    font-size: 1.5rem;
    cursor: pointer;
}

.rating-star {
    color: #ffc107;
    transition: all 0.2s;
}

.rating-star:hover {
    transform: scale(1.2);
}

/* 评论列表 */
.review-item {
    padding: 15px 0;
}

.user-avatar {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.review-content {
    padding-left: 65px;
}

/* ================= 响应式设计 ================= */
@media (min-width: 768px) {
    /* 桌面端样式 */
    .image-overlay {
        opacity: 0;
    }

    .game-card:hover .image-overlay {
        opacity: 1;
    }

    .card-img-container {
        height: 200px;
    }

    .category-filter-btn {
        padding: 10px 15px;
        margin-right: 10px;
    }
}

@media (max-width: 767.98px) {
    /* 移动端优化 */
    .game-card {
        margin-bottom: 15px;
    }

    .card-img-container {
        height: 160px;
    }

    .card-title {
        font-size: 1rem;
        -webkit-line-clamp: 1;
    }

    .card-text {
        -webkit-line-clamp: 2;
        font-size: 0.85rem;
    }

    .play-button {
        padding: 6px 16px;
        font-size: 0.85rem;
    }

    .category-filter-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* 详情页移动端优化 */
    .game-icon {
        width: 50px;
        height: 50px;
    }

    .game-title {
        font-size: 1.5rem;
    }

    .game-banner-container {
        margin-bottom: 20px;
    }

    .review-content {
        padding-left: 0;
        margin-top: 10px;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 575.98px) {
    /* 超小屏幕优化 */
    .card-img-container {
        height: 140px;
    }

    .rating-stars {
        padding: 3px 6px;
    }

    .rating-stars i {
        font-size: 0.8rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-footer-actions .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .category-filter-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .page-link {
        padding: 0.3rem 0.5rem;
        min-width: 36px;
        font-size: 0.875rem;
    }

    /* 详情页超小屏幕优化 */
    .game-icon {
        width: 40px;
        height: 40px;
    }

    .game-title {
        font-size: 1.3rem;
    }

    .btn-play, .btn-outline-secondary {
        /*width: 100%;*/
    }
}

/* 滚动容器 */
.overflow-x-auto {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.overflow-x-auto::-webkit-scrollbar {
    display: none;
}

/* 确保Font Awesome图标正确显示 */
.fas, .far {
    font-family: 'Font Awesome 6 Free';
}

/* 橙色按钮样式 */
.btn-orange {
    background-color: #fd7e14;
    color: white;
    border-color: #fd7e14;
}

.btn-orange:hover, .btn-orange.active {
    background-color: #e67312;
    border-color: #e67312;
    color: white;
}


/* 平板设备 */
@media screen and (max-width: 992px) {
    .banner-slider {
        height: 350px;
    }

    .slide-overlay h2 {
        font-size: 1.8rem;
    }
}

/* 移动设备 */
@media screen and (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #e67312;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 1.5rem 0;
    }

    .banner-slider {
        height: 300px;
    }

    .slide-overlay {
        padding: 1.5rem;
    }

    .slide-overlay h2 {
        font-size: 1.5rem;
    }

    .slider-controls button {
        width: 35px;
        height: 35px;
    }

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

/* 小屏幕移动设备 */
@media screen and (max-width: 576px) {
    .banner-slider {
        height: 250px;
    }

    .slide-overlay {
        padding: 1rem;
    }

    .slide-overlay h2 {
        font-size: 1.3rem;
    }

    .slide-overlay p {
        font-size: 0.9rem;
    }

    .play-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .games-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .game-banner {
        height: 120px;
    }

    .game-title {
        font-size: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}
