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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    padding-top: 44px;
    padding-bottom: 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, li {
    list-style: none;
}

img {
    display: block;
    width: 100%;
    height: 100%;
}

/* 顶部导航栏 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.header-logo {
    font-size: 1.125rem;
    font-weight: 600;
    color: #52c41a;
    text-decoration: none;
}

/* 汉堡菜单图标 */
.hamburger-menu {
    width: 24px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    padding: 2px 0;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #52c41a;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-menu:active {
    opacity: 0.7;
}

/* 分类菜单弹出层 */
.category-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-overlay.active {
    display: block;
    opacity: 1;
}

.category-panel {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.category-overlay.active .category-panel {
    transform: translateY(0);
}

.category-tabs {
    display: flex;
    border-bottom: 1px solid #e8e8e8;
}

.category-tab {
    flex: 1;
    padding: 12px 0;
    background-color: transparent;
    border: none;
    font-size: 0.938rem;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-tab.active {
    color: #52c41a;
    font-weight: 600;
    border-bottom: 2px solid #52c41a;
}

.category-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.category-content {
    display: none;
}

.category-content.active {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* 网格卡片样式 */
.category-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 100px;
}

.category-grid-item:active {
    background-color: #f5f5f5;
    transform: scale(0.98);
}

.category-grid-name {
    font-size: 0.938rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-align: center;
}

.category-grid-count {
    font-size: 0.75rem;
    color: #999;
    text-align: center;
}

/* 主导航栏（首页、应用、游戏等） */
.main-nav {
    position: fixed;
    top: 44px;
    left: 0;
    right: 0;
    height: 44px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-bottom: 1px solid #e5e5e5;
    z-index: 900;
}

.nav-link {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    color: #666;
    font-size: 15px;
    position: relative;
}

.nav-link.active {
    color: #5cb85c;
    font-weight: 500;
}

.nav-link .arrow-down {
    font-size: 10px;
    margin-left: 3px;
    font-style: normal;
}

/* 排行榜子菜单 */
.rank-submenu {
    position: fixed;
    top: 88px;
    left: 0;
    right: 0;
    height: 44px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e5e5e5;
    z-index: 890;
}

.submenu-item {
    padding: 8px 20px;
    color: #666;
    font-size: 14px;
    margin: 0 10px;
}

.submenu-item.active {
    color: #5cb85c;
    font-weight: 500;
}

/* 图标样式 */
/* .icon-download::before { content: '?'; } */

/* 主内容区域 */
.main-content {
    padding: 10px 0;
    background-color: #f5f5f5;
    margin-top: 88px;
}

/* 分类筛选标签（4x4网格） */
.filter-tags-grid {
    background-color: #fff;
    margin-bottom: 10px;
    padding: 15px;
    position: relative;
    min-height: 200px;
}

.tags-container {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.tags-container.active {
    display: grid;
}

.filter-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background-color: #f5f5f5;
    border-radius: 6px;
    color: #666;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s;
    min-height: 44px;
}

.filter-tag.active {
    background-color: #5cb85c;
    color: #fff;
    font-weight: 500;
}

.filter-tag:active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* 应用列表区域 */
.app-list-section {
    background-color: #fff;
    padding: 15px;
    display: none;
}

.section-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 15px;
}

.app-list-items {
    
}

.app-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.app-item:last-child {
    border-bottom: none;
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 12px;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-info {
    flex: 1;
    min-width: 0;
}

.app-name {
    font-size: 15px;
    color: #333;
    font-weight: 400;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-rating {
    margin-bottom: 4px;
}

.stars {
    color: #ff9500;
    font-size: 11px;
    letter-spacing: 1px;
}

.app-meta {
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-detail-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    margin-left: 10px;
    flex-shrink: 0;
}

.app-detail-btn i {
    font-size: 24px;
    margin-bottom: 2px;
    font-style: normal;
}

.app-detail-btn span {
    font-size: 12px;
    color: #5cb85c;
}

/* 页脚 */
.footer {
    background-color: #f5f5f5;
    padding: 20px 15px;
    text-align: center;
}

.back-to-top {
    display: inline-block;
    padding: 10px 20px;
    background-color: #fff;
    color: #5cb85c;
    border: 1px solid #5cb85c;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.back-to-top:active {
    background-color: #5cb85c;
    color: #fff;
}

.footer-links {
    font-size: 12px;
    color: #999;
}

.footer-links a {
    color: #666;
    margin: 0 5px;
}

.footer-links span {
    margin: 0 5px;
}

/* 响应式适配 */
@media screen and (min-width: 768px) {
    body {
        max-width: 768px;
        margin: 0 auto;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .header,
    .main-nav,
    .rank-submenu,
    .bottom-nav {
        max-width: 768px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .category-drawer {
        right: calc(50% - 384px - 280px);
    }
    
    .category-drawer.active {
        right: calc(50% - 384px);
    }
}

/* 动画效果 */
@keyframes slideInRight {
    from {
        right: -280px;
        opacity: 0;
    }
    to {
        right: 0;
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        right: 0;
        opacity: 1;
    }
    to {
        right: -280px;
        opacity: 0;
    }
}

#gameRankList.active, #softwareRankList.active{
    display: block;
}