/* 移动端样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    padding-top: 0px;
    padding-bottom: 0px;
}

/* 通用容器 */
.container {
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 弹性布局 */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 间距类 */
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.ml-10 { margin-left: 10px; }
.mr-10 { margin-right: 10px; }

.p-10 { padding: 10px; }
.p-15 { padding: 15px; }

/* 文本样式 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: #007bff; }
.text-success { color: #28a745; }
.text-warning { color: #ffc107; }
.text-danger { color: #dc3545; }

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-success {
    background-color: #28a745;
    color: #fff;
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0px 8px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    overflow: hidden;
}

.card-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}

.card-body {
    padding: 15px;
}

/* 列表样式 */
.list {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.list-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

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

/* 图片样式 */
.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-circle {
    border-radius: 50%;
}

/* 响应式工具类 */
@media (max-width: 576px) {
    .hide-xs {
        display: none !important;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .hide-sm {
        display: none !important;
    }
}

/* 动画类 */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.3s;
}

.fade-enter, .fade-leave-to {
    opacity: 0;
}

/* 常用工具类 */
.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-ellipsis-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}


/* 用户面板样式 */
.userPanel {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 15px !important;
    width: 100% !important;
    position: relative !important;
}

.userPanel-user {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 10px !important;
    width: 100% !important;
    position: relative !important;
    margin-top: -6px !important;
    overflow: visible !important;
    margin-left: 0px !important;
}

.userPanel-user h6 {
    margin: 0 !important;
    font-size: 18px !important;
    color: #000 !important;
    width: 100% !important;
    text-align: left !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 1 !important;
}

.userPanel-user .toLogin {
    margin: 2px 0 0 0 !important;
    font-size: 14px !important;
    color: #788b9d !important;
    width: 100% !important;
    text-align: left !important;
    padding: 0 !important;
    position: relative !important;
    left: 0 !important;
    transform: none !important;
    float: none !important;
    display: block !important;
}

/* 强制覆盖其他样式 */
body .userPanel-user .toLogin,
html .userPanel-user .toLogin {
    margin-left: 0 !important;
    padding-left: 0 !important;
    text-align: left !important;
    float: none !important;
    display: block !important;
    position: relative !important;
    left: 0 !important;
    transform: none !important;
    margin-top: 15px !important;
    padding: 0 15px !important;
}

/* 添加新的toLogin样式 */
.toLogin {
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    display: block !important;
    position: absolute !important;
    left: -20px !important;
    top: -10px !important;
    font-size: 24px !important;
    color: #000 !important;
    width: auto !important;
}

/* 强制覆盖其他样式 */
body .toLogin,
html .toLogin {
    position: absolute !important;
    left: -20px !important;
    top: -10px !important;
}

/* 首页导航栏样式 */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.nav-bar-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* 轮播图样式 */
.swiper-container {
    width: 100%;
    height: 180px;
    margin-top: 44px;
}

.swiper-slide {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 首页内容区域 */
.home-content {
    padding: 15px;
    margin-top: 10px;
}

/* 功能导航区 */
.function-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
}

.function-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.function-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
}

.function-text {
    font-size: 12px;
    color: #666;
}

/* 推荐商品区 */
.recommend-section {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.section-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title .more {
    font-size: 12px;
    color: #999;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.product-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.product-info {
    padding: 10px;
}

.product-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.product-price {
    color: #ff4d4f;
    font-size: 16px;
    font-weight: 500;
}

/* 底部导航栏 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #fff;
    display: flex;
    border-top: 1px solid #eee;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
}

.tab-item.active {
    color: #007bff;
}

.tab-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

/* 首页搜索框 */
.search-bar {
    padding: 10px 15px;
    background: #fff;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    height: 36px;
    background: #f5f5f5;
    border-radius: 18px;
    padding: 0 15px;
    font-size: 14px;
    color: #333;
    border: none;
}

.search-input::placeholder {
    color: #999;
}

/* 首页公告栏 */
.notice-bar {
    margin: 10px 15px;
    padding: 8px 15px;
    background: #fff7e6;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.notice-icon {
    color: #fa8c16;
    margin-right: 8px;
}

.notice-text {
    flex: 1;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 首页活动区域 */
.activity-section {
    margin: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.activity-banner {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

/* 首页分类导航 */
.category-nav {
    display: flex;
    padding: 15px;
    background: #fff;
    margin-bottom: 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-item {
    flex-shrink: 0;
    width: 60px;
    margin-right: 15px;
    text-align: center;
}

.category-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 5px;
}

.category-name {
    font-size: 12px;
    color: #666;
}

/* 首页加载更多 */
.load-more {
    text-align: center;
    padding: 15px;
    color: #999;
    font-size: 12px;
}

/* 首页骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0 50%;
    }
}

/* 首页下拉刷新 */
.pull-to-refresh {
    text-align: center;
    padding: 15px;
    color: #999;
    font-size: 12px;
}

/* 首页空状态 */
.empty-state {
    padding: 30px 15px;
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}

.empty-text {
    color: #999;
    font-size: 14px;
}

/* 首页返回顶部 */
.back-to-top {
    position: fixed;
    right: 15px;
    bottom: 70px;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    z-index: 99;
}

/* 用户面板导航项样式 */
.userPanel-nav-items {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 2px !important;
}

.userPanel-nav-items img {
    width: 45px !important;
    height: 45px !important;
    display: block !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

.userPanel-nav-items p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px !important;
    color: #666 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    width: 100% !important;
    font-weight: 500 !important;
    margin-top: 2px !important;
}

/* 用户面板导航样式 */
.userPanel-nav {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.userPanel-nav > * {
    margin: 0 5px !important;
    padding: 0 !important;
}

.userPanel-nav > *:first-child {
    margin-left: 0 !important;
}

.userPanel-nav > *:last-child {
    margin-right: 0 !important;
}

/* 游戏导航封面项样式 */
.gameNavCover-items {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.gameNavCover-items img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
    display: block;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
}

.gameNavCover-items p {
    font-size: 12px;
    color: #666;
    margin: 0;
    word-break: break-word;
}

/* 首页活动区域图片样式 */
.activity-section .img.lazy-img {
    height: 130px !important; /* 设置图片高度 */
    object-fit: cover !important; /* 确保图片覆盖区域 */
    width: 100% !important; /* 确保宽度填充 */
    display: block !important; /* 确保块级显示 */
}
