/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #fff;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 顶部 Banner 区 ==================== */
.top-banner {
    background-color: #ffe14d;
    padding: 20px 0;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 20px;
}

.banner-text {
    flex: 1;
}

.banner-content h1 {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.banner-content p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.secure-tag {
    display: inline-block;
    background-color: #ffb700;
    color: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
    align-self: center;
}

.search-area {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.search-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-area input {
    flex: 1;
    height: 40px;
    border: none;
    border-radius: 4px 0 0 4px;
    padding: 0 15px;
    font-size: 14px;
}

.search-btn {
    height: 40px;
    border: none;
    border-radius: 0 4px 4px 0;
    background: #ff6a00;
    color: white;
    padding: 0 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #e55a00;
}

/* 搜索建议下拉框 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    flex-shrink: 0;
}

.suggestion-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.suggestion-text {
    flex: 1;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-btn {
    height: 40px;
    border: none;
    background-color: #ffc107;
    color: #fff;
    padding: 0 20px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.all-games {
    margin-left: 10px;
    font-size: 16px;
    font-weight: bold;
}

.hot-tags {
    display: flex;
    flex-wrap: wrap;
}

.tag-item {
    display: inline-block;
    margin-right: 10px;
    font-size: 14px;
    color: #e91e63;
}

.tag-item i {
    margin-right: 5px;
}


/* ==================== 热门游戏区 ==================== */
.popular-games {
    padding: 20px 0;
}

.games-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
}

.games-content {
    flex: 1;
}

.section-title {
    font-size: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
    align-self: flex-start;
    margin-top: 0;
}

@media (max-width: 768px) {
    .popular-games {
        padding: 15px 0;
    }

    .games-header {
        flex-direction: column;
        gap: 15px;
    }

    .section-title {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .popular-games {
        padding: 10px 0;
    }

    .games-header {
        gap: 10px;
    }

    /* 375px附近尺寸保持水平布局但调整样式 */
    .banner-content {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }

    .banner-content h1 {
        font-size: 16px;
        margin-bottom: 3px;
    }

    .banner-content p {
        font-size: 11px;
    }

    .secure-tag {
        font-size: 12px;
        padding: 6px 10px;
        align-self: center;
    }

    .search-area {
        flex-direction: column;
        gap: 8px;
    }

    .search-area input {
        border-radius: 4px;
        height: 36px;
        font-size: 14px;
    }

    .search-btn {
        height: 36px;
        font-size: 14px;
        padding: 0 15px;
    }
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.game-item {
    text-align: center;
    padding: 12px 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
}

.game-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.game-item img {
    width: 100%;
    max-width: 65px;
    border-radius: 8px;
    margin-bottom: 6px;
    object-fit: cover;
}

.game-item p {
    font-size: 12px;
    margin-bottom: 0;
    color: #333;
    font-weight: 500;
    line-height: 1.2;
    height: 28px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ==================== 加载和错误状态样式 ==================== */
.loading-games, .no-results, .search-error, .load-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.loading-games {
    color: #ffc107;
}

.search-error, .load-error {
    color: #dc3545;
}

/* 旋转加载动画 */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 按钮禁用状态 */
.more-games-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #6c757d !important;
}

/* ==================== 更多游戏区 ==================== */
.more-games {
    padding: 20px 0;
    background-color: #f5f5f5;
}

.more-games-btn {
    display: flex;
    align-items: center;
    width: 120px;
    padding: 10px;
    background-color: #fff;
    border-radius: 4px;
    margin-bottom: 15px;
    cursor: pointer;
}

.more-games-btn i {
    margin-right: 5px;
    color: #ffb700;
}

.games-row {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
}

.games-row .game-item {
    flex: 0 0 auto;
}


/* ==================== 售后保障区 ==================== */
.after-sale {
    padding: 30px 0;
}

.after-sale-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-right: 15px;
}

.orange {
    background-color: #ff9800;
}

.green {
    background-color: #4caf50;
}

.blue {
    background-color: #2196f3;
}

.text h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.text p {
    font-size: 14px;
    color: #666;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    /* 顶部Banner */
    .banner-content {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }

    .banner-content h1 {
        font-size: 18px;
    }

    .banner-content p {
        font-size: 12px;
    }

    .secure-tag {
        align-self: center;
    }

    .search-area {
        flex-direction: column;
        gap: 8px;
    }

    .search-area input {
        border-radius: 4px;
        height: 36px;
        font-size: 14px;
    }

    .search-btn {
        border-radius: 4px;
        height: 36px;
        font-size: 14px;
    }

    .all-games {
        margin-left: 0;
        text-align: center;
        font-size: 14px;
    }

    .hot-tags {
        justify-content: center;
        flex-wrap: wrap;
    }

    .tag-item {
        font-size: 12px;
        margin-right: 5px;
        margin-bottom: 5px;
    }

    /* 游戏网格 - 手机端保持5列 */
    .games-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .game-item {
        padding: 8px 4px;
        background: #fff;
        border-radius: 6px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    }

    .game-item img {
        max-width: 45px;
        margin-bottom: 4px;
    }

    .game-item p {
        font-size: 10px;
        height: 24px;
        margin-bottom: 0;
        line-height: 1.2;
    }

    /* 更多游戏 */
    .more-games-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 14px;
    }

    .section-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 5px;
    }

    /* 游戏网格 - 超小屏幕也保持5列，但更紧凑 */
    .games-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    .game-item {
        padding: 6px 2px;
        border-radius: 4px;
    }

    .game-item img {
        max-width: 40px;
        margin-bottom: 2px;
    }

    .game-item p {
        font-size: 9px;
        height: 20px;
        margin-bottom: 0;
        line-height: 1.1;
    }

    /* 顶部Banner更紧凑 */
    .banner-content h1 {
        font-size: 16px;
    }

    .banner-content p {
        font-size: 11px;
    }

    .secure-tag {
        font-size: 12px;
        padding: 3px 6px;
    }

    .search-area input {
        height: 32px;
        font-size: 13px;
    }

    .search-btn {
        height: 32px;
        font-size: 13px;
    }

    .all-games {
        font-size: 12px;
    }

    .tag-item {
        font-size: 11px;
        margin-right: 3px;
        margin-bottom: 3px;
    }

    .section-title {
        font-size: 15px;
    }

    /* 售后保障 */
    .after-sale-item {
        flex-direction: column;
        text-align: center;
    }

    .icon {
        margin: 0 auto 10px;
    }
}

/* ==================== 页脚 ==================== */
.main-footer {
    background-color: #333;
    color: #fff;
    padding: 20px 0;
    text-align: center;
    margin-top: 40px;
}