/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
}

body {
    width: 100%;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

button {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* 顶部栏 - Logo 和搜索 */
.top-bar {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo img {
    height: 30px;
    width: auto;
}

.search-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-btn:active {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

/* 导航栏 */
.nav-bar {
    position: sticky;
    top: 50px;
    left: 0;
    width: 100%;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 44px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 999;
}

.nav-item {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    padding: 12px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-item.active {
    color: #ff6b6b;
    font-weight: 600;
}

.nav-item.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background-color: #ff6b6b;
    border-radius: 1px;
}

/* 主内容区 */
.main {
    padding-bottom: 20px;
}

/* 轮播区 */
.banner-section {
    background-color: #fff;
    padding: 12px;
    margin-bottom: 10px;
}

.banner-wrapper {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.banner-wrapper::-webkit-scrollbar {
    display: none;
}

.banner-slide {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    scroll-snap-align: start;
    display: block;
}

.banner-slide img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.banner-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: #fff;
    padding: 30px 15px 12px;
    font-size: 16px;
    font-weight: 600;
}

.banner-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ddd;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dot.active {
    width: 18px;
    border-radius: 3px;
    background-color: #ff6b6b;
}

/* 内容区块 */
.content-section {
    background-color: #fff;
    margin-bottom: 10px;
    padding: 15px 12px;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
}

.section-icon {
    font-size: 20px;
    margin-right: 6px;
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

.section-title .highlight {
    color: #ff6b6b;
}

/* 游戏网格布局 - 4列 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 8px;
}

.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background-color: #fafafa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.game-card:active {
    background-color: #f0f0f0;
    transform: scale(0.95);
}

.game-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.game-name {
    font-size: 12px;
    color: #333;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-all;
    min-height: 31px;
    max-height: 31px;
}

.game-btn {
    padding: 4px 12px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: #fff;
    font-size: 11px;
    border-radius: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.game-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* 底部信息 */
.footer {
    background-color: #2c3e50;
    padding: 25px 20px;
    margin-top: 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-text,
.footer-contact,
.footer-copyright,
.footer-icp {
    color: #bdc3c7;
    font-size: 12px;
    line-height: 1.8;
    margin-bottom: 8px;
}

.footer-text {
    margin-bottom: 12px;
}

.footer-contact {
    color: #ff6b6b;
}

.footer-icp {
    margin-bottom: 0;
    margin-top: 12px;
    opacity: 0.8;
}

/* 响应式适配 - 小屏幕 */
@media screen and (max-width: 360px) {
    .game-icon {
        width: 55px;
        height: 55px;
    }
    
    .game-name {
        font-size: 11px;
    }
    
    .game-btn {
        font-size: 10px;
        padding: 3px 10px;
    }
}

/* 响应式适配 - 大屏幕 */
@media screen and (min-width: 414px) {
    .game-icon {
        width: 70px;
        height: 70px;
    }
    
    .game-name {
        font-size: 13px;
    }
}

/* 响应式适配 - 平板 */
@media screen and (min-width: 768px) {
    .top-bar,
    .nav-bar,
    .main,
    .footer-content {
        max-width: 750px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .top-bar {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .nav-bar {
        left: 50%;
        transform: translateX(-50%);
    }
}
