* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #000000;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

#app {
    height: 100dvh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== 顶部区域 ==================== */
.banner-area {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    flex-shrink: 0;
}

.banner-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: opacity 0.5s ease;
}

.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background-color 0.3s;
}

.banner-dot.active {
    background-color: #ffd700;
}

.notice-bar {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background-color: #1a1a1a;
    border-bottom: 1px solid #333;
    overflow: hidden;
    flex-shrink: 0;
}

.notice-icon {
    font-size: 14px;
    margin-right: 8px;
    flex-shrink: 0;
}

.notice-content {
    display: flex;
    animation: notice-scroll 12s linear infinite;
    white-space: nowrap;
}

.notice-content span {
    margin-right: 30px;
    font-size: 12px;
    color: #999;
}

@keyframes notice-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(10px + env(safe-area-inset-top)) 15px 10px;
    padding: calc(10px + constant(safe-area-inset-top)) 15px 10px;
    background-color: #1a1a1a;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.header-left {
    flex: 1;
}

.logo-img {
    height: 36px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    font-size: 12px;
    color: #999;
}

.kefu-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* ==================== 快捷功能栏 ==================== */
.top-bar {
    display: flex;
    background-color: #1a1a1a;
    padding: 12px 15px;
    border-bottom: 1px solid #333;
    gap: 10px;
    flex-shrink: 0;
}

.top-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.top-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    background-size: 60% 60%;
    background-repeat: no-repeat;
    background-position: center;
}

.deposit-icon {
    background-image: url('../images/cuenkuan.png');
}

.withdraw-icon {
    background-image: url('../images/qvkuan.png');
}

.transfer-icon {
    background-image: url('../images/zhuanzhang.png');
}

.vip-icon {
    background-image: url('../images/vip.png');
}

.top-text {
    font-size: 11px;
    color: #999;
}

.vip-item .top-text {
    color: #ffd700;
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    display: flex;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    /* 关键：为固定底部导航预留空间，防止内容被遮挡 */
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
    padding-bottom: calc(80px + constant(safe-area-inset-bottom));
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: 85px;
    background-color: #000;
    display: flex;
    flex-direction: column;
    padding: 10px 8px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 6px;
    margin-bottom: 4px;
}

.sidebar-item.active {
    background-color: #2a2a2a;
}

.sidebar-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background-color: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    background-size: 55% 55%;
    background-repeat: no-repeat;
    background-position: center;
}

.sidebar-item.active .sidebar-icon {
    background-color: #ffd700;
}

.live-icon {
    background-image: url('../images/zhenren.png');
}

.electronic-icon {
    background-image: url('../images/dianzi.png');
}

.sports-icon {
    background-image: url('../images/tiyu.png');
}

.esports-icon {
    background-image: url('../images/dianjing.png');
}

.lottery-icon {
    background-image: url('../images/caipiao.png');
}

.poker-icon {
    background-image: url('../images/qipai.png');
}

.sidebar-text {
    font-size: 11px;
    color: #999;
}

.sidebar-item.active .sidebar-text {
    color: #ffd700;
    font-weight: bold;
}

/* ==================== 右侧内容区 ==================== */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #000;
    position: relative;
    overflow-y: auto;
    padding: 10px;
}

.category-title {
    display: none;
}

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

.grid-item {
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background-color: #1a1a1a;
    transition: transform 0.2s;
    border: 1px solid #333;
}

.grid-item:active {
    transform: scale(0.98);
}

.grid-item img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background-color: #000;
}

.grid-item-label {
    padding: 6px 8px;
    text-align: center;
    font-size: 12px;
    color: #fff;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.6);
}

/* ==================== 底部导航栏（核心修复） ==================== */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    background-color: #1a1a1a;
    border-top: 1px solid #333;
    flex-shrink: 0;
    /* 兼容 iOS 11.0-11.1 的 constant + 新版 env 双写 */
    padding: 10px 0 calc(10px + constant(safe-area-inset-bottom));
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}

.footer-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 0;
}

.footer-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.home-icon {
    background-image: url('../images/shouye.png');
}

.promo-icon {
    background-image: url('../images/youhui.png');
}

.wallet-icon {
    background-image: url('../images/qianbao.png');
}

.profile-icon {
    background-image: url('../images/wode.png');
}

.footer-text {
    font-size: 11px;
    color: #999;
}

.footer-item.active .footer-text {
    color: #ffd700;
}

/* ==================== 加载与提示 ==================== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #2a2a2a;
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 15px;
    font-size: 14px;
    color: #999;
}

.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    border: 1px solid #ffd700;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: toast-show 0.3s ease, toast-hide 0.3s ease 2s forwards;
}

@keyframes toast-show {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes toast-hide {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.8); }
}
